Browse Source

样本管理 已存储样本 自定义查询功能修改 弹框扩展字段成功显示

gongyb 4 years ago
parent
commit
117c9ebe26

+ 44 - 43
src/dashoo.cn/frontend_animal/src/components/samples/samplesearchdialog.vue

@@ -925,7 +925,7 @@ export default {
           <el-tab-pane label="样本来源扩展字段"
                        style="height:calc(100vh - 370px)">
             <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">
-              <el-tree :data="data4"
+              <el-tree :data="data"
                        @node-click="handleNodeClicKuoZhan"></el-tree>
             </div>
 
@@ -1310,39 +1310,40 @@ export default {
       }
       ],
       data3: [],
-      data2: [{
-        value: 'Area',
-        label: '取样地区',
-        type: 'str'
-      }, {
-        value: 'SurveyDate',
-        label: '采样日期',
-        type: 'date'
-      }, {
-        value: 'Genus',
-        label: '蜂种',
-        type: 'str'
-      }, {
-        value: 'Remark',
-        label: '备注信息',
-        type: 'str'
-      }, {
-        value: 'Altitude',
-        label: '海拔',
-        type: 'str'
-      }, {
-        value: 'ProjectName',
-        label: '项目属性',
-        type: 'str'
-      }, {
-        value: 'SampleTypestr',
-        label: '样本类型',
-        type: 'date'
-      }, {
-        value: 'Name',
-        label: '名称',
-        type: 'str'
-      }
+      data2: [
+        {
+          value: 'Area',
+          label: '取样地区',
+          type: 'str'
+        }, {
+          value: 'SurveyDate',
+          label: '采样日期',
+          type: 'date'
+        }, {
+          value: 'Genus',
+          label: '蜂种',
+          type: 'str'
+        }, {
+          value: 'Remark',
+          label: '备注信息',
+          type: 'str'
+        }, {
+          value: 'Altitude',
+          label: '海拔',
+          type: 'str'
+        }, {
+          value: 'ProjectName',
+          label: '项目属性',
+          type: 'str'
+        }, {
+          value: 'SampleTypestr',
+          label: '样本类型',
+          type: 'date'
+        }, {
+          value: 'Name',
+          label: '名称',
+          type: 'str'
+        }
         //   {
         //   value: 'Latitude',
         //   label: '纬度',
@@ -1353,7 +1354,7 @@ export default {
         //   type: 'str'
         // }
       ],
-      data4: []
+      data: []
     }
   },
 
@@ -1388,16 +1389,16 @@ export default {
       for (let i = 0; i < rows.length; i++) {
         let row = rows[i]
         if (!nodejsonexists(rows, row[pidFieldName])) {
-          var data = {
+          var data3 = {
             id: row[idFieldName]
           }
           let arrFiled = fileds.split(',')
           for (var j = 0; j < arrFiled.length; j++) {
             if (arrFiled[j] !== idFieldName) {
-              data[arrFiled[j]] = row[arrFiled[j]]
+              data3[arrFiled[j]] = row[arrFiled[j]]
             }
           }
-          nodes.push(data)
+          nodes.push(data3)
         }
       }
       let toDo = []
@@ -1467,7 +1468,7 @@ export default {
     },
     // 查询扩展字段
     searchKuoZhanData () {
-      this.data = []
+      this.data3 = []
       service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'CustomizeSearch', {type: 'Sample'})
         .then(res => {
           var models = res.data
@@ -1479,20 +1480,20 @@ export default {
             if (i !== 0) {
               // 和上一条数据是同一种类型,i-1>=0 数组下标不会越界
               if (models[i].GroupName === models[i - 1].GroupName) {
-                this.data[this.data.length - 1].label = models[i].GroupName
-                this.data[this.data.length - 1].children.push({ label: models[i].Name, FieldName: models[i].FieldName, FieldType: models[i].FieldType })
+                this.data3[this.data3.length - 1].label = models[i].GroupName
+                this.data3[this.data3.length - 1].children.push({ label: models[i].Name, FieldName: models[i].FieldName, FieldType: models[i].FieldType })
               } else {
                 // 和上一条数据不是同一个样本类型
                 kuozhan.label = models[i].GroupName
                 kuozhan.children.push({ label: models[i].Name, FieldName: models[i].FieldName, FieldType: models[i].FieldType })
                 // 不是同一种样本类型的时候需要增加一个元素
-                this.data.push(kuozhan)
+                this.data3.push(kuozhan)
               }
             } else {
               // 第一次循环肯定要加入一个元素
               kuozhan.label = models[i].SampleTypeName
               kuozhan.children.push({ label: models[i].Name, FieldName: models[i].FieldName, FieldType: models[i].FieldType })
-              this.data.push(kuozhan)
+              this.data3.push(kuozhan)
             }
           }
         })

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/samples/archived/index.vue

@@ -37,7 +37,7 @@
                 <el-dropdown-item command="search">高级查询</el-dropdown-item>
                 <el-dropdown-item command="clear">查询重置</el-dropdown-item>
                 <el-dropdown-item style="color:black;" v-for="item in searchTemplates" :key="item.name"
-                  :command="item.name">{{item.name}}</el-dropdown-item>
+                  :command="item.template">{{item.name}}</el-dropdown-item>
                 <el-dropdown-item divided style="color:black;" command="编辑">自定义</el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/samples/prerecorded/index.vue

@@ -41,7 +41,7 @@
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="search">高级查询</el-dropdown-item>
                 <el-dropdown-item command="clear">查询重置</el-dropdown-item>
-                <el-dropdown-item style="color:black;" v-for="item in searchTemplates" :key="item.name" :command="item.name">{{item.name}}</el-dropdown-item>
+                <el-dropdown-item style="color:black;" v-for="item in searchTemplates" :key="item.name" :command="item.template">{{item.name}}</el-dropdown-item>
                 <el-dropdown-item divided style="color:black;" command="编辑">自定义</el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>

+ 1 - 1
src/dashoo.cn/frontend_animal/src/pages/samples/waitingstore/index.vue

@@ -32,7 +32,7 @@
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="search">高级查询</el-dropdown-item>
                 <el-dropdown-item command="clear">查询重置</el-dropdown-item>
-                <el-dropdown-item style="color:black;" v-for="item in searchTemplates" :key="item.name" :command="item.name">{{item.name}}</el-dropdown-item>
+                <el-dropdown-item style="color:black;" v-for="item in searchTemplates" :key="item.name" :command="item.template">{{item.name}}</el-dropdown-item>
                 <el-dropdown-item divided style="color:black;" command="编辑">自定义</el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>