|
@@ -0,0 +1,1365 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="lzzxData-container">
|
|
|
|
+ <div class="data-top-container">
|
|
|
|
+ <el-button
|
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.lzzxData_batchAddEdb"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="medium"
|
|
|
|
+ :loading="btnLoading"
|
|
|
|
+ @click="handleCheckEdb"
|
|
|
|
+ ><!-- 批量加入指标库 -->{{ $t("Edb.Detail.batch_add_edb") }}</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.lzzxData_exportExcel"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ size="medium"
|
|
|
|
+ :loading="exportLoading"
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ ><!-- 导出excel -->{{ $t("Common.exp_excel") }}</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-autocomplete
|
|
|
|
+ style="width: 443px; float: right"
|
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
|
+ v-model="search_txt"
|
|
|
|
+ :fetch-suggestions="handleSearch"
|
|
|
|
+ :trigger-on-focus="false"
|
|
|
|
+ :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
|
|
|
|
+ @select="handleSelect"
|
|
|
|
+ popper-class="el-autocomplete-suggestion-data-entry"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div v-if="scope.item.nodata" style="text-align: center">
|
|
|
|
+ <!-- 暂无数据 -->{{ $t("Table.prompt_slogan") }}
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ {{ scope.item.IndexName }}
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-autocomplete>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="lzzxData-inner-container" id="box">
|
|
|
|
+ <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" id="left" 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',
|
|
|
|
+ }"
|
|
|
|
+ :current-node-key="select_node"
|
|
|
|
+ :default-expanded-keys="defaultShowNodes"
|
|
|
|
+ :expand-on-click-node="false"
|
|
|
|
+ check-strictly
|
|
|
|
+ empty-text="暂无分类"
|
|
|
|
+ lazy
|
|
|
|
+ :load="getLazyTreeData"
|
|
|
|
+ @current-change="nodeChangeHandle"
|
|
|
|
+ >
|
|
|
|
+ <div class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
|
+ <span class="text_oneLine">{{
|
|
|
|
+ currentLang === "zh"
|
|
|
|
+ ? data.ClassifyName
|
|
|
|
+ : data.ClassifyNameEn || data.ClassifyName
|
|
|
|
+ }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </el-tree>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <span class="move-btn resize" v-drag id="resize"></span>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div
|
|
|
|
+ class="right-cont minHeight"
|
|
|
|
+ id="right"
|
|
|
|
+ :element-loading-text="$t('Table.data_loading')"
|
|
|
|
+ v-loading="dataloading"
|
|
|
|
+ >
|
|
|
|
+ <div class="tree-container" v-if="showType == 'tree'">
|
|
|
|
+ <div class="tree-header">
|
|
|
|
+ <span class="title-tip">{{
|
|
|
|
+ $t("EtaBasePage.total_show", { limit: treeDataMeta.total || 0 })
|
|
|
|
+ }}</span>
|
|
|
|
+ <el-checkbox
|
|
|
|
+ v-model="isCheckAll"
|
|
|
|
+ @change="listCheckAllChange"
|
|
|
|
+ :indeterminate="isIndeterminate"
|
|
|
|
+ ><!-- 列表全选 -->{{
|
|
|
|
+ $t("SystemManage.OperateAuth.all_select")
|
|
|
|
+ }}</el-checkbox
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div class="table-wrap">
|
|
|
|
+ <el-table
|
|
|
|
+ :data="tableTreeData"
|
|
|
|
+ ref="treeTable"
|
|
|
|
+ border
|
|
|
|
+ style="margin: 8px 0"
|
|
|
|
+ :row-style="{
|
|
|
|
+ cursor: permissionBtn.isShowBtn(
|
|
|
|
+ 'dataSourcePermission',
|
|
|
|
+ 'lzzxData_view'
|
|
|
|
+ )
|
|
|
|
+ ? 'pointer'
|
|
|
|
+ : 'default',
|
|
|
|
+ }"
|
|
|
|
+ @selection-change="selectionChange"
|
|
|
|
+ @select="selectHandle"
|
|
|
|
+ @select-all="selectAllHandle"
|
|
|
|
+ @row-click="rowClick"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-for="item in treeColumns"
|
|
|
|
+ :key="item.label"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :prop="item.key"
|
|
|
|
+ :width="item.widthsty"
|
|
|
|
+ :sortable="item.sortable ? true : false"
|
|
|
|
+ align="center"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <template v-if="item.key == 'Handle'">
|
|
|
|
+ <span
|
|
|
|
+ class="editsty"
|
|
|
|
+ v-if="
|
|
|
|
+ !row.EdbExist &&
|
|
|
|
+ permissionBtn.isShowBtn(
|
|
|
|
+ 'dataSourcePermission',
|
|
|
|
+ 'lzzxData_addEdb'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ @click.stop="checkAddEdb(row)"
|
|
|
|
+ >
|
|
|
|
+ <!-- 加入指标库 -->
|
|
|
|
+ {{ $t("YsDataPage.add_base_btn") }}
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <span v-else>{{ row[item.key] }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
|
|
+ <div slot="empty" style="padding: 100px 0">
|
|
|
|
+ <tableNoData :text="$t('Table.prompt_slogan')" size="mini" />
|
|
|
|
+ </div>
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+ <div style="height: 35px; margin: 20px 0px">
|
|
|
|
+ <el-pagination
|
|
|
|
+ layout="total,prev,pager,next,jumper"
|
|
|
|
+ background
|
|
|
|
+ :current-page="treeDataMeta.page"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ :page-size="treeDataMeta.pageSize"
|
|
|
|
+ :total="treeDataMeta.total"
|
|
|
|
+ style="float: right"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ v-else-if="showType == 'detail'"
|
|
|
|
+ class="tree-container tree-height"
|
|
|
|
+ v-infinite-scroll="loadUpdate"
|
|
|
|
+ :infinite-scroll-disabled="updateLoadingMore.isEnd"
|
|
|
|
+ infinite-scroll-distance="10"
|
|
|
|
+ infinite-scroll-immediate="false"
|
|
|
|
+ >
|
|
|
|
+ <div class="tree-header">
|
|
|
|
+ <span class="title-tip">{{ $t("Edb.Detail.edb_detail") }}</span>
|
|
|
|
+ <!-- 加入指标库 -->
|
|
|
|
+ <span
|
|
|
|
+ v-if="
|
|
|
|
+ !detailData.EdbExist &&
|
|
|
|
+ permissionBtn.isShowBtn(
|
|
|
|
+ 'dataSourcePermission',
|
|
|
|
+ 'lzzxData_addEdb'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ class="title-tip"
|
|
|
|
+ style="color: #0052d9; cursor: pointer"
|
|
|
|
+ @click="checkAddEdb(detailData)"
|
|
|
|
+ >{{ $t("ManualEdbListPage.add_tobase_btn") }}</span
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div class="table-wrap">
|
|
|
|
+ <el-table
|
|
|
|
+ :data="[detailData]"
|
|
|
|
+ ref="detailTable"
|
|
|
|
+ border
|
|
|
|
+ style="margin: 8px 0 0 0"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-for="item in detailColumns"
|
|
|
|
+ :key="item.label"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :prop="item.key"
|
|
|
|
+ :width="item.widthsty"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ v-if="detailData.DataList && detailData.DataList.length > 0"
|
|
|
|
+ class="table-wrap"
|
|
|
|
+ >
|
|
|
|
+ <el-table
|
|
|
|
+ :data="detailData.DataList"
|
|
|
|
+ ref="updateTable"
|
|
|
|
+ :show-header="false"
|
|
|
|
+ border
|
|
|
|
+ >
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-for="item in updateColumns"
|
|
|
|
+ :key="item.label"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :prop="item.key"
|
|
|
|
+ :width="item.widthsty"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div v-else class="nodata-cont">
|
|
|
|
+ <tableNoData :text="$t('Table.prompt_slogan')" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 添加到指标库弹窗 -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ v-if="addEdbDialog.show"
|
|
|
|
+ :title="$t('YsDataPage.add_base_btn')"
|
|
|
|
+ :visible.sync="addEdbDialog.show"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :modal-append-to-body="false"
|
|
|
|
+ @close="addEdbDialog.show = false"
|
|
|
|
+ width="556px"
|
|
|
|
+ v-dialogDrag
|
|
|
|
+ center
|
|
|
|
+ >
|
|
|
|
+ <div style="box-sizing: border-box; padding: 15px 35px">
|
|
|
|
+ <el-form
|
|
|
|
+ ref="addEdbForm"
|
|
|
|
+ :model="addEdbDialog.data"
|
|
|
|
+ label-width="88px"
|
|
|
|
+ label-position="left"
|
|
|
|
+ :rules="addEdbDialogRules"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item prop="IndexName" :label="$t('Edb.Detail.e_name')">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="addEdbDialog.data.IndexName"
|
|
|
|
+ clearable
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ :placeholder="
|
|
|
|
+ $t('Edb.InputHolderAll.input_common', {
|
|
|
|
+ label: this.$t('Edb.Detail.e_name'),
|
|
|
|
+ })
|
|
|
|
+ "
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item :label="$t('Edb.Detail.e_menu')" prop="Classify_Id">
|
|
|
|
+ <el-cascader
|
|
|
|
+ v-model="addEdbDialog.data.Classify_Id"
|
|
|
|
+ :placeholder="$t('Edb.InputHolderAll.input_menu')"
|
|
|
|
+ :options="edbCatalogList"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ :props="{
|
|
|
|
+ label: 'ClassifyName',
|
|
|
|
+ value: 'ClassifyId',
|
|
|
|
+ children: 'Children',
|
|
|
|
+ checkStrictly: true,
|
|
|
|
+ emitPath: false,
|
|
|
|
+ }"
|
|
|
|
+ ></el-cascader>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item :label="$t('Edb.Detail.e_fre')" prop="Frequency">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="addEdbDialog.data.Frequency"
|
|
|
|
+ :placeholder="$t('Edb.InputHolderAll.input_fre')"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="i in frequencyList"
|
|
|
|
+ :key="i.label"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ :label="i.label"
|
|
|
|
+ :value="i.value"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item :label="$t('Edb.Detail.e_unit')" prop="Unit">
|
|
|
|
+ <selectUnit v-model="addEdbDialog.data.Unit" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div style="text-align: center; margin-bottom: 30px">
|
|
|
|
+ <el-button @click="addEdbDialog.show = false" style="width: 120px">{{
|
|
|
|
+ $t("Dialog.cancel_btn")
|
|
|
|
+ }}</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="handleAddEdb"
|
|
|
|
+ :loading="btnLoading"
|
|
|
|
+ style="width: 120px"
|
|
|
|
+ >{{ $t("Dialog.confirm_save_btn") }}</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 批量加入指标库弹框 -->
|
|
|
|
+ <batchAddToEdbDialog
|
|
|
|
+ ref="batchAddToEdbDialog"
|
|
|
|
+ :isShow.sync="batchAddDialog.show"
|
|
|
|
+ :list="batchAddDialog.addToBaseList"
|
|
|
|
+ @handleCheckName="handleCheckName"
|
|
|
|
+ ></batchAddToEdbDialog>
|
|
|
|
+
|
|
|
|
+ <!-- 操作提示弹窗 -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ :title="$t('BloombergPage.operation_prompt')"
|
|
|
|
+ :visible.sync="isHintDialog.show"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :modal-append-to-body="false"
|
|
|
|
+ @close="isHintDialog.show = false"
|
|
|
|
+ width="578px"
|
|
|
|
+ v-dialogDrag
|
|
|
|
+ center
|
|
|
|
+ >
|
|
|
|
+ <div class="hint-dialog-wrap">
|
|
|
|
+ <p style="margin-bottom: 20px">{{ hintText }}</p>
|
|
|
|
+ <ul class="hint-dialog-content">
|
|
|
|
+ <li
|
|
|
|
+ v-for="(item, index) in isHintDialog.existEdbList"
|
|
|
|
+ :key="index"
|
|
|
|
+ class="hint-item"
|
|
|
|
+ @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">{{
|
|
|
|
+ $t("Dialog.known")
|
|
|
|
+ }}</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import leftMixin from "./mixins/leftMixin.js";
|
|
|
|
+import { frequencySelectList } from "@/utils/defaultOptions";
|
|
|
|
+import { dataBaseInterface } from "@/api/api.js";
|
|
|
|
+import batchAddToEdbDialog from "./components/batchAddToEdbDialog.vue";
|
|
|
|
+import { lzzxInterface } from "@/api/modules/thirdBaseApi";
|
|
|
|
+import http from "@/api/http.js";
|
|
|
|
+import axios from "axios";
|
|
|
|
+export default {
|
|
|
|
+ mixins: [leftMixin],
|
|
|
|
+ components: { batchAddToEdbDialog },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ exportUrl: "/entry/data/export/oilchemList", //数据导出接口,
|
|
|
|
+ isLeftWrapShow: true,
|
|
|
|
+ search_txt: "", //搜索框内容
|
|
|
|
+ classifyList: [], //分类
|
|
|
|
+ dataloading: false,
|
|
|
|
+ btnLoading: false,
|
|
|
|
+ exportLoading: false,
|
|
|
|
+ select_classify: "", //选中的classifyid
|
|
|
|
+ index_code: "", //选中的indexCode
|
|
|
|
+ showType: "", //tree目录表格 detail详情
|
|
|
|
+ edbCatalogList: [], //指标目录
|
|
|
|
+
|
|
|
|
+ isIndeterminate: false,
|
|
|
|
+ isCheckAll: false, //与isIndeterminate一起表示列表全选的状态
|
|
|
|
+ isSelectAll: false, //是否勾选了列表全选:为true时,selectList是剔除的指标,为false时selectList是已选择的指标
|
|
|
|
+ selectList: [], //已选择/已剔除的指标id
|
|
|
|
+ selectionReactCancel: false, //select-事件触发时,为true;该事件触发完成后,为false;
|
|
|
|
+
|
|
|
|
+ tableTreeData: [], //目录表格数据
|
|
|
|
+ treeDataMeta: {
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ page: 1,
|
|
|
|
+ total: 0,
|
|
|
|
+ }, //目录分页信息
|
|
|
|
+ addEdbDialog: {
|
|
|
|
+ //添加指标库
|
|
|
|
+ title: "加入指标库",
|
|
|
|
+ show: false,
|
|
|
|
+ data: {},
|
|
|
|
+ },
|
|
|
|
+ isHintDialog: {
|
|
|
|
+ //筛选掉的弹框
|
|
|
|
+ show: false,
|
|
|
|
+ existEdbList: [],
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ batchAddDialog: {
|
|
|
|
+ //批量加入指标库
|
|
|
|
+ show: false,
|
|
|
|
+ addToBaseList: [],
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ detailData: {
|
|
|
|
+ DataList: [],
|
|
|
|
+ }, //详情信息
|
|
|
|
+ updateLoadingMore: {
|
|
|
|
+ isLoading: false,
|
|
|
|
+ isEnd: false,
|
|
|
|
+ page: 1,
|
|
|
|
+ pageSize: 30,
|
|
|
|
+ }, //加载更多更新信息
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ computed: {
|
|
|
|
+ treeColumns() {
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_id"),
|
|
|
|
+ key: "IndexCode",
|
|
|
|
+ widthsty: "190px",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_name"),
|
|
|
|
+ key: "IndexName",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_fre"),
|
|
|
|
+ key: "Frequency",
|
|
|
|
+ widthsty: "117px",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_unit"),
|
|
|
|
+ key: "Unit",
|
|
|
|
+ widthsty: "117px",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: /* '最新日期' */ this.$t("Chart.option_date_type_new"),
|
|
|
|
+ key: "DataTime",
|
|
|
|
+ widthsty: "127px",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: /* '最新值' */ this.$t("Edb.Detail.e_latest_value"),
|
|
|
|
+ key: "Value",
|
|
|
|
+ widthsty: "117px",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Table.column_operations"),
|
|
|
|
+ key: "Handle",
|
|
|
|
+ widthsty: "180px",
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ },
|
|
|
|
+ detailColumns() {
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_id"),
|
|
|
|
+ key: "IndexCode",
|
|
|
|
+ widthsty: "230px",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_name"),
|
|
|
|
+ key: "IndexName",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_fre"),
|
|
|
|
+ key: "Frequency",
|
|
|
|
+ widthsty: "140px",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_unit"),
|
|
|
|
+ key: "Unit",
|
|
|
|
+ widthsty: "140px",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: /* '更新时间' */ this.$t("Edb.Detail.e_update_time"),
|
|
|
|
+ key: "ModifyTime",
|
|
|
|
+ widthsty: "280px",
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ },
|
|
|
|
+ updateColumns() {
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_update_time"),
|
|
|
|
+ key: "DataTime",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: this.$t("Edb.Detail.e_update_data"),
|
|
|
|
+ key: "Value",
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ },
|
|
|
|
+ hintText() {
|
|
|
|
+ let key = 0;
|
|
|
|
+ if (this.isHintDialog.existEdbList.length) key++;
|
|
|
|
+ if (!this.batchAddDialog.addToBaseList.length) key++;
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ 0: "",
|
|
|
|
+ 1: this.$t("YsDataPage.haved_some_msg"), //指标库中已存在以下指标,会自动过滤!
|
|
|
|
+ 2: this.$t("YsDataPage.haved_all_msg"), //本次添加的指标均已在指标库中,请勿重复添加!
|
|
|
|
+ }[key];
|
|
|
|
+ },
|
|
|
|
+ //添加指标库
|
|
|
|
+ addEdbDialogRules() {
|
|
|
|
+ return {
|
|
|
|
+ IndexName: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t("Edb.InputHolderAll.input_common", {
|
|
|
|
+ label: this.$t("Edb.Detail.e_name"),
|
|
|
|
+ }),
|
|
|
|
+ trigger: "blur",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ Frequency: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t("Edb.InputHolderAll.input_fre"),
|
|
|
|
+ trigger: "blur",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ Unit: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t("Edb.InputHolderAll.input_unit"),
|
|
|
|
+ trigger: "blur",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ Classify_Id: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t("Edb.InputHolderAll.input_menu"),
|
|
|
|
+ trigger: "blur",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ frequencyList() {
|
|
|
|
+ return frequencySelectList();
|
|
|
|
+ },
|
|
|
|
+ currentLang() {
|
|
|
|
+ return this.$store.state.lang;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ created() {
|
|
|
|
+ this.getClassify(); //获取分类
|
|
|
|
+ this.getEdbCatalog(); //获取指标库目录
|
|
|
|
+ this.initTableData(); //默认展示全部指标
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ methods: {
|
|
|
|
+ /* 获取分类 */
|
|
|
|
+ getClassify() {
|
|
|
|
+ lzzxInterface.classifyList().then((res) => {
|
|
|
|
+ if (res.Ret != 200) return;
|
|
|
|
+ res.Data.map((item) => {
|
|
|
|
+ item.UniqueCode = `lzzxclassify_${item.BaseFromOilchemClassifyId}_${item.ParentID}`;
|
|
|
|
+ item.Children = [];
|
|
|
|
+ });
|
|
|
|
+ this.classifyList = res.Data || [];
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //默认展示全部指标
|
|
|
|
+ initTableData() {
|
|
|
|
+ this.showType = "tree";
|
|
|
|
+ this.select_node = null;
|
|
|
|
+ this.select_classify = "";
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
|
|
+ //获取指标表格
|
|
|
|
+ getTableData() {
|
|
|
|
+ this.dataloading = true;
|
|
|
|
+ let p = {
|
|
|
|
+ CurrentIndex: this.treeDataMeta.page,
|
|
|
|
+ PageSize: this.treeDataMeta.pageSize,
|
|
|
|
+ ClassifyId: this.select_classify || 0,
|
|
|
|
+ };
|
|
|
|
+ lzzxInterface
|
|
|
|
+ .indexList(p)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.dataloading = false;
|
|
|
|
+ this.tableTreeData = res.Data.List || [];
|
|
|
|
+ this.treeDataMeta.page = res.Data.Paging.CurrentIndex;
|
|
|
|
+ this.treeDataMeta.total = res.Data.Paging.Totals;
|
|
|
|
+ this.adjustSelection(); //表格跨页多选的判断
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.dataloading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ async handleCheckEdb() {
|
|
|
|
+ if (!this.selectList.length && !this.isSelectAll)
|
|
|
|
+ return this.$message.warning(
|
|
|
|
+ this.$t("Edb.InputHolderAll.input_select_edb")
|
|
|
|
+ );
|
|
|
|
+ this.btnLoading = true;
|
|
|
|
+ let IndexCodes = [];
|
|
|
|
+ if (this.isSelectAll) {
|
|
|
|
+ let result = await lzzxInterface.indexList({
|
|
|
|
+ CurrentIndex: 1,
|
|
|
|
+ PageSize: 99999,
|
|
|
|
+ ClassifyId: this.select_classify || 0,
|
|
|
|
+ });
|
|
|
|
+ if (result.Ret != 200) return (this.btnLoading = false);
|
|
|
|
+ if (this.selectList && this.selectList.length > 0) {
|
|
|
|
+ let r = this.selectList.map((_) => _.IndexCode);
|
|
|
|
+ IndexCodes = result.Data.List.filter(
|
|
|
|
+ (_) => !r.includes(_.IndexCode)
|
|
|
|
+ ).map((_) => _.IndexCode);
|
|
|
|
+ } else {
|
|
|
|
+ IndexCodes = result.Data.List.map((_) => _.IndexCode);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ IndexCodes = this.selectList.map((_) => _.IndexCode);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ lzzxInterface
|
|
|
|
+ .addCheck({
|
|
|
|
+ //接口没有全选 需要前置处理
|
|
|
|
+ IndexCodes,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.btnLoading = false;
|
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
|
+ const edbList = res.Data || [];
|
|
|
|
+ this.isHintDialog.existEdbList = edbList.filter(
|
|
|
|
+ (i) => i.EdbExist === 1
|
|
|
|
+ );
|
|
|
|
+ this.batchAddDialog.addToBaseList = edbList.filter(
|
|
|
|
+ (i) => i.EdbExist === 0
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ this.isHintDialog.existEdbList.length &&
|
|
|
|
+ (this.isHintDialog.show = true);
|
|
|
|
+ !this.isHintDialog.existEdbList.length && this.handleCloseHintDia();
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.btnLoading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ async handleExport() {
|
|
|
|
+ this.exportLoading = true;
|
|
|
|
+ let params = {
|
|
|
|
+ IndexCode: this.showType == "tree" ? [] : [this.detailData.IndexCode],
|
|
|
|
+ ClassifyId: this.showType == "tree" ? this.select_classify || 0 : 0,
|
|
|
|
+ IsSelectedAll: this.showType == "tree",
|
|
|
|
+ };
|
|
|
|
+ axios({
|
|
|
|
+ //导出excel
|
|
|
|
+ method: "post",
|
|
|
|
+ url: this.exportUrl,
|
|
|
|
+ baseURL: process.env.VUE_APP_API_ROOT,
|
|
|
|
+ data: params,
|
|
|
|
+ timeout: 600000,
|
|
|
|
+ headers: { "Content-Type": "application/json; charset=utf-8" },
|
|
|
|
+ responseType: "blob",
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.exportLoading = false;
|
|
|
|
+ const blob = new Blob([res.data], {
|
|
|
|
+ type: "application/vnd.ms-excel;charset=utf-8",
|
|
|
|
+ });
|
|
|
|
+ let fileName =
|
|
|
|
+ "隆众资讯" + http.dateFormatter(new Date(), false) + ".xlsx";
|
|
|
|
+ if (this.showType != "tree")
|
|
|
|
+ fileName =
|
|
|
|
+ this.detailData.IndexName +
|
|
|
|
+ http.dateFormatter(new Date(), false) +
|
|
|
|
+ ".xlsx";
|
|
|
|
+
|
|
|
|
+ const elink = document.createElement("a");
|
|
|
|
+ elink.download = fileName; //命名下载名称
|
|
|
|
+ elink.style.display = "none";
|
|
|
|
+ elink.href = URL.createObjectURL(blob);
|
|
|
|
+ document.body.appendChild(elink);
|
|
|
|
+ elink.click(); // 点击下载
|
|
|
|
+ URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
|
|
+ document.body.removeChild(elink); // 释放标
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.exportLoading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //搜索
|
|
|
|
+ async handleSearch(query, cb) {
|
|
|
|
+ //2.0.6 搜索
|
|
|
|
+ if (!query) return;
|
|
|
|
+ const res = await lzzxInterface.indexSearch({
|
|
|
|
+ Keyword: query,
|
|
|
|
+ });
|
|
|
|
+ if (res.Ret === 200) {
|
|
|
|
+ let arr = res.Data || [];
|
|
|
|
+ if (!arr.length) {
|
|
|
|
+ cb([{ nodata: true }]);
|
|
|
|
+ } else {
|
|
|
|
+ cb(arr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 选中搜索值
|
|
|
|
+ handleSelect(e) {
|
|
|
|
+ if (!e.IndexCode) return;
|
|
|
|
+
|
|
|
|
+ this.select_node = `${e.IndexCode}_${e.BaseFromOilchemIndexId}_${e.ClassifyId}`;
|
|
|
|
+ let _ = this.classifyList.find(
|
|
|
|
+ (item) => item.BaseFromOilchemClassifyId == e.ClassifyId
|
|
|
|
+ );
|
|
|
|
+ let params = {
|
|
|
|
+ code: this.select_node,
|
|
|
|
+ selectClassifyNodes: [_.UniqueCode],
|
|
|
|
+ };
|
|
|
|
+ this.selectCurrentNode(params);
|
|
|
|
+ this.select_classify = e.ClassifyId;
|
|
|
|
+ this.index_code = e.IndexCode;
|
|
|
|
+
|
|
|
|
+ this.nodeChangeInit();
|
|
|
|
+ this.search_txt = e.IndexName;
|
|
|
|
+ this.showType = "detail";
|
|
|
|
+ this.getDetailData();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 改变节点 */
|
|
|
|
+ nodeChangeHandle(data, node) {
|
|
|
|
+ if (this.dataloading)
|
|
|
|
+ return this.$message(this.$t("MsgPrompt.request_frequency"));
|
|
|
|
+
|
|
|
|
+ //如果点击的是目录
|
|
|
|
+ if (node.level == 1) {
|
|
|
|
+ this.select_node = data.UniqueCode;
|
|
|
|
+ this.index_code = "";
|
|
|
|
+ this.nodeChangeInit();
|
|
|
|
+ this.select_classify = data.BaseFromOilchemClassifyId;
|
|
|
|
+ this.showType = "tree";
|
|
|
|
+ this.getTableData();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //如果点击的是指标 并且有权限
|
|
|
|
+ if (
|
|
|
|
+ node.level != 1 &&
|
|
|
|
+ this.permissionBtn.isShowBtn("dataSourcePermission", "lzzxData_view")
|
|
|
|
+ ) {
|
|
|
|
+ this.select_node = data.UniqueCode;
|
|
|
|
+ this.index_code = data.IndexCode;
|
|
|
|
+ this.nodeChangeInit();
|
|
|
|
+ this.select_classify = data.ClassifyId;
|
|
|
|
+ this.showType = "detail";
|
|
|
|
+ this.getDetailData();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //el-tree的懒加载
|
|
|
|
+ async getLazyTreeData(node, resolve) {
|
|
|
|
+ let arr = [];
|
|
|
|
+ if (node.level == 1) {
|
|
|
|
+ let result = await lzzxInterface.indexList({
|
|
|
|
+ ClassifyId: node.data.BaseFromOilchemClassifyId,
|
|
|
|
+ PageSize: 99999,
|
|
|
|
+ CurrentIndex: 1,
|
|
|
|
+ });
|
|
|
|
+ if (result.Ret != 200) return;
|
|
|
|
+ result.Data.List &&
|
|
|
|
+ result.Data.List.map((item) => {
|
|
|
|
+ item.UniqueCode = `${item.IndexCode}_${item.BaseFromOilchemIndexId}_${item.ClassifyId}`;
|
|
|
|
+ item.Children = null;
|
|
|
|
+ item.isLeaf = true;
|
|
|
|
+ item.ClassifyName = item.IndexName;
|
|
|
|
+ });
|
|
|
|
+ arr = result.Data.List || [];
|
|
|
|
+ } else {
|
|
|
|
+ arr = node.data.Children || [];
|
|
|
|
+ }
|
|
|
|
+ resolve(arr);
|
|
|
|
+ },
|
|
|
|
+ //切换点击时的初始化
|
|
|
|
+ nodeChangeInit() {
|
|
|
|
+ this.search_txt = "";
|
|
|
|
+ this.isIndeterminate = false;
|
|
|
|
+ this.isCheckAll = false;
|
|
|
|
+ this.isSelectAll = false;
|
|
|
|
+ this.selectList = [];
|
|
|
|
+ this.selectionReactCancel = false;
|
|
|
|
+ this.treeDataMeta.page = 1;
|
|
|
|
+ this.treeDataMeta.total = 0;
|
|
|
|
+ this.detailData = { DataList: [] };
|
|
|
|
+ this.updateLoadingMore.isEnd = false;
|
|
|
|
+ this.updateLoadingMore.page = 1;
|
|
|
|
+ $("#right")[0].scrollTop = 0;
|
|
|
|
+ },
|
|
|
|
+ adjustSelection() {
|
|
|
|
+ this.selectionReactCancel = true;
|
|
|
|
+ if (!this.isSelectAll) {
|
|
|
|
+ this.selectList.map((_) => {
|
|
|
|
+ let row = this.tableTreeData.find(
|
|
|
|
+ (item) => item.IndexCode == _.IndexCode
|
|
|
|
+ );
|
|
|
|
+ if (row) {
|
|
|
|
+ //设置部分选中
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.$refs.treeTable.toggleRowSelection(row, true);
|
|
|
|
+ }, 20);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.treeTable && this.$refs.treeTable.toggleAllSelection();
|
|
|
|
+ this.selectList.map((_) => {
|
|
|
|
+ let row = this.tableTreeData.find(
|
|
|
|
+ (item) => item.IndexCode == _.IndexCode
|
|
|
|
+ );
|
|
|
|
+ if (row) {
|
|
|
|
+ //设置部分不勾选
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.$refs.treeTable.toggleRowSelection(row, false);
|
|
|
|
+ }, 20);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.selectionReactCancel = false;
|
|
|
|
+ }, 30);
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange(page) {
|
|
|
|
+ $("#right")[0].scrollTop = 0;
|
|
|
|
+ this.treeDataMeta.page = page;
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
|
|
+ checkAddEdb(row) {
|
|
|
|
+ this.addEdbDialog.data = Object.assign({}, row, { Classify_Id: "" });
|
|
|
|
+ this.addEdbDialog.show = true;
|
|
|
|
+ },
|
|
|
|
+ async handleAddEdb() {
|
|
|
|
+ const { Classify_Id, Frequency, IndexName, IndexCode, Unit } =
|
|
|
|
+ this.addEdbDialog.data;
|
|
|
|
+
|
|
|
|
+ this.$refs.addEdbForm.validate(async (valid) => {
|
|
|
|
+ if (!valid) return;
|
|
|
|
+
|
|
|
|
+ this.btnLoading = true;
|
|
|
|
+ // 名称检测
|
|
|
|
+ let result = await lzzxInterface.nameCheck([
|
|
|
|
+ { EdbCode: IndexCode, EdbName: IndexName },
|
|
|
|
+ ]);
|
|
|
|
+ if (result.Ret != 200) return (this.btnLoading = false);
|
|
|
|
+ if (result.Data && result.Data.length > 0 && result.Data[0].Exist) {
|
|
|
|
+ this.btnLoading = false;
|
|
|
|
+ return this.$message.warning(
|
|
|
|
+ this.$t("BloombergPage.add_edb_check_hint2")
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //修改接口
|
|
|
|
+ lzzxInterface
|
|
|
|
+ .batchAdd([
|
|
|
|
+ {
|
|
|
|
+ EdbCode: IndexCode,
|
|
|
|
+ EdbName: IndexName,
|
|
|
|
+ Frequency: Frequency,
|
|
|
|
+ Unit: Unit,
|
|
|
|
+ ClassifyId: Classify_Id,
|
|
|
|
+ },
|
|
|
|
+ ])
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.btnLoading = false;
|
|
|
|
+ if (res.Ret != 200) return;
|
|
|
|
+ this.addEdbDialog.show = false;
|
|
|
|
+ this.$message.success(this.$t("MsgPrompt.add_msg2"));
|
|
|
|
+ if (this.showType == "tree") {
|
|
|
|
+ this.getTableData();
|
|
|
|
+ } else {
|
|
|
|
+ this.nodeChangeInit();
|
|
|
|
+ this.getDetailData();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.btnLoading = false;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ loadUpdate() {
|
|
|
|
+ if (this.updateLoadingMore.isLoading) return;
|
|
|
|
+ this.updateLoadingMore.page += 1;
|
|
|
|
+ this.getDetailData();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getDetailData() {
|
|
|
|
+ //获取详情信息
|
|
|
|
+ this.dataloading = true;
|
|
|
|
+ this.updateLoadingMore.isLoading = true;
|
|
|
|
+ lzzxInterface
|
|
|
|
+ .dataList({
|
|
|
|
+ PageSize: this.updateLoadingMore.pageSize,
|
|
|
|
+ CurrentIndex: this.updateLoadingMore.page,
|
|
|
|
+ ClassifyId: this.select_classify,
|
|
|
|
+ IndexCode: this.index_code,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.dataloading = false;
|
|
|
|
+ this.updateLoadingMore.isLoading = false;
|
|
|
|
+ if (res.Ret != 200) return;
|
|
|
|
+ this.detailData.IndexCode = res.Data.IndexCode;
|
|
|
|
+ this.detailData.IndexName = res.Data.IndexName;
|
|
|
|
+ this.detailData.Frequency = res.Data.Frequency;
|
|
|
|
+ this.detailData.Unit = res.Data.Unit;
|
|
|
|
+ this.detailData.ModifyTime = res.Data.ModifyTime;
|
|
|
|
+ this.detailData.EdbExist = res.Data.EdbExist;
|
|
|
|
+ this.detailData.DataList = this.detailData.DataList.concat(
|
|
|
|
+ res.Data.DataList || []
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ this.updateLoadingMore.page = res.Data.Paging.CurrentIndex;
|
|
|
|
+ this.updateLoadingMore.isEnd = res.Data.Paging.IsEnd;
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.dataloading = false;
|
|
|
|
+ this.updateLoadingMore.isLoading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ listCheckAllChange(value) {
|
|
|
|
+ this.selectList = [];
|
|
|
|
+ this.isSelectAll = value;
|
|
|
|
+ this.$refs.treeTable && this.$refs.treeTable.clearSelection();
|
|
|
|
+ if (value) {
|
|
|
|
+ this.$refs.treeTable && this.$refs.treeTable.toggleAllSelection();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ selectHandle(selection, row) {
|
|
|
|
+ if (this.selectionReactCancel) return;
|
|
|
|
+ //当前项是选中还是取消选
|
|
|
|
+ let haveChecked = selection.some((_) => _.IndexCode === row.IndexCode);
|
|
|
|
+
|
|
|
|
+ //全选取消选和不全选选中才有意义
|
|
|
|
+ if (
|
|
|
|
+ (haveChecked && !this.isSelectAll) ||
|
|
|
|
+ (!haveChecked && this.isSelectAll)
|
|
|
|
+ ) {
|
|
|
|
+ this.selectList.push(row);
|
|
|
|
+ } else {
|
|
|
|
+ this.selectList = this.selectList.filter(
|
|
|
|
+ (_) => _.IndexCode !== row.IndexCode
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ selectAllHandle(selection) {
|
|
|
|
+ if (this.selectionReactCancel) return;
|
|
|
|
+ //当前页是选中还是取消
|
|
|
|
+ let haveChecked = selection && selection.length > 0;
|
|
|
|
+
|
|
|
|
+ //全选取消选和不全选选中才有意义
|
|
|
|
+ if (
|
|
|
|
+ (haveChecked && !this.isSelectAll) ||
|
|
|
|
+ (!haveChecked && this.isSelectAll)
|
|
|
|
+ ) {
|
|
|
|
+ this.selectList = [...this.selectList, ...this.tableTreeData]; //这里没去重,去重在selectionChange中
|
|
|
|
+ } else {
|
|
|
|
+ let pageIds = this.tableTreeData.map((_) => _.IndexCode);
|
|
|
|
+ this.selectList = this.selectList.filter(
|
|
|
|
+ (_) => !pageIds.includes(_.IndexCode)
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ selectionChange() {
|
|
|
|
+ if (this.selectionReactCancel) return;
|
|
|
|
+ // selectAllHandle的触发在selectionChange后面,将selectionChange的逻辑延迟一下
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ // 去重
|
|
|
|
+ this.selectList = this.selectList.filter((item, index, arr) => {
|
|
|
|
+ return arr.findIndex((_) => _.IndexCode == item.IndexCode) == index;
|
|
|
|
+ });
|
|
|
|
+ //isSelectAll为true时,selectList表示需要剔除的项
|
|
|
|
+ //isSelectAll为false时,selectList表示需要勾选的项
|
|
|
|
+ //全选
|
|
|
|
+ if (
|
|
|
|
+ (this.selectList.length == this.treeDataMeta.total &&
|
|
|
|
+ this.treeDataMeta.total > 0 &&
|
|
|
|
+ !this.isSelectAll) ||
|
|
|
|
+ (this.selectList.length == 0 && this.isSelectAll)
|
|
|
|
+ ) {
|
|
|
|
+ this.isCheckAll = true;
|
|
|
|
+ this.isIndeterminate = false;
|
|
|
|
+ //全不选
|
|
|
|
+ } else if (
|
|
|
|
+ (this.selectList.length == 0 && !this.isSelectAll) ||
|
|
|
|
+ (this.selectList.length == this.treeDataMeta.total &&
|
|
|
|
+ this.isSelectAll)
|
|
|
|
+ ) {
|
|
|
|
+ this.isCheckAll = false;
|
|
|
|
+ this.isIndeterminate = false;
|
|
|
|
+ //半选
|
|
|
|
+ } else {
|
|
|
|
+ this.isCheckAll = false;
|
|
|
|
+ this.isIndeterminate = true;
|
|
|
|
+ }
|
|
|
|
+ }, 1);
|
|
|
|
+ },
|
|
|
|
+ rowClick(data, column) {
|
|
|
|
+ if (column.type == "selection") return;
|
|
|
|
+ if (
|
|
|
|
+ this.permissionBtn.isShowBtn("dataSourcePermission", "lzzxData_view")
|
|
|
|
+ ) {
|
|
|
|
+ this.nodeChangeInit();
|
|
|
|
+ this.select_node = data.UniqueCode;
|
|
|
|
+ this.select_classify = data.ClassifyId;
|
|
|
|
+ this.index_code = data.IndexCode;
|
|
|
|
+
|
|
|
|
+ this.showType = "detail";
|
|
|
|
+ this.getDetailData();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //获取指标目录
|
|
|
|
+ getEdbCatalog() {
|
|
|
|
+ dataBaseInterface.menuListV3().then((res) => {
|
|
|
|
+ if (res.Ret === 200) {
|
|
|
|
+ this.edbCatalogList = res.Data.AllNodes || [];
|
|
|
|
+ this.filterNodes(this.edbCatalogList);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ filterNodes(arr) {
|
|
|
|
+ arr.length &&
|
|
|
|
+ arr.forEach((item) => {
|
|
|
|
+ item.Children.length && this.filterNodes(item.Children);
|
|
|
|
+ if (!item.Children.length) {
|
|
|
|
+ item.Children = null;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //提示弹窗关闭
|
|
|
|
+ handleCloseHintDia() {
|
|
|
|
+ this.isHintDialog.show = false;
|
|
|
|
+ //判断是否要展示下一个弹窗
|
|
|
|
+ if (!this.batchAddDialog.addToBaseList.length) return;
|
|
|
|
+
|
|
|
|
+ if (this.batchAddDialog.addToBaseList.length > 30)
|
|
|
|
+ return this.$message.warning(this.$t("BloombergPage.add_edb_hint"));
|
|
|
|
+
|
|
|
|
+ this.batchAddDialog.show = true;
|
|
|
|
+ },
|
|
|
|
+ //跳转至指标详情
|
|
|
|
+ goToEdbBase(data) {
|
|
|
|
+ const { EdbClassifyId, EdbInfoId, UniqueCode } = data || {};
|
|
|
|
+ const { href } = this.$router.resolve({
|
|
|
|
+ path: "/database",
|
|
|
|
+ query: {
|
|
|
|
+ code: UniqueCode,
|
|
|
|
+ id: EdbInfoId,
|
|
|
|
+ classifyId: EdbClassifyId,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ window.open(href, "_blank");
|
|
|
|
+ },
|
|
|
|
+ //批量加入指标库
|
|
|
|
+ handleCheckName(data) {
|
|
|
|
+ lzzxInterface
|
|
|
|
+ .nameCheck(
|
|
|
|
+ data.map((_) => ({ EdbCode: _.IndexCode, EdbName: _.IndexName }))
|
|
|
|
+ )
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
|
+ let existNameArr = res.Data.filter((i) => i.Exist).map(
|
|
|
|
+ (_) => _.EdbName
|
|
|
|
+ );
|
|
|
|
+ this.$refs.batchAddToEdbDialog &&
|
|
|
|
+ this.$refs.batchAddToEdbDialog.setValue(
|
|
|
|
+ "existNameArr",
|
|
|
|
+ existNameArr
|
|
|
|
+ );
|
|
|
|
+ if (existNameArr.length) return;
|
|
|
|
+ this.handleSave(data);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleSave(data) {
|
|
|
|
+ let haveIncomplete = data.some(
|
|
|
|
+ (_) => !_.IndexName || !_.ClassifyId || !_.Unit
|
|
|
|
+ );
|
|
|
|
+ if (haveIncomplete)
|
|
|
|
+ return this.$message.warning(
|
|
|
|
+ this.$t("BloombergPage.add_edb_check_hint1")
|
|
|
|
+ );
|
|
|
|
+ this.$refs.batchAddToEdbDialog &&
|
|
|
|
+ this.$refs.batchAddToEdbDialog.setValue("saveLoading", true);
|
|
|
|
+
|
|
|
|
+ lzzxInterface
|
|
|
|
+ .batchAdd(
|
|
|
|
+ data.map((i) => ({
|
|
|
|
+ EdbCode: i.IndexCode,
|
|
|
|
+ EdbName: i.IndexName,
|
|
|
|
+ Frequency: i.Frequency,
|
|
|
|
+ Unit: i.Unit,
|
|
|
|
+ ClassifyId: i.ClassifyId,
|
|
|
|
+ }))
|
|
|
|
+ )
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$refs.batchAddToEdbDialog &&
|
|
|
|
+ this.$refs.batchAddToEdbDialog.setValue("saveLoading", false);
|
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
|
+ this.$message.success(this.$t("MsgPrompt.add_msg2"));
|
|
|
|
+ this.$refs.batchAddToEdbDialog &&
|
|
|
|
+ this.$refs.batchAddToEdbDialog.cancelHandle();
|
|
|
|
+ this.nodeChangeInit();
|
|
|
|
+ this.getTableData();
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.$refs.batchAddToEdbDialog &&
|
|
|
|
+ this.$refs.batchAddToEdbDialog.setValue("saveLoading", false);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
+.lzzxData-container {
|
|
|
|
+ .data-top-container {
|
|
|
|
+ padding: 19px;
|
|
|
|
+ background: #ffffff;
|
|
|
|
+ border: 1px solid #ececec;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ margin-bottom: 30px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .lzzxData-inner-container {
|
|
|
|
+ display: flex;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .slide-btn-icon {
|
|
|
|
+ &.slide-left {
|
|
|
|
+ right: 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &.slide-right {
|
|
|
|
+ left: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ * {
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .left-cont {
|
|
|
|
+ min-width: 330px;
|
|
|
|
+ width: 330px;
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
+ margin-right: 20px;
|
|
|
|
+ padding: 30px 0;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .scroll-wrap {
|
|
|
|
+ padding: 0 20px;
|
|
|
|
+ height: calc(100vh - 280px);
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ margin-right: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .target_tree {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .move-btn {
|
|
|
|
+ height: 100%;
|
|
|
|
+ width: 4px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 0px;
|
|
|
|
+ top: 0;
|
|
|
|
+
|
|
|
|
+ &:hover {
|
|
|
|
+ cursor: col-resize;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .right-cont {
|
|
|
|
+ flex: 1;
|
|
|
|
+ overflow-x: auto;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .title-tip {
|
|
|
|
+ color: #333333;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tree-height {
|
|
|
|
+ height: 100%;
|
|
|
|
+ overflow-anchor: none;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tree-container {
|
|
|
|
+ .tree-header {
|
|
|
|
+ margin-top: 8px;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ height: 48px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 0 16px;
|
|
|
|
+ color: #333;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .table-wrap {
|
|
|
|
+ padding: 0 16px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .nodata-cont {
|
|
|
|
+ width: 150px !important;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #666;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.minHeight {
|
|
|
|
+ height: calc(100vh - 230px);
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.hint-dialog-wrap {
|
|
|
|
+ padding-bottom: 30px;
|
|
|
|
+
|
|
|
|
+ .hint-dialog-content {
|
|
|
|
+ max-height: 40vh;
|
|
|
|
+ overflow: auto;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .hint-item {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+
|
|
|
|
+ &:hover {
|
|
|
|
+ color: #409eff;
|
|
|
|
+ text-decoration: underline;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|
|
|
|
+<style lang="scss">
|
|
|
|
+.lzzxData-container {
|
|
|
|
+ .el-table {
|
|
|
|
+ tr:nth-of-type(2n-1) {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-table__header-wrapper th.is-leaf {
|
|
|
|
+ background-color: #ebeef5 !important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-cascader .el-input {
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|