소스 검색

文件详情设置字典

Alfyn 2 주 전
부모
커밋
64e30a1657
2개의 변경된 파일24개의 추가작업 그리고 41개의 파일을 삭제
  1. 23 39
      src/views/document/fileDetail.vue
  2. 1 2
      src/views/modelView/IOT/SubAttributes.vue

+ 23 - 39
src/views/document/fileDetail.vue

@@ -103,40 +103,22 @@
     </a-card>
     <a-card :title="$t('menu.dictionary')" style="margin-top: 10px">
       <a-form-model layout="inline" :model="dictionaryForm">
-        <a-form-model-item :label="$t('global.Doc-Stage')" prop="doc_stage">
-          <a-select
-            :placeholder="$t('global.Placeholder-select')"
-            v-model="dictionaryForm.doc_stage"
-            style="width: 200px"
-            :disabled="status === 'view'"
-          >
-            <a-select-option v-for="(item, i) in docStageTable.options" :key="i" :value="item.value">
-              <a-tooltip placement="topLeft">
-                <template slot="title">
-                  {{ item.lang.en }}
-                </template>
-                {{ item.lang.en }}
-              </a-tooltip></a-select-option
-            >
-          </a-select>
-        </a-form-model-item>
-        <a-form-model-item :label="$t('global.Doc-Type')" prop="doc_type" style="margin-left: 120px">
-          <a-select
-            :placeholder="$t('global.Placeholder-select')"
-            v-model="dictionaryForm.doc_type"
-            style="width: 200px"
-            :disabled="status === 'view'"
-          >
-            <a-select-option v-for="(item, i) in docTypeTable.options" :key="i" :value="item.value">
-              <a-tooltip placement="topLeft">
-                <template slot="title">
-                  {{ item.lang.en }}
-                </template>
-                {{ item.lang.en }}
-              </a-tooltip>
-            </a-select-option>
-          </a-select>
-        </a-form-model-item>
+        <a-row>
+          <a-col :span="24" style="margin-bottom: 10px">
+            <a-form-model-item v-for="dictionaryItem in dictionary" :key="dictionaryItem.key" :label="dictionaryItem.key">
+              <a-select
+                placeholder="please select"
+                style="width: 200px"
+                v-model="dictionaryForm[dictionaryItem.key]"
+                 :disabled="status === 'view'"
+              >
+                <a-select-option v-for="(item, i) in dictionaryItem.options" :key="i" :value="item.value">{{
+                  item.lang.en
+                }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
       </a-form-model>
     </a-card>
     <a-card style="margin-top: 10px" v-if="info?.container && info?.file.naming_rule">
@@ -144,7 +126,7 @@
       <a-form-model layout="inline" :model="namingRuleForm">
         <a-row>
           <a-col :span="24" style="margin-bottom: 10px">
-            <a-form-model-item v-for="domain in ruleDomains" :key="domain.key" :label="domain.key" required>
+            <a-form-model-item v-for="domain in ruleDomains" :key="domain.key" :label="domain.key">
               <a-select
                 v-if="domain.type == 3"
                 placeholder="please select"
@@ -168,7 +150,7 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
-            <a-form-model-item v-for="domain in codeDomains" :key="domain.key" :label="domain.key" required>
+            <a-form-model-item v-for="domain in codeDomains" :key="domain.key" :label="domain.key">
               <a-select
                 placeholder="please select"
                 style="width: 200px"
@@ -280,6 +262,7 @@ export default {
         doc_stage: '0',
         doc_type: 'DR',
       },
+      dictionary:[],
       //命名规则
       domains: null,
       namingRuleForm: {
@@ -311,6 +294,7 @@ export default {
     if (localStorage.getItem(`fileDetailItem_${this.$route.query.id}`)) {
       this.info = JSON.parse(localStorage.getItem(`fileDetailItem_${this.$route.query.id}`))
     }
+    this.initFileInfo()
     this.getHistory()
     this.getTaskList()
     this.getApprovalProcess()
@@ -420,9 +404,8 @@ export default {
     },
     //字典
     getTaskList() {
-      customFieldt({ group: 'Folder', batch: ['folder.doc_stage', 'folder.doc_type'] }).then((res) => {
-        this.docStageTable = res.data[0]
-        this.docTypeTable = res.data[1]
+      customFieldt({ group: 'Folder'}).then((res) => {
+        this.dictionary = res.data
       })
     },
     //命名规则
@@ -477,6 +460,7 @@ export default {
         title: this.info.file.title,
         naming_rule_id: this.info.file.naming_rule ? this.info.file.naming_rule.id : null,
         naming_rules: JSON.stringify(this.namingRuleForm.domains) === '' ? null : this.namingRuleForm.domains,
+        ...this.dictionaryForm
       }
       await modifyFileDetail(this.info.file.id, params)
       await this.initFileInfo()

+ 1 - 2
src/views/modelView/IOT/SubAttributes.vue

@@ -95,9 +95,8 @@ export default {
   },
   beforeDestroy() {},
   methods: {
-
     GetComponentProperties() {
-      message.info('Click to pick the component whose properties you want to query')
+      message.info('Left click to pick the component whose properties you want to query')
       let that = this
       window.api.Public.event('LEFT_CLICK', function (click) {
         that.choose = false