|
@@ -0,0 +1,1335 @@
|
|
|
+<template>
|
|
|
+ <div class="sciHongqiData-page" id="box">
|
|
|
+ <div class="header">
|
|
|
+ <div class="left-btn">
|
|
|
+ <el-button
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.sciHongqi_batch_addBase"
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ @click="handleBatchAddBase"
|
|
|
+ ><!-- 批量加入指标库 -->{{$t('SteelChemicalPage.batch_add_edb_btn')}}</el-button>
|
|
|
+ <el-button
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.sciHongqi_batch_del"
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ plain
|
|
|
+ @click="handBatchDelEdb"
|
|
|
+ ><!-- 批量删除 -->{{$t('SciHongqiPage.btn_batch_del')}}</el-button>
|
|
|
+ <el-button
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.sciHongqi_batch_edit"
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ plain
|
|
|
+ @click="handleBatchEdit"
|
|
|
+ ><!-- 批量编辑 -->{{$t('SciHongqiPage.btn_batch_edit')}}</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="right-wrap">
|
|
|
+ <el-button
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.sciHongqi_export"
|
|
|
+ type="text"
|
|
|
+ @click="exportClick"
|
|
|
+ :loading="btnload"
|
|
|
+ ><!-- 导出Excel -->{{$t('Common.exp_excel')}}</el-button>
|
|
|
+
|
|
|
+ <el-select
|
|
|
+ v-model="leftSearchVal"
|
|
|
+ ref="searchRef"
|
|
|
+ :filterable="!leftSearchVal"
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
|
|
|
+ style="width: 260px;margin-left:10px;"
|
|
|
+ :remote-method="searchHandle"
|
|
|
+ >
|
|
|
+ <i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
|
+ <el-option
|
|
|
+ v-for="item in searchOptions"
|
|
|
+ :key="item.BaseFromSciHqIndexId"
|
|
|
+ :label="item.IndexName"
|
|
|
+ :value="item.BaseFromSciHqIndexId"
|
|
|
+ />
|
|
|
+ </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="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_move')"
|
|
|
+ :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"
|
|
|
+ >
|
|
|
+ <div class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <div
|
|
|
+ class="text_oneLine"
|
|
|
+ :style="`width:${
|
|
|
+ select_node === data.UniqueCode ? '60%' :'100%'
|
|
|
+ }`"
|
|
|
+ >
|
|
|
+ <span v-if="data.IndexCode">{{data.IndexName}}</span>
|
|
|
+ <span v-else>
|
|
|
+ {{ currentLang==='zh' ? data.ClassifyName : data.ClassifyNameEn }}
|
|
|
+ </span>
|
|
|
+ </div
|
|
|
+ >
|
|
|
+ <div v-if="select_node===data.UniqueCode&&data.ClassifyId">
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/data_m/move_ico.png"
|
|
|
+ v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_move')"
|
|
|
+ style="width: 16px; height: 16px; margin-right: 5px"
|
|
|
+ @click.stop="clickClassifyHandle('move', data, node)"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/set_m/add.png"
|
|
|
+ style="width: 16px; height: 16px;
|
|
|
+ margin-right: 5px"
|
|
|
+ v-if="node.level===1&&permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_add')"
|
|
|
+ @click.stop="clickClassifyHandle('add', data, node)"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/set_m/edit.png"
|
|
|
+ v-if="node.level!==3&&permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_edit')"
|
|
|
+ alt=""
|
|
|
+ style="width: 16px; height: 16px; margin-right: 5px"
|
|
|
+ @click.stop="clickClassifyHandle('edit', data, node)"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/set_m/del.png"
|
|
|
+ v-if="node.level!==3&&permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_del')"
|
|
|
+ alt=""
|
|
|
+ style="width: 14px; height: 14px"
|
|
|
+ @click.stop="clickClassifyHandle('del', data, node)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-tree>
|
|
|
+
|
|
|
+ <div class="add-cont" @click="addClassifyHandle(null)" v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_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')"
|
|
|
+ >
|
|
|
+ <template v-if="!selectEdb">
|
|
|
+ <div class="right-header">
|
|
|
+ <span>{{$t('SciHongqiPage.total_msg',{limit:total})}}</span>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="filterObj.checkAll"
|
|
|
+ :indeterminate="filterObj.checkSome"
|
|
|
+ :disabled="tableData.length===0"
|
|
|
+ style="margin-left:20px"
|
|
|
+ @change="listCheckAllChange"
|
|
|
+ ><!-- 列表全选 -->{{$t('SystemManage.OperateAuth.all_select')}}</el-checkbox>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ style="box-shadow: 0px 3px 6px rgba(155, 170, 219, 0.2);margin-top: 20px"
|
|
|
+ border
|
|
|
+ ref="table"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ @select="selectHandle"
|
|
|
+ @select-all="selectAllPageHandle"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection"/>
|
|
|
+ <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==='IndexName'" class="editsty" @click="nodeChangeHandle(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
|
|
|
+ v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_opera_edit')"
|
|
|
+ class="editsty"
|
|
|
+ @click="handleEdb({item:row,type:'edit'})"
|
|
|
+ >{{$t('Table.edit_btn')}}</span>
|
|
|
+
|
|
|
+ <span v-if="!row.EdbExist&&permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_opera_addBase')" class="editsty" @click="handleEdb({item:row,type:'addToBase'})"><!-- 加入指标库 -->{{$t('ManualEntryPage.add_tobase')}}</span>
|
|
|
+
|
|
|
+ <span
|
|
|
+ v-if="!row.EdbExist&&permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_opera_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>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <edbDataDetail
|
|
|
+ ref="edbDetailRef"
|
|
|
+ :id="selectEdb"
|
|
|
+ @handle="handleEdb"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </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_name">
|
|
|
+ <span>{{ classifyForm.parent_classify_name }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('SteelChemicalPage.label_classify_name')" prop="classifyId" v-if="classifyForm.indexId">
|
|
|
+ <el-cascader
|
|
|
+ v-model="classifyForm.classify_id"
|
|
|
+ style="width: 80%"
|
|
|
+ :options="classifyList"
|
|
|
+ :props="{
|
|
|
+ label: 'ClassifyName',
|
|
|
+ value: 'ClassifyIdStr',
|
|
|
+ children: 'Children',
|
|
|
+ emitPath:false
|
|
|
+ }"
|
|
|
+ :placeholder="$t('SteelChemicalPage.ph_classify_name')"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('SteelChemicalPage.label_classify_name')" prop="classify_name" v-else>
|
|
|
+ <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>
|
|
|
+
|
|
|
+ <!-- 批量入库 -->
|
|
|
+ <addToBaseDia
|
|
|
+ :isShow.sync="isAddToBaseDia"
|
|
|
+ :list="addToBaseList"
|
|
|
+ @success="() => { listCheckAllChange(false);handlePageChange(1)}"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 批量编辑index分类 -->
|
|
|
+ <batchEditIndexDia
|
|
|
+ :isShow.sync="isBatchEditIndexDia"
|
|
|
+ :list="addToBaseList"
|
|
|
+ :classifyList="classifyList"
|
|
|
+ @success="getClassify"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 单个添加至指标库弹窗 -->
|
|
|
+ <addIndicsDia
|
|
|
+ :isOpenDialog="isAddIndicsDiaShow"
|
|
|
+ :edbData="currentIndicData"
|
|
|
+ @close="isAddIndicsDiaShow=false;"
|
|
|
+ @addCallback="intoBaseBack"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 操作提示弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="$t('BloombergPage.operation_prompt')"
|
|
|
+ :visible.sync="isHintDialogShow"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ @close="isHintDialogShow=false"
|
|
|
+ width="578px"
|
|
|
+ v-dialogDrag
|
|
|
+ center>
|
|
|
+ <div class="hint-dialog-wrap">
|
|
|
+ <p style="margin-bottom: 20px;">{{ hintText }}</p>
|
|
|
+ <ul class="hint-list">
|
|
|
+ <li v-for="(item,index) in showHintList" :key="index" :class="{'hint-item':!batchDelList.length}" @click="goToEdbBase(item)">
|
|
|
+ {{ index+1 }}、{{ item.IndexName }}({{ item.IndexCode }})
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center;margin-bottom: 30px;">
|
|
|
+ <el-button type="primary" @click="handleCloseHintDia" v-if="existEdbList.length">{{$t('Dialog.known')}}</el-button>
|
|
|
+
|
|
|
+ <template v-if="batchDelList.length">
|
|
|
+ <el-button type="primary" @click="isHintDialogShow=false" plain><!-- 取消 -->{{$t('Dialog.cancel_btn')}}</el-button>
|
|
|
+ <el-button type="primary" @click="handleCloseHintDia"><!-- 确定 -->{{$t('Dialog.confirm_btn')}}</el-button>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { zhuochuangRedStageInterface } from "@/api/modules/thirdBaseApi";
|
|
|
+import mDialog from "@/components/mDialog.vue";
|
|
|
+import mPage from '@/components/mPage.vue';
|
|
|
+import edbDataDetail from './components/edbDataDetail.vue';
|
|
|
+import addIndicsDia from './components/addIndicsDia.vue';
|
|
|
+import addToBaseDia from './components/addToBaseDia.vue';
|
|
|
+import batchEditIndexDia from './components/batchEditIndexDia.vue';
|
|
|
+export default {
|
|
|
+ name: "",
|
|
|
+ components: { mDialog,edbDataDetail,mPage,addIndicsDia,addToBaseDia,batchEditIndexDia },
|
|
|
+ computed: {
|
|
|
+ exportGlapi() {
|
|
|
+ // 数据导出接口
|
|
|
+ let urlStr = this.exportBase;
|
|
|
+ // token
|
|
|
+ urlStr += `?${localStorage.getItem("auth") || ""}`;
|
|
|
+ // 指标名称参数
|
|
|
+
|
|
|
+ let IndexCode = this.selectEdb? this.$refs.edbDetailRef.edbInfo.IndexCode : 0
|
|
|
+ urlStr += `&ClassifyId=${this.selectClassify}&IndexCode=${IndexCode}`;
|
|
|
+ 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' },
|
|
|
+ { label: this.$t('Edb.Detail.e_unit'),key: 'Unit', },
|
|
|
+ { label: this.$t('Edb.Detail.e_latest_date'),key: 'LatestDate', },
|
|
|
+ { label: this.$t('Edb.Detail.e_latest_value'),key: 'LatestValue', },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+
|
|
|
+ hintText(){
|
|
|
+ let key = 0
|
|
|
+ if(this.existEdbList.length) key++
|
|
|
+ if(!this.addToBaseList.length) key++
|
|
|
+ if(this.batchDelList.length) key = 3
|
|
|
+
|
|
|
+ return {
|
|
|
+ 0:'',
|
|
|
+ 1:this.$t('YsDataPage.haved_some_msg'),//指标库中已存在以下指标,会自动过滤!
|
|
|
+ 2:this.$t('YsDataPage.haved_all_msg'),//本次添加的指标均已在指标库中,请勿重复添加!
|
|
|
+ 3: this.$t('SciHongqiPage.del_msg')
|
|
|
+ }[key]
|
|
|
+ },
|
|
|
+
|
|
|
+ showHintList() {
|
|
|
+ return this.existEdbList.length ? this.existEdbList : this.batchDelList;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ leftSearchVal(nval) {
|
|
|
+ if(!nval) return
|
|
|
+
|
|
|
+ this.selectEdb = nval;
|
|
|
+ this.selectClassify = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isLeftWrapShow:true,
|
|
|
+ dataloading: false,
|
|
|
+ exportBase:process.env.VUE_APP_API_ROOT + "/datamanage/export/sciHqList", //数据导出接口
|
|
|
+
|
|
|
+ selectClassify:0,
|
|
|
+ leftSearchVal: "",
|
|
|
+ searchOptions: [],
|
|
|
+ classifyList: [],
|
|
|
+ defaultShowNodes: [], //展开节点
|
|
|
+
|
|
|
+ selectEdb: 0,
|
|
|
+ tableData: [],
|
|
|
+ total:0,
|
|
|
+ page_size: 10,
|
|
|
+ page_no: 1,
|
|
|
+ filterObj: {
|
|
|
+ checkAll: false,
|
|
|
+ checkSome: false,
|
|
|
+ },
|
|
|
+ isSelectAll: false, //真正意义上的全选或不全选
|
|
|
+ checkedList: [], //不全选勾选中的 或 全选取消勾的
|
|
|
+ selectionReactCancel:false,//手动设置选中
|
|
|
+
|
|
|
+ select_node: "",
|
|
|
+
|
|
|
+ /* 分类弹窗 */
|
|
|
+ openClassifyDia: false,
|
|
|
+ classifyForm: {
|
|
|
+ title: "添加分类",
|
|
|
+ classify_name: "",
|
|
|
+ parent_classify_name: "",
|
|
|
+ parent_classify_id: 0,
|
|
|
+ },
|
|
|
+ classifyFormRules: {
|
|
|
+ classify_name: [
|
|
|
+ { required: true, message: /* "分类名称不能为空" */this.$t('Edb.InputHolderAll.input_common',{label: this.$t('SteelChemicalPage.label_classify_name')}), trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+
|
|
|
+ //批量添加指标弹窗
|
|
|
+ isAddToBaseDia: false,
|
|
|
+ addToBaseList: [],//可加入的指标
|
|
|
+ existEdbList: [],//已存在的指标
|
|
|
+ batchDelList: [],
|
|
|
+
|
|
|
+ isAddIndicsDiaShow:false,//单个添加至指标库弹窗
|
|
|
+ currentIndicData:{},//当前选中指标
|
|
|
+
|
|
|
+ //批量编辑
|
|
|
+ isBatchEditIndexDia: false,
|
|
|
+
|
|
|
+ /* 提示弹窗 */
|
|
|
+ isHintDialogShow: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getClassify();
|
|
|
+ this.getEdbList('init');
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* 批量入库 */
|
|
|
+ async handleBatchAddBase() {
|
|
|
+ let res = await this.getBatchEdbList()
|
|
|
+ if(!res.Data) return
|
|
|
+
|
|
|
+ const checkRes = await zhuochuangRedStageInterface.batchAddEdbCheck({IndexCodes:res.Data.map(_ => _.IndexCode)})
|
|
|
+ if(checkRes.Ret !== 200) return
|
|
|
+
|
|
|
+ const edbList = checkRes.Data||[]
|
|
|
+ this.batchDelList = [];
|
|
|
+ this.existEdbList = edbList.filter(i=>i.EdbExist===1)
|
|
|
+ this.addToBaseList = edbList.filter(i=>i.EdbExist===0)
|
|
|
+
|
|
|
+ this.existEdbList.length&&(this.isHintDialogShow=true)
|
|
|
+ !this.existEdbList.length&&this.handleCloseHintDia()
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 批量编辑 */
|
|
|
+ async handleBatchEdit() {
|
|
|
+ let res = await this.getBatchEdbList()
|
|
|
+ if(!res.Data) return
|
|
|
+
|
|
|
+ this.addToBaseList= res.Data;
|
|
|
+ this.isBatchEditIndexDia = true
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 批量删除 */
|
|
|
+ async handBatchDelEdb() {
|
|
|
+ this.addToBaseList= []
|
|
|
+ this.existEdbList= []
|
|
|
+
|
|
|
+ let res = await this.getBatchEdbList()
|
|
|
+ if(!res.Data) return
|
|
|
+
|
|
|
+ this.batchDelList = res.Data;
|
|
|
+ this.batchDelList.length&&(this.isHintDialogShow=true)
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ async handBatchDelApi() {
|
|
|
+ let res = await zhuochuangRedStageInterface.batchDelEdb(
|
|
|
+ this.batchDelList.map(_ => ({ BaseFromSciHqIndexId:_.BaseFromSciHqIndexId }))
|
|
|
+ )
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.$message.success(/* '删除成功!' */this.$t('MsgPrompt.delete_msg'));
|
|
|
+
|
|
|
+ if(res.Data&&res.Data.length){
|
|
|
+ let haveExistStr= res.Data.map(_ => (`${_.IndexName}(${_.IndexCode})`)).join('、')
|
|
|
+ this.$alert(`${haveExistStr}已加入指标库,不可删除,已过滤`,this.$t('Confirm.prompt'),{
|
|
|
+ confirmButtonText: '知道了',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.getClassify();
|
|
|
+ this.getEdbList()
|
|
|
+ },
|
|
|
+
|
|
|
+ //提示弹窗关闭
|
|
|
+ async handleCloseHintDia(){
|
|
|
+ this.isHintDialogShow = false
|
|
|
+
|
|
|
+ if(this.batchDelList.length) return this.handBatchDelApi()
|
|
|
+
|
|
|
+ //判断是否要展示下一个弹窗
|
|
|
+ if(!this.addToBaseList.length) return
|
|
|
+
|
|
|
+ if(this.addToBaseList.length>30) return this.$message.warning('批量添加指标数量不得超过30个!')
|
|
|
+
|
|
|
+ this.isAddToBaseDia = true
|
|
|
+ },
|
|
|
+
|
|
|
+ //跳转至指标详情
|
|
|
+ goToEdbBase(data){
|
|
|
+ if(!data.EdbInfoId) return
|
|
|
+
|
|
|
+ const {EdbClassifyId,EdbInfoId,EdbUniqueCode} = data||{}
|
|
|
+ const { href } = this.$router.resolve({
|
|
|
+ path:'/database',
|
|
|
+ query:{
|
|
|
+ code:EdbUniqueCode,
|
|
|
+ id:EdbInfoId,
|
|
|
+ classifyId:EdbClassifyId,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ window.open(href,"_blank")
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 获取所有批量操作的指标信息 */
|
|
|
+ async getBatchEdbList() {
|
|
|
+
|
|
|
+ if(!this.checkedList.length && !this.isSelectAll) return this.$message.warning('请选择指标')
|
|
|
+ return new Promise(async(resolve,reject) => {
|
|
|
+ const res = await zhuochuangRedStageInterface.searchEdbBatch({
|
|
|
+ ClassifyId: this.selectClassify,
|
|
|
+ Keyword: this.leftSearchVal,
|
|
|
+ SelectedId: this.checkedList.map(_=>Number(_.BaseFromSciHqIndexId)),
|
|
|
+ isSelectAll: this.isSelectAll
|
|
|
+ })
|
|
|
+
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ async searchHandle(query) {
|
|
|
+ if(!query) return
|
|
|
+
|
|
|
+ const res = await zhuochuangRedStageInterface.searchEdb({
|
|
|
+ Keyword: query
|
|
|
+ })
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.searchOptions = res.Data || []
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 指标操作 */
|
|
|
+ handleEdb({item,type}) {
|
|
|
+ const typeMap = {
|
|
|
+ 'edit': this.handleEditEdb,
|
|
|
+ 'addToBase': this.handleAddToBase,
|
|
|
+ 'clear': this.handleClear,
|
|
|
+ 'del': this.handleDelEdb
|
|
|
+ }
|
|
|
+
|
|
|
+ typeMap[type]&&typeMap[type](item)
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 编辑指标 */
|
|
|
+ handleEditEdb(item) {
|
|
|
+ this.openClassifyDia = true;
|
|
|
+ this.classifyForm = {
|
|
|
+ title: "编辑分类",
|
|
|
+ classify_name: '',
|
|
|
+ indexId: item.BaseFromSciHqIndexId,
|
|
|
+ classify_id: String(item.ClassifyId),
|
|
|
+ parent_classify_name:"",
|
|
|
+ parent_classify_id: 0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async handleEditEdbApi() {
|
|
|
+ const res = await zhuochuangRedStageInterface.edbEdit({
|
|
|
+ BaseFromSciHqIndexId: this.classifyForm.indexId,
|
|
|
+ ClassifyId: Number(this.classifyForm.classify_id)
|
|
|
+ })
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+ this.$message.success(/* "保存成功" */this.$t('MsgPrompt.saved_msg'));
|
|
|
+ this.cancelDialogHandle();
|
|
|
+
|
|
|
+ this.getClassify();
|
|
|
+ !this.selectEdb && this.getEdbList()
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 加入指标库 */
|
|
|
+ handleAddToBase(item){
|
|
|
+ //打开弹窗
|
|
|
+ this.currentIndicData = {
|
|
|
+ ...item,
|
|
|
+ FrequencyName: item.Frequency,
|
|
|
+ UnitName: item.Unit
|
|
|
+ }
|
|
|
+ this.isAddIndicsDiaShow = true
|
|
|
+ },
|
|
|
+
|
|
|
+ intoBaseBack() {
|
|
|
+ this.isAddIndicsDiaShow = false
|
|
|
+ if(this.selectedEdb){
|
|
|
+ this.$refs.edbDetailRef.getEdbDetail()
|
|
|
+ }else {
|
|
|
+ this.getEdbList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 清除 */
|
|
|
+ async handleClear(item) {
|
|
|
+ const res = await zhuochuangRedStageInterface.clearEdbClassify({
|
|
|
+ BaseFromSciHqIndexId: item.BaseFromSciHqIndexId
|
|
|
+ })
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.$message.success(this.$t('MsgPrompt.clean_classify_msg'));
|
|
|
+ this.getClassify();
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 删除指标 */
|
|
|
+ handleDelEdb(item) {
|
|
|
+
|
|
|
+ this.$confirm(
|
|
|
+ this.$t('ManualEdbListPage.del_edb_msg'),
|
|
|
+ this.$t('Dialog.warn_tit'),{
|
|
|
+ type:'warning'
|
|
|
+ }).then(async() => {
|
|
|
+ const res = await zhuochuangRedStageInterface.edbDel({
|
|
|
+ BaseFromSciHqIndexId:item.BaseFromSciHqIndexId
|
|
|
+ })
|
|
|
+
|
|
|
+ if( res.Ret !== 200 ) return
|
|
|
+ this.$message.success(/* '删除成功!' */this.$t('MsgPrompt.delete_msg'));
|
|
|
+ this.selectEdb = 0;
|
|
|
+ this.getClassify();
|
|
|
+ this.getEdbList()
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 获取分类 */
|
|
|
+ getClassify(params = null) {
|
|
|
+ zhuochuangRedStageInterface.classifyList().then((res) => {
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ this.classifyList = res.Data || [];
|
|
|
+ this.filterNodes(this.classifyList)
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.select_node = res.Data[0].UniqueCode
|
|
|
+ this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ filterNodes(arr) {
|
|
|
+ arr.length &&
|
|
|
+ arr.forEach((item) => {
|
|
|
+ item.ClassifyIdStr = String(item.ClassifyId)
|
|
|
+ item.disabled=(item.Level===1&&String(item.ClassifyId)!=='0'&&!item.Children.length)?true:false;
|
|
|
+ item.Children&&item.Children.length && this.filterNodes(item.Children);
|
|
|
+ if (!item.Children||!item.Children.length) {
|
|
|
+ delete item.Children;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //指标懒加载
|
|
|
+ async getLazyTreeData(node,resolve){
|
|
|
+ console.log(node)
|
|
|
+ let arr=[]
|
|
|
+ if(node.level===2||node.data.ClassifyIdStr==='0'){
|
|
|
+ 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(type='pageChange') {
|
|
|
+ const res = await zhuochuangRedStageInterface.getEdbList({
|
|
|
+ PageSize: this.page_size,
|
|
|
+ CurrentIndex: this.page_no,
|
|
|
+ ClassifyId: this.selectClassify
|
|
|
+ })
|
|
|
+
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.tableData =res.Data.List||[]
|
|
|
+ this.total = res.Data.Paging.Totals;
|
|
|
+
|
|
|
+ if(type==='filter'){
|
|
|
+ this.listCheckAllChange(true)
|
|
|
+ }else {
|
|
|
+ //页码变化 选中项不做清空
|
|
|
+ this.checkedSomeSelection()
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 设置当页数据勾选状态 */
|
|
|
+ checkedSomeSelection() {
|
|
|
+ this.selectionReactCancel=true
|
|
|
+
|
|
|
+ if(!this.isSelectAll){
|
|
|
+ this.checkedList.map(_ =>{
|
|
|
+ let row = this.tableData.find(item => item.IndexCode===_.IndexCode)
|
|
|
+ if(row){ //设置部分选中
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.$refs.table.toggleRowSelection(row,true)
|
|
|
+ },20)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$refs.table &&this.$refs.table.toggleAllSelection()
|
|
|
+ this.checkedList.map(_ =>{
|
|
|
+ let row = this.tableData.find(item => item.IndexCode===_.IndexCode)
|
|
|
+ if(row){ //设置部分不勾选
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.$refs.table.toggleRowSelection(row,false)
|
|
|
+ },20)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.selectionReactCancel=false
|
|
|
+ },30)
|
|
|
+ },
|
|
|
+
|
|
|
+ //列表全选或全不选
|
|
|
+ listCheckAllChange(value){
|
|
|
+ this.checkedList = []
|
|
|
+ this.isSelectAll = value
|
|
|
+ this.$refs.table && this.$refs.table.clearSelection()
|
|
|
+
|
|
|
+ value && this.$refs.table && this.$refs.table.toggleAllSelection()
|
|
|
+ },
|
|
|
+
|
|
|
+ selectionChange() {
|
|
|
+ if(this.selectionReactCancel) return
|
|
|
+
|
|
|
+ //设置全选框状态 选中 半选 不选
|
|
|
+ setTimeout(()=>{
|
|
|
+ let filterChecked = Array.from(new Set(this.checkedList))
|
|
|
+ //全选
|
|
|
+ if(
|
|
|
+ (filterChecked.length===this.total&&this.total>0 && (!this.isSelectAll))
|
|
|
+ || (filterChecked.length === 0 && this.isSelectAll)
|
|
|
+ ){
|
|
|
+ this.filterObj.checkAll = true
|
|
|
+ this.filterObj.checkSome = false
|
|
|
+ //不选
|
|
|
+ }else if(
|
|
|
+ (filterChecked.length === 0 && (!this.isSelectAll))
|
|
|
+ || (filterChecked.length === this.total && this.isSelectAll)
|
|
|
+ ){
|
|
|
+ this.filterObj.checkAll = false
|
|
|
+ this.filterObj.checkSome = false
|
|
|
+ //半选
|
|
|
+ }else{
|
|
|
+ this.filterObj.checkAll = false
|
|
|
+ this.filterObj.checkSome=true
|
|
|
+ }
|
|
|
+ },1)
|
|
|
+ },
|
|
|
+
|
|
|
+ //单选
|
|
|
+ selectHandle(selection,row){ //当前选中的项是进选中还是取消选中中
|
|
|
+ if(this.selectionReactCancel) return
|
|
|
+
|
|
|
+ //当前项是选中还是取消选
|
|
|
+ let haveChecked = selection.some(_ => _.IndexCode === row.IndexCode);
|
|
|
+
|
|
|
+ //全选取消选和不全选选中才有意义
|
|
|
+ if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
|
|
|
+ this.checkedList.push(row)
|
|
|
+ }else {
|
|
|
+ this.checkedList=this.checkedList.filter(_ => _.IndexCode!==row.IndexCode)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //整列选
|
|
|
+ selectAllPageHandle(selection){
|
|
|
+ if(this.selectionReactCancel) return
|
|
|
+
|
|
|
+ //当前页是选中还是取消
|
|
|
+ let haveChecked = selection && selection.length>0;
|
|
|
+
|
|
|
+ //全选取消选和不全选选中才有意义
|
|
|
+ if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
|
|
|
+ this.checkedList = [...this.checkedList,...this.tableData]
|
|
|
+ }else {
|
|
|
+
|
|
|
+ let pageIds = this.tableData.map(_ => _.IndexCode);
|
|
|
+ this.checkedList = this.checkedList.filter(_ => !pageIds.includes(_.IndexCode))
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ handlePageChange(page) {
|
|
|
+ this.page_no = page;
|
|
|
+ this.getEdbList()
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 改变节点 */
|
|
|
+ nodeChangeHandle(data, node) {
|
|
|
+
|
|
|
+ this.select_node = data.UniqueCode;
|
|
|
+ this.selectClassify = data.BaseFromSciHqIndexId?0:data.ClassifyId;
|
|
|
+ this.selectEdb = data.BaseFromSciHqIndexId;
|
|
|
+
|
|
|
+ if(!this.selectEdb){
|
|
|
+ this.page_no = 1;
|
|
|
+ this.getEdbList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 数据导出 */
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 编辑分类 */
|
|
|
+ async editClassifyHandle(
|
|
|
+ {
|
|
|
+ ClassifyId,
|
|
|
+ ClassifyName,
|
|
|
+ ClassifyNameEn,
|
|
|
+ ParentId,
|
|
|
+ BaseFromSciHqIndexId,
|
|
|
+ },
|
|
|
+ node
|
|
|
+ ) {
|
|
|
+ //分类
|
|
|
+ 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 : 0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 删除分类 */
|
|
|
+ delClassifyHandle(
|
|
|
+ { ClassifyId, BaseFromSciHqIndexId },
|
|
|
+ node
|
|
|
+ ) {
|
|
|
+ this.$confirm(
|
|
|
+ this.$t('SteelChemicalPage.del_classify_edb_msg'),
|
|
|
+ this.$t('Dialog.warn_tit'),
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ ).then(async () => {
|
|
|
+ let res = 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: "",
|
|
|
+ parent_classify_id: 0
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ cancelDialogHandle() {
|
|
|
+ this.$refs.classifyFormRef.clearValidate();
|
|
|
+ this.classifyForm = {
|
|
|
+ title: "添加分类",
|
|
|
+ classify_name: "",
|
|
|
+ parent_classify_name: "",
|
|
|
+ parent_classify_id: 0,
|
|
|
+ };
|
|
|
+ this.openClassifyDia = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 保存分类 */
|
|
|
+ async saveClassifyHandle() {
|
|
|
+ await this.$refs.classifyFormRef.validate();
|
|
|
+
|
|
|
+ if(this.classifyForm.indexId) return this.handleEditEdbApi();
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ ClassifyName: this.classifyForm.classify_name,
|
|
|
+ ParentId: this.classifyForm.parent_classify_id
|
|
|
+ };
|
|
|
+ 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;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 对[# ;]转义
|
|
|
+ escapeStr(str) {
|
|
|
+ return str.replace(/#/g, escape("#")).replace(/;/g, escape(";"));
|
|
|
+ },
|
|
|
+
|
|
|
+ // 树节点展开
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 判断节点是否能被拖入 */
|
|
|
+ canDropHandle(draggingNode, dropNode, type) {
|
|
|
+ let canDrop = false;
|
|
|
+ // 移动的是一级目录
|
|
|
+ if (draggingNode.level === 1 && dropNode.level === 1 &&type!=='inner') {
|
|
|
+ canDrop = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 二级
|
|
|
+ if (draggingNode.level === 2) {
|
|
|
+ if (
|
|
|
+ (dropNode.level === 1 && type === "inner") ||
|
|
|
+ (dropNode.level === 2 && type !== "inner")
|
|
|
+ ) {
|
|
|
+ canDrop = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //三级指标层
|
|
|
+ if(draggingNode.level===3){
|
|
|
+ if(
|
|
|
+ (dropNode.level===2&&type==='inner')||
|
|
|
+ (dropNode.level===3&&type!=='inner')
|
|
|
+ ) {
|
|
|
+ canDrop=true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return canDrop;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ /* 拖拽完成 */
|
|
|
+ dropOverHandle(b, a, i, e) {
|
|
|
+ // console.log(i, a);
|
|
|
+ // 被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置
|
|
|
+ // 一/二级目录
|
|
|
+ if ([1,2].includes(b.level)) this.handleMoveCatalogue(b, a, i, e);
|
|
|
+
|
|
|
+ // 指标层
|
|
|
+ if (b.level === 3) this.handleMoveEdb(b, a, i, e);
|
|
|
+ },
|
|
|
+
|
|
|
+ // 移动的为一二级目录
|
|
|
+ handleMoveCatalogue(b, a, i, e) {
|
|
|
+ let list = a.parent.childNodes,
|
|
|
+ targetIndex = 0,
|
|
|
+ PrevClassifyId = 0,
|
|
|
+ NextClassifyId = 0,
|
|
|
+ ParentClassifyId=0;
|
|
|
+
|
|
|
+ list.forEach((item, index) => {
|
|
|
+ if (item.data.ClassifyId === b.data.ClassifyId) {
|
|
|
+ targetIndex = index;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if(targetIndex===0){
|
|
|
+ PrevClassifyId=0
|
|
|
+ NextClassifyId=list[targetIndex+1].data.ClassifyId
|
|
|
+ }else if(targetIndex===list.length-1){
|
|
|
+ PrevClassifyId=list[targetIndex-1].data.ClassifyId
|
|
|
+ NextClassifyId=0
|
|
|
+ }else{
|
|
|
+ PrevClassifyId=list[targetIndex-1].data.ClassifyId
|
|
|
+ NextClassifyId=list[targetIndex+1].data.ClassifyId
|
|
|
+ }
|
|
|
+
|
|
|
+ if(b.level===2){
|
|
|
+ if(i==='inner'){
|
|
|
+ ParentClassifyId=a.data.ClassifyId
|
|
|
+ PrevClassifyId=0
|
|
|
+ NextClassifyId=a.data.Children.length>1?a.data.Children[1].ClassifyId:0
|
|
|
+ }else{
|
|
|
+ ParentClassifyId=a.data.ParentId
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ zhuochuangRedStageInterface.classifyMove({
|
|
|
+ ClassifyId: b.data.ClassifyId,
|
|
|
+ PrevClassifyId: PrevClassifyId,
|
|
|
+ NextClassifyId: NextClassifyId,
|
|
|
+ ParentClassifyId: ParentClassifyId
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ this.$message.success(this.$t('MsgPrompt.move_success_msg'));
|
|
|
+ this.getClassify();
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ // 移动指标
|
|
|
+ handleMoveEdb(b, a, i, e) {
|
|
|
+ let PrevEdbId = 0,
|
|
|
+ NextEdbId = 0,
|
|
|
+ targetIndex = 0,
|
|
|
+ list = a.parent.data.Children;
|
|
|
+ if (i === "inner") {
|
|
|
+ PrevEdbId = 0;
|
|
|
+ NextEdbId =
|
|
|
+ a.data.Children.length > 1 ? a.data.Children[1].BaseFromSciHqIndexId : 0;
|
|
|
+ } else {
|
|
|
+ list.forEach((item, index) => {
|
|
|
+ if (item.BaseFromSciHqIndexId === b.data.BaseFromSciHqIndexId) {
|
|
|
+ targetIndex = index;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (targetIndex === 0) {
|
|
|
+ PrevEdbId = 0;
|
|
|
+ NextEdbId = list[targetIndex + 1].BaseFromSciHqIndexId;
|
|
|
+ } else if (targetIndex === list.length - 1) {
|
|
|
+ PrevEdbId = list[targetIndex - 1].BaseFromSciHqIndexId;
|
|
|
+ NextEdbId = 0;
|
|
|
+ } else {
|
|
|
+ PrevEdbId = list[targetIndex - 1].BaseFromSciHqIndexId;
|
|
|
+ NextEdbId = list[targetIndex + 1].BaseFromSciHqIndexId;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ zhuochuangRedStageInterface.edbMove({
|
|
|
+ ClassifyId: a.data.ClassifyId,
|
|
|
+ BaseFromSciHqIndexId: b.data.BaseFromSciHqIndexId,
|
|
|
+ PrevBaseFromSciHqIndexId: PrevEdbId,
|
|
|
+ NextBaseFromSciHqIndexId: NextEdbId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ this.$message.success(this.$t('MsgPrompt.move_success_msg'));
|
|
|
+ this.getClassify();
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+};
|
|
|
+</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;
|
|
|
+ .right-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+.dialog-cont {
|
|
|
+ padding-left: 50px;
|
|
|
+}
|
|
|
+.dia-bot {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 50px;
|
|
|
+}
|
|
|
+.hint-dialog-wrap{
|
|
|
+ padding-bottom:30px;
|
|
|
+ .hint-list {
|
|
|
+ max-height: 350px;
|
|
|
+ overflow-y: auto;
|
|
|
+ li { margin-bottom: 10px; }
|
|
|
+ }
|
|
|
+ .hint-item{
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover{
|
|
|
+ color:#409EFF;
|
|
|
+ text-decoration: underline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</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>
|