zhangjie 1 年之前
父节点
当前提交
7146606501

+ 6 - 3
src/views/sop/components/dynamic-form-item/device-table/edit-column-dialog.vue

@@ -165,9 +165,12 @@ const dialogOpened = async () => {
 const save = async () => {
   const valid = await formRef.value.validate();
   if (valid !== true) return;
-  formData.address = formData.addressArr.join('');
-
+  let data = {};
+  for (let key in formData) {
+    data[key] = formData[key];
+  }
+  data.address = data.addressArr.join('');
   emit('update:visible', false);
-  emit('success', formData);
+  emit('success', data);
 };
 </script>

+ 2 - 5
src/views/sop/components/dynamic-form-item/device-table/index.vue

@@ -22,10 +22,6 @@
       <template #deviceStatus="{ row }">
         <status-tag :value="row.deviceStatus" type="runningStatus"></status-tag>
       </template>
-      <template #address="{ row }">
-        <span v-if="!isOutType">{{ row.address }}</span>
-        <span v-else>{{ row.address.join('') }}</span>
-      </template>
       <template #basePhotoPath="{ row }">
         <t-image
           v-if="row.basePhotoPath"
@@ -135,7 +131,8 @@ const handleAdd = () => {
     deviceStatus: '',
     scanCount: '',
     location: '',
-    address: isOutType.value ? ['', '', ''] : '',
+    address: '',
+    addressArr: isOutType.value ? ['', '', ''] : '',
     basePhotoPath: '',
   };
   showEditColumnDialog.value = true;