Kaynağa Gözat

修复参编单位分隔符号

ZengChao 1 ay önce
ebeveyn
işleme
14a0230feb
1 değiştirilmiş dosya ile 16 ekleme ve 14 silme
  1. 16 14
      src/views/basic-info/Standard.vue

+ 16 - 14
src/views/basic-info/Standard.vue

@@ -129,21 +129,21 @@
                 <template #reference>
                   <div class="tag-group">
                     <el-tag 
-                      v-for="(unit, idx) in scope.row.participating_units.split(';').slice(0, 2)" 
+                      v-for="(unit, idx) in scope.row.participating_units.split(VALUE_DELIMITER).slice(0, 2)" 
                       :key="idx" 
                       size="small" 
                       class="info-tag"
                     >
                       {{ unit }}
                     </el-tag>
-                    <el-tag v-if="scope.row.participating_units.split(';').length > 2" size="small" type="info" class="info-tag">
-                      +{{ scope.row.participating_units.split(';').length - 2 }}
+                    <el-tag v-if="scope.row.participating_units.split(VALUE_DELIMITER).length > 2" size="small" type="info" class="info-tag">
+                      +{{ scope.row.participating_units.split(VALUE_DELIMITER).length - 2 }}
                     </el-tag>
                   </div>
                 </template>
                 <div class="popover-tag-list">
                   <el-tag 
-                    v-for="(unit, idx) in scope.row.participating_units.split(';')" 
+                    v-for="(unit, idx) in scope.row.participating_units.split(VALUE_DELIMITER)" 
                     :key="idx" 
                     size="small" 
                     class="popover-info-tag"
@@ -168,7 +168,7 @@
                 <template #reference>
                   <div class="tag-group">
                     <el-tag 
-                      v-for="(std, idx) in scope.row.reference_basis.split(';').slice(0, 2)" 
+                      v-for="(std, idx) in scope.row.reference_basis.split(VALUE_DELIMITER).slice(0, 2)" 
                       :key="idx" 
                       size="small" 
                       type="info"
@@ -176,14 +176,14 @@
                     >
                       {{ std }}
                     </el-tag>
-                    <el-tag v-if="scope.row.reference_basis.split(';').length > 2" size="small" type="info" class="info-tag">
-                      +{{ scope.row.reference_basis.split(';').length - 2 }}
+                    <el-tag v-if="scope.row.reference_basis.split(VALUE_DELIMITER).length > 2" size="small" type="info" class="info-tag">
+                      +{{ scope.row.reference_basis.split(VALUE_DELIMITER).length - 2 }}
                     </el-tag>
                   </div>
                 </template>
                 <div class="popover-tag-list">
                   <el-tag 
-                    v-for="(std, idx) in scope.row.reference_basis.split(';')" 
+                    v-for="(std, idx) in scope.row.reference_basis.split(VALUE_DELIMITER)" 
                     :key="idx" 
                     size="small" 
                     type="info"
@@ -444,13 +444,13 @@
         <el-descriptions-item label="专业领域">{{ currentItem?.professional_field || '-' }}</el-descriptions-item>
         <el-descriptions-item label="参编单位">
           <div v-if="currentItem?.participating_units">
-            <div v-for="(unit, idx) in currentItem.participating_units.split(';')" :key="idx">{{ unit }}</div>
+            <div v-for="(unit, idx) in currentItem.participating_units.split(VALUE_DELIMITER)" :key="idx">{{ unit }}</div>
           </div>
           <span v-else>-</span>
         </el-descriptions-item>
         <el-descriptions-item label="引用依据">
           <div v-if="currentItem?.reference_basis">
-            <div v-for="(std, idx) in currentItem.reference_basis.split(';')" :key="idx">{{ std }}</div>
+            <div v-for="(std, idx) in currentItem.reference_basis.split(VALUE_DELIMITER)" :key="idx">{{ std }}</div>
           </div>
           <span v-else>-</span>
         </el-descriptions-item>
@@ -538,6 +538,8 @@ const formRules = {
 
 const ingesting = ref(false)
 const knowledgeBases = ref<any[]>([])
+// 参编/引用类多值字段统一使用该分隔符
+const VALUE_DELIMITER = '、'
 
 // 动态列表字段存储
 const participatingUnitsList = ref<string[]>([''])
@@ -806,8 +808,8 @@ const handleAction = async (action: string, row: any) => {
       Object.keys(editForm).forEach(key => {
         editForm[key] = row[key] || ''
       })
-      participatingUnitsList.value = row.participating_units ? row.participating_units.split(';') : ['']
-      referenceBasisList.value = row.reference_basis ? row.reference_basis.split(';') : ['']
+      participatingUnitsList.value = row.participating_units ? row.participating_units.split(VALUE_DELIMITER) : ['']
+      referenceBasisList.value = row.reference_basis ? row.reference_basis.split(VALUE_DELIMITER) : ['']
       editForm.id = row.id
       fileList.value = []
       formDialogVisible.value = true
@@ -905,8 +907,8 @@ const submitForm = async () => {
       return
     }
 
-    editForm.participating_units = participatingUnitsList.value.filter(item => item.trim() !== '').join(';')
-    editForm.reference_basis = referenceBasisList.value.filter(item => item.trim() !== '').join(';')
+    editForm.participating_units = participatingUnitsList.value.filter(item => item.trim() !== '').join(VALUE_DELIMITER)
+    editForm.reference_basis = referenceBasisList.value.filter(item => item.trim() !== '').join(VALUE_DELIMITER)
     
     const url = editForm.id 
       ? `/api/v1/sample/basic-info/edit?type=standard&id=${editForm.id}`