|
@@ -0,0 +1,780 @@
|
|
|
+<template>
|
|
|
+ <div class="sciHongqiData-page" id="box">
|
|
|
+ <div class="header">
|
|
|
+ <div class="left-btn">
|
|
|
+ <el-button
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.mysteelData_batchAddEdb"
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ @click="isBatchAddIndicsDiaShow = true"
|
|
|
+ ><!-- 批量加入指标库 -->{{$t('SteelChemicalPage.batch_add_edb_btn')}}</el-button>
|
|
|
+ <el-button
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.mysteelData_batchAddEdb"
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ @click="isBatchAddIndicsDiaShow = true"
|
|
|
+ >批量删除</el-button>
|
|
|
+ <el-button
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.mysteelData_batchAddEdb"
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ @click="isBatchAddIndicsDiaShow = true"
|
|
|
+ >批量编辑</el-button>
|
|
|
+ <el-button
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.mysteelData_export"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ size="medium"
|
|
|
+ @click="exportClick"
|
|
|
+ :loading="btnload"
|
|
|
+ ><!-- 导出Excel -->{{$t('Common.exp_excel')}}</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="right-wrap">
|
|
|
+ <el-select
|
|
|
+ v-model="leftSearchVal"
|
|
|
+ v-loadMore="searchLoad"
|
|
|
+ ref="searchRef"
|
|
|
+ :filterable="!leftSearchVal"
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
|
|
|
+ style="width: 260px;margin-left:10px;"
|
|
|
+ :remote-method="searchHandle"
|
|
|
+ @click.native="inputFocusHandle"
|
|
|
+ >
|
|
|
+ <i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
|
+ <el-option
|
|
|
+ v-for="item in searchOptions"
|
|
|
+ :key="item.TradeCode"
|
|
|
+ :label="item.SecName"
|
|
|
+ :value="item.TradeCode"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="main">
|
|
|
+ <span
|
|
|
+ v-show="!isLeftWrapShow"
|
|
|
+ class="slide-btn-icon slide-right"
|
|
|
+ @click="isLeftWrapShow = !isLeftWrapShow"
|
|
|
+ >
|
|
|
+ <i :class="{'el-icon-d-arrow-left':isLeftWrapShow,'el-icon-d-arrow-right':!isLeftWrapShow}"></i>
|
|
|
+ </span>
|
|
|
+ <div class="left-cont minHeight" v-show="isLeftWrapShow">
|
|
|
+ <span
|
|
|
+ v-show="isLeftWrapShow"
|
|
|
+ class="slide-btn-icon slide-left"
|
|
|
+ @click="isLeftWrapShow = !isLeftWrapShow"
|
|
|
+ >
|
|
|
+ <i :class="{'el-icon-d-arrow-left':isLeftWrapShow,'el-icon-d-arrow-right':!isLeftWrapShow}"></i>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <div class="scroll-wrap">
|
|
|
+ <el-tree
|
|
|
+ ref="treeRef"
|
|
|
+ class="target_tree"
|
|
|
+ :data="classifyList"
|
|
|
+ node-key="UniqueCode"
|
|
|
+ :props="{
|
|
|
+ label: 'ClassifyName',
|
|
|
+ children: 'Children',
|
|
|
+ isLeaf:'isLeaf'
|
|
|
+ }"
|
|
|
+ :allow-drag="canDragHandle"
|
|
|
+ :allow-drop="canDropHandle"
|
|
|
+ :current-node-key="select_node"
|
|
|
+ :default-expanded-keys="defaultShowNodes"
|
|
|
+ draggable
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ check-strictly
|
|
|
+ empty-text="暂无分类"
|
|
|
+ lazy
|
|
|
+ :load="getLazyTreeData"
|
|
|
+ @node-expand="handleNodeExpand"
|
|
|
+ @node-collapse="handleNodeCollapse"
|
|
|
+ @current-change="nodeChangeHandle"
|
|
|
+ @node-drop="dropOverHandle"
|
|
|
+ @node-drag-end="dropMouseLeave"
|
|
|
+ @node-drag-leave="dropMouseLeave"
|
|
|
+ @node-drag-enter="dropMouseOver"
|
|
|
+ >
|
|
|
+ <div class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <span
|
|
|
+ class="text_oneLine"
|
|
|
+ :style="`width:${
|
|
|
+ (select_node === data.UniqueCode && node.Nodewidth) || ''
|
|
|
+ }`"
|
|
|
+ >{{ currentLang==='zh' ? data.ClassifyName : (data.ClassifyNameEn||data.ClassifyName) }}</span
|
|
|
+ >
|
|
|
+ <div v-if="select_node === data.UniqueCode">
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/data_m/move_ico.png"
|
|
|
+ v-if="data.Button.MoveButton"
|
|
|
+ alt=""
|
|
|
+ style="width: 14px; height: 14px; margin-right: 5px"
|
|
|
+ @click.stop="clickClassifyHandle('move', data, node)"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/set_m/add.png"
|
|
|
+ style="width: 14px; height: 14px; margin-right: 5px"
|
|
|
+ @click.stop="clickClassifyHandle('add', data, node)"
|
|
|
+ v-if="data.Button.AddButton&&permissionBtn.isShowBtn('dataSourcePermission','mysteelData_classifyOpt_add')"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/set_m/edit.png"
|
|
|
+ v-if="data.Button.OpButton&&permissionBtn.isShowBtn('dataSourcePermission','mysteelData_classifyOpt_edit')"
|
|
|
+ alt=""
|
|
|
+ style="width: 14px; height: 14px; margin-right: 5px"
|
|
|
+ @click.stop="clickClassifyHandle('edit', data, node)"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/set_m/del.png"
|
|
|
+ v-if="data.Button.DeleteButton&&permissionBtn.isShowBtn('dataSourcePermission','mysteelData_classifyOpt_delete')"
|
|
|
+ alt=""
|
|
|
+ style="width: 14px; height: 14px"
|
|
|
+ @click.stop="clickClassifyHandle('del', data, node)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-tree>
|
|
|
+
|
|
|
+ <div class="add-cont" @click="addClassifyHandle" v-if="permissionBtn.isShowBtn('dataSourcePermission','mysteelData_classifyOpt_add')">
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/set_m/add_ico.png"
|
|
|
+ alt=""
|
|
|
+ style="width: 16px; height: 16px; margin: 10px"
|
|
|
+ />
|
|
|
+ <span><!-- 添加分类 -->{{$t('SteelChemicalPage.add_classify_btn')}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="right-cont minHeight"
|
|
|
+ v-loading="dataloading"
|
|
|
+ :element-loading-text="$t('Table.data_loading')"
|
|
|
+ >
|
|
|
+ <div class="right-header">
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ style="box-shadow: 0px 3px 6px rgba(155, 170, 219, 0.2);margin-top: 20px"
|
|
|
+ border
|
|
|
+ ref="table"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ v-for="item in tableColums"
|
|
|
+ :key="item.key"
|
|
|
+ :label="item.label"
|
|
|
+ :width="item.widthsty"
|
|
|
+ :min-width="item.minwidthsty"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span v-if="item.key==='SecName'" class="editsty" @click="lookDetailHandle(row)">{{row[item.key]}}</span>
|
|
|
+ <span v-else>{{row[item.key]}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('Table.column_operations')"
|
|
|
+ align="center"
|
|
|
+ min-width="200"
|
|
|
+ >
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <div>
|
|
|
+ <span
|
|
|
+ class="editsty"
|
|
|
+ @click="handleEdb({item:row,type:'edit'})"
|
|
|
+ >{{$t('Table.edit_btn')}}</span>
|
|
|
+
|
|
|
+ <span v-if="permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_add')" class="editsty" @click="handleEdb({item:row,type:'addToBase'})"><!-- 加入指标库 -->{{$t('ManualEntryPage.add_tobase')}}</span>
|
|
|
+
|
|
|
+ <span
|
|
|
+ v-if="permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_del')"
|
|
|
+ class="deletesty"
|
|
|
+ @click="handleEdb({item:row,type:'del'})"
|
|
|
+ >{{$t('Table.delete_btn')}}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <div class="nodata" slot="empty">
|
|
|
+ <tableNoData :text="$t('Table.prompt_slogan')" size="mini"/>
|
|
|
+ </div>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div style="height:35px;margin: 20px 0;">
|
|
|
+ <m-page
|
|
|
+ :page_no="page_no"
|
|
|
+ :pageSize="pageSize"
|
|
|
+ :total="total"
|
|
|
+ @handleCurrentChange="handlePageChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 分类弹窗 -->
|
|
|
+ <m-dialog
|
|
|
+ :show.sync="openClassifyDia"
|
|
|
+ width="700px"
|
|
|
+ :title="classifyForm.title==='添加分类'?$t('SteelChemicalPage.add_classify_btn'):$t('SteelChemicalPage.edit_classify_msg')"
|
|
|
+ @close="openClassifyDia = false"
|
|
|
+ >
|
|
|
+ <div class="dialog-cont">
|
|
|
+ <el-form
|
|
|
+ ref="classifyFormRef"
|
|
|
+ label-position="left"
|
|
|
+ hide-required-asterisk
|
|
|
+ label-width="120px"
|
|
|
+ :model="classifyForm"
|
|
|
+ :rules="classifyFormRules"
|
|
|
+ @close="cancelDialogHandle"
|
|
|
+ >
|
|
|
+ <el-form-item :label="$t('SteelChemicalPage.label_one_level')" v-if="classifyForm.parent_classify_id">
|
|
|
+ <span>{{ classifyForm.parent_classify_name }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('SteelChemicalPage.label_classify_name')" prop="classify_name">
|
|
|
+ <el-input
|
|
|
+ v-model="classifyForm.classify_name"
|
|
|
+ style="width: 80%"
|
|
|
+ :placeholder="$t('Dialog.require_vaild')"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="dia-bot">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ style="margin-right: 20px"
|
|
|
+ @click="saveClassifyHandle"
|
|
|
+ ><!-- 保存 -->{{$t('Dialog.confirm_save_btn')}}</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" plain @click="cancelDialogHandle"
|
|
|
+ ><!-- 取消 -->{{$t('Dialog.cancel_btn')}}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </m-dialog>
|
|
|
+
|
|
|
+ <!-- 指标弹窗 -->
|
|
|
+ <target-dialog
|
|
|
+ :isOpenDialog.sync="addTargetDialog"
|
|
|
+ :classifyList="classifyList"
|
|
|
+ :edbForm="edbForm"
|
|
|
+ @successCallback="addSuccessCallback"
|
|
|
+ />
|
|
|
+ <!-- 批量添加指标弹窗 -->
|
|
|
+ <batch-add-edb-dia :isOpenDialog.sync="batchAddDiaShow"
|
|
|
+ :classifyList="classifyList"
|
|
|
+ @successCallback="addSuccessCallback"/>
|
|
|
+ <!-- 批量添加至指标库弹窗 -->
|
|
|
+ <batchAddIndicsDia
|
|
|
+ :isOpenDialog="isBatchAddIndicsDiaShow"
|
|
|
+ @close="isBatchAddIndicsDiaShow=false"
|
|
|
+ />
|
|
|
+ <!-- 单个添加至指标库弹窗 -->
|
|
|
+ <addIndicsDia
|
|
|
+ :isOpenDialog="isAddIndicsDiaShow"
|
|
|
+ :edbData="currentIndicData"
|
|
|
+ @close="isAddIndicsDiaShow=false;"
|
|
|
+ @addCallback="isAddIndicsDiaShow=false;"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { zhuochuangRedStageInterface } from "@/api/modules/thirdBaseApi";
|
|
|
+import mDialog from "@/components/mDialog.vue";
|
|
|
+export default {
|
|
|
+ name: "",
|
|
|
+ components: { mDialog, },
|
|
|
+ computed: {
|
|
|
+ exportGlapi() {
|
|
|
+ // 数据导出接口
|
|
|
+ let urlStr = this.exportBase;
|
|
|
+ // token
|
|
|
+ urlStr += `?${localStorage.getItem("auth") || ""}`;
|
|
|
+ // 指标名称参数
|
|
|
+ urlStr += `&ClassifyId=${this.selectClassify}`;
|
|
|
+ return this.escapeStr(urlStr);
|
|
|
+ },
|
|
|
+
|
|
|
+ currentLang() {
|
|
|
+ return this.$store.state.lang
|
|
|
+ },
|
|
|
+
|
|
|
+ tableColums() {
|
|
|
+ return [
|
|
|
+ { label: this.$t('Edb.Detail.e_id'),key: 'IndexCode' },
|
|
|
+ { label: this.$t('Edb.Detail.e_name'),key: 'IndexName',minwidthsty:'150px' },
|
|
|
+ { label: this.$t('Edb.Detail.e_fre'),key: 'Frequency',widthsty:'100px' },
|
|
|
+ { label: this.$t('Edb.Detail.e_unit'),key: 'Unit', },
|
|
|
+ { label: this.$t('Edb.Detail.e_update_time'),key: 'ModifyTime', },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isLeftWrapShow:true,
|
|
|
+ dataloading: false,
|
|
|
+ exportBase:
|
|
|
+ process.env.VUE_APP_API_ROOT +
|
|
|
+ "/datamanage/mysteel_chemical/export/dataList", //数据导出接口
|
|
|
+
|
|
|
+ selectClassify:0,
|
|
|
+ leftSearchVal: "",
|
|
|
+ classifyList: [],
|
|
|
+ dynamicNode: null,
|
|
|
+ defaultShowNodes: [], //展开节点
|
|
|
+
|
|
|
+ selectEdb: 0,
|
|
|
+ tableData: [],
|
|
|
+ total:0,
|
|
|
+ page_size: 10,
|
|
|
+ page_no: 1,
|
|
|
+
|
|
|
+ index_code: "", //添加指标后的code,无论是否加载出来,无论是否加载成功
|
|
|
+ select_node: "",
|
|
|
+
|
|
|
+ /* 分类弹窗 */
|
|
|
+ openClassifyDia: false,
|
|
|
+ classifyForm: {
|
|
|
+ title: "添加分类",
|
|
|
+ classify_name: "",
|
|
|
+ parent_classify_name: "",
|
|
|
+ parent_classify_id: "",
|
|
|
+ },
|
|
|
+ classifyFormRules: {
|
|
|
+ classify_name: [
|
|
|
+ { required: true, message: /* "分类名称不能为空" */this.$t('Edb.InputHolderAll.input_common',{label: this.$t('SteelChemicalPage.label_classify_name')}), trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+
|
|
|
+ addTargetDialog: false, //指标弹窗
|
|
|
+ edbForm: {},
|
|
|
+
|
|
|
+ //批量添加指标弹窗
|
|
|
+ batchAddDiaShow:false,
|
|
|
+
|
|
|
+ isBatchAddIndicsDiaShow:false, //批量添加至指标库弹窗
|
|
|
+ isAddIndicsDiaShow:false,//单个添加至指标库弹窗
|
|
|
+ currentIndicData:{},//当前选中指标
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getClassify();
|
|
|
+ this.getEdbList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* 获取分类 */
|
|
|
+ getClassify(params = null) {
|
|
|
+ zhuochuangRedStageInterface.classifyList().then((res) => {
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ this.classifyList = res.Data || [];
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ /* 处理树展开和选中 */
|
|
|
+ params && this.selectCurrentNode(params);
|
|
|
+ !params &&
|
|
|
+ this.select_node &&
|
|
|
+ this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //指标懒加载
|
|
|
+ async getLazyTreeData(node,resolve){
|
|
|
+ let arr=[]
|
|
|
+ if(node.level===2){
|
|
|
+ const res=await zhuochuangRedStageInterface.edbListForClassify({
|
|
|
+ ClassifyId:node.data.ClassifyId
|
|
|
+ })
|
|
|
+ if(res.Ret===200){
|
|
|
+ const temarr=res.Data||[]
|
|
|
+ arr=temarr.map(item=>{
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ isLeaf:true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ arr=node.data.Children||[]
|
|
|
+ }
|
|
|
+
|
|
|
+ resolve(arr)
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 获取数据 */
|
|
|
+ async getEdbList() {
|
|
|
+ const res = await zhuochuangRedStageInterface.getEdbList({
|
|
|
+ PageSize: this.page_size,
|
|
|
+ CurrentIndex: this.page_no
|
|
|
+ })
|
|
|
+
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.tableData =res.Data.List||[]
|
|
|
+ },
|
|
|
+
|
|
|
+ handlePageChange(page) {
|
|
|
+ this.page_no = page;
|
|
|
+ this.getEdbList()
|
|
|
+ },
|
|
|
+
|
|
|
+ lookDetailHandle() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ /* 改变节点 */
|
|
|
+ nodeChangeHandle(data, node) {
|
|
|
+ if (this.dataloading)
|
|
|
+ return this.$message(this.$t('MsgPrompt.request_frequency'));
|
|
|
+ this.dynamicNode = node;
|
|
|
+ this.select_node = data.UniqueCode;
|
|
|
+ this.selectClassify = data.ClassifyId;
|
|
|
+ this.selectEdb = data.BaseFromSciHqIndexId;
|
|
|
+ this.index_code = data.IndexCode
|
|
|
+
|
|
|
+ this.rightShow = false;
|
|
|
+ this.leftSearchVal = "";
|
|
|
+
|
|
|
+ this.resetNodeStyle(node);
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 钢联数据导出 */
|
|
|
+ exportClick() {
|
|
|
+ this.btnload = true;
|
|
|
+
|
|
|
+ const link = document.createElement("a");
|
|
|
+ link.href = this.exportGlapi;
|
|
|
+ link.download = "";
|
|
|
+ link.click();
|
|
|
+ setTimeout(() => {
|
|
|
+ this.btnload = false;
|
|
|
+ }, 5000);
|
|
|
+ },
|
|
|
+
|
|
|
+ //左侧搜索
|
|
|
+ async handleLeftSearch(query, cb) {
|
|
|
+ cb([]);
|
|
|
+ if (!query) return;
|
|
|
+ const res = await zhuochuangRedStageInterface.searchEdb({
|
|
|
+ Keyword: query,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ let arr = res.Data || [];
|
|
|
+ if (!arr.length) {
|
|
|
+ cb([{ nodata: true }]);
|
|
|
+ } else {
|
|
|
+ cb(arr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 选中左侧搜索值
|
|
|
+ handleSelectLeftSearchval(e) {
|
|
|
+ if (!e.IndexCode) return;
|
|
|
+
|
|
|
+ this.leftSearchVal = e.IndexName;
|
|
|
+
|
|
|
+ // 父级
|
|
|
+ let selectClassifyNodes=[`${e.ParentClassifyId}`,`${e.ClassifyId}`]
|
|
|
+ this.getClassify({ code: e.UniqueCode, id: e.Id ,selectClassifyNodes});
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 编辑分类 */
|
|
|
+ async editClassifyHandle(
|
|
|
+ {
|
|
|
+ ClassifyId,
|
|
|
+ ClassifyName,
|
|
|
+ ClassifyNameEn,
|
|
|
+ ParentId,
|
|
|
+ BaseFromSciHqIndexId,
|
|
|
+ },
|
|
|
+ node
|
|
|
+ ) {
|
|
|
+ if (node.level === 3) {
|
|
|
+ // 指标
|
|
|
+ let { Data } = await zhuochuangRedStageInterface.edbDetail({
|
|
|
+ BaseFromSciHqIndexId,
|
|
|
+ });
|
|
|
+ this.edbForm = {
|
|
|
+ selectEdb: Data.BaseFromSciHqIndexId,
|
|
|
+ classify_id: Data.ClassifyId,
|
|
|
+ from_edb_code: Data.IndexCode,
|
|
|
+ frequency: Data.UpdateWeek,
|
|
|
+ update_time: Data.UpdateTime ? Data.UpdateTime.split(",") : [],
|
|
|
+ };
|
|
|
+ this.addTargetDialog = true;
|
|
|
+ } else {
|
|
|
+ //分类
|
|
|
+ this.openClassifyDia = true;
|
|
|
+ this.classifyForm = {
|
|
|
+ title: "编辑分类",
|
|
|
+ classify_name: this.currentLang==='zh' ? ClassifyName : ClassifyNameEn,
|
|
|
+ classify_id: ClassifyId,
|
|
|
+ parent_classify_name:
|
|
|
+ node.level === 2 ? (this.currentLang==='zh'?node.parent.data.ClassifyName:node.parent.data.ClassifyNameEn) : "",
|
|
|
+ parent_classify_id: node.level === 2 ? ParentId : "",
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 删除分类 */
|
|
|
+ delClassifyHandle(
|
|
|
+ { ClassifyId, BaseFromSciHqIndexId },
|
|
|
+ node
|
|
|
+ ) {
|
|
|
+ this.$confirm(
|
|
|
+ `${
|
|
|
+ node.level === 3
|
|
|
+ ? this.$t('SteelChemicalPage.del_edb_msg')
|
|
|
+ : this.$t('SteelChemicalPage.del_classify_edb_msg')
|
|
|
+ }`,
|
|
|
+ this.$t('Dialog.warn_tit'),
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(async () => {
|
|
|
+ let res =
|
|
|
+ node.level === 3
|
|
|
+ ? await zhuochuangRedStageInterface.edbDel({ BaseFromSciHqIndexId })
|
|
|
+ : await zhuochuangRedStageInterface.classifyDel({
|
|
|
+ ClassifyId,
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+
|
|
|
+ this.$message.success(/* "删除成功" */this.$t('MsgPrompt.delete_msg'));
|
|
|
+ this.getClassify();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
+ clickClassifyHandle(key, item, node) {
|
|
|
+ const handleMap = {
|
|
|
+ add: this.addClassifyHandle,
|
|
|
+ edit: this.editClassifyHandle,
|
|
|
+ del: this.delClassifyHandle,
|
|
|
+ };
|
|
|
+
|
|
|
+ handleMap[key] && handleMap[key](item, node);
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 添加分类 */
|
|
|
+ addClassifyHandle(item = null) {
|
|
|
+ this.openClassifyDia = true;
|
|
|
+ this.classifyForm = item
|
|
|
+ ? {
|
|
|
+ title: "添加分类",
|
|
|
+ classify_name: "",
|
|
|
+ parent_classify_name: this.currentLang==='zh' ? item.ClassifyName : item.ClassifyNameEn,
|
|
|
+ parent_classify_id: item.ClassifyId,
|
|
|
+ }
|
|
|
+ : {
|
|
|
+ title: "添加分类",
|
|
|
+ classify_name: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ cancelDialogHandle() {
|
|
|
+ this.$refs.classifyFormRef.clearValidate();
|
|
|
+ this.classifyForm.classify_name = "";
|
|
|
+ this.openClassifyDia = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 保存分类 */
|
|
|
+ async saveClassifyHandle() {
|
|
|
+ await this.$refs.classifyFormRef.validate();
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ ClassifyName: this.classifyForm.classify_name,
|
|
|
+ ParentId: this.classifyForm.parent_classify_id,
|
|
|
+ Level: this.classifyForm.parent_classify_id ? 1 : 0,
|
|
|
+ };
|
|
|
+ const res = this.classifyForm.classify_id
|
|
|
+ ? await zhuochuangRedStageInterface.classifyEdit({
|
|
|
+ ...params,
|
|
|
+ ClassifyId: this.classifyForm.classify_id,
|
|
|
+ })
|
|
|
+ : await zhuochuangRedStageInterface.classifyAdd(params);
|
|
|
+
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+
|
|
|
+ this.$message.success(/* "保存成功" */this.$t('MsgPrompt.saved_msg'));
|
|
|
+ this.getClassify();
|
|
|
+ this.openClassifyDia = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ handleAddToLib(data){
|
|
|
+ //添加前校验 ID是否已存在指标库中
|
|
|
+ //打开弹窗
|
|
|
+ this.currentIndicData = data
|
|
|
+ this.isAddIndicsDiaShow = true
|
|
|
+ },
|
|
|
+ addToLibCallback(){
|
|
|
+ //添加成功回调
|
|
|
+ this.isAddIndicsDiaShow = false
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 添加后回调 */
|
|
|
+ addSuccessCallback({ code, id,selectClassifyNodes,indexCode }) {
|
|
|
+ indexCode && (this.index_code = indexCode)
|
|
|
+ this.getClassify({ code, id,selectClassifyNodes });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 对[# ;]转义
|
|
|
+ escapeStr(str) {
|
|
|
+ return str.replace(/#/g, escape("#")).replace(/;/g, escape(";"));
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.sciHongqiData-page {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ position: relative;
|
|
|
+ box-sizing: border-box;
|
|
|
+ height: calc(100vh - 120px);
|
|
|
+ .slide-btn-icon{
|
|
|
+ &.slide-left{
|
|
|
+ right:0;
|
|
|
+ }
|
|
|
+ &.slide-right{
|
|
|
+ left: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .header,.left-cont,.right-cont {
|
|
|
+ padding: 20px;
|
|
|
+ background: #fff;
|
|
|
+ border: 1px solid #C8CDD9;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ .header {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .main {
|
|
|
+ display: flex;
|
|
|
+ flex: 1;
|
|
|
+ .left-cont {
|
|
|
+ min-width: 340px;
|
|
|
+ width: 340px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-right: 20px;
|
|
|
+ padding: 30px 0;
|
|
|
+ overflow: hidden;
|
|
|
+ position: relative;
|
|
|
+ .left-top {
|
|
|
+ padding: 0 20px;
|
|
|
+ }
|
|
|
+ .scroll-wrap {
|
|
|
+ padding: 0 20px;
|
|
|
+ height: calc(100vh - 320px);
|
|
|
+ overflow-y: auto;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ .target_tree {
|
|
|
+ color: #333;
|
|
|
+ .label-input .el-input__inner {
|
|
|
+ height: 25px;
|
|
|
+ line-height: 25px;
|
|
|
+ }
|
|
|
+ .custom-tree-node {
|
|
|
+ display: flex !important;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ display: block;
|
|
|
+ flex: 1;
|
|
|
+ .node_label {
|
|
|
+ margin-right: 2px;
|
|
|
+ }
|
|
|
+ .el-icon-view {
|
|
|
+ color: #409eff;
|
|
|
+ font-size: 18px;
|
|
|
+ margin-left: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .add-cont {
|
|
|
+ margin: 50px 0 20px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #409eff;
|
|
|
+ font-size: 16px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .right-cont {
|
|
|
+ flex:1;
|
|
|
+ padding: 30px;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+.dialog-cont {
|
|
|
+ padding-left: 50px;
|
|
|
+}
|
|
|
+.dia-bot {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+.sciHongqiData-page {
|
|
|
+ .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>
|