Kaynağa Gözat

Merge branch 'ch/ETA_2.0.7' of eta_front/eta_front into master

leichen 2 ay önce
ebeveyn
işleme
f47d13d1c8

+ 23 - 2
src/api/modules/thirdBaseApi.js

@@ -833,6 +833,7 @@ const yongyiInterface={
 	},
 }
 
+
 /* 汾渭煤炭树 */
 const fwmtInterface={
 		/**
@@ -853,10 +854,30 @@ const fwmtInterface={
 		getTargetDataList:params=>{
 			return http.get('/datamanage/fenwei/single_data',params);
 		},
+		// 查询批量指标数据
+		searchEdbBatch: params => {
+			return http.get('/datamanage/fenwei/get/index/info',params);
+		},
+		// 导出指标数据
+		exportData: params => {
+			return http.get('/datamanage/fenwei/index/data/export',params);
+		},
+		// 获取频度
+		getFrequency: params => {
+			return http.get('/datamanage/fenwei/frequency/list',params);
+		},
 		// 搜索
-		getTargetListByName:params=>{
+		getTargetListByName: params=>{
 			return http.get('/datamanage/fenwei/search_list',params);
-		}
+		},
+		// 加入指标库前校验
+		batchAddEdbCheck : params => {
+			return http.post('/datamanage/fenwei/index/add/validate',params);
+		},
+		// 加入指标库
+		addIndex: params => {
+			return http.post('/datamanage/fenwei/index/add',params);
+		},
 }
 /* 广期所 */
 const guangqiInterface={

+ 26 - 3
src/components/lzTable.vue

@@ -24,11 +24,19 @@
 									: frequencyMap.get(data[item])
 								: data[item] 
 							}}
-							<span v-if="item==='Opt'&&$route.path==='/steelChemical'&&data['IndexCode'] ">
+							<!-- 有几个地方要用到这个组件,因为有些在测试、有些在开发、有些在正式所以暂时这样封装一下如果合代码的时候有冲突记得加getPermissionKey里的路由(因为每个页面的权限都不一样所以用了路由),下面原代码没有删除如果有问题可以参考 -->
+							<span v-if="item === 'Opt' && operateRouteList.includes($route.path) && data['IndexCode'] && !data.EdbInfoId">
+								<el-button type="text" @click.stop="$emit('addToLib', data)"
+									v-if="!data.EdbInfoId && permissionBtn.isShowBtn('dataSourcePermission', getPermissionKey($route.path))">
+									{{ $t('ManualEdbListPage.add_tobase_btn') }}
+								</el-button>
+							</span>
+
+							<!-- <span v-if="item==='Opt' && operateRouteList.includes($route.path) && data['IndexCode'] ">
 								<el-button type="text" @click.stop="$emit('addToLib',data)"
 									v-if="!data.EdbInfoId&&permissionBtn.isShowBtn('dataSourcePermission','mysteelData_addEdb')"
 								>{{$t('ManualEdbListPage.add_tobase_btn')}}</el-button>
-							</span>
+							</span> -->
 						</template>
 					</template>
 					<!-- 百川盈孚数据源 频度和单位需要可编辑 -->
@@ -99,6 +107,9 @@ export default {
 				}
 			}else if(sourceTypeOne.includes(this.source)){
 				arr=['IndexName','IndexCode','Frequency','Unit','ModifyTime']
+				if(this.$route.path==='/fwmtData'){
+					arr.push('Opt')
+				}
 			}
 
 			return arr
@@ -139,6 +150,9 @@ export default {
 					['Unit', this.$t('Edb.Detail.e_unit')],
 					['ModifyTime', this.$t('Edb.Detail.e_update_time')],
 				])
+				if(this.$route.path==='/fwmtData'){
+					temMap.set('Opt',this.$t('Table.column_operations'))
+				}
 			}
 
 			return temMap
@@ -187,6 +201,7 @@ export default {
 	},
 	data() {
 		return {
+			operateRouteList: ['/steelChemical', '/fwmtData'] // 操作路由列表
 			// dynamic_key: (this.source === 'smm'||this.source ==='baiinfo')? 'Value' 
 			// :this.source==='coal'?'Value': 'InputValue',
 	// 		headerArr: this.source === 'gl' 
@@ -250,7 +265,15 @@ export default {
 		},
     editTarget(data){
       this.$emit('editTarget',data)
-    }
+    },
+		getPermissionKey(routePath) {
+			const map = {
+				'/steelChemical': 'mysteelData_addEdb',
+				'/fwmtData': 'fwData_opera_addBase',
+				// '/steobase': 'eiaData_opera_add'
+			};
+			return map[routePath] || '';
+		}
 	},
 	created() {},
 	updated() {

+ 5 - 0
src/utils/buttonConfig.js

@@ -278,6 +278,11 @@ export const dataSourcePermission = {
     dataSource_account_enable:'dataSourceAccount:enable',//禁用/启用
     /*--------涌益咨询---- */
     yyzxData_export:'yyzx:exportData',
+    /*--------汾渭数据---- */
+    fwData_export:'fwsj:exportData', // 导出
+    fwData_view: 'fwsj:showData',//查看
+    fwData_batch_addBase: 'fwsj:batch:addBase',//批量添加到指标库
+    fwData_opera_addBase: 'fwsj:opera:addBase',//指标入库
     /*--------煤炭江湖---- */
     coalWordData_view:'coalWord:view', // 查看
     coalWordData_export:'coalWord:export', // 导出

+ 268 - 19
src/views/dataEntry_manage/thirdBase/FwmtData.vue

@@ -16,9 +16,12 @@
             <i :class="{'el-icon-d-arrow-left':isLeftWrapShow,'el-icon-d-arrow-right':!isLeftWrapShow}"></i>
         </span>
       <div class="left-top">
+        <el-button style="margin-left: 0;margin-bottom: 10px;" v-permission="permissionBtn.dataSourcePermission.fwData_batch_addBase"
+          type="primary" size="medium" @click="isBatchAddIndicsDiaShow = true"
+            ><!-- 批量加入指标库 -->{{$t('SteelChemicalPage.batch_add_edb_btn')}}</el-button
+          >
         <el-button
-          v-permission="permissionBtn.dataSourcePermission.yyzxData_export"
-          style="width: 100%"
+          v-permission="permissionBtn.dataSourcePermission.fwData_export"
           type="primary"
           plain
           size="medium"
@@ -52,18 +55,34 @@
           ref="treeRef"
           class="target_tree word-wrap"
           :data="classifyList"
-          node-key="ClassifyId"
+          node-key="key"
           :props="{
             label: 'ClassifyName',
             children: 'Child',
+            isLeaf: 'leaf'
           }"
+          :default-checked-keys = "defaultCheckedKeys"
+          :default-expanded-keys="defaultShowNodes"
           :current-node-key="select_classify"
           :expand-on-click-node="false"
           check-strictly
           highlight-current
           empty-text="暂无分类"
+          lazy
+          :load="getLazyTreeData"
+          @node-expand="handleNodeExpand"
+          @node-collapse="handleNodeCollapse"
           @current-change="nodeChangeHandle"
         >
+          <div slot-scope="{ node, data }" class="custom-tree-node">
+            <div class="text_oneLine" style="width:100%">
+              <span v-if="data.IndexCode">{{data.IndexName}}</span>
+              <span v-else>
+                <!-- {{ currentLang==='zh' ? data.ClassifyName : data.ClassifyNameEn }} -->
+                {{ data.ClassifyName }}
+              </span>
+            </div>
+          </div>
         </el-tree>
       </div>
       <span
@@ -88,6 +107,7 @@
               tableType="header"
               ref="table"
               source="yyzx"
+              @addToLib="addToLib"
               @editTarget="editTargetByTable"
             />
           </div>
@@ -101,24 +121,43 @@
           </div>
           <div v-else class="nodata"></div>
         </div>
+        <div class="frequency-box">
+          <div :class="indexFrequency !== index ? 'frequency' : 'frequency active' " v-for="(item, index) in frequencyList" :key="index" @click="clickFrequencyList(index, item)">{{ item }}</div>
+        </div>
       </template>
       <div v-else class="nodata-cont">
         <tableNoData :text="$t('Table.prompt_slogan')"/>
       </div>
     </div>
+    <!-- 批量添加至指标库弹窗 -->
+    <batchAddIndicsDia 
+      :isOpenDialog="isBatchAddIndicsDiaShow"
+      @close="isBatchAddIndicsDiaShow=false"
+    />
+    <!-- 单个添加至指标库弹窗 -->
+    <addIndicsDia 
+      :isOpenDialog="isAddIndicsDiaShow"
+      :edbData="currentIndicData"
+      @close="isAddIndicsDiaShow=false;"
+      @addCallback="intoBaseBack"
+    />
   </div>
 </template>
 
 <script>
 import lzTable from "@/components/lzTable.vue";
 import { fwmtInterface } from "@/api/api.js";
+import batchAddIndicsDia from "./components/batchFwAddIndicsDia"
+import addIndicsDia from './components/addIndicsDia.vue';
+import leftMixin from "./mixins/leftMixin.js";
 export default {
   name: "Fwmt",
-  components: { lzTable },
+  mixins: [leftMixin],
+  components: { lzTable, batchAddIndicsDia, addIndicsDia },
   data() {
     return {
       isLeftWrapShow:true,
-      exportBase:process.env.VUE_APP_API_ROOT + "/datamanage/fenwei/export", //ssm数据导出接口
+      exportBase:process.env.VUE_APP_API_ROOT + "/datamanage/fenwei/index/data/export", //ssm数据导出接口
       dataloading: false,
       rightShow: false,
       select_classify: 0,
@@ -133,6 +172,17 @@ export default {
       leftSearchVal: "", //左侧搜索值
       leftSearchTradeCode: "", //如果是搜索选择的 则有此code
       isShowSingleData: false, //右侧是否展示的是单个指标数据
+      isBatchAddIndicsDiaShow: false, //批量添加指标弹窗
+      currentIndicData:{}, //当前选中指标
+      isAddIndicsDiaShow: false, //单个添加指标弹窗
+      defaultShowNodes: [], // 
+      defaultCheckedKeys: [], // 选中
+      repetition: null, // 是否重复请求
+      indexFrequency: 0, // 当前选中的指标code
+      select_frequency: '', // 当前选中的频度
+      classId: '', // 当前选中的指标的分类id
+      selectedEdb: false, // 是否选中指标
+      FenweiIndexId: '', // 当前选中的指标的key
     };
   },
   methods: {
@@ -140,7 +190,19 @@ export default {
     getClassify() {
       fwmtInterface.classifyList().then((res) => {
         if (res.Ret !== 200) return;
-        this.classifyList = res.Data || [];
+        const addKey = arr => arr.map(item => ({
+          ...item,
+          key: item.ClassifyId, // key值为当前项ClassifyId
+          Child: item.Child ? addKey(item.Child) : null // 这里要判断原数据有没有子级如果没有判断会报错
+        }))
+        this.classifyList = addKey(res.Data || []);
+        // this.classifyList = res.Data || [];
+        this.select_classify = this.classifyList.length ? (this.classifyList[0].Child && this.classifyList[0].Child.length ? this.classifyList[0].Child[0].ClassifyId : this.classifyList[0].ClassifyId) : 0; // 获取classifyList中第一个元素的ClassifyId,如果该元素有子元素,则取第一个子元素的ClassifyId
+        // this.defaultShowNodes = [this.classifyList[0].ClassifyId]
+        this.$nextTick(() => { // 获取到节点后设置选中
+          this.$refs.treeRef.setCurrentKey(this.select_classify)
+        })
+        this.getFrequency()
       });
     },
     /* 获取数据 */
@@ -150,6 +212,7 @@ export default {
       fwmtInterface
         .dataList({
           ClassifyId: this.select_classify,
+          Frequency: this.select_frequency,
           PageSize: this.page_size,
           CurrentIndex: this.page_no,
         })
@@ -215,6 +278,23 @@ export default {
             });
         });
     }, 200),
+
+    // 获取频度
+    getFrequency() {
+      fwmtInterface.getFrequency({ClassifyId: this.select_classify}).then((res) => {
+        if (res.Ret !== 200) return;
+        this.frequencyList = res.Data || [];
+        this.select_frequency = this.frequencyList[0];
+        this.getDataList()
+      });
+    },
+    // 点击频度
+    clickFrequencyList(index,  item) {
+      this.indexFrequency = index;
+      this.select_frequency = item;
+      this.getDataList();
+    },
+
     // 获取单个指标数据
     async getTargetDataList(code) {
       this.isShowSingleData = true;
@@ -225,6 +305,7 @@ export default {
         });
         this.rightShow = true;
         if (res.Ret !== 200) return;
+        this.frequencyList = [];
         const DataList = res.Data.Data || [];
         // 设置为没有更多数据
         this.haveMore = false;
@@ -251,10 +332,10 @@ export default {
             this.dateArr.push("");
             if (this.dateArr.length >= 12) break;
           }
-        this.select_quota = res.Data.IndexName;
-        this.select_Unit = res.Data.Unit;
-        this.select_frequency = res.Data.Frequency;
-        this.select_ModifyTime = res.Data.ModifyTime || "";
+        // this.select_quota = res.Data.IndexName;
+        // this.select_Unit = res.Data.Unit;
+        // this.select_frequency = res.Data.Frequency;
+        // this.select_ModifyTime = res.Data.ModifyTime || "";
         this.dataloading = false;
         this.rightShow && this.initWidth();
       } catch (err) {
@@ -269,6 +350,76 @@ export default {
         $(".right-box")[0].scrollLeft = 0;
       });
     },
+
+    //指标懒加载
+    async getLazyTreeData(node,resolve){
+      let arr=[]
+      if(!node.data.Child && !node.data.isLeaf && node.data.ClassifyId){
+        const res=await fwmtInterface.dataList({
+          ClassifyId: node.data.ClassifyId
+        })
+        if(res.Ret===200){
+          const temarr=res.Data||[]
+          if (temarr.length > 0) {
+            arr=temarr.map((item, i)=>{
+              const classId = item.ClassifyId
+              delete item.ClassifyId
+              return {
+                ...item,
+                classId,
+                key: item.FenweiIndexId,
+                leaf: true
+              }
+            })
+          } else {
+            arr = []
+          }
+        }
+      }else{
+        arr=node.data.Child||[]
+      }
+      resolve(arr)
+      this.$nextTick(() => { // 获取到节点后设置选中
+        this.$refs.treeRef.setCurrentKey(this.FenweiIndexId)
+      })
+    },
+    // 树节点展开
+    handleNodeExpand(data) {
+      // 保存当前展开的节点
+      let flag = this.defaultShowNodes.some((item) => item === data.UniqueCode);
+
+      if (!flag) {
+        // 不存在则存到数组里
+        this.defaultShowNodes.push(data.UniqueCode);
+      }
+    },
+    // 树节点关闭
+    handleNodeCollapse(data) {
+      this.defaultShowNodes.some((item, index) => {
+        if (item === data.UniqueCode) {
+          // 删除关闭节点
+          this.defaultShowNodes.length = index;
+        }
+      });
+    },
+
+    // 获取选中指标数据
+    addToLib(data){
+        //添加前校验 ID是否已存在指标库中
+        //打开弹窗
+        this.currentIndicData = data
+        this.isAddIndicsDiaShow = true
+    },
+    //添加指标到库
+    intoBaseBack() {
+      this.isAddIndicsDiaShow = false
+      if(this.isShowSingleData){
+        // this.$refs.edbDetailRef.getEdbDetail()
+        this.getTargetDataList(this.leftSearchTradeCode)
+      }else {
+        this.getDataList()
+      }
+    },
     /* 无频度的异常显示处理 7*12*/
     nodataDeal() {
       this.tableOption = [];
@@ -322,12 +473,46 @@ export default {
         }
       }
     },
+
+    /**
+     * 在数组中找到满足条件的元素的索引数组
+     *
+     * @param arr 要查找的数组
+     * @param fn 查找条件函数,函数接收一个参数,返回布尔值
+     * @returns 返回满足条件的元素的索引数组,如果未找到则返回null
+     */
+   findIndex (arr, fn) {
+    function findData(arr,indexs = []){
+      return arr.reduce((obj, item, index) => {
+        if(obj.config && fn(obj.config)){
+          return obj
+        }
+        const isArray = Array.isArray(item.Child)
+        const res = isArray ? findData(item.Child, obj.indexs) : fn(item) ? {config:item} : null
+        if (res && res.config && fn(res.config)) {
+          obj.indexs.push(index)
+          return {
+            config: res.config,
+            indexs:obj.indexs
+          }
+        }
+        return obj
+      }, { config: null, indexs })
+    }
+      const res = findData(arr)
+      const indexs = res.indexs.reverse()
+      return res.config&&fn(res.config)?indexs:null
+    },
     // 选中左侧搜索值
     handleSelectLeftSearchval(e) {
+      console.log(e);
       if (!e.IndexCode) return;
       this.leftSearchTradeCode = e.IndexCode;
       this.leftSearchVal = e.IndexName;
-
+      const ParentClassifyId = this.classifyList[this.findIndex(this.classifyList, (item) => item.ClassifyId === e.ClassifyId)[0]].ClassifyId
+      this.defaultShowNodes = [ParentClassifyId, e.ClassifyId];
+      this.FenweiIndexId = e.FenweiIndexId;
+      // this.defaultShowNodes = [ParentClassifyId, e.ClassifyId];
       // 获取单独指标数据
       this.getTargetDataList(e.IndexCode);
     },
@@ -348,16 +533,20 @@ export default {
   
     //改变选中节点
     nodeChangeHandle(data, node) {
-      if (data.ClassifyId === this.select_classify) return;
+      this.classId = data.classId
+      if (data.ClassifyId === this.repetition || data.IndexCode === this.repetition) return;
       this.select_classify = data.ClassifyId;
-      if(data.ParentId===0&&data.Child){
-        this.rightShow=false
-        return
-      }
+      this.repetition = data.ClassifyId || data.IndexCode
       this.leftSearchVal=''
       this.page_no = 1;
       this.page_size = 20;
-      this.getDataList()
+      if (!data.IndexCode) {
+        this.leftSearchTradeCode = ''
+        this.getFrequency()
+      } else {// 获取单独指标数据
+        this.leftSearchTradeCode = data.IndexCode
+        this.getTargetDataList(data.IndexCode);
+      }
     },
    
   },
@@ -371,7 +560,7 @@ export default {
         // 指标id
         urlStr += `&IndexCode=${
           this.isShowSingleData ? this.leftSearchTradeCode : ""
-        }`;
+        }&ClassifyId=${ this.classId }`;
       } else {
         // 目录id
         urlStr += `&ClassifyId=${
@@ -414,7 +603,7 @@ export default {
     width: 5px !important;
   } */
   .left-cont {
-    min-width: 300px;
+    min-width: 320px;
     width: 300px;
     margin-right: 20px;
     padding: 30px 0;
@@ -523,6 +712,26 @@ export default {
         margin: 0 30px 10px 0;
       }
     }
+    .frequency-box {
+      margin-top: 10px;
+      height: 40px;
+      display: flex;
+      align-items: center;
+      .frequency {
+        color: #0052D9;
+        line-height: 40px;
+        text-align: center;
+        background: #99baf0;
+        width: 120px;
+        height: 40px;
+        border-radius: 4px;
+        margin-right: 10px;
+      }
+      .active {
+        color: #fff;
+        background: rgba(0, 82, 217, 1);
+      }
+    }
     .nodata-cont {
       width: 150px !important;
       text-align: center;
@@ -539,4 +748,44 @@ export default {
   display: flex;
   justify-content: center;
 }
+</style>
+<style lang="scss">
+.smmTarget-container {
+  .el-tree__drop-indicator {
+    height: 3px;
+    background-color: #409eff;
+  }
+  .el-tree-node__content {
+    margin-bottom: 14px !important;
+  }
+  .el-tree-node__children {
+    .el-tree-node {
+      margin-bottom: 0px !important;
+      padding-left: 18px;
+    }
+    .el-tree-node__content {
+      margin-bottom: 5px !important;
+      padding-left: 0 !important;
+    }
+  }
+  .expanded.el-icon-caret-right:before {
+    content: url("~@/assets/img/set_m/down.png") !important;
+  }
+  .el-icon-caret-right:before {
+    content: url("~@/assets/img/set_m/slide.png") !important;
+  }
+  .el-tree-node__expand-icon.is-leaf.el-icon-caret-right:before {
+    content: "" !important;
+  }
+  .el-tree-node__expand-icon.expanded {
+    -webkit-transform: rotate(0deg);
+    transform: rotate(0deg);
+  }
+  .el-tree-node.is-current > .el-tree-node__content {
+    background-color: #f0f4ff !important;
+  }
+  .el-tree-node__content {
+    padding-right: 10px !important;
+  }
+}
 </style>

+ 38 - 10
src/views/dataEntry_manage/thirdBase/components/addIndicsDia.vue

@@ -68,7 +68,7 @@
 
 <script>
 import { dataBaseInterface } from '@/api/api.js';
-import { steelInterface,zhuochuangRedStageInterface } from "@/api/modules/thirdBaseApi";
+import { steelInterface,zhuochuangRedStageInterface, fwmtInterface } from "@/api/modules/thirdBaseApi";
 import selectUnit from '@/components/selectUnit.vue';
 import { frequencySelectList } from '@/utils/defaultOptions';
 export default {
@@ -152,12 +152,29 @@ export default {
             
             let saveApiMap = {
                 '/zchqDataBase': this.handleAddzchqApi,
-                '/steelChemical': this.handleAddSteelApi
+                '/steelChemical': this.handleAddSteelApi,
+                '/fwmtData': this.handleAddFwmtDataApi
             }
 
             saveApiMap[this.$route.path] && saveApiMap[this.$route.path]()
         },
-        
+
+        /* 汾渭数据api */
+        async handleAddFwmtDataApi() {
+            const {code,edb_name,menu,frequency,unit} = this.formData
+            const res = await fwmtInterface.addIndex([{
+                EdbCode:code,
+                EdbName:edb_name,
+                Unit:unit,
+                Frequency:frequency,
+                ClassifyId:Number(menu),
+            }])
+            this.btnloading=false
+            if(res.Ret !== 200) return 
+            this.$message.success(this.$t('MsgPrompt.add_msg2'))
+            this.$emit('addCallback')
+        }, 
+           
         /* 卓创红期api */
         async handleAddzchqApi() {
             const {code,edb_name,menu,frequency,unit} = this.formData
@@ -217,13 +234,24 @@ export default {
         initDia(){
             this.btnloading=false
             this.getClassifyOpt()
-            const {IndexName,UnitName,FrequencyName,IndexCode} = this.edbData
-            this.formData = {
-                code:IndexCode,
-                edb_name:IndexName,
-                menu:'',
-                frequency:FrequencyName,
-                unit:UnitName
+            const route = ['/fwmtData', '/steobase']
+            const {IndexName,UnitName,FrequencyName,IndexCode, Unit, Frequency} = this.edbData
+            if (route.includes(this.$route.path)) {
+                this.formData = {
+                    code:IndexCode,
+                    edb_name:IndexName,
+                    menu:'',
+                    frequency: Frequency,
+                    unit: Unit
+                }
+            } else {
+                this.formData = {
+                    code:IndexCode,
+                    edb_name:IndexName,
+                    menu:'',
+                    frequency:FrequencyName,
+                    unit:UnitName
+                }
             }
         }
     },

+ 472 - 0
src/views/dataEntry_manage/thirdBase/components/batchFwAddIndicsDia.vue

@@ -0,0 +1,472 @@
+<template>
+    <!-- 批量添加至指标库 -->
+    <el-dialog
+        :visible.sync="isOpenDialog"
+        :close-on-click-modal="false"
+        :modal-append-to-body="false"
+        top="5vh"
+        :title="$t('SteelChemicalPage.batch_add_edb_btn')"
+        @close="$emit('close')"
+        custom-class="batch-add-edb-dia"
+        center
+        width="70%"
+        v-dialogDrag
+    >
+        <div class="dialog-container">
+            <div class="select-box">
+                <el-cascader v-model="searchClassify"
+                    :options="classifyList"
+                    :props="{
+                        children:'Child',
+                        label:'ClassifyName',
+                        value:'ClassifyId',
+                        multiple:true,
+                        emitPath:false
+                    }"
+                    :placeholder="$t('Edb.InputHolderAll.input_classify')"
+                    @change="getEdbList"
+                ></el-cascader>
+                <el-select
+                    v-model="frequency"
+                    @change="filterChange"
+                    clearable
+                    >
+                    <el-option v-for="item in frequencyOptions" :key="item.val" :label="item.label" :value="item.val"/>
+                </el-select>
+                <el-input style="width:240px;" v-model="searchName"
+                    :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
+                    prefix-icon="el-icon-search"
+                    @input="getEdbList"
+                />
+            </div>
+            <div class="select-table">
+                <el-table :data="edbList" border 
+                :row-class-name="tableRowClassName"
+                @selection-change="handleSelectionChange" 
+                v-loading="tableLoading">
+                    <el-table-column  type="selection" width="55" align="center"></el-table-column>
+                    <el-table-column :label="$t('Edb.Detail.e_id')" align="center" width="120" prop="edbId"></el-table-column>
+                    <el-table-column :label="$t('Table.edb_name')" align="center">
+                        <template slot-scope="{row}">
+                            <el-input v-model="row.edbName" :placeholder="$t('Table.edb_name')"></el-input>
+                        </template>
+                    </el-table-column>
+                    <el-table-column :label="$t('Edb.Detail.e_fre')" align="center" width="140">
+                        <template slot-scope="{row}">
+                            <el-select 
+                                v-model="row.frequency" 
+                                :placeholder="$t('CustomAnalysisPage.select_frequency')" 
+                                clearable>
+                                <el-option
+                                    v-for="item in frequencyArr"
+                                    :key="item.value"
+                                    :label="item.label"
+                                    :value="item.value">
+                                </el-option>
+                            </el-select>
+                        </template>
+                    </el-table-column>
+                    <el-table-column :label="$t('Edb.Detail.e_unit')" align="center" width="140">
+                        <template slot-scope="{row}">
+                            <selectUnit v-model="row.unit" />
+                        </template>
+                    </el-table-column>
+                    <!-- 操作 -->
+                    <el-table-column align="center">
+                        <template slot="header" slot-scope="{row}">
+                            <!-- <span>{{$t('EtaBasePage.catalogue_directory')}}</span> -->
+                            <el-radio-group v-model="classifyType" @change="handleClassifyTypeChange">
+                                <el-radio :label="1" style="margin-right:5px"><!-- 分目录 -->{{$t('EtaBasePage.subdirectory_radio')}}</el-radio>
+                                <el-radio :label="2"><!-- 同目录 -->{{$t('EtaBasePage.directory_radio')}}</el-radio>
+                            </el-radio-group>
+                            <el-cascader v-if="classifyType===2" v-model="selectClassify"
+                                :options="edbClassifyList"
+                                :props="{
+                                    label: 'ClassifyName',
+                                    value: 'ClassifyId',
+                                    children: 'Children',
+                                    checkStrictly: true,
+                                    emitPath:false
+                                }"
+                                :placeholder="$t('SteelChemicalPage.batch_add_placeholder')"
+                            >
+                            </el-cascader>
+                        </template>
+                        <template slot-scope="{row,$index}">
+                            <el-cascader 
+                                v-model="row.classify"
+                                :options="edbClassifyList"
+                                :props="{
+                                    label: 'ClassifyName',
+                                    value: 'ClassifyId',
+                                    children: 'Children',
+                                    checkStrictly: true,
+                                    emitPath:false
+                                }"
+                                :placeholder="$t('SteelChemicalPage.batch_add_placeholder')"
+                                style="width:100%;"
+                                :disabled="classifyType===2"
+                            ></el-cascader>
+                        </template>
+                    </el-table-column>
+                    <div class="no-data" slot="empty">
+                        <tableNoData :text="$t('Table.prompt_slogan')"/>
+                    </div>
+                </el-table>
+            </div>
+        </div>
+        <div class="footer-container" slot="footer">
+            <el-button type="primary" plain @click="$emit('close')">{{ $t('Dialog.cancel_btn') }}</el-button>
+            <el-button type="primary" @click="handleAddEdb" :loading="btnloading">{{ $t('ManualEdbListPage.add_tobase_btn') }}</el-button>
+        </div>
+        <!-- 操作提示弹窗 -->
+        <el-dialog 
+            :title="$t('BloombergPage.operation_prompt')"
+            :visible.sync="isHintDiaShow"
+            :close-on-click-modal="false"
+            :modal-append-to-body="false"
+            @close="handleCloseDia"
+            width="578px"
+            v-dialogDrag
+            center>
+            <div class="hint-dialog-wrap">
+                <p style="margin-bottom: 20px;">{{ hintText }}</p>
+                <ul>
+                    <li v-for="(item,index) in hintList" :key="index" class="hint-item" @click="gotoEdbDetail(item)">
+                        {{ index+1 }}、{{ item.IndexName }}({{ item.IndexCode }})
+                    </li>
+                </ul>
+            </div>
+            <div style="text-align: center;margin-bottom: 30px;">
+                    <el-button type="primary" @click="handleCloseDia">{{$t('Dialog.known')}}</el-button>
+                </div>
+        </el-dialog>
+    </el-dialog>
+</template>
+
+<script>
+import { fwmtInterface } from "@/api/modules/thirdBaseApi";
+import { dataBaseInterface } from '@/api/api.js';
+import selectUnit from '@/components/selectUnit.vue';
+import { frequencySelectList } from '@/utils/defaultOptions';
+export default {
+    components:{ selectUnit },
+    props:{
+        isOpenDialog:{
+            type:Boolean,
+            default:false
+        }
+    },
+    watch:{
+        isOpenDialog(newval){
+            if(newval){
+                this.initDia()
+            }
+        }
+    },
+    data() {
+        return {
+            classifyList:[],//钢联化工数据库的目录
+            searchName:'',
+            searchClassify:'',
+            classifyType:1,//1分目录 2同目录
+            selectClassify:'',
+            frequencyArr:frequencySelectList(),
+            edbList:[
+                /* {
+                    edbId:'123456',
+                    edbName:'指标名称指标名称',
+                    frequency:'日度',
+                    unit:'吨',
+                    classify:'',
+                    isHighlight:false
+                }, */
+            ],
+            tableLoading:false,
+            edbClassifyList:[],//指标库目录
+            selectEdbList:[],//勾选的指标
+
+            isHintDiaShow:false,
+            hintList:[],
+            hintText:'',
+            btnloading:false,
+
+            frequency: '',
+            frequencyOptions: []
+        };
+    },
+    methods: {
+        tableRowClassName({row}){
+            return row.isHighlight?'highlight-row':''
+        },
+        initDia(){
+            this.getClassifyList()
+            this.getClassifyOpt()
+            this.getFrequency()
+            this.searchClassify = ''
+            this.searchName = ''
+            this.edbList = []
+            this.selectEdbList = []
+            this.selectClassify=''
+            this.btnloading=false
+        },
+        // 获取频度
+        getFrequency() {
+            fwmtInterface.getFrequency().then((res) => {
+                if (res.Ret !== 200) return;
+                const frequencyList = res.Data || [];
+                this.frequencyOptions = frequencyList.map((item) => {
+                    return {
+                        label: item,
+                        val: item
+                    };
+                })
+            });
+        },
+        //获取钢联化工数据库目录
+        getClassifyList(){
+            fwmtInterface.classifyList().then((res) => {
+                if(res.Ret!==200) return 
+                this.classifyList = res.Data||[]
+            })
+        },
+        filterNodes(arr) {
+            arr.length &&
+                arr.forEach((item) => {
+                    item.Children.length && this.filterNodes(item.Children);
+                    if (!item.Children.length) {
+                        delete item.Children;
+                    }
+                });
+        },
+        // 获取指标分类列表
+        async getClassifyOpt(){
+            const res=await dataBaseInterface.menuListV3()
+            if (res.Ret !== 200) return
+            this.filterNodes(res.Data.AllNodes||[]);
+            this.edbClassifyList = res.Data.AllNodes || [];
+        },
+        //获取对应目录下的钢联化工指标
+        getEdbList(){
+            console.log(this.searchClassify);
+            console.log(this.searchName);
+            console.log(this.frequency);
+            
+            if (!this.searchClassify.length && !this.searchName && !this.frequency) return this.edbList = []
+            //每一次筛选项改变清空选择框
+            this.selectEdbList = []
+            this.classifyType = 1
+            //tableData
+            this.tableLoading = true
+            fwmtInterface.searchEdbBatch({
+                ClassifyIds: Array.isArray(this.searchClassify)?this.searchClassify.join(','):'',
+                Keyword:this.searchName||'',
+                Frequencies: this.frequency,
+            }).then(res=>{
+                this.tableLoading = false
+                if(res.Ret!==200) return 
+                this.edbList = res.Data?res.Data.map(item=>{
+                    return {
+                        edbId:item.IndexCode||'',
+                        edbName:item.IndexName||'',
+                        frequency:item.Frequency||'',
+                        unit:item.Unit||'',
+                        classify:'',
+                        isHighlight:false
+                    }
+                }):[]
+            })
+           
+        },
+        filterChange(item) {
+            console.log(item);
+            this.frequency = item
+            this.getEdbList()
+        },
+        handleSelectionChange(val){
+            this.selectEdbList = val
+        },
+        handleAddEdb(){
+            //校验所选指标
+            if(!this.selectEdbList.length){
+                return this.$message.warning(this.$t('Edb.InputHolderAll.input_select_edb'))
+            }
+            if(this.selectEdbList.length>30){
+                return this.$message.warning(this.$t('SteelChemicalPage.batch_add_max_msg'))
+            }
+            //校验所选指标信息是否完整
+            if(this.classifyType===2&&!this.selectClassify){
+                return this.$message.warning(this.$t('CustomAnalysisPage.select_appropriate_category'))
+            }
+            //重置tableData的高亮
+            this.edbList.forEach(i=>i.isHighlight=false)
+            let messageList = [] //有问题的列表
+            this.selectEdbList.forEach((item)=>{
+                item.isHighlight=false
+                if(!this.checkEdbData(item)){
+                    item.isHighlight = true
+                    messageList.push(item)
+                }
+            })
+            //message轻提示 同时标出不完整的行
+            if(messageList.length){
+                return this.$message.warning(/* '部分指标信息未填写完整,请检查' */this.$t('SteelChemicalPage.batch_add_hint1'))
+            }
+
+            this.btnloading = true
+            //添加检测
+            fwmtInterface.batchAddEdbCheck({
+                IndexCodes:this.selectEdbList.map(i=>i.edbId)
+            }).then(res=>{
+                if(res.Ret!==200) return (this.btnloading=false)
+                const edbList = res.Data||[]
+                // const afterAddList = this.selectEdbList.filter(i =>
+                //     edbList.find(s=>s.IndexCode === i.edbId)    
+                // ) //已添加进指标库的指标
+                const beforeAddList = this.selectEdbList.filter(i => 
+                    !edbList.some((item) => i.edbId === item.IndexCode)
+                ) //需要添加进指标库的指标
+                //已选择的指标均添加进指标库 弹窗提示
+                if(!beforeAddList.length){
+                    return this.showHintDialog('all',edbList)
+                }
+                this.batchAddEdb(edbList,beforeAddList)
+                // //剩余指标进行重名校验
+                // this.batchNameCheck(afterAddList,beforeAddList)
+            })
+            
+        },
+        //重名检测
+        // batchNameCheck(afterAddList,beforeAddList){
+        //     const indexCodeList = beforeAddList.map(i=>i.IndexCode)
+        //     let checkList = []
+        //     indexCodeList.forEach(i=>{
+        //         const item = this.selectEdbList.find(s=>s.edbId===i)
+        //         item&&checkList.push(item)
+        //     })
+        //     fwmtInterface.batchCheckEdbName(checkList.map(i=>{
+        //         return {
+        //             EdbCode:i.edbId,
+        //             EdbName:i.edbName,
+        //             Frequency:i.frequency
+        //         }
+        //     })).then(res=>{
+        //         if(res.Ret!==200) return (this.btnloading=false)
+        //         const checkedList = res.Data.filter(i=>i.Exist)
+        //         if(checkedList.length){
+        //             checkedList.forEach(i=>{
+        //                 const item = this.selectEdbList.find(s=>s.edbId===i.EdbCode)
+        //                 item&&(item.isHighlight = true)
+        //             })
+        //             return this.$message.warning(/* '部分指标名称已存在,请重新填写' */this.$t('SteelChemicalPage.batch_add_hint2'))&&(this.btnloading=false)
+        //         }else{
+        //             //通过重名校验后添加进指标库
+        //             this.batchAddEdb(afterAddList,checkList)
+        //         }
+        //     })
+            
+        // },
+        checkEdbData(edbData){
+            return edbData.edbName&&edbData.frequency&&edbData.unit&&(this.classifyType===1?edbData.classify:true)
+        },
+        //显示操作提示弹窗
+        showHintDialog(type,list){
+            this.btnloading = false
+            this.isHintDiaShow = true
+            console.log(list);
+            
+            this.hintList = list
+            this.hintText = type==='all'
+            ?this.$t('YsDataPage.haved_all_msg') //本次添加的指标均已在指标库中,请勿重复添加!
+            :this.$t('YsDataPage.haved_some_msg') //指标库中已存在以下指标,会自动过滤!
+        },
+        //添加进指标库
+        batchAddEdb(afterAddList=[],checkList){
+            //checkList
+            fwmtInterface.addIndex(checkList.map(i=>{
+                return {
+                    EdbCode:i.edbId,
+                    EdbName:i.edbName,
+                    Unit:i.unit,
+                    Frequency:i.frequency,
+                    ClassifyId:this.classifyType===1?Number(i.classify):Number(this.selectClassify),
+                }
+            })).then(res=>{
+                if(res.Ret!==200) return (this.btnloading=false)
+                const checkedList = res.Data ? res.Data.filter(i=>i.Exist) : []
+                if(checkedList.length){
+                    checkedList.forEach(i=>{
+                        const item = this.selectEdbList.find(s=>s.edbId===i.EdbCode)
+                        item&&(item.isHighlight = true)
+                    })
+                    return this.$message.warning(/* '部分指标名称已存在,请重新填写' */this.$t('SteelChemicalPage.batch_add_hint2'))&&(this.btnloading=false)
+                }else{
+                    //若afterAddList有值 弹窗提示部分指标已加入
+                    if(afterAddList.length){
+                        this.showHintDialog('',afterAddList)
+                    }else{
+                        this.$message.success(this.$t('MsgPrompt.add_msg2'))
+                        this.$emit('close')
+                    }
+                }
+            })
+        },
+        //跳转至指标库
+        gotoEdbDetail(data){
+
+            const {classify_id,edb_info_id,unique_code} = data||{}
+            const href = this.$router.resolve({
+                path:'/database',
+                query:{
+                    code:unique_code,
+                    id:edb_info_id,
+                    classifyId:classify_id,
+                }
+            }).href
+            window.open(href,"_blank")
+        },
+        handleCloseDia(){
+            //两个弹窗都关掉
+            this.isHintDiaShow=false
+            this.$emit('close')
+        }
+    },
+};
+</script>
+
+<style lang="scss">
+.batch-add-edb-dia{
+    .dialog-container{
+        .el-input{
+            width:100%;
+        }
+        .el-table .highlight-row{
+            background-color:#fef0f0 !important;
+        }
+    }
+}
+</style>
+<style scoped lang="scss">
+.batch-add-edb-dia{
+    .dialog-container{
+        .select-box{
+            margin-bottom:20px;
+        }
+        .select-table{
+            max-height:600px;
+            overflow-y:auto;
+        }
+    }
+    .hint-dialog-wrap{
+            padding-bottom:30px;
+            .hint-item{
+                cursor: pointer;
+                margin-bottom: 10px;
+                &:hover{
+                    color:#409EFF;
+                    text-decoration: underline;
+                }
+            }
+        }
+}
+</style>