From f11f5e1729a81eeffa50eab78ca58358abb129f1 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 28 Mar 2023 13:34:16 +0800 Subject: [PATCH 1/7] fix: bug#11013 --- .../iot-card/CardManagement/BindDevice.vue | 232 ++++++++++-------- yarn.lock | 4 +- 2 files changed, 125 insertions(+), 111 deletions(-) diff --git a/src/views/iot-card/CardManagement/BindDevice.vue b/src/views/iot-card/CardManagement/BindDevice.vue index a0a8c3b5..75197e35 100644 --- a/src/views/iot-card/CardManagement/BindDevice.vue +++ b/src/views/iot-card/CardManagement/BindDevice.vue @@ -1,132 +1,146 @@ - - + diff --git a/yarn.lock b/yarn.lock index 1a3e9019..12ea964d 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#531a7cd5cc4069dc299f0efcc92411a4eee369e7" - integrity sha512-7VHsz5lVG9PlFkHoJvEown4QARuVuasR+jDa9NNQ+pJSHAtHAeiIO1bpVTQKfE5WCyhCKPnN8yIerJLLzmQ1fA== + resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#031a300df4df31a353d738cacee8b4ff630ae2d0" + integrity sha512-SfucQ7LzlE13VdyZsDhrhzwF9Le/NOke5F6UY3bNN1OJiRD/bZMJecGQxWBQGv567lKcV60SOPCMT8ExiZxUgw== dependencies: "@vueuse/core" "^9.12.0" ant-design-vue "^3.2.15" From 80a362e815f10bb108453de2830cb7b7ec2bbac7 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 28 Mar 2023 14:14:24 +0800 Subject: [PATCH 2/7] fix: bug#10741 --- .../device/Firmware/Task/Save/SelectDevices.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/views/device/Firmware/Task/Save/SelectDevices.vue b/src/views/device/Firmware/Task/Save/SelectDevices.vue index 355efce9..6caf66f5 100644 --- a/src/views/device/Firmware/Task/Save/SelectDevices.vue +++ b/src/views/device/Firmware/Task/Save/SelectDevices.vue @@ -166,6 +166,7 @@ const columns = [ dataIndex: 'registerTime', search: { type: 'date', + rename: 'registryTime' }, width: 200, scopedSlots: true, @@ -290,7 +291,19 @@ watch( * @param params */ const handleSearch = (e: any) => { - params.value = e; + const newParams = (e?.terms as any[])?.map(item1 => { + item1.terms = item1.terms.map((item2: any) => { + if (item2.column === 'version') { + return { + column: 'id$dev-firmware', + value: [item2] + } + } + return item2 + }) + return item1 + }) + params.value = { terms: newParams || []} }; From 7474254a45de5e06d60afc0055f4ddabddbb3809 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 28 Mar 2023 15:38:21 +0800 Subject: [PATCH 3/7] fix: bug#10935 --- src/views/init-home/data/baseMenu.ts | 3 +- .../Save/action/ListItem/FilterCondition.vue | 30 +++++++++++++--- .../Save/components/Terms/ParamsItem.vue | 34 +++++++++++++++---- 3 files changed, 54 insertions(+), 13 deletions(-) diff --git a/src/views/init-home/data/baseMenu.ts b/src/views/init-home/data/baseMenu.ts index eafb6658..a78c6fc8 100644 --- a/src/views/init-home/data/baseMenu.ts +++ b/src/views/init-home/data/baseMenu.ts @@ -185,7 +185,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'notifyConfig' }, { code: 'notice/Template', diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue b/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue index 80dc2198..9126c28d 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue @@ -242,10 +242,30 @@ const handleOptionsColumnsValue = (termsColumns: any[], _options: any) => { } const columnSelect = (e: any) => { - paramsValue.termType = 'eq' - paramsValue.value = { - source: tabsOptions.value[0].key, - value: undefined + const dataType = e.type + const hasTypeChange = dataType !== tabsOptions.value[0].component + let termTypeChange = false + + // 如果参数类型未发生变化,则不修改操作符以及值 + const termTypes = e.termTypes + if (!termTypes.some((item: {id: string}) => paramsValue.termType === item.id)) { // 修改操作符 + termTypeChange = true + paramsValue.termType = termTypes?.length ? termTypes[0].id : 'eq' + } + + if (hasTypeChange) { + paramsValue.termType = termTypes?.length ? termTypes[0].id : 'eq' + paramsValue.value = { + source: tabsOptions.value[0].key, + value: undefined + } + } else if (termTypeChange) { + const oldValue = isArray(paramsValue.value!.value) ? paramsValue.value!.value[0] : paramsValue.value!.value + const value = arrayParamsKey.includes(e.key) ? [ oldValue, undefined ] : oldValue + paramsValue.value = { + source: paramsValue.value?.source || tabsOptions.value[0].key, + value: value + } } const columns = e.metadata === true ? [e.column] : [] @@ -266,7 +286,7 @@ const termsTypeSelect = (e: { key: string, name: string }) => { const oldValue = isArray(paramsValue.value!.value) ? paramsValue.value!.value[0] : paramsValue.value!.value const value = arrayParamsKey.includes(e.key) ? [ oldValue, undefined ] : oldValue paramsValue.value = { - source: tabsOptions.value[0].key, + source: paramsValue.value?.source || tabsOptions.value[0].key, value: value } emit('update:value', { ...paramsValue }) 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 40f92b8f..66737739 100644 --- a/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue +++ b/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue @@ -216,12 +216,14 @@ watch(() => [columnOptions.value, paramsValue.column], () => { const showDouble = computed(() => { 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 => isRange ? item.range : !item.range) } else { metricOption.value = [] } - return isRange && !isMetric.value + + return isRange && !isMetric.value && !isSourceMetric }) const mouseover = () => { @@ -237,11 +239,29 @@ const mouseout = () => { } const columnSelect = (option: any) => { + const dataType = option.dataType + const hasTypeChange = dataType !== tabsOptions.value[0].component + let termTypeChange = false + // 如果参数类型未发生变化,则不修改操作符以及值 const termTypes = option.termTypes - paramsValue.termType = termTypes?.length ? termTypes[0].id : 'eq' - paramsValue.value = { - source: tabsOptions.value[0].key, - value: undefined + if (!termTypes.some((item: {id: string}) => paramsValue.termType === item.id)) { // 修改操作符 + termTypeChange = true + paramsValue.termType = termTypes?.length ? termTypes[0].id : 'eq' + } + + if (hasTypeChange) { // 类型发生变化 + paramsValue.termType = termTypes?.length ? termTypes[0].id : 'eq' + paramsValue.value = { + source: tabsOptions.value[0].key, + value: undefined + } + } else if (termTypeChange) { + const oldValue = isArray(paramsValue.value!.value) ? paramsValue.value!.value[0] : paramsValue.value!.value + const value = arrayParamsKey.includes(paramsValue.termType as string) ? [ oldValue, undefined ] : oldValue + paramsValue.value = { + source: paramsValue.value?.source || tabsOptions.value[0].key, + value: value + } } handOptionByColumn(option) emit('update:value', { ...paramsValue }) @@ -254,7 +274,7 @@ const termsTypeSelect = (e: { key: string, name: string }) => { const oldValue = isArray(paramsValue.value!.value) ? paramsValue.value!.value[0] : paramsValue.value!.value const value = arrayParamsKey.includes(e.key) ? [ oldValue, undefined ] : oldValue paramsValue.value = { - source: tabsOptions.value[0].key, + source: paramsValue.value?.source || tabsOptions.value[0].key, value: value } emit('update:value', { ...paramsValue }) @@ -263,7 +283,7 @@ const termsTypeSelect = (e: { key: string, name: string }) => { } -const valueSelect = (_: any, label: string, labelObj: Record) => { +const valueSelect = (v: any, label: string, labelObj: Record) => { emit('update:value', { ...paramsValue }) formItemContext.onFieldChange() formModel.value.options!.when[props.branchName].terms[props.whenName].terms[props.name][2] = labelObj From eb21e64cc1699f12681b5ac45199982f8282993e Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 28 Mar 2023 16:14:45 +0800 Subject: [PATCH 4/7] fix: bug#10921 --- .../Scene/Save/components/ParamsDropdown/Double.vue | 2 +- .../Scene/Save/components/ParamsDropdown/index.vue | 2 +- .../Scene/Save/components/ParamsDropdown/typings.ts | 2 +- .../Scene/Save/components/Terms/ParamsItem.vue | 12 +++++++++--- .../Scene/Save/components/Terms/WhenItem.vue | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/Double.vue b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/Double.vue index 40b7b70b..23c25abf 100644 --- a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/Double.vue +++ b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/Double.vue @@ -48,7 +48,7 @@ const label: Record = { const emit = defineEmits() -const myValue = ref(props.value) +const myValue = ref(props.value || [undefined, undefined] as any) const mySource = ref(props.source) const onSelect = (v: any, _label: string, index: number) => { diff --git a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue index b76586ee..69b522a8 100644 --- a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue +++ b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue @@ -100,7 +100,7 @@ type Emit = { } const props = defineProps({ - ...defaultSetting + ...defaultSetting, }) const emit = defineEmits() diff --git a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/typings.ts b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/typings.ts index fc93e106..35974dbb 100644 --- a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/typings.ts +++ b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/typings.ts @@ -14,7 +14,7 @@ export type TabsOption = { key: string; component: string } -type ValueArrayType = [string, number] +type ValueArrayType = [string, number, undefined] export type ValueType = string | number | undefined | ValueArrayType export const defaultSetting = { 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 66737739..5d6663fb 100644 --- a/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue +++ b/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue @@ -133,7 +133,7 @@ const props = defineProps({ type: '', termType: 'eq', value: { - source: 'fixed', + source: 'manual', value: undefined } }) @@ -223,7 +223,13 @@ const showDouble = computed(() => { metricOption.value = [] } - return isRange && !isMetric.value && !isSourceMetric + if (isRange) { + if (isMetric.value) { + return !isSourceMetric + } + return true + } + return false }) const mouseover = () => { @@ -298,7 +304,7 @@ const termAdd = () => { const terms = { column: undefined, value: { - source: 'fixed', + source: 'manual', value: undefined }, termType: undefined, diff --git a/src/views/rule-engine/Scene/Save/components/Terms/WhenItem.vue b/src/views/rule-engine/Scene/Save/components/Terms/WhenItem.vue index e31f07da..a30e5528 100644 --- a/src/views/rule-engine/Scene/Save/components/Terms/WhenItem.vue +++ b/src/views/rule-engine/Scene/Save/components/Terms/WhenItem.vue @@ -97,7 +97,7 @@ const addWhen = () => { { column: undefined, value: { - source: 'fixed', + source: 'manual', value: undefined }, termType: undefined, From 28e850551ba7d7800c54c9bd4d4e6dbfac19bfc6 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 28 Mar 2023 16:46:25 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/init-home/data/baseMenu.ts | 64 ++++++++++++++++++---------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/src/views/init-home/data/baseMenu.ts b/src/views/init-home/data/baseMenu.ts index a78c6fc8..f1a4b94d 100644 --- a/src/views/init-home/data/baseMenu.ts +++ b/src/views/init-home/data/baseMenu.ts @@ -307,6 +307,7 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, + assetType: 'notifyTemplate', supportDataAccess: true }, ], @@ -970,8 +971,9 @@ export default [ ], }, ], - accessSupport: { text: "不支持", value: "unsupported" }, - supportDataAccess: false + accessSupport: { text: "支持", value: "support" }, + supportDataAccess: true, + assetType: 'deviceGateway' }, { code: 'link/Protocol', @@ -1042,8 +1044,9 @@ export default [ ], }, ], - accessSupport: { text: "不支持", value: "unsupported" }, - supportDataAccess: false + accessSupport: { text: "支持", value: "support" }, + supportDataAccess: true, + assetType: 'protocol' }, { code: 'Log', @@ -1144,8 +1147,9 @@ export default [ ], }, ], - accessSupport: { text: "不支持", value: "unsupported" }, - supportDataAccess: false + accessSupport: { text: "支持", value: "support" }, + supportDataAccess: true, + assetType: 'network' }, { code: 'link/Certificate', @@ -1201,7 +1205,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'certificate' }, { code: 'media/Stream', @@ -1547,7 +1552,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'dataCollectChannel' }, { code: 'DataCollect/Collector', @@ -1680,7 +1686,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'ataCollectCollector' }, ], }, @@ -1851,7 +1858,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'alarmConfig' }, { code: 'rule-engine/Alarm/Log', @@ -1995,8 +2003,9 @@ export default [ ], }, ], - accessSupport: { text: "不支持", value: "unsupported" }, - supportDataAccess: false + accessSupport: { text: "支持", value: "support" }, + supportDataAccess: true, + assetType: 'dueros' }, { code: 'Northbound/AliCloud', @@ -2234,7 +2243,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'ruleInstance' }, { code: 'rule-engine/Scene', @@ -2386,7 +2396,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'scene' }, ], }, @@ -2907,7 +2918,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'gbCascade' }, ], }, @@ -3052,7 +3064,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'user' }, { code: 'system/Department', @@ -3250,7 +3263,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'organization' }, { code: 'system/Role', @@ -3327,7 +3341,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'role' }, { code: 'system/Menu', @@ -3641,7 +3656,8 @@ export default [ }, ], accessSupport: { text: "支持", value: "support" }, - supportDataAccess: true + supportDataAccess: true, + assetType: 'datasource' }, { code: 'system/Platforms/Setting', @@ -4043,8 +4059,9 @@ export default [ ], }, ], - accessSupport: { text: "不支持", value: "unsupported" }, - supportDataAccess: false + accessSupport: { text: "支持", value: "support" }, + supportDataAccess: true, + assetType: 'networkCard' }, { path: '5Hpl-ZjAG', @@ -4161,8 +4178,9 @@ export default [ ], }, ], - accessSupport: { text: "不支持", value: "unsupported" }, - supportDataAccess: false + accessSupport: { text: "支持", value: "support" }, + supportDataAccess: true, + assetType: 'networkCardPlatform' }, { path: '5Hpl-cL34', From cb25adfde089e0ea6a9b7dbd154fb7d94ad38ca8 Mon Sep 17 00:00:00 2001 From: leiqiaochu Date: Tue, 28 Mar 2023 16:51:56 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=E8=AE=BE=E5=A4=87=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=8E=A5=E5=85=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/device/Product/Detail/DeviceAccess/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/device/Product/Detail/DeviceAccess/index.vue b/src/views/device/Product/Detail/DeviceAccess/index.vue index 0a2444f9..da67db62 100644 --- a/src/views/device/Product/Detail/DeviceAccess/index.vue +++ b/src/views/device/Product/Detail/DeviceAccess/index.vue @@ -1019,6 +1019,9 @@ watchEffect(() => { nextTick(() => { getData(); }); +watch(()=>productStore.current,()=>{ + getData() +})