From 43a8d3965502b7d5deb4372061d1a21ad586940a Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 29 Mar 2023 20:15:11 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix:=20=E7=89=A9=E8=81=94=E7=BD=91?= =?UTF-8?q?=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device/instance.ts | 3 + src/components/NormalUpload/index.vue | 15 +- src/views/device/Instance/Process/index.vue | 8 +- src/views/device/Instance/index.vue | 7 +- src/views/iot-card/CardManagement/Import.vue | 132 +++++++++--------- .../iot-card/CardManagement/UploadFile.vue | 115 +++++++++++++++ 6 files changed, 208 insertions(+), 72 deletions(-) create mode 100644 src/views/iot-card/CardManagement/UploadFile.vue diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 9562fd06..9f4cf6f9 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -571,3 +571,6 @@ export const queryLog = (deviceId: string, data: Record) => ser */ export const queryLogsType = () => server.get(`/dictionary/device-log-type/items`) +export const getDeviceNumber = (data?:any) => server.post('/device-instance/_count', data) + + diff --git a/src/components/NormalUpload/index.vue b/src/components/NormalUpload/index.vue index 42cc2455..1ed86af6 100644 --- a/src/components/NormalUpload/index.vue +++ b/src/components/NormalUpload/index.vue @@ -40,14 +40,13 @@ import { FILE_UPLOAD } from '@/api/comm'; import { TOKEN_KEY } from '@/utils/variable'; import { LocalStore, onlyMessage } from '@/utils/comm'; -import { downloadFile, downloadFileByUrl } from '@/utils/utils'; +import { downloadFileByUrl } from '@/utils/utils'; import { deviceImport, - deviceTemplateDownload, templateDownload, } from '@/api/device/instance'; import { EventSourcePolyfill } from 'event-source-polyfill'; -import { message } from 'ant-design-vue'; +import { message } from 'jetlinks-ui-components'; type Emits = { (e: 'update:modelValue', data: string[]): void; @@ -73,6 +72,15 @@ const props = defineProps({ }; }, }, + url: { + type: Object, + default: () => { + return { + fileType: 'xlsx', + autoDeploy: false, + }; + }, + }, }); const importLoading = ref(false); @@ -81,7 +89,6 @@ const count = ref(0); const errMessage = ref(''); const downFile = async (type: string) => { - // downloadFile(deviceTemplateDownload(props.product, type)); const res: any = await templateDownload(props.product, type); if (res) { const blob = new Blob([res], { type: type }); diff --git a/src/views/device/Instance/Process/index.vue b/src/views/device/Instance/Process/index.vue index eb6fe298..0437cc9d 100644 --- a/src/views/device/Instance/Process/index.vue +++ b/src/views/device/Instance/Process/index.vue @@ -23,7 +23,7 @@ @@ -188,3 +193,4 @@ getConfig(); color: @primary-color; } + diff --git a/src/views/iot-card/CardManagement/UploadFile.vue b/src/views/iot-card/CardManagement/UploadFile.vue new file mode 100644 index 00000000..ed5e3b72 --- /dev/null +++ b/src/views/iot-card/CardManagement/UploadFile.vue @@ -0,0 +1,115 @@ + + + \ No newline at end of file From 542f2011755a359d16a187804d303da5508fa886 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 29 Mar 2023 20:20:24 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=20=E7=89=A9=E8=81=94=E7=BD=91?= =?UTF-8?q?=E5=8D=A1=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot-card/CardManagement/Import.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/iot-card/CardManagement/Import.vue b/src/views/iot-card/CardManagement/Import.vue index 9f324fa1..0843fba8 100644 --- a/src/views/iot-card/CardManagement/Import.vue +++ b/src/views/iot-card/CardManagement/Import.vue @@ -181,6 +181,7 @@ const handleCancel = () => { }; const handleOk = () => { + modelRef.configId = undefined; emit('save', true); }; From 384930fa4ea0b3b8d21049c333f26672bcb97a72 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Wed, 29 Mar 2023 20:20:54 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=20bug#11006=E3=80=8111093?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Collector/Point/Save/SaveModBus.vue | 20 ++----------- .../Collector/Point/Save/SaveOPCUA.vue | 22 ++------------- .../Collector/Point/Scan/Table.vue | 9 ++---- .../Point/components/BatchUpdate/index.vue | 7 ++--- .../DataCollect/Collector/Point/index.vue | 28 +++++++++---------- .../DataCollect/Collector/Tree/index.vue | 9 ++++-- src/views/DataCollect/Collector/index.vue | 2 +- src/views/DataCollect/Dashboard/tool.ts | 2 +- src/views/link/DashBoard/components/Cpu.vue | 5 +--- src/views/link/DashBoard/components/Jvm.vue | 5 +--- src/views/link/DashBoard/components/tool.ts | 1 + 11 files changed, 37 insertions(+), 73 deletions(-) diff --git a/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue b/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue index 325ae6e6..916cab23 100644 --- a/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue +++ b/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue @@ -187,19 +187,14 @@ - @@ -346,15 +341,6 @@ const changeFunction = (value: string) => { value === 'InputRegisters' ? ['read'] : ['read', 'write']; }; -const checkLength = (_rule: Rule, value: string): Promise => - new Promise(async (resolve, reject) => { - if (value) { - return String(value).length > 64 - ? reject('最多可输入64个字符') - : resolve(''); - } - }); - const checkProvider = (_rule: Rule, value: string): Promise => new Promise(async (resolve, reject) => { if (value) { diff --git a/src/views/DataCollect/Collector/Point/Save/SaveOPCUA.vue b/src/views/DataCollect/Collector/Point/Save/SaveOPCUA.vue index 8af6c961..869d0954 100644 --- a/src/views/DataCollect/Collector/Point/Save/SaveOPCUA.vue +++ b/src/views/DataCollect/Collector/Point/Save/SaveOPCUA.vue @@ -49,19 +49,14 @@ - @@ -156,17 +151,6 @@ const handleCancel = () => { emit('change', false); }; -const checkLength = (_rule: Rule, value: string): Promise => - new Promise(async (resolve, reject) => { - if (value) { - return String(value).length > 64 - ? reject('最多可输入64个字符') - : resolve(''); - } else { - reject(''); - } - }); - const filterOption = (input: string, option: any) => { return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0; }; diff --git a/src/views/DataCollect/Collector/Point/Scan/Table.vue b/src/views/DataCollect/Collector/Point/Scan/Table.vue index 40b5ca5e..bb6712cd 100644 --- a/src/views/DataCollect/Collector/Point/Scan/Table.vue +++ b/src/views/DataCollect/Collector/Point/Scan/Table.vue @@ -111,17 +111,13 @@ 'value', ]" :rules="[ - { - validator: checkLength, - trigger: 'change', - }, { pattern: regOnlyNumber, message: '请输入0或者正整数', }, ]" > - + > - diff --git a/src/views/DataCollect/Collector/Point/index.vue b/src/views/DataCollect/Collector/Point/index.vue index a7011686..7782d0b2 100644 --- a/src/views/DataCollect/Collector/Point/index.vue +++ b/src/views/DataCollect/Collector/Point/index.vue @@ -572,20 +572,20 @@ const handleClick = (dt: any) => { }; const subscribeProperty = (value: any) => { - const list = value.map((item: any) => item.id); - const id = `collector-${props.data?.channelId || 'channel'}-${ - props.data?.id || 'point' - }-data-${list.join('-')}`; - const topic = `/collector/${props.data?.channelId || '*'}/${ - props.data?.id || '*' - }/data`; - subRef.value = getWebSocket(id, topic, { - pointId: list.join(','), - }) - ?.pipe(map((res: any) => res.payload)) - .subscribe((payload: any) => { - propertyValue.value.set(payload.pointId, payload); - }); + // const list = value.map((item: any) => item.id); + // const id = `collector-${props.data?.channelId || 'channel'}-${ + // props.data?.id || 'point' + // }-data-${list.join('-')}`; + // const topic = `/collector/${props.data?.channelId || '*'}/${ + // props.data?.id || '*' + // }/data`; + // subRef.value = getWebSocket(id, topic, { + // pointId: list.join(','), + // }) + // ?.pipe(map((res: any) => res.payload)) + // .subscribe((payload: any) => { + // propertyValue.value.set(payload.pointId, payload); + // }); }; const onCheckAllChange = (e: any) => { diff --git a/src/views/DataCollect/Collector/Tree/index.vue b/src/views/DataCollect/Collector/Tree/index.vue index 48cd8035..5a2f7259 100644 --- a/src/views/DataCollect/Collector/Tree/index.vue +++ b/src/views/DataCollect/Collector/Tree/index.vue @@ -237,7 +237,8 @@ const handleSearch = async (value: any) => { if (clickSearch) { defualtDataSource.value = res.result; if (res.result.length !== 0) { - selectedKeys.value = [res.result[0].id]; // 通道跳转进来或者搜索时,默认选中第一个 + selectedKeys.value.length === 0 && + (selectedKeys.value = [res.result[0].id]); // 通道跳转进来或者搜索时,默认选中第一个 } } else { defualtDataSource.value = _.cloneDeep(root); @@ -285,7 +286,11 @@ watch( watch( () => searchValue.value, (value) => { - !value && handleSearch(value); + if (!value) { + setTimeout(() => { + handleSearch(value); + }, 0); + } }, ); diff --git a/src/views/DataCollect/Collector/index.vue b/src/views/DataCollect/Collector/index.vue index 7d3e24b5..4bc78162 100644 --- a/src/views/DataCollect/Collector/index.vue +++ b/src/views/DataCollect/Collector/index.vue @@ -30,7 +30,7 @@ const changeTree = (row: any) => { collectorId: row?.id, }; spinning.value = false; - }, 300); + }, 1000); }; diff --git a/src/views/DataCollect/Dashboard/tool.ts b/src/views/DataCollect/Dashboard/tool.ts index 7ca5d408..4fd5a133 100644 --- a/src/views/DataCollect/Dashboard/tool.ts +++ b/src/views/DataCollect/Dashboard/tool.ts @@ -86,7 +86,7 @@ export const pointParams = (data: any) => { from: Number(data.time.time[0]), to: Number(data.time.time[1]), interval: getParams(data.time).interval, - format: getParams(data.time).format, + format: 'YYYY-MM-dd HH:mm', }, }, ]; diff --git a/src/views/link/DashBoard/components/Cpu.vue b/src/views/link/DashBoard/components/Cpu.vue index 2b03f631..fbe6b86d 100644 --- a/src/views/link/DashBoard/components/Cpu.vue +++ b/src/views/link/DashBoard/components/Cpu.vue @@ -53,7 +53,6 @@ import * as echarts from 'echarts'; import { dashboard } from '@/api/link/dashboard'; import dayjs from 'dayjs'; import { - getTimeFormat, getTimeByType, arrayReverse, defulteParamsData, @@ -84,9 +83,7 @@ const getCPUEcharts = async (val: any) => { const value = item.data.value; const nodeID = item.data.clusterNodeId; _cpuXAxis.add( - dayjs(value.timestamp).format( - getTimeFormat(data.value.type), - ), + dayjs(value.timestamp).format('YYYY-MM-DD HH:mm'), ); if (!_cpuOptions[nodeID]) { diff --git a/src/views/link/DashBoard/components/Jvm.vue b/src/views/link/DashBoard/components/Jvm.vue index d721b18e..b30f0bfa 100644 --- a/src/views/link/DashBoard/components/Jvm.vue +++ b/src/views/link/DashBoard/components/Jvm.vue @@ -53,7 +53,6 @@ import * as echarts from 'echarts'; import { dashboard } from '@/api/link/dashboard'; import dayjs from 'dayjs'; import { - getTimeFormat, getTimeByType, arrayReverse, typeDataLine, @@ -95,9 +94,7 @@ const getJVMEcharts = async (val: any) => { _jvmOptions[nodeID] = []; } _jvmXAxis.add( - dayjs(value.timestamp).format( - getTimeFormat(data.value.type), - ), + dayjs(value.timestamp).format('YYYY-MM-DD HH:mm'), ); _jvmOptions[nodeID].push(_value); }); diff --git a/src/views/link/DashBoard/components/tool.ts b/src/views/link/DashBoard/components/tool.ts index 2b32809e..be73f058 100644 --- a/src/views/link/DashBoard/components/tool.ts +++ b/src/views/link/DashBoard/components/tool.ts @@ -114,6 +114,7 @@ export const defulteParamsData = (group: any, val: any) => [ params: { from: dayjs(val.time[0]).valueOf(), to: dayjs(val.time[1]).valueOf(), + format: 'YYYY-MM-dd HH:mm', }, }, ]; From 2588145b96a5ecda3a7419de4f0a2e9d8ece0bfe Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Wed, 29 Mar 2023 16:31:28 +0800 Subject: [PATCH 04/12] fix: bug#11138 --- src/views/init-home/data/baseMenu.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/init-home/data/baseMenu.ts b/src/views/init-home/data/baseMenu.ts index 14b9ffc8..d3a1628a 100644 --- a/src/views/init-home/data/baseMenu.ts +++ b/src/views/init-home/data/baseMenu.ts @@ -2083,8 +2083,9 @@ export default [ ], }, ], - accessSupport: { text: "不支持", value: "unsupported" }, - supportDataAccess: false + accessSupport: { text: "支持", value: "support" }, + supportDataAccess: true, + assetType: 'aliyunNorthOutput' }, ], }, From c6717f6be08812da3ac67a40f773963ad7d72322 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Wed, 29 Mar 2023 16:38:47 +0800 Subject: [PATCH 05/12] fix: bug#11035 --- src/views/iot-card/Platform/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/iot-card/Platform/index.vue b/src/views/iot-card/Platform/index.vue index 50e2e170..c3cafec1 100644 --- a/src/views/iot-card/Platform/index.vue +++ b/src/views/iot-card/Platform/index.vue @@ -26,7 +26,7 @@ @@ -124,6 +124,7 @@ const props = defineProps({ }) const emit = defineEmits() +const unitMax = ref(99) const cronRules = [ { max: 64, message: '最多可输入64个字符' }, @@ -171,7 +172,6 @@ const showPeriod = computed(() => { }) - const updateValue = () => { const cloneValue = cloneDeep(formModel) @@ -189,12 +189,26 @@ const updateValue = () => { emit('update:value', cloneValue) } -const triggerChange = (v: any) => { +const triggerChange = () => { formModel.when = [] formModel.cron = undefined updateValue() } +/** + * 频率单位切换 + * @param v + */ +const periodUnitChange = (v: any) => { + if(v === 'hours') { + unitMax.value = 99999 + } else { + unitMax.value = 99 + } + formModel.period!.every = 1 + updateValue() +} + defineExpose({ validateFields: () => new Promise(async (resolve) => { const data = await timerForm.value?.validateFields() From 81f7e58c01d9f8935ed7f8e0a89e7eed28cf8187 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Wed, 29 Mar 2023 17:36:28 +0800 Subject: [PATCH 08/12] fix: bug#11087 --- src/components/ValueItem/index.vue | 27 ++++++++++++++++++--------- src/views/iot-card/Recharge/Save.vue | 4 ++-- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/ValueItem/index.vue b/src/components/ValueItem/index.vue index 79725601..f63df285 100644 --- a/src/components/ValueItem/index.vue +++ b/src/components/ValueItem/index.vue @@ -157,15 +157,17 @@ const componentsType = ref({ }); const typeMap = new Map(Object.entries(componentsType.value)); -const myValue = computed({ - get: () => { - return props.modelValue; - }, - set: (val: any) => { - objectValue.value = val; - emit('update:modelValue', val); - }, -}); +// const myValue = computed({ +// get: () => { +// return props.modelValue; +// }, +// set: (val: any) => { +// objectValue.value = val; +// emit('update:modelValue', val); +// }, +// }); + +const myValue = ref(props.modelValue) // 代码编辑器弹窗 const modalVis = ref(false); @@ -174,6 +176,7 @@ const handleItemModalSubmit = () => { myValue.value = objectValue.value.replace(/[\r\n]\s*/g, ''); modalVis.value = false; emit('change', objectValue.value) + emit('update:modelValue', myValue.value); }; // 文件上传 @@ -189,20 +192,26 @@ const handleFileChange = (info: UploadChangeParam>) => { const selectChange = (e: string, option: any) => { emit('change', e, option) + emit('update:modelValue', myValue.value); } const timeChange = (e: any) => { emit('change', e) + emit('update:modelValue', myValue.value); } const inputChange = (e: any) => { emit('change', e && e.target ? e.target.value : e) + emit('update:modelValue', myValue.value); } const dateChange = (e: any) => { emit('change', e) + emit('update:modelValue', myValue.value); } +myValue.value = props.modelValue + diff --git a/src/views/iot-card/Recharge/Save.vue b/src/views/iot-card/Recharge/Save.vue index 988ba2a0..b65f0c6d 100644 --- a/src/views/iot-card/Recharge/Save.vue +++ b/src/views/iot-card/Recharge/Save.vue @@ -71,7 +71,7 @@ import { queryPlatformNoPage, recharge } from '@/api/iot-card/cardManagement'; import { message } from 'jetlinks-ui-components'; import { PaymentMethod } from '@/views/iot-card/data'; -const emit = defineEmits(['change']); +const emit = defineEmits(['change', 'save']); const btnLoading = ref(false); const configList = ref[]>([]); @@ -171,7 +171,7 @@ const handleOk = () => { } else { window.open(resp.result); } - emit('change'); + emit('change', true); formRef.value.resetFields(); } }) From b283c729d9e5da91eb926889a539dc66db8ce895 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Wed, 29 Mar 2023 17:58:17 +0800 Subject: [PATCH 09/12] fix: bug#10938 --- src/components/ValueItem/index.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/ValueItem/index.vue b/src/components/ValueItem/index.vue index f63df285..09d33c26 100644 --- a/src/components/ValueItem/index.vue +++ b/src/components/ValueItem/index.vue @@ -85,6 +85,7 @@ width="700px" @cancel="modalVis = false" @ok="handleItemModalSubmit" + :zIndex='1100' >
@@ -212,6 +213,10 @@ const dateChange = (e: any) => { myValue.value = props.modelValue +if (props.itemType === 'object') { + objectValue.value = props.modelValue as string +} + From 8566c3e74ccaf2ef80cd5007d58e131532e91ded Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Wed, 29 Mar 2023 20:21:11 +0800 Subject: [PATCH 10/12] =?UTF-8?q?update:=20=E5=8D=87=E7=BA=A7=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 12ea964d..95dc6559 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3700,8 +3700,8 @@ jetlinks-store@^0.0.3: jetlinks-ui-components@^1.0.5: version "1.0.5" - resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#031a300df4df31a353d738cacee8b4ff630ae2d0" - integrity sha512-SfucQ7LzlE13VdyZsDhrhzwF9Le/NOke5F6UY3bNN1OJiRD/bZMJecGQxWBQGv567lKcV60SOPCMT8ExiZxUgw== + resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#a8c912f424b8e6c3e0aa8e2aa9ddcc59fe13cd3a" + integrity sha512-zZsVbqG7sLfKsizK+8sT0bCmAz7rEu/qoS5yYSEUzGMvTGQU3Q5W6qdT/5o5v92BYFP+1Kud1l5CNhA3e3NtWQ== dependencies: "@vueuse/core" "^9.12.0" ant-design-vue "^3.2.15" From 8187e27a43cad1c9860f0845322df751a0f6738a Mon Sep 17 00:00:00 2001 From: leiqiaochu Date: Wed, 29 Mar 2023 20:24:43 +0800 Subject: [PATCH 11/12] fix: bug#11128 --- src/views/init-home/data/RoleData.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/views/init-home/data/RoleData.ts b/src/views/init-home/data/RoleData.ts index ff565179..9729255d 100644 --- a/src/views/init-home/data/RoleData.ts +++ b/src/views/init-home/data/RoleData.ts @@ -478,12 +478,6 @@ export default { buttons: [ { id: 'view', name: '查看', enabled: true, granted: true }, { id: 'update', name: '编辑', enabled: true, granted: true }, - { - id: 'action', - name: '启/禁用', - enabled: true, - granted: true, - }, { id: 'delete', name: '删除', enabled: true, granted: true }, { id: 'add', @@ -949,12 +943,6 @@ export default { buttons: [ { id: 'view', name: '查看', enabled: true, granted: true }, { id: 'update', name: '编辑', enabled: true, granted: true }, - { - id: 'action', - name: '启/禁用', - enabled: true, - granted: true, - }, { id: 'delete', name: '删除', enabled: true, granted: true }, { id: 'add', From ecd956b4fd6d616b8b20e05cad7e0a877c85b84a Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 29 Mar 2023 20:38:24 +0800 Subject: [PATCH 12/12] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E8=81=94=E5=8A=A8=E6=89=A7=E8=A1=8C=E5=8A=A8=E4=BD=9C?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=9F=A5=E8=AF=A2=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scene/Save/action/Device/device/Device.vue | 2 +- src/views/system/DataSource/Management/index.vue | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue b/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue index 8ab6ad76..b837d4da 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue @@ -150,7 +150,7 @@ const handleSearch = (p: any) => { const deviceQuery = (p: any) => { const sorts: any = []; - if (props.value) { + if (props.value[0]?.value) { sorts.push({ name: 'id', value: props.value[0]?.value, diff --git a/src/views/system/DataSource/Management/index.vue b/src/views/system/DataSource/Management/index.vue index ea797fec..2f3f119e 100644 --- a/src/views/system/DataSource/Management/index.vue +++ b/src/views/system/DataSource/Management/index.vue @@ -147,7 +147,7 @@ :danger="true" :popConfirm="{ title: `确认删除`, - onConfirm: () => clickDel(record), + onConfirm: () => clickDel(record, index), }" :disabled="record.status" > @@ -358,14 +358,18 @@ const addRow = () => { table.data.push(initData); }; -const clickDel = (row: any) => { +const clickDel = (row: any, index: number) => { if (row.scale !== undefined) { delSaveRow_api(id, leftData.selectedKeys[0], [row.name]).then( (resp: any) => { - if (resp.status === 200) table.data.splice(row.index, 1); + if (resp.status === 200) { + table.data.splice(index, 1) + } }, ); - } else table.data.splice(row.index, 1); + } else { + table.data.splice(index, 1) + }; }; const clickSave = () => {