From 06139305eb69ef3658f7f57feefbdf3ebc8ae42d Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Fri, 24 Mar 2023 09:56:39 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20bug#10779=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=87=87=E9=9B=86=E5=99=A8=E6=96=B0=E5=A2=9E=E6=97=B6=E9=80=9A?= =?UTF-8?q?=E9=81=93=E4=B8=8D=E5=AE=8C=E6=95=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data-collect/collector.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/data-collect/collector.ts b/src/api/data-collect/collector.ts index 75d9abc7..6c1ed981 100644 --- a/src/api/data-collect/collector.ts +++ b/src/api/data-collect/collector.ts @@ -4,7 +4,7 @@ export const queryCollector = (data: any) => server.post(`/data-collect/collector/_query/no-paging?paging=false`, data); export const queryChannelNoPaging = () => - server.post(`/data-collect/channel/_query/no-paging?paging=false`, {}); + server.post(`/data-collect/channel/_query/no-paging`, { paging: false }); export const save = (data: any) => server.post(`/data-collect/collector`, data); From 3f075e6f2491e84e1b3acf07a70760e1ca4fd82a Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Fri, 24 Mar 2023 10:06:51 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20=E6=B5=81=E5=AA=92=E4=BD=93=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=20=E5=9F=9F=E5=90=8Dip=E6=A0=A1=E9=AA=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/link/Type/data.ts | 12 ++++-------- src/views/media/Stream/Detail/index.vue | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/views/link/Type/data.ts b/src/views/link/Type/data.ts index 46420ab7..0b54fc9b 100644 --- a/src/views/link/Type/data.ts +++ b/src/views/link/Type/data.ts @@ -113,8 +113,8 @@ export const Validator = { regOnlyNumber: new RegExp(/^\d+$/), }; -const validateAddress = (_rule: any, value: string): Promise => - new Promise(async (resolve, reject) => { +const validateAddress = (_rule: any, value: string): Promise => { + return new Promise(async (resolve, reject) => { if ( Validator.regIpv4.test(value) || Validator.regIPv6.test(value) || @@ -122,9 +122,10 @@ const validateAddress = (_rule: any, value: string): Promise => ) { return resolve(''); } else { - return reject('请输入正确的IP地址或者域名'); + return value ? reject('请输入正确的IP地址或者域名') : resolve(''); } }); +}; export const Rules = { name: [ @@ -176,11 +177,6 @@ export const Rules = { validator: validateAddress, message: '请输入正确的IP地址或者域名', }, - // { - // pattern: - // Validator.regIpv4 || Validator.regIPv6 || Validator.regDomain, - // message: '请输入正确格式的域名或ip', - // }, ], publicPort: [ { diff --git a/src/views/media/Stream/Detail/index.vue b/src/views/media/Stream/Detail/index.vue index ba13c1dd..e5620008 100644 --- a/src/views/media/Stream/Detail/index.vue +++ b/src/views/media/Stream/Detail/index.vue @@ -302,7 +302,7 @@ const validateAddress = (_rule: any, value: string): Promise => ) { return resolve(''); } else { - return reject('请输入正确的IP地址或者域名'); + return value ? reject('请输入正确的IP地址或者域名') : resolve(''); } }); From 62bd45e6242713c2f84a278fdd637e1410be81eb Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Fri, 24 Mar 2023 15:34:04 +0800 Subject: [PATCH 3/7] fix: bug#10844 --- src/views/system/Menu/Detail/ButtonMange.vue | 3 ++- src/views/system/Menu/components/ButtonAddDialog.vue | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/views/system/Menu/Detail/ButtonMange.vue b/src/views/system/Menu/Detail/ButtonMange.vue index 41e52f86..77d8f618 100644 --- a/src/views/system/Menu/Detail/ButtonMange.vue +++ b/src/views/system/Menu/Detail/ButtonMange.vue @@ -122,7 +122,8 @@ const table = reactive({ routeParams.id && getMenuInfo_api(routeParams.id).then((resp: any) => { menuInfo.value = resp.result; - table.tableData = resp.result.buttons as tableDataItem[]; + table.tableData = + (resp.result?.buttons as tableDataItem[]) || []; }); }, clickDel: (row: tableDataItem) => { diff --git a/src/views/system/Menu/components/ButtonAddDialog.vue b/src/views/system/Menu/components/ButtonAddDialog.vue index 5bec96ea..ffc69edb 100644 --- a/src/views/system/Menu/components/ButtonAddDialog.vue +++ b/src/views/system/Menu/components/ButtonAddDialog.vue @@ -95,8 +95,8 @@ const confirm = () => { loading.value = true; formRef.value && formRef.value.validate().then(() => { - const buttons = toRaw(props.menuInfo.buttons); - const button = buttons.find((item) => item.id === form.data.id); + const buttons = toRaw(props.menuInfo?.buttons); + const button = buttons?.find((item) => item.id === form.data.id); if (button) { Object.entries(form.data).forEach(([key, value]) => { button[key] = value; @@ -112,7 +112,10 @@ const confirm = () => { emits('confirm'); emits('update:visible', false); }) - .finally(() => (loading.value = false)); + .finally(() => (loading.value = false)) + .catch(() => { + loading.value = false; + }); }); }; const initForm = { From 32e78e9fc0fadde6068dca88721e55568ddb3341 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Fri, 24 Mar 2023 15:36:25 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=87=87=E9=9B=86?= =?UTF-8?q?=E5=99=A8=E6=96=AD=E5=BC=80=E6=96=87=E6=A1=88=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?PLC=E5=9C=B0=E5=9D=80=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Collector/Point/Save/SaveModBus.vue | 37 +++++++++++++++---- .../DataCollect/Collector/Tree/Save/index.vue | 4 +- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue b/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue index 2e1e1120..07a0ce3c 100644 --- a/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue +++ b/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue @@ -57,8 +57,18 @@ v-model:value="formData.pointKey" :min="0" :max="255" + :precision="0" /> +

+ PLC地址:{{ + InitAddress[formData.configuration.function] + + formData.pointKey + }} +

@@ -258,6 +269,12 @@ const collectorId = props.data.collectorId; const provider = props.data.provider; const oldPointKey = props.data.pointKey; +const InitAddress = { + Coils: 1, + HoldingRegisters: 40001, + InputRegisters: 30001, +}; + const formData = ref({ name: '', configuration: { @@ -371,9 +388,20 @@ const getProviderList = async () => { value: item.id, label: item.name, })); + + setProviderList(formData.value.configuration.function); }; getProviderList(); +const setProviderList = (value: string | undefined) => { + providerList.value = + value === 'HoldingRegisters' + ? providerListAll.value + : providerListAll.value.filter( + (item: any) => item.value !== 'bool', + ); +}; + watch( () => formData.value.configuration.parameter.quantity, (value) => { @@ -384,14 +412,9 @@ watch( watch( () => formData.value.configuration.function, (value) => { - providerList.value = - value === 'HoldingRegisters' - ? providerListAll.value - : providerListAll.value.filter( - (item: any) => item.value !== 'bool', - ); + setProviderList(value); }, - { deep: true }, + { immediate: true, deep: true }, ); watch( () => props.data, diff --git a/src/views/DataCollect/Collector/Tree/Save/index.vue b/src/views/DataCollect/Collector/Tree/Save/index.vue index b821a575..5142f14d 100644 --- a/src/views/DataCollect/Collector/Tree/Save/index.vue +++ b/src/views/DataCollect/Collector/Tree/Save/index.vue @@ -77,7 +77,7 @@ v-model:value="formData.circuitBreaker.type" :options="[ { label: '降频', value: 'LowerFrequency' }, - { label: '熔断', value: 'Break' }, + { label: '断开', value: 'Break' }, { label: '忽略', value: 'Ignore' }, ]" @change="changeCardSelectType" @@ -203,7 +203,7 @@ const getTypeTooltip = (value: string) => value === 'LowerFrequency' ? '连续20次异常,降低连接频率至原有频率的1/10(重试间隔不超过1分钟),故障处理后自动恢复至设定连接频率' : value === 'Break' - ? '连续10分钟异常,停止采集数据进入熔断状态,设备重新启用后恢复采集状态' + ? '连续10分钟异常,停止采集数据进入断开状态,设备重新启用后恢复采集状态' : '忽略异常,保持原采集频率超时时间为5s'; const handleCancel = () => { From 1c23a544fea7ccfa90ae3006628ae448211771d0 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Fri, 24 Mar 2023 18:04:13 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E8=8F=9C=E5=8D=95=E9=85=8D=E7=BD=AEtodo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/Menu/Setting/index copy.vue | 388 ++++++++++++++++ src/views/system/Menu/Setting/index.vue | 462 +++++++------------ 2 files changed, 545 insertions(+), 305 deletions(-) create mode 100644 src/views/system/Menu/Setting/index copy.vue diff --git a/src/views/system/Menu/Setting/index copy.vue b/src/views/system/Menu/Setting/index copy.vue new file mode 100644 index 00000000..b0444c57 --- /dev/null +++ b/src/views/system/Menu/Setting/index copy.vue @@ -0,0 +1,388 @@ + + + + + diff --git a/src/views/system/Menu/Setting/index.vue b/src/views/system/Menu/Setting/index.vue index c1904ac7..96f5fa15 100644 --- a/src/views/system/Menu/Setting/index.vue +++ b/src/views/system/Menu/Setting/index.vue @@ -1,350 +1,202 @@