zhengnaiwen_citu hai 3 meses
pai
achega
09c2f47a0c

+ 45 - 8
src/views/dataOrigin/unstructuredData/manualCollection/components/imageImportEdit.vue

@@ -55,7 +55,7 @@
             <template #baseInfo>
               <div>
                 <v-subheader>基础信息</v-subheader>
-                <v-menu
+                <!-- <v-menu
                   attach
                   :nudge-width="200"
                   offset-x
@@ -80,7 +80,7 @@
                       alt="John"
                     >
                   </v-card>
-                </v-menu>
+                </v-menu> -->
               </div>
             </template>
             <template #companyInfo>
@@ -92,21 +92,41 @@
             <template #addressInfo>
               <v-subheader>地址信息</v-subheader>
             </template>
+            <template #career_path="{ item }">
+              <div class="flex-grow-1 flex-shrink-1">
+                <v-subheader>职业轨迹</v-subheader>
+                <div>
+                  <v-row v-for="(path, index) in formQuery[item.key]" :key="index">
+                    <v-col :cols="4"><v-text-field hide-details v-model="path.company_name" outlined dense label="酒店名称"></v-text-field></v-col>
+                    <v-col :cols="1" class="d-flex align-center justify-center">
+                      <v-icon>mdi-minus</v-icon>
+                    </v-col>
+                    <v-col :cols="4"><v-text-field hide-details v-model="path.position" outlined dense label="职位名称"></v-text-field></v-col>
+                    <v-col :cols="3">
+                      <v-btn color="primary" @click="addCareerPath(index)">添加</v-btn>
+                      <v-btn v-if="formQuery[item.key]?.length > 1" class="ml-2" color="error" @click="removeCareerPath(index)">删除</v-btn>
+                    </v-col>
+                  </v-row>
+                </div>
+              </div>
+            </template>
             <template #systemInfo>
               <div class="pb-3">
                 <v-subheader>系统信息</v-subheader>
                   <div class="px-3 infoBox">
                     <div class="mb-3">
                       <span class="label">状态</span>
-                      <v-chip small color="success">开启</v-chip>
+                      <v-chip small :color="itemData.status === 'active' ? 'success' : 'error'">
+                        {{ itemData.status === 'active' ? '已启用' : '已禁用' }}
+                      </v-chip>
                     </div>
                     <div class="mb-3">
                       <span class="label">创建时间</span>
-                      <v-chip small color="info">2025/03/31 10:06</v-chip>
+                      <v-chip small color="default">{{ itemData.created_at }}</v-chip>
                     </div>
                     <div class="mb-3">
                       <span class="label">更新时间</span>
-                      <v-chip small color="info">2025/03/31 11:48</v-chip>
+                      <v-chip small color="default">{{ itemData.updated_at }}</v-chip>
                     </div>
                   </div>
               </div>
@@ -165,7 +185,7 @@ export default {
         { label: '中文隶属关系', key: 'affiliation_zh', type: 'text', outlined: true, dense: true, col: 6 },
         { label: '英文隶属关系', key: 'affiliation_en', type: 'text', outlined: true, dense: true, col: 6 },
         { label: '品牌组合', key: 'brand_group', type: 'text', outlined: true, dense: true, col: 6 },
-        { label: '职业轨迹', key: 'career_path', type: 'text', outlined: true, dense: true, col: 6 },
+        { slotName: 'career_path', key: 'career_path' },
         { slotName: 'addressInfo' },
         { label: '中文地址', key: 'address_zh', type: 'text', outlined: true, dense: true, col: 6 },
         { label: '英文地址', key: 'address_en', type: 'text', outlined: true, dense: true, col: 6 },
@@ -183,9 +203,13 @@ export default {
       this.show = true
       this.loading = false
       this.itemData = null
+      const defaultCareer = {
+        company_name: null,
+        position: null
+      }
       this.formQuery = this.formItems.reduce((res, val) => {
         if (val.key) {
-          res[val.key] = null
+          res[val.key] = val.key === 'career_path' ? [defaultCareer] : null
         }
         return res
       }, {})
@@ -193,12 +217,13 @@ export default {
         this.file = null
         this.previewUrl = null
         this.id = null
+        this.formQuery.career_path = [defaultCareer]
         return
       }
       this.id = item.id
       this.itemData = { ...item }
       Object.keys(this.formQuery).forEach(key => {
-        this.formQuery[key] = item[key] || null
+        this.formQuery[key] = item[key] || (key === 'career_path' ? [defaultCareer] : null)
       })
       // 获取文件内容
       if (!item.image_path) {
@@ -248,6 +273,18 @@ export default {
         this.linearLoading = false
       }
     },
+    addCareerPath () {
+      this.formQuery.career_path = this.formQuery.career_path || []
+      this.formQuery.career_path.push({
+        company_name: null,
+        position: null
+      })
+    },
+    removeCareerPath (index) {
+      if (this.formQuery.career_path && this.formQuery.career_path.length > index) {
+        this.formQuery.career_path.splice(index, 1)
+      }
+    },
     async handleUpdate () {
       if (!this.id) {
         this.$snackbar.error('ID获取异常')