diff --git a/build.sh b/build.sh index 5bbf1f2e..6ead7b78 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.2.0-SNAPSHOT . -docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.2.0-SNAPSHOT +docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1.0-TEST . +docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1.0-TEST diff --git a/package-lock.json b/package-lock.json index bd0c8c2a..022d589e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", + "jetlinks-ui-components": "^1.0.37", "js-cookie": "^3.0.1", "jsencrypt": "^3.3.2", "less": "^4.1.3", @@ -5216,6 +5217,30 @@ "resolved": "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz", "integrity": "sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q==" }, + "node_modules/jetlinks-ui-components": { + "version": "1.0.37", + "resolved": "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.37.tgz", + "integrity": "sha512-Zhjz5/Zs02Jy40eLmh/zgF9zQlDKUpeHptTYzb9LQjszqAUAV3XjWPcNoyMqE4nP8Q3uagyw1yxJfWvzxDf62Q==", + "dependencies": { + "@vueuse/core": "^9.12.0", + "@vueuse/router": "^9.13.0", + "ant-design-vue": "^3.2.15", + "colorpicker-v3": "^2.10.2", + "lodash-es": "^4.17.21", + "monaco-editor": "^0.40.0", + "onigasm": "^2.2.5", + "sortablejs": "^1.15.0", + "vuedraggable": "^4.1.0" + }, + "engines": { + "node": ">=18.14.0" + } + }, + "node_modules/jetlinks-ui-components/node_modules/monaco-editor": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.40.0.tgz", + "integrity": "sha512-1wymccLEuFSMBvCk/jT1YDW/GuxMLYwnFwF9CDyYCxoTw2Pt379J3FUhwy9c43j51JdcxVPjwk0jm0EVDsBS2g==" + }, "node_modules/js-cookie": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz", @@ -8823,8 +8848,11 @@ "version": "2.0.5", "resolved": "http://registry.jetlinks.cn/init-package-json/-/init-package-json-2.0.5.tgz", "integrity": "sha512-u1uGAtEFu3VA6HNl/yUWw57jmKEMx8SKOxHhxjGnOFUiIlFnohKDFg4ZrPpv9wWqk44nDxGJAtqjdQFm+9XXQA==", +<<<<<<< HEAD +======= "resolved": "http://registry.jetlinks.cn/init-package-json/-/init-package-json-2.0.5.tgz", "integrity": "sha512-u1uGAtEFu3VA6HNl/yUWw57jmKEMx8SKOxHhxjGnOFUiIlFnohKDFg4ZrPpv9wWqk44nDxGJAtqjdQFm+9XXQA==", +>>>>>>> dev-bug "inBundle": true, "license": "ISC", "dependencies": { @@ -17472,6 +17500,29 @@ "resolved": "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz", "integrity": "sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q==" }, + "jetlinks-ui-components": { + "version": "1.0.37", + "resolved": "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.37.tgz", + "integrity": "sha512-Zhjz5/Zs02Jy40eLmh/zgF9zQlDKUpeHptTYzb9LQjszqAUAV3XjWPcNoyMqE4nP8Q3uagyw1yxJfWvzxDf62Q==", + "requires": { + "@vueuse/core": "^9.12.0", + "@vueuse/router": "^9.13.0", + "ant-design-vue": "^3.2.15", + "colorpicker-v3": "^2.10.2", + "lodash-es": "^4.17.21", + "monaco-editor": "^0.40.0", + "onigasm": "^2.2.5", + "sortablejs": "^1.15.0", + "vuedraggable": "^4.1.0" + }, + "dependencies": { + "monaco-editor": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.40.0.tgz", + "integrity": "sha512-1wymccLEuFSMBvCk/jT1YDW/GuxMLYwnFwF9CDyYCxoTw2Pt379J3FUhwy9c43j51JdcxVPjwk0jm0EVDsBS2g==" + } + } + }, "js-cookie": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz", diff --git a/src/views/device/Firmware/Save/FileUpload.vue b/src/views/device/Firmware/Save/FileUpload.vue index 60ca6653..6b8eb9e4 100644 --- a/src/views/device/Firmware/Save/FileUpload.vue +++ b/src/views/device/Firmware/Save/FileUpload.vue @@ -4,7 +4,7 @@ placeholder="请上传文件" v-model:value="fileValue" style="width: calc(100% - 110px)" - :disabled="true" + @change="fileValueChange" /> { } }; +const fileValueChange = () =>{ + emit('update:modelValue',fileValue.value) +} + watch( () => props.modelValue, (value) => { diff --git a/src/views/device/Instance/Detail/Function/components/Advance.vue b/src/views/device/Instance/Detail/Function/components/Advance.vue index 18623077..d7eaf12d 100644 --- a/src/views/device/Instance/Detail/Function/components/Advance.vue +++ b/src/views/device/Instance/Detail/Function/components/Advance.vue @@ -9,9 +9,14 @@ > @@ -34,10 +39,7 @@ > 执行 - + 清空 @@ -76,7 +78,7 @@ const newFunctions = ref([]); * @param type * @param json */ - const setInitValue = (type: string, json?: any) => { +const setInitValue = (type: string, json?: any) => { let initVal: any = ''; if (['int', 'long', 'float', 'double'].includes(type)) { initVal = 0; @@ -122,8 +124,8 @@ watch( }, { immediate: true, - deep: true - } + deep: true, + }, ); const onTabChange = (_key: string) => { @@ -148,7 +150,8 @@ const handleExecute = async (func: any) => { loading.value = false; }); if (resp.success) { - executeResult.value = resp?.result instanceof Array ? resp?.result?.[0] : resp.result; + executeResult.value = + resp?.result instanceof Array ? resp?.result?.[0] : resp.result; onlyMessage('操作成功'); } }; @@ -181,4 +184,9 @@ const handleClear = () => { overflow: auto; } } +.tabTitle { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} diff --git a/src/views/device/Instance/Detail/Function/components/Simple.vue b/src/views/device/Instance/Detail/Function/components/Simple.vue index 0d3aadc5..f336564f 100644 --- a/src/views/device/Instance/Detail/Function/components/Simple.vue +++ b/src/views/device/Instance/Detail/Function/components/Simple.vue @@ -6,12 +6,22 @@ 精简模式下参数只支持输入框的方式录入 - + @@ -137,7 +147,7 @@ const columns = ref([ }, ]); -const executeResult = ref('') +const executeResult = ref(''); // 设备功能数据处理 const newFunctions = computed(() => { @@ -174,7 +184,7 @@ const newFunctions = computed(() => { ? tableItem['json']?.['properties'][0] : undefined, value: undefined, - required: tableItem.expands?.required + required: tableItem.expands?.required, }); } @@ -203,17 +213,18 @@ const handleExecute = async (func: any) => { obj[item.id] = item.value; } }); - loading.value = true + loading.value = true; const { success, result } = await execute( route.params.id as string, func.id, obj, - ).catch(() => { - loading.value = false - }) - .finally(() => { - loading.value = false - }) + ) + .catch(() => { + loading.value = false; + }) + .finally(() => { + loading.value = false; + }); if (!success) return; onlyMessage('操作成功'); executeResult.value = result instanceof Array ? result[0] : result; @@ -227,13 +238,13 @@ const handleExecute = async (func: any) => { * 清空 */ const handleClear = (func: any) => { - executeResult.value = '' + executeResult.value = ''; proxy?.$refs[`${func.id}Ref`][0].resetFields(); }; const onTabChange = (_key: string) => { - executeResult.value = '' -} + executeResult.value = ''; +}; diff --git a/src/views/device/Instance/Detail/Running/Property/Indicators.vue b/src/views/device/Instance/Detail/Running/Property/Indicators.vue index 95f7218f..b6d27253 100644 --- a/src/views/device/Instance/Detail/Running/Property/Indicators.vue +++ b/src/views/device/Instance/Detail/Running/Property/Indicators.vue @@ -160,8 +160,19 @@ watch( ); modelRef.metrics = list || []; } else { - modelRef.metrics = - props.data.expands?.metrics || []; + modelRef.metrics = ( + props.data.expands?.metrics || [] + ).map((item: any) => { + const val = Array.isArray(item?.value) + ? item?.value + : isNumber(item?.value) + ? [item.value] + : item?.value?.split(','); + return { + ...item, + value: val, + }; + }); } } } diff --git a/src/views/device/Instance/Detail/Running/index.vue b/src/views/device/Instance/Detail/Running/index.vue index 3ff066df..bdbb953a 100644 --- a/src/views/device/Instance/Detail/Running/index.vue +++ b/src/views/device/Instance/Detail/Running/index.vue @@ -16,7 +16,18 @@ :tabBarStyle="{ width: '200px' }" @change="tabChange" > - + + + @@ -129,4 +140,9 @@ const tabChange = (key: string) => { flex: 1; } } - \ No newline at end of file +.tabTitle { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + diff --git a/src/views/device/Instance/Import/file.vue b/src/views/device/Instance/Import/file.vue index 0a002e14..6340dcfe 100644 --- a/src/views/device/Instance/Import/file.vue +++ b/src/views/device/Instance/Import/file.vue @@ -161,7 +161,6 @@ const submitData = async (fileUrl: string) => { errCount.value = et; } } - flag.value=false; disabled.value = false; }; source.onerror = (e: { status: number }) => { diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue index 394f893d..94c07aa2 100644 --- a/src/views/device/Instance/index.vue +++ b/src/views/device/Instance/index.vue @@ -720,7 +720,10 @@ const getActions = ( const resp = await _delete(data.id); if (resp.status === 200) { onlyMessage('操作成功!'); - _selectedRowKeys.value=[]; + const index = _selectedRowKeys.value.findIndex((id: any) => id === data.id); + if (index !== -1) { + _selectedRowKeys.value.splice(index, 1); + } instanceRef.value?.reload(); } else { onlyMessage('操作失败!', 'error'); diff --git a/src/views/device/components/Metadata/Base/Base.vue b/src/views/device/components/Metadata/Base/Base.vue index 8ac4a951..c205eb04 100644 --- a/src/views/device/components/Metadata/Base/Base.vue +++ b/src/views/device/components/Metadata/Base/Base.vue @@ -210,7 +210,7 @@ key="add" :disabled="hasOperate('add', type)" :tooltip="{ - placement: hasOperate('add', type) ? 'topRight' : 'top', + placement:'top', title: hasOperate('add', type) ? '当前的存储方式不支持新增' : '新增', diff --git a/src/views/iot-card/CardManagement/index.vue b/src/views/iot-card/CardManagement/index.vue index 13e22f63..f562be3a 100644 --- a/src/views/iot-card/CardManagement/index.vue +++ b/src/views/iot-card/CardManagement/index.vue @@ -680,7 +680,10 @@ const getActions = ( const resp: any = await del(data.id); if (resp.status === 200) { onlyMessage('操作成功'); - _selectedRowKeys.value=[]; + const index = _selectedRowKeys.value.findIndex((id: any) => id === data.id); + if (index !== -1) { + _selectedRowKeys.value.splice(index, 1); + } cardManageRef.value?.reload(); } else { onlyMessage('操作失败!', 'error'); diff --git a/src/views/link/AccessConfig/index.vue b/src/views/link/AccessConfig/index.vue index 2dc716a1..1b888329 100644 --- a/src/views/link/AccessConfig/index.vue +++ b/src/views/link/AccessConfig/index.vue @@ -205,7 +205,6 @@ const tableRef = ref>({}); const params = ref>({}); let providersList = ref>([]); -const providersOptions = ref>([]); const statusMap = new Map(); statusMap.set('enabled', 'success'); @@ -227,7 +226,13 @@ const columns = [ key: 'provider', search: { type: 'select', - options: providersOptions, + options: async() =>{ + const res: any = await getProviders(); + const providersOptions = accessConfigTypeFilter(res.result || []); + return providersOptions.filter((i:any)=>{ + return i.id !== 'modbus-tcp' && i.id !== 'opc-ua' + }) + }, }, }, { @@ -331,10 +336,6 @@ const getActions = (data: Partial>): ActionsType[] => { const getProvidersList = async () => { const res: any = await getProviders(); providersList.value = res.result; - providersOptions.value = accessConfigTypeFilter(res.result || []); - providersOptions.value = providersOptions.value.filter((i:any)=>{ - return i.id !== 'modbus-tcp' && i.id !== 'opc-ua' - }) }; getProvidersList(); diff --git a/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue b/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue index b0881082..6781f17f 100644 --- a/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue +++ b/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue @@ -303,7 +303,7 @@ watch( const showDouble = computed(() => { const isRange = paramsValue.termType - ? doubleParamsKey.includes(paramsValue.termType) + ? arrayParamsKey.includes(paramsValue.termType) : false; const isSourceMetric = paramsValue.value?.source === 'metric'; if (metricsCacheOption.value.length) { @@ -324,13 +324,7 @@ const showDouble = computed(() => { }); const showArray = computed(()=>{ - const isRange = paramsValue.termType ? [ - 'in', - 'nin', - 'contains_all', - 'contains_any', - 'not_contains', - ].includes(paramsValue.termType) : false; + const isRange = paramsValue.termType ? arrayParamsKey.includes(paramsValue.termType) : false; const isSourceMetric = paramsValue.value?.source === 'metric'; if (metricsCacheOption.value.length) { metricOption.value = metricsCacheOption.value.filter((item) => @@ -458,6 +452,8 @@ const termsTypeSelect = (e: { key: string; name: string }) => { if (arrayParamsKey.includes(e.key) !== isArray) { // 有变化 newValue.value = undefined; + }else{ + newValue.value = paramsValue.value!.value } } if (['isnull', 'notnull'].includes(e.key)) { diff --git a/src/views/system/Apply/index.vue b/src/views/system/Apply/index.vue index 440cbbf9..a15bb1c9 100644 --- a/src/views/system/Apply/index.vue +++ b/src/views/system/Apply/index.vue @@ -53,10 +53,16 @@