diff --git a/src/views/iot/tplink/camera/camera.data.ts b/src/views/iot/tplink/camera/camera.data.ts
index e8f155c..c31f1e0 100644
--- a/src/views/iot/tplink/camera/camera.data.ts
+++ b/src/views/iot/tplink/camera/camera.data.ts
@@ -17,7 +17,7 @@ export const columns: BasicColumn[] = [
{
title: '设备标识',
align: "center",
- dataIndex: 'deviceName'
+ dataIndex: 'mac'
},
{
title: '设备型号',
diff --git a/src/views/iot/tplink/network/network.data.ts b/src/views/iot/tplink/network/network.data.ts
index 4b67788..1936bfd 100644
--- a/src/views/iot/tplink/network/network.data.ts
+++ b/src/views/iot/tplink/network/network.data.ts
@@ -16,7 +16,7 @@ export const columns: BasicColumn[] = [
{
title: '设备标识',
align: "center",
- dataIndex: 'deviceName'
+ dataIndex: 'mac'
},
{
title: '设备型号',
diff --git a/src/views/iot/weihu/components/Reamrks.api.ts b/src/views/iot/weihu/components/Reamrks.api.ts
deleted file mode 100644
index 69207a4..0000000
--- a/src/views/iot/weihu/components/Reamrks.api.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import {defHttp} from '/@/utils/http/axios';
-import { useMessage } from "/@/hooks/web/useMessage";
-
-const { createConfirm } = useMessage();
-
-enum Api {
- list = '/iot/weihu/deviceMaintain/remarksList',
- save='/iot/weihu/deviceMaintain/add',
- edit='/iot/weihu/deviceMaintain/edit',
- deleteOne = '/iot/weihu/deviceMaintain/delete',
- deleteBatch = '/iot/weihu/deviceMaintain/deleteBatch',
-}
-
-/**
- * 列表接口
- * @param params
- */
-export const list = (params) =>
- defHttp.get({url: Api.list, params});
-
-/**
- * 删除单个
- */
-export const deleteOne = (params,handleSuccess) => {
- return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
- handleSuccess();
- });
-}
-/**
- * 批量删除
- * @param params
- */
-export const batchDelete = (params, handleSuccess) => {
- createConfirm({
- iconType: 'warning',
- title: '确认删除',
- content: '是否删除选中数据',
- okText: '确认',
- cancelText: '取消',
- onOk: () => {
- return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
- handleSuccess();
- });
- }
- });
-}
-/**
- * 保存或者更新
- * @param params
- */
-export const saveOrUpdate = (params, isUpdate) => {
- let url = isUpdate ? Api.edit : Api.save;
- return defHttp.post({url: url, params}, { isTransformResponse: false });
-}
diff --git a/src/views/iot/weihu/components/Reamrks.data.ts b/src/views/iot/weihu/components/Reamrks.data.ts
deleted file mode 100644
index 54b6a46..0000000
--- a/src/views/iot/weihu/components/Reamrks.data.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-import {BasicColumn} from '/@/components/Table';
-import {FormSchema} from '/@/components/Table';
-import { rules} from '/@/utils/helper/validator';
-import { render } from '/@/utils/common/renderUtils';
-import { getWeekMonthQuarterYear } from '/@/utils';
-//列表数据
-export const columns: BasicColumn[] = [
- {
- title: '设备类型',
- align: "center",
- dataIndex: 'type'
- },
- {
- title: '设备编码',
- align: "center",
- dataIndex: 'deviceId'
- },
- {
- title: 'SN',
- align: "center",
- dataIndex: 'sn'
- },
- {
- title: '发往机构名',
- align: "center",
- dataIndex: 'reserveDepartName'
- },
- {
- title: '更新时间',
- align:"center",
- dataIndex: 'updateDate',
- width: 160
- },
- {
- title: '备注',
- align:"center",
- dataIndex: 'remark'
- },
-];
-//查询数据
-export const searchFormSchema: FormSchema[] = [
- {
- label: '删除',
- field: 'delFlag',
- component: 'Select',
- componentProps: {
- options: [
- {
- label: '正常',
- value: '0',
- key: '0',
- },
- {
- label: '删除',
- value: '1',
- key: '1',
- },
- ],
- },
- colProps: { span: 6 },
- },
-];
diff --git a/src/views/iot/weihu/components/ReamrksFormModal.vue b/src/views/iot/weihu/components/ReamrksFormModal.vue
deleted file mode 100644
index a05a127..0000000
--- a/src/views/iot/weihu/components/ReamrksFormModal.vue
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
- 关闭
-
-
-
-
-
-
-
-
diff --git a/src/views/iot/weihu/components/ReamrksListModal.vue b/src/views/iot/weihu/components/ReamrksListModal.vue
index 78749dd..8eb481f 100644
--- a/src/views/iot/weihu/components/ReamrksListModal.vue
+++ b/src/views/iot/weihu/components/ReamrksListModal.vue
@@ -36,7 +36,7 @@ function add() {
* @param record
*/
function edit(record) {
- title.value = '运维列表';
+ title.value = '物联设备维护日志列表';
visible.value = true;
nextTick(() => {
remarksList.value.init(record);
diff --git a/src/views/iot/weihu/components/RemarksForm.vue b/src/views/iot/weihu/components/RemarksForm.vue
deleted file mode 100644
index 7620b4a..0000000
--- a/src/views/iot/weihu/components/RemarksForm.vue
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/iot/weihu/components/RemarksList.vue b/src/views/iot/weihu/components/RemarksList.vue
index aaa5f3e..463d627 100644
--- a/src/views/iot/weihu/components/RemarksList.vue
+++ b/src/views/iot/weihu/components/RemarksList.vue
@@ -1,48 +1,9 @@
-
-
-
-
-
-
-
+
- 新增
-
-
-
-
-
- 删除
-
-
-
- 批量操作
-
-
-
@@ -52,8 +13,6 @@
-
-
@@ -61,33 +20,23 @@
import {ref, reactive, computed, unref, defineProps} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
- import ReamrksFormModal from './ReamrksFormModal.vue';
- import {columns, searchFormSchema} from './Reamrks.data';
- import {list, deleteOne, batchDelete} from './Reamrks.api';
- import { downloadFile } from '/@/utils/common/renderUtils';
+ import { logColumns } from '../weihu.data';
+ import { remarksList } from '../weihu.api';
import { useUserStore } from '/@/store/modules/user';
- const props = defineProps({
- formDisabled: { type: Boolean, default: false },
- formData: { type: Object, default: () => ({})},
- formBpm: { type: Boolean, default: true }
- });
+
const queryParam = reactive({});
- const parentData = ref();
- const checkedKeys = ref>([]);
+ const deviceName = ref('');
const userStore = useUserStore();
const registerModal = ref();
//注册table数据
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '设备维护日志',
- api: list,
- defSort: {
- column: 'id',
- order: 'asc',
- },
- columns,
+ api: remarksList,
+ columns: logColumns,
canResize:false,
showIndexColumn: true,
+ showActionColumn: false,
actionColumn: {
width: 130,
fixed:'right'
@@ -108,39 +57,6 @@ import {ref, reactive, computed, unref, defineProps} from 'vue';
sm: { span: 16 },
});
- /**
- * 新增事件
- */
- function handleAdd() {
- registerModal.value.disableSubmit = false;
- registerModal.value.add(parentData.value);
- }
- /**
- * 编辑事件
- */
- function handleEdit(record: Recordable) {
- registerModal.value.disableSubmit = false;
- registerModal.value.edit(record);
- }
- /**
- * 详情
- */
- function handleDetail(record: Recordable) {
- registerModal.value.disableSubmit = true;
- registerModal.value.edit(record);
- }
- /**
- * 删除事件
- */
- async function handleDelete(record) {
- await deleteOne({id: record.id}, handleSuccess);
- }
- /**
- * 批量删除事件
- */
- async function batchHandleDelete() {
- await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
- }
/**
* 成功回调
*/
@@ -151,67 +67,22 @@ import {ref, reactive, computed, unref, defineProps} from 'vue';
* 操作栏
*/
function getTableAction(record){
- // return [
- // {
- // label: '详情',
- // onClick: handleDetail.bind(null, record),
- // },
- // {
- // label: '编辑',
- // onClick: handleEdit.bind(null, record),
- // }, {
- // label: '删除',
- // popConfirm: {
- // title: '是否确认删除',
- // confirm: handleDelete.bind(null, record),
- // placement: 'topLeft',
- // },
- // }
- // ]
- const actions = [];
- actions.push(
- {
- label: '详情',
- onClick: handleDetail.bind(null, record),
- }
- );
- if(record.delFlag == '0'){
- // actions.push(
- // {
- // label: '编辑',
- // onClick: handleEdit.bind(null, record),
- // }
- // );
- actions.push(
- {
- label: '删除',
- popConfirm: {
- title: '是否确认删除',
- confirm: handleDelete.bind(null, record),
- placement: 'topLeft',
- },
- }
- );
- }
- return actions;
+ return []
}
- function init(record){
- parentData.value = unref(record);
- queryParam.deviceId = parentData.value.deviceId;
- queryParam.delFlag = '0';
- reload();
- }
-
function searchQuery(){
+ queryParam.deviceName = deviceName.value;
reload();
}
function searchReset(){
- queryParam.delFlag = '0';
- selectedRowKeys.value = [];
//刷新数据
- reload();
+ searchQuery();
+ }
+
+ function init(record){
+ deviceName.value = record.deviceName;
+ searchQuery();
}
// 暴露给父组件的方法
@@ -219,7 +90,6 @@ import {ref, reactive, computed, unref, defineProps} from 'vue';
init
});
-
diff --git a/src/views/iot/weihu/index.vue b/src/views/iot/weihu/index.vue
index aba18d9..822a32a 100644
--- a/src/views/iot/weihu/index.vue
+++ b/src/views/iot/weihu/index.vue
@@ -1,10 +1,9 @@
@@ -47,7 +46,7 @@ import {onMounted, reactive, ref} from 'vue';
//注册table数据
const { prefixCls,tableContext } = useListPage({
tableProps:{
- title: '设备维修',
+ title: '设备维护',
api: list,
columns,
canResize:false,
@@ -69,19 +68,19 @@ import {onMounted, reactive, ref} from 'vue';
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
- function handleSelectionChange(selectedRowSet) {
- selectedRows.value = selectedRowSet.rows;
- console.log('当前选中数据:', selectedRows.value);
- }
-
- function handleSendOrg(){
- openDrawer(true, {
- records : selectedRows.value,
- isUpdate: true,
- showFooter: true,
- tenantSaas: false,
- });
- }
+ // function handleSelectionChange(selectedRowSet) {
+ // selectedRows.value = selectedRowSet.rows;
+ // console.log('当前选中数据:', selectedRows.value);
+ // }
+ //
+ // function handleSendOrg(){
+ // openDrawer(true, {
+ // records : selectedRows.value,
+ // isUpdate: true,
+ // showFooter: true,
+ // tenantSaas: false,
+ // });
+ // }
/**
* 成功回调
@@ -111,10 +110,6 @@ import {onMounted, reactive, ref} from 'vue';
*/
function getTableAction(record){
return [
- // {
- // label: '备注',
- // onClick: handleDetail.bind(null, record),
- // },
{
label: '备注',
onClick: handleDetail.bind(null, record),
diff --git a/src/views/iot/weihu/weihu.api.ts b/src/views/iot/weihu/weihu.api.ts
index 4646cc4..1261ba6 100644
--- a/src/views/iot/weihu/weihu.api.ts
+++ b/src/views/iot/weihu/weihu.api.ts
@@ -5,6 +5,7 @@ enum Api {
saveSendOrg = '/iot/weihu/deviceMaintain/saveSendOrg',
departlist = '/iot/weihu/deviceMaintain/departlist',
nulist = '/iot/weihu/deviceMaintain/nulist',
+ remarksList = '/iot/weihu/deviceMaintain/remarksList',
}
/**
@@ -32,3 +33,9 @@ export const departlist = (params) => defHttp.get({ url: Api.departlist, params
* @param params
*/
export const nulist = (params) => defHttp.get({ url: Api.nulist, params });
+
+/**
+ * 接口
+ * @param params
+ */
+export const remarksList = (params) => defHttp.get({ url: Api.remarksList, params });
diff --git a/src/views/iot/weihu/weihu.data.ts b/src/views/iot/weihu/weihu.data.ts
index 7bef970..b50765d 100644
--- a/src/views/iot/weihu/weihu.data.ts
+++ b/src/views/iot/weihu/weihu.data.ts
@@ -4,22 +4,65 @@ import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
- title: '设备类型',
+ title: '机构编码',
align: "center",
- dataIndex: 'type'
+ dataIndex: 'orgCode',
+ width: 100,
+ },
+ {
+ title: '机构名称',
+ align: "center",
+ dataIndex: 'departName'
+ },
+ {
+ title: '区域编码',
+ align: "center",
+ dataIndex: 'nuId',
+ width: 100,
+ },
+ {
+ title: '区域名称',
+ align: "center",
+ dataIndex: 'nuName'
+ },
+ {
+ title: '区域类型',
+ align: "center",
+ dataIndex: 'areaFlag_dictText',
+ width: 100,
+ },
+ {
+ title: '设备标识',
+ align: "center",
+ dataIndex: 'deviceName',
+ width: 140,
},
{
title: '设备编码',
align: "center",
- dataIndex: 'deviceId'
+ dataIndex: 'deviceId',
+ width: 140,
},
{
- title: 'SN',
+ title: '设备类型',
align: "center",
- dataIndex: 'sn'
+ dataIndex: 'deviceType',
+ width: 100,
},
{
- title: '维修状态',
+ title: '在线状态',
+ align: "center",
+ dataIndex: 'deviceStatus',
+ width: 100,
+ },
+ {
+ title: '分配状态',
+ align: "center",
+ dataIndex: 'izAllocate',
+ width: 100,
+ },
+ {
+ title: '设备状态',
align: "center",
dataIndex: 'maintainStatus',
customRender:({record})=>{
@@ -27,89 +70,25 @@ export const columns: BasicColumn[] = [
return "正常";
}
if(record.maintainStatus==1){
- return "报修";
+ return "释放";
}
if(record.maintainStatus==2){
- return "报废";
+ return "损坏";
}
},
+ width: 100,
},
{
- title: '绑定区域',
+ title: '时间戳',
align: "center",
- dataIndex: 'nuId',
- },
- {
- title: '绑定机构',
- align: "center",
- dataIndex: 'orgCode',
- },
- {
- title: '绑定机构名',
- align: "center",
- dataIndex: 'departName',
- },
- {
- title: '发往机构名',
- align: "center",
- dataIndex: 'reserveDepartName'
- },
- {
- title: '更新时间',
- align: "center",
- dataIndex: 'updateDate'
+ dataIndex: 'updateDate',
+ width: 160,
},
];
export const searchFormSchema: FormSchema[] = [
{
- label: '设备类型',
- field: 'type',
- component: 'JDictSelectTag',
- componentProps: {
- placeholder: '请选择类型',
- options: [
- { label: '摄像头', value: '摄像头' },
- { label: '电表', value: '电表' },
- { label: '水表', value: '水表' },
- { label: '温湿度计', value: '温湿度计' },
- ],
- },
- colProps: { span: 6 },
- },
- {
- label: 'SN',
- field: 'sn',
- component: 'Input',
- colProps: { span: 6 },
- },
- {
- label: '维修状态',
- field: 'maintainStatus',
- component: 'JDictSelectTag',
- componentProps: {
- placeholder: '请选择类型',
- options: [
- { label: '正常', value: '0' },
- { label: '报修', value: '1' },
- { label: '报废', value: '2' },
- ],
- },
- colProps: { span: 6 },
- },
- // {
- // label: '机构',
- // field: 'departId',
- // component: 'JDictSelectTag',
- // slot: 'depart',
- // // componentProps: {
- // // placeholder: '请选择机构',
- // // dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
- // // },
- // colProps: { span: 6 },
- // },
- {
- label: '绑定机构',
+ label: '机构名称',
field: 'orgCode',
component: 'JDictSelectTag',
slot: 'depart',
@@ -120,7 +99,7 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 6 },
},
{
- label: '绑定区域',
+ label: '区域名称',
field: 'nuId',
component: 'JDictSelectTag',
slot: 'nuArea',
@@ -131,52 +110,77 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 6 },
},
{
- label: '发往机构',
- field: 'reserveDepartId',
+ label: '设备类型',
+ field: 'deviceType',
component: 'JDictSelectTag',
componentProps: {
- placeholder: '请选择区域',
- dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
+ placeholder: '请选择类型',
+ options: [
+ { label: '录像机', value: '录像机' },
+ { label: '摄像头', value: '摄像头' },
+ { label: '路由器', value: '路由器' },
+ { label: '交换机', value: '交换机' },
+ { label: '无线AP', value: '无线AP' },
+ { label: '智能电表', value: '智能电表' },
+ { label: '智能水表', value: '智能水表' },
+ { label: '温湿度计', value: '温湿度计' },
+ ],
+ },
+ colProps: { span: 6 },
+ },
+ {
+ label: '在线状态',
+ field: 'deviceStatus',
+ component: 'JDictSelectTag',
+ componentProps: {
+ placeholder: '请选择在线状态',
+ options: [
+ { label: '在线', value: '在线' },
+ { label: '离线', value: '离线' },
+ ],
+ },
+ colProps: { span: 6 },
+ },
+ {
+ label: '分配状态',
+ field: 'izAllocate',
+ component: 'JDictSelectTag',
+ componentProps: {
+ placeholder: '请选择分配状态',
+ options: [
+ { label: '未分配', value: '未分配' },
+ { label: '已分配', value: '已分配' },
+ ],
+ },
+ colProps: { span: 6 },
+ },
+ {
+ label: '设备状态',
+ field: 'maintainStatus',
+ component: 'JDictSelectTag',
+ componentProps: {
+ placeholder: '请选择设备状态',
+ options: [
+ { label: '正常', value: '0' },
+ { label: '释放', value: '1' },
+ { label: '损坏', value: '2' },
+ ],
},
colProps: { span: 6 },
},
];
-export const formSchema: FormSchema[] = [
+//列表数据
+export const logColumns: BasicColumn[] = [
{
- label: '',
- field: 'id',
- component: 'Input',
- show: false,
+ title: '备注',
+ align:"center",
+ dataIndex: 'remark'
},
{
- label: '选择机构',
- field: 'reserveDepartId',
- component: 'JSelectDept',
- componentProps: {
- //是否开启异步加载
- sync: false,
- //是否显示复选框
- checkable: true,
- //是否显示选择按钮
- showButton: false,
- //父子节点选中状态不再关联
- checkStrictly: false,
- //选择框标题
- modalTitle: '请选择机构',
- },
- required: true
- },
- {
- label: '备注',
- field: 'remark',
- component: 'InputTextArea',
- componentProps: {
- showCount: true,
- maxlength: 1000,
- autosize:{
- minRows: 5
- },
- }
+ title: '创建时间',
+ align:"center",
+ dataIndex: 'updateDate',
+ width: 160
},
];