diff --git a/src/views/iot/device/components/DeviceAttributeForm.vue b/src/views/iot/device/components/DeviceAttributeForm.vue index 827a2071..78fe19ca 100644 --- a/src/views/iot/device/components/DeviceAttributeForm.vue +++ b/src/views/iot/device/components/DeviceAttributeForm.vue @@ -64,13 +64,6 @@ :disabled="!ratioEnabled" /> - - - { formData.value.attributeCode = val?.replace(/[\u4e00-\u9fa5]/g, '') } -const handleSortInput = (val: string) => { - formData.value.sort = val?.replace(/\D/g, '') -} const handleAttributeTypeChange = (val: number | string) => { const matched = typeList.value.find( @@ -190,22 +179,6 @@ const formRules = reactive({ } ], attributeName: [{ required: true, message: t('DataCollection.Device.attributeValidatorNameRequired'), trigger: 'blur' }], - sort: [ - { - validator: (_rule: any, value: string, callback: any) => { - if (!value) { - callback() - return - } - if (!/^\d+$/.test(value)) { - callback(new Error(t('DataCollection.Device.attributeValidatorSortNumber'))) - return - } - callback() - }, - trigger: ['blur', 'change'] - } - ], remark: [ { validator: (_rule: any, value: string, callback: any) => { @@ -232,17 +205,10 @@ const buildSubmitData = () => { address, dataUnit, ratio, - sort, remark, deviceId } = formData.value - const parsedSort = - sort === undefined || sort === null || sort === '' - ? undefined - : Number.isNaN(Number(sort)) - ? undefined - : Number(sort) const data: any = { attributeCode, attributeName, @@ -252,7 +218,6 @@ const buildSubmitData = () => { address, dataUnit, ratio: ratioEnabled.value ? ratio : undefined, - sort: parsedSort, remark, deviceId } @@ -279,11 +244,6 @@ const open = async (type: string, id?: number, deviceId: number) => { ;(formData.value as any).deviceId = deviceId } - const currentSort = (formData.value as any)?.sort - if (currentSort !== undefined && currentSort !== null) { - ;(formData.value as any).sort = String(currentSort) - } - const currentType = (formData.value as any)?.attributeType if (currentType !== undefined && currentType !== null && currentType !== '') { const matched = typeList.value.find( @@ -341,7 +301,6 @@ const resetForm = () => { address: undefined, dataUnit: undefined, ratio: undefined, - sort: undefined, remark: undefined, deviceId: undefined } diff --git a/src/views/iot/device/components/DeviceAttributeList.vue b/src/views/iot/device/components/DeviceAttributeList.vue index c18c6e19..024487aa 100644 --- a/src/views/iot/device/components/DeviceAttributeList.vue +++ b/src/views/iot/device/components/DeviceAttributeList.vue @@ -140,16 +140,6 @@ ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-to :formatter="dateFormatter" width="170px" /> - - -