瀏覽代碼

单个指标加入指标库弹窗

cxmo 9 月之前
父節點
當前提交
e111484268

+ 7 - 0
src/components/lzTable.vue

@@ -17,6 +17,9 @@
 								: frequencyMap.get(data[item])
 							: data[item] 
 						}}
+						<span v-if="item==='Opt'&&$route.path==='/steelChemical'&&data['IndexCode'] ">
+							<el-button type="text" @click.stop="$emit('addToLib',data)">{{$t('ManualEdbListPage.add_tobase_btn')}}</el-button>
+						</span>
 					</template>
 					<!-- 百川盈孚数据源 频度和单位需要可编辑 -->
 					<template v-else>
@@ -79,6 +82,9 @@ export default {
 
 			if(this.source==='gl'){
 				arr=['IndexName','IndexCode','FrequencyName','UnitName','UpdateTime']
+				if(this.$route.path==='/steelChemical'){
+					arr.push('Opt')
+				}
 			}else if(sourceTypeOne.includes(this.source)){
 				arr=['IndexName','IndexCode','Frequency','Unit','ModifyTime']
 			}
@@ -102,6 +108,7 @@ export default {
 					['FrequencyName', this.$t('Edb.Detail.e_fre')],
 					['UnitName', this.$t('Edb.Detail.e_unit')],
 					['UpdateTime', this.$t('Edb.Detail.e_update_time')],
+					['Opt','操作']
 				])
 			}else if(sourceTypeOne.includes(this.source)){
 				temMap=new Map([

+ 51 - 0
src/views/dataEntry_manage/thirdBase/components/addIndicsDia.vue

@@ -0,0 +1,51 @@
+<template>
+    <!-- 单个指标添加进指标库 -->
+    <el-dialog
+        :visible.sync="isOpenDialog"
+        :close-on-click-modal="false"
+        :modal-append-to-body="false"
+        top="5vh"
+        :title="$t('ManualEdbListPage.add_tobase_btn')"
+        @close="$emit('close')"
+        custom-class="add-indics-dia"
+        center
+        width="798px"
+        v-dialogDrag
+    >
+        <div class="dialog-container">
+            <el-form>
+                <el-form-item label="指标名称"></el-form-item>
+                <el-form-item label="指标目录"></el-form-item>
+                <el-form-item label="频度"></el-form-item>
+                <el-form-item label="单位"></el-form-item>
+            </el-form>
+        </div>
+        <div class="footer-container" slot="footer">
+            <el-button type="primary" @click="handleAddEdb">保存</el-button>
+            <el-button type="primary" plain @click="$emit('close')">取消</el-button>
+        </div>
+    </el-dialog>
+</template>
+
+<script>
+export default {
+    props:{
+        isOpenDialog:{
+            type:Boolean,
+            default:false
+        }
+    },
+    data() {
+        return {
+
+        };
+    },
+    methods: {
+        handleAddEdb(){}
+    },
+};
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 40 - 7
src/views/dataEntry_manage/thirdBase/components/batchAddIndicsDia.vue

@@ -40,12 +40,12 @@
                             <el-input v-model="row.edbName"></el-input>
                         </template>
                     </el-table-column>
-                    <el-table-column label="频度" align="center" width="140">
+                    <el-table-column :label="$t('Edb.Detail.e_fre')" align="center" width="140">
                         <template slot-scope="{row}">
                             <el-select v-model="row.frequency"></el-select>
                         </template>
                     </el-table-column>
-                    <el-table-column label="单位" align="center" width="140">
+                    <el-table-column :label="$t('Edb.Detail.e_unit')" align="center" width="140">
                         <template slot-scope="{row}">
                             <el-input v-model="row.unit"></el-input>
                         </template>
@@ -53,12 +53,25 @@
                     <!-- 操作 -->
                     <el-table-column align="center">
                         <template slot="header" slot-scope="{row}">
-                            <span>指标库目录</span>
-                            <el-radio v-model="classifyType" :label="1" style="margin-right:5px;">分目录</el-radio>
-                            <el-radio v-model="classifyType" :label="2">同目录</el-radio>
+                            <span>{{$t('EtaBasePage.catalogue_directory')}}</span>
+                            <el-radio-group v-model="classifyType" @change="handleClassifyTypeChange">
+                                <el-radio :label="1"><!-- 分目录 -->{{$t('EtaBasePage.subdirectory_radio')}}</el-radio>
+                                <el-radio :label="2"><!-- 同目录 -->{{$t('EtaBasePage.directory_radio')}}</el-radio>
+                            </el-radio-group>
                         </template>
-                        <template slot-scope="{row}">
-                            <el-input v-model="row.classify"></el-input>
+                        <template slot-scope="{row,$index}">
+                            <el-cascader 
+                                v-model="row.classify"
+                                :options="edbClassifyList"
+                                :props="{
+                                    label: 'ClassifyName',
+                                    value: 'ClassifyId',
+                                    children: 'Children',
+                                    checkStrictly: true,
+                                    emitPath:false
+                                }"
+                                :disabled="classifyType===1&&$index>0"
+                            ></el-cascader>
                         </template>
                     </el-table-column>
                 </el-table>
@@ -73,6 +86,7 @@
 
 <script>
 import { steelInterface } from "@/api/modules/thirdBaseApi";
+import { dataBaseInterface } from '@/api/api.js';
 export default {
     props:{
         isOpenDialog:{
@@ -102,12 +116,14 @@ export default {
                     classify:''
                 } */
             ],
+            edbClassifyList:[],//指标库目录
             selectEdbList:[]
         };
     },
     methods: {
         initDia(){
             this.getClassifyList()
+            this.getClassifyOpt()
             this.searchClassify = ''
             this.searchName = ''
             this.edbList = []
@@ -120,6 +136,22 @@ export default {
                 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(){
             this.edbList = [{
@@ -130,6 +162,7 @@ export default {
                     classify:''
                 }]
         },
+        handleClassifyTypeChange(){},
         handleAddEdb(){
             //校验所选指标
         },

+ 22 - 1
src/views/dataEntry_manage/thirdBase/steelChemicalbase.vue

@@ -174,6 +174,7 @@
               tableType="header"
               ref="table"
               source="gl"
+              @addToLib="handleAddToLib"
             />
           </div>
           <div class="data-cont" v-if="dateArr.length">
@@ -261,6 +262,12 @@
         :isOpenDialog="isBatchAddIndicsDiaShow"
         @close="isBatchAddIndicsDiaShow=false"
     />
+    <!-- 单个添加至指标库弹窗 -->
+    <addIndicsDia 
+        :isOpenDialog="isAddIndicsDiaShow"
+        :edbData="currentIndicData"
+        @close="isAddIndicsDiaShow=false"
+    />
   </div>
 
 </template>
@@ -272,11 +279,12 @@ import mDialog from "@/components/mDialog.vue";
 import targetDialog from "./components/targetDialog.vue";
 import batchAddEdbDia from "./components/batchAddEdbDia.vue";
 import batchAddIndicsDia from "./components/batchAddIndicsDia"
+import addIndicsDia from "./components/addIndicsDia"
 import leftMixin from "./mixins/leftMixin.js";
 export default {
   name: "",
   mixins: [leftMixin],
-  components: { lzTable, mDialog, targetDialog,batchAddEdbDia,batchAddIndicsDia },
+  components: { lzTable, mDialog, targetDialog,batchAddEdbDia,batchAddIndicsDia,addIndicsDia },
   data() {
     return {
       isLeftWrapShow:true,
@@ -323,6 +331,8 @@ export default {
       batchAddDiaShow:false,
 
       isBatchAddIndicsDiaShow:false, //批量添加至指标库弹窗
+      isAddIndicsDiaShow:false,//单个添加至指标库弹窗
+      currentIndicData:{},//当前选中指标
     };
   },
   methods: {
@@ -715,6 +725,17 @@ export default {
         });
     },
 
+    handleAddToLib(data){
+        //添加前校验 ID是否已存在指标库中
+        //打开弹窗
+        this.currentIndicData = data
+        this.isAddIndicsDiaShow = true
+    },
+    addToLibCallback(){
+        //添加成功回调 
+        this.isAddIndicsDiaShow = false
+    },
+
     /* 添加后回调 */
     addSuccessCallback({ code, id,selectClassifyNodes,indexCode }) {
       indexCode && (this.index_code = indexCode)