Эх сурвалжийг харах

Merge branch 'master' of http://8.136.199.33:3000/eta_front/eta_front

Karsa 11 сар өмнө
parent
commit
58e766cbf2

+ 9 - 0
src/api/modules/thirdBaseApi.js

@@ -81,6 +81,10 @@ const smmDataInterface = {
 	classifyList: params => {
 		return http.get('/datamanage/smm/classify',params);
 	},
+	// 分类下的指标列表
+	edbListForClassify:params=>{
+		return http.get('/datamanage/smm/index/list',params)
+	},
 	/**
 	 * 获取指标目录详情
 	 * @param {ClassifyId}  分类id
@@ -235,6 +239,11 @@ const steelInterface = {
 		return http.get('/datamanage/mysteel_chemical/classify')
 	},
 
+	//指标懒加载
+	edbListForClassify:params=>{
+		return http.get('/datamanage/mysteel_chemical/index/list',params)
+	},
+
 	/**
 	 * 编辑分类 ClassifyName BaseFromMysteelChemicalClassifyId ParentId  Level
 	 * @param {*} params 

BIN
src/assets/img/add-quadrate-blue.png


BIN
src/assets/img/delete-minus-red.png


+ 1 - 1
src/components/lzTable.vue

@@ -38,7 +38,7 @@
 			>
 				<th>{{date}}</th>
 				<td v-for="(data, sub_index) in tableOption" :key="sub_index">
-					{{data.DataList.find(item => date === item.DataTime) ? 
+					{{data.DataList && data.DataList.find(item => date === item.DataTime) ? 
 					data.DataList.find(item => date === item.DataTime)[dynamic_key]
 					: ''}}
 				</td>

+ 288 - 0
src/views/dataEntry_manage/thirdBase/components/batchAddEdbDia.vue

@@ -0,0 +1,288 @@
+<template>
+  <el-dialog
+    :visible.sync="isOpenDialog"
+    :close-on-click-modal="false"
+    :modal-append-to-body="false"
+    top="5vh"
+    title="添加指标"
+    @close="cancelHandle"
+    custom-class="dialog"
+    center
+    width="780px"
+    v-dialogDrag
+  >
+    <div
+    v-loading="isAddLoading"
+    element-loading-text="加载时间大概五分钟,关闭弹窗不影响加载"
+    element-loading-spinner="el-icon-loading">
+      <div class="dialog-main">
+        <el-row :gutter="10" class="row" style="margin-bottom: 15px;">
+          <el-col style="width: 250px;" class="col title-col">指标ID</el-col>
+          <el-col style="width: 382px;" class="col title-col">所属分类</el-col>
+        </el-row>
+        <el-form :model="edbForm" ref="edbFormDataListRef" >
+          <div class="form-box" ref="formBoxRef">
+            <el-row v-for="(item,index) in edbForm.edbDataList" :key="item.edbIndex" :gutter="10" class="row">
+            <el-col class="col edb-col">
+              <el-form-item :prop="`edbDataList.${index}.IndexCode`" 
+              :rules="[{required:true,message:'指标ID不能为空',trigger:'blur'},
+                        {validator:checkAge,trigger:'blur'}]">
+                <el-input v-model.trim="item.IndexCode" placeholder="请输入指标ID"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col class="col classify-col">
+              <el-form-item :prop="`edbDataList.${index}.BaseFromMysteelChemicalClassifyId`" 
+              :rules="{required:true,message:'所属分类不能为空',trigger:'change'}">
+                <el-cascader
+                  class="classify-cascader"
+                  :ref="'classifyCascader'+item.edbIndex"
+                  v-model="item.BaseFromMysteelChemicalClassifyId"
+                  :options="classifyOptions"
+                  :key="item.edbIndex"
+                  :props="{
+                    label: 'ClassifyName',
+                    value: 'BaseFromMysteelChemicalClassifyId',
+                    children: 'Children',
+                    emitPath: false,
+                  }"
+                  placeholder="请选择分类"
+                />
+              </el-form-item>
+            </el-col>
+            <img src="~@/assets/img/delete-minus-red.png" @click="delEdbItem(index)" v-if="edbForm.edbDataList.length>1" />
+          </el-row>
+          </div>
+          <div class="add-box" @click="addEdbItem">
+            <img src="~@/assets/img/add-quadrate-blue.png"/>
+            <span>添加</span>
+          </div>
+        </el-form>
+      </div>
+      <div class="dia-bot">
+        <el-button type="primary" style="margin-right: 20px" @click="saveHandle"
+          >保存</el-button
+        >
+        <el-button type="primary" plain @click="cancelHandle">取消</el-button>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { steelInterface } from "@/api/modules/thirdBaseApi";
+
+  export default {
+    props: {
+      isOpenDialog: {
+        type: Boolean,
+      },
+      classifyList: {
+        type: Array,
+      },
+    },
+    watch: {
+      isOpenDialog(newval) {
+        if (newval) {
+          let classifyArr = _.cloneDeep(this.classifyList);
+          this.filterNodes(classifyArr);
+          this.classifyOptions = classifyArr;
+        }
+      },
+    },
+    data(){
+      this.checkAge=(rule, value, callback) => {
+        // 不能输入中文和空格
+        let reg = /[\u4e00-\u9fa5]+|\s+/
+        if(reg.test(value)){
+          callback(new Error('不能输入中文和空格'))
+        }else{
+          callback()
+        }
+      }
+      return{
+        isAddLoading: false,
+        classifyOptions:[],
+        // edbIndex 仅前端使用的唯一标识
+        edbForm:{edbDataList:[{edbIndex:1,IndexCode:'',BaseFromMysteelChemicalClassifyId:''}]},
+        timer:null,
+        emitParams:{},
+        getAddBack:false
+      }
+    },
+    methods:{
+      saveHandle(){
+        this.$refs.edbFormDataListRef.validate((valid)=>{
+          if(valid){
+            // console.log(this.edbForm.edbDataList);
+            steelInterface.edbAdd({List:this.edbForm.edbDataList}).then(res=>{
+                if (res.Ret !== 200) return;
+                this.isAddLoading = true;
+                // console.log(this.edbForm.edbDataList);
+                let edbItem = this.edbForm.edbDataList.find(it => it.IndexCode.toUpperCase() == res.Data.IndexCode.toUpperCase())
+                if(!edbItem){
+                  edbItem=this.edbForm.edbDataList[0]
+                }
+                let edbIndexCurrent = edbItem?edbItem.edbIndex:0
+                let selectClassifyNodes=this.$refs['classifyCascader'+edbIndexCurrent][0].getCheckedNodes()[0].path.map(it => it+'')
+                this.emitParams={
+                  code: res.Data.UniqueCode,
+                  id: res.Data.BaseFromMysteelChemicalIndexId,
+                  indexCode:res.Data.IndexCode,
+                  selectClassifyNodes
+                }
+                this.getAddBack=true
+                setTimeout(() => {
+                  this.cancelHandle();
+                  
+                }, 5*60000);
+              })
+          
+          }else{
+            this.$message.error("指标信息请填写完整!")
+            let errorElDom = this.$refs.edbFormDataListRef.fields.filter((item) => {
+              return item.validateState === 'error';
+            });
+            let errorOffsetTops = errorElDom.map((item) => {
+              return item.$el
+            })
+            // 滚动到指定节点
+            errorOffsetTops[0].scrollIntoView({
+                // 值有start,center,end,nearest
+                block: 'start'
+            })
+          }
+        })
+      },
+      /* 取消 */
+      cancelHandle() {
+        this.isAddLoading = false;
+        this.edbForm={edbDataList:[{edbIndex:1,IndexCode:'',BaseFromMysteelChemicalClassifyId:''}]}
+        this.$refs.edbFormDataListRef && this.$refs.edbFormDataListRef.resetFields();
+        this.$emit("update:isOpenDialog", false);
+        if(this.getAddBack){
+          this.$emit("successCallback", this.emitParams);
+          clearTimeout(this.timer)
+          this.getAddBack=false
+        }
+      },
+      // 递归改变第三级目录结构
+      filterNodes(arr) {
+        arr.length &&
+          arr.forEach((item) => {
+            item.Children &&
+              item.Children.length &&
+              this.filterNodes(item.Children);
+            if (item.Level === 2) {
+              delete item.Children;
+            }
+          });
+      },
+      addEdbItem(){
+        this.$refs.edbFormDataListRef.validate(valid=>{
+          if(valid){
+            if(this.edbForm.edbDataList.length>=100){
+              this.$message.warning('添加数量已达上限(上限100)!')
+              return 
+            }
+            let lastItem = this.edbForm.edbDataList[this.edbForm.edbDataList.length-1]
+            this.edbForm.edbDataList.push({
+              edbIndex:lastItem?1+lastItem.edbIndex:1,
+              IndexCode:'',
+              BaseFromMysteelChemicalClassifyId:lastItem?lastItem.BaseFromMysteelChemicalClassifyId:''
+            })
+            this.$nextTick(()=>{
+              // console.log(this.$refs.formBoxRef.scrollTop,this.$refs.formBoxRef.scrollHeight,'');
+              this.$refs.formBoxRef.scrollTop = this.$refs.formBoxRef.scrollHeight
+            })
+
+          }else{
+            // console.log(this.$refs.edbFormDataListRef.fields,'this.$refs.edbFormDataListRef.fields');
+            let errorElDom = this.$refs.edbFormDataListRef.fields.filter((item) => {
+              return item.validateState === 'error';
+            });
+            let errorOffsetTops = errorElDom.map((item) => {
+              return item.$el
+            })
+            // 滚动到指定节点
+            errorOffsetTops[0].scrollIntoView({
+                // 值有start,center,end,nearest
+                block: 'start'
+            })
+          }
+        })
+      },
+      delEdbItem(index){
+        this.edbForm.edbDataList.splice(index,1)
+      }
+    },
+  }
+</script>
+
+<style lang="scss" scoped>
+.dialog-main {
+  padding: 0 35px;
+  .form-box{
+    max-height: 450px;
+    overflow-y: auto;
+    overflow-x: hidden;
+    scroll-behavior: smooth;
+  }
+  .add-box{
+    display: inline-flex;
+    align-items: center;
+    cursor: pointer;
+    margin-top: 10px;
+    img{
+      height: 18px;
+      width: 18px;
+      margin-right: 7px;
+    }
+    span{
+      font-size: 14px;
+      color: #0052D9;
+    }
+  }
+  .row{
+    .title-col{
+      color: #333333;
+    }
+    .edb-col{
+      width: 250px;
+    }
+    .classify-col{
+      width: 382px;
+    }
+    img{
+      height: 18px;
+      width: 18px;
+      margin: 10px 0 0 8px;
+      cursor: pointer;
+    }
+  }
+}
+
+.dia-bot {
+  margin: 52px 0 30px;
+  display: flex;
+  justify-content: center;
+}
+</style>
+<style lang="scss">
+.form-box{
+  .el-form-item{
+    margin-bottom: 18px;
+  }
+}
+.col{
+  .el-input{
+    width: 100%;
+    height: 38px;
+    .el-input__inner{
+      height: 38px;
+    }
+  }
+  .classify-cascader{
+    min-width: 100%;
+  }
+}
+</style>

+ 23 - 17
src/views/dataEntry_manage/thirdBase/components/targetDialog.vue

@@ -37,6 +37,7 @@
               }"
               style="width: 90%"
               placeholder="请选择分类"
+              ref='classifyIns'
             />
           </el-form-item>
           <el-form-item label="指标ID" prop="from_edb_code">
@@ -48,7 +49,7 @@
               :disabled="edbForm.edb_id"
             />
           </el-form-item>
-          <el-form-item>
+          <!-- <el-form-item>
             <template slot="label">
               <span>
                 更新频度
@@ -96,7 +97,7 @@
                 </el-option>
               </el-select>
             </div>
-          </el-form-item>
+          </el-form-item> -->
         </el-form>
       </div>
       <div class="dia-bot">
@@ -144,19 +145,19 @@ export default {
     },
   },
   computed: {
-    timeArr() {
-      //30间隔的时间数组
-      const timeArrays = new Array(48).fill("").map((item, index) => {
-        let time_val = index * 30;
-        let hour = Math.floor(time_val / 60);
-        let min = time_val % 60;
-        let time =
-          (hour < 10 ? "0" + hour : hour) + ":" + (min === 0 ? "00" : min);
+    // timeArr() {
+    //   //30间隔的时间数组
+    //   const timeArrays = new Array(48).fill("").map((item, index) => {
+    //     let time_val = index * 30;
+    //     let hour = Math.floor(time_val / 60);
+    //     let min = time_val % 60;
+    //     let time =
+    //       (hour < 10 ? "0" + hour : hour) + ":" + (min === 0 ? "00" : min);
 
-        return time;
-      });
-      return timeArrays;
-    },
+    //     return time;
+    //   });
+    //   return timeArrays;
+    // },
   },
   data() {
     return {
@@ -177,7 +178,7 @@ export default {
           { required: true, message: "指标ID不能为空" },
         ],
       },
-      frequencyArr: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
+      // frequencyArr: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
     };
   },
   methods: {
@@ -196,12 +197,15 @@ export default {
             ...params,
             BaseFromMysteelChemicalIndexId: edb_id,
           })
-        : await steelInterface.edbAdd({
+        : await steelInterface.edbAdd([{
             ...params,
             IndexCode: from_edb_code,
-          });
+          }]);
       if (Ret !== 200) return;
 
+      //获取所选的父级分类数据id
+      const selectClassifyNodes=this.$refs.classifyIns.getCheckedNodes()[0].path
+      console.log(selectClassifyNodes);
       if (!edb_id) {
         //新增
         this.isAddLoading = true;
@@ -209,6 +213,7 @@ export default {
           this.cancelHandle();
           this.$emit("successCallback", {
             code: Data.UniqueCode,
+            selectClassifyNodes:selectClassifyNodes,
             id: Data.BaseFromMysteelChemicalIndexId,
           });
         }, 20000);
@@ -217,6 +222,7 @@ export default {
         this.cancelHandle();
         this.$emit("successCallback", {
           code: Data.UniqueCode,
+          selectClassifyNodes:selectClassifyNodes,
           id: Data.BaseFromMysteelChemicalIndexId,
         });
       }

+ 14 - 4
src/views/dataEntry_manage/thirdBase/mixins/leftMixin.js

@@ -38,13 +38,22 @@ export default {
 
   methods: {
     /* 根据unicode展开树结构并选中 */
-    selectCurrentNode({ code, id, type }) {
+    selectCurrentNode({ code, id, type ,selectClassifyNodes}) {
       let deep_arr = _.cloneDeep(this.classifyList);
       // 查找图表的分类父级id
-      let arr = this.findParentNodeHandle(deep_arr, code).slice(1).reverse(); // 父的父的父-父的父-父
-      this.defaultShowNodes = arr;
+      if(selectClassifyNodes && selectClassifyNodes.length>0){
+        this.defaultShowNodes = selectClassifyNodes.map(_e=>`${_e}`);
+      }else{
+        let arr = this.findParentNodeHandle(deep_arr, code).slice(1).reverse(); // 父的父的父-父的父-父
+        this.defaultShowNodes = arr;
+      }
       this.select_node = code;
-      this.$refs.treeRef.setCurrentKey(this.select_node);
+      this.$nextTick(()=>{
+        setTimeout(() => {
+          this.$refs.treeRef.setCurrentKey(this.select_node);
+        }, 300);
+      })
+      
       // // 重置筛选状态
       this.edb_id = id;
       this.getFrequency();
@@ -68,6 +77,7 @@ export default {
 
     /* 拖动时node宽度跟随变化 */
     resetNodeStyle: _.debounce(function(node) {
+      console.log(node);
 			const tree = $('.target_tree')[0];
 			let width = tree.offsetWidth;
 			let label_wid =

+ 46 - 9
src/views/dataEntry_manage/thirdBase/smmTargetbase.vue

@@ -55,12 +55,15 @@
           :props="{
             label: 'ClassifyName',
             children: 'Children',
+            isLeaf:'isLeaf'
           }"
           draggable
           :current-node-key="select_node"
           :expand-on-click-node="false"
           check-strictly
           empty-text="暂无分类"
+          lazy
+					:load="getLazyTreeData"
           @current-change="nodeChangeHandle"
           :default-expanded-keys="defaultShowNodes"
           @node-expand="handleNodeExpand"
@@ -377,6 +380,37 @@ export default {
       });
       return arr;
     },
+    // 懒加载指标
+    async getLazyTreeData(node,resolve){
+      // console.log(node);
+      let arr=[]
+      // 点击二级分类或者一级分类但是分类id为0的
+      if((node.level===2&&node.data.ClassifyId!=0)||(node.level===1&&node.data.ClassifyId==0)){
+        const res=await smmDataInterface.edbListForClassify({ClassifyId:node.data.ClassifyId})
+        if(res.Ret===200){
+          const temarr = res.Data.List || [];
+					arr=temarr.map(item=>{
+						return {
+							...item,
+              UniqueCode:`${item.ClassifyId}_${item.BaseFromSmmIndexId}_${item.BaseFromSmmIndexCode}`,
+              Button:{
+                AddButton: false,
+                OpButton: true,
+                DeleteButton: false,
+                MoveButton: true,
+                cleanButton: true,
+                targetDelButton: true,
+              },
+							isLeaf:true
+						}
+					})
+        }
+      }
+      if(node.level===1&&node.data.ClassifyId!==0){
+        arr=node.data.Children||[]
+      }
+      resolve(arr)
+    },
     /* 获取频度 */
     async getFrequency(defaultSelect) {
       const res = await smmDataInterface.frequencyList({
@@ -621,7 +655,7 @@ export default {
 
       this.$nextTick(() => {
         //找到父节点并展开
-        const targetData = this.getTargetData(e.IndexCode, this.classifyList);
+        const targetData = this.getTargetData(e.ClassifyId, this.classifyList);
         if (targetData) {
           //一级节点
           const { topParentNodeId, UniqueCode } = targetData;
@@ -636,11 +670,14 @@ export default {
           let width = tree.offsetWidth;
           let label_width =
             width > 500 ? "auto" : width <= 500 ? 90 : 0.7 * width;
-          targetData.NodeWidth = label_width;
-          this.select_node = UniqueCode;
-          this.$refs.treeRef.setCurrentNode(targetData);
-          const node = this.$refs.treeRef.getCurrentNode();
-          this.resetNodeStyle(node);
+          // targetData.NodeWidth = label_width;
+          this.select_node = `${e.ClassifyId}_${e.BaseFromSmmIndexId}_${e.IndexCode}`;
+
+          setTimeout(() => {
+            this.$refs.treeRef.setCurrentKey(this.select_node);
+            const node = this.$refs.treeRef.getNode(this.select_node);
+            this.resetNodeStyle(node);
+          }, 1000);
         }
         //this.handleScrollLeftWrap()
       });
@@ -652,11 +689,11 @@ export default {
         scrollTop: top - 200,
       });
     },
-    getTargetData(code, arr) {
+    getTargetData(ClassifyId, arr) {
       for (const item of arr) {
-        if (item.BaseFromSmmIndexCode === code) return item;
+        if (item.ClassifyId === ClassifyId) return item;
         if (item.Children && item.Children.length) {
-          const _item = this.getTargetData(code, item.Children);
+          const _item = this.getTargetData(ClassifyId, item.Children);
           if (_item) return _item;
         }
       }

+ 76 - 11
src/views/dataEntry_manage/thirdBase/steelChemicalbase.vue

@@ -4,7 +4,7 @@
       <div class="left-top">
         <div>
           <el-button v-permission="permissionBtn.dataSourcePermission.mysteelData_add"
-          type="primary" size="medium" @click="addTargetHandle"
+          type="primary" size="medium" @click="addTargetBatch"
             >新增指标</el-button
           >
           <el-button
@@ -48,6 +48,7 @@
           :props="{
             label: 'ClassifyName',
             children: 'Children',
+            isLeaf:'isLeaf'
           }"
           :allow-drag="canDragHandle"
           :allow-drop="canDropHandle"
@@ -57,6 +58,8 @@
           :expand-on-click-node="false"
           check-strictly
           empty-text="暂无分类"
+          lazy
+					:load="getLazyTreeData"
           @node-expand="handleNodeExpand"
           @node-collapse="handleNodeCollapse"
           @current-change="nodeChangeHandle"
@@ -231,6 +234,10 @@
       :edbForm="edbForm"
       @successCallback="addSuccessCallback"
     />
+    <!-- 批量添加指标弹窗 -->
+    <batch-add-edb-dia :isOpenDialog.sync="batchAddDiaShow" 
+    :classifyList="classifyList" 
+    @successCallback="addSuccessCallback"/>
   </div>
 </template>
 
@@ -239,11 +246,12 @@ import lzTable from "@/components/lzTable.vue";
 import { steelInterface } from "@/api/modules/thirdBaseApi";
 import mDialog from "@/components/mDialog.vue";
 import targetDialog from "./components/targetDialog.vue";
+import batchAddEdbDia from "./components/batchAddEdbDia.vue";
 import leftMixin from "./mixins/leftMixin.js";
 export default {
   name: "",
   mixins: [leftMixin],
-  components: { lzTable, mDialog, targetDialog },
+  components: { lzTable, mDialog, targetDialog,batchAddEdbDia },
   data() {
     return {
       dataloading: false,
@@ -265,6 +273,7 @@ export default {
       isRefresh: false,
 
       edb_id: "", //搜索指标id
+      index_code: "", //添加指标后的code,无论是否加载出来,无论是否加载成功
       select_node: "",
       dynamicNode: null,
       defaultShowNodes: [], //展开节点
@@ -284,6 +293,8 @@ export default {
 
       addTargetDialog: false, //添加指标弹窗
       edbForm: {},
+      //批量添加指标弹窗
+      batchAddDiaShow:false
     };
   },
   methods: {
@@ -302,6 +313,28 @@ export default {
         });
       });
     },
+    //指标懒加载
+    async getLazyTreeData(node,resolve){
+      let arr=[]
+      if(node.level===2){
+        const res=await steelInterface.edbListForClassify({
+          BaseFromMysteelChemicalClassifyId:node.data.BaseFromMysteelChemicalClassifyId
+        })
+        if(res.Ret===200){
+          const temarr=res.Data.List||[]
+          arr=temarr.map(item=>{
+            return {
+              ...item,
+              isLeaf:true
+            }
+          })
+        }
+      }else{
+        arr=node.data.Children||[]
+      }
+
+      resolve(arr)
+    },
 
     /* 获取频度 */
     getFrequency(defaultSelect) {
@@ -324,7 +357,33 @@ export default {
               : "";
 
           this.page_no = 1;
-          this.select_frequency && this.getDataList();
+          if(!this.select_frequency){
+            if(this.index_code){
+              this.tableOption=[{
+                IndexName:'',
+                IndexCode:this.index_code,
+                FrequencyName:'',
+                UnitName:'',
+                UpdateTime:''
+              }]
+              //为了美观
+              for (let i = 0; i < 6; i++) {
+                this.tableOption.push({
+                  IndexName:'',
+                  IndexCode:'',
+                  FrequencyName:'',
+                  UnitName:'',
+                  UpdateTime:''
+                })
+              }
+              //为了美观
+              this.dateArr=new Array(12).fill('')
+              this.haveMore=false
+              this.rightShow=true
+            }
+          }else{
+            this.getDataList();
+          }
         });
     },
 
@@ -395,7 +454,6 @@ export default {
             }
 
           this.dataloading = false;
-          
           this.rightShow = true;
           this.page_no === 1 &&
             this.$nextTick(() => {
@@ -417,6 +475,7 @@ export default {
       this.select_node = data.UniqueCode;
       this.select_classify = data.BaseFromMysteelChemicalClassifyId;
       this.edb_id = data.BaseFromMysteelChemicalIndexId;
+      this.index_code = data.IndexCode
 
       this.select_frequency = "";
       this.rightShow = false;
@@ -473,7 +532,9 @@ export default {
 
       this.leftSearchVal = e.IndexName;
 
-      this.getClassify({ code: e.UniqueCode, id: e.Id });
+      // 父级
+      let selectClassifyNodes=[`${e.ParentClassifyId}`,`${e.BaseFromMysteelChemicalClassifyId}`]
+      this.getClassify({ code: e.UniqueCode, id: e.Id ,selectClassifyNodes});
     },
 
     /* 编辑分类 */
@@ -600,12 +661,15 @@ export default {
       this.openClassifyDia = false;
     },
 
+    // /* 添加指标 */
+    // addTargetHandle() {
+    //   this.edbForm = {};
+    //   this.addTargetDialog = true;
+    // },
     /* 添加指标 */
-    addTargetHandle() {
-      this.edbForm = {};
-      this.addTargetDialog = true;
+    addTargetBatch() {
+      this.batchAddDiaShow = true;
     },
-
     /* 指标刷新 */
     edbRefreshHandle() {
       this.isRefresh = true;
@@ -623,8 +687,9 @@ export default {
     },
 
     /* 添加后回调 */
-    addSuccessCallback({ code, id }) {
-      this.getClassify({ code, id });
+    addSuccessCallback({ code, id,selectClassifyNodes,indexCode }) {
+      indexCode && (this.index_code = indexCode)
+      this.getClassify({ code, id,selectClassifyNodes });
     },
 
     // 对[# ;]转义

+ 5 - 0
src/views/smartReport/components/TextEdit.vue

@@ -25,6 +25,9 @@ export default {
             editor: null,
             lastEditRange: null,
             froalaConfig:{
+                imageUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
+                videoUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
+                fileUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url 更多上传介绍 请访问https://www.froala.com/wysiwyg-editor/docs/options
                 toolbarButtons: [
                     "textColor",
                     "bold",
@@ -100,6 +103,8 @@ export default {
     methods: {
         sendHtml(){
             const str=this.html.replace(/<p data-f-id=\"pbf\".*?<\/p>/g, "")
+            //如果富文本中有未上传完成的图片,去除这个dom
+			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
             this.$emit('textChange', str)
         }
     },