|
@@ -6,22 +6,22 @@
|
|
|
v-permission="permissionBtn.dataSourcePermission.sciHongqi_batch_addBase"
|
|
|
type="primary"
|
|
|
size="medium"
|
|
|
- @click="isBatchAddIndicsDiaShow = true"
|
|
|
+ @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="isBatchAddIndicsDiaShow = true"
|
|
|
- >批量删除</el-button>
|
|
|
+ @click="handBatchDelEdb"
|
|
|
+ ><!-- 批量删除 -->{{$t('SciHongqiPage.btn_batch_del')}}</el-button>
|
|
|
<el-button
|
|
|
v-permission="permissionBtn.dataSourcePermission.sciHongqi_batch_edit"
|
|
|
type="primary"
|
|
|
size="medium"
|
|
|
plain
|
|
|
- @click="isBatchAddIndicsDiaShow = true"
|
|
|
- >批量编辑</el-button>
|
|
|
+ @click="handleBatchEdit"
|
|
|
+ ><!-- 批量编辑 -->{{$t('SciHongqiPage.btn_batch_edit')}}</el-button>
|
|
|
<el-button
|
|
|
v-permission="permissionBtn.dataSourcePermission.sciHongqi_export"
|
|
|
type="primary"
|
|
@@ -35,7 +35,6 @@
|
|
|
<div class="right-wrap">
|
|
|
<el-select
|
|
|
v-model="leftSearchVal"
|
|
|
- v-loadMore="searchLoad"
|
|
|
ref="searchRef"
|
|
|
:filterable="!leftSearchVal"
|
|
|
remote
|
|
@@ -43,14 +42,13 @@
|
|
|
: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"
|
|
|
+ :key="item.BaseFromSciHqIndexId"
|
|
|
+ :label="item.IndexName"
|
|
|
+ :value="item.BaseFromSciHqIndexId"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -83,7 +81,7 @@
|
|
|
children: 'Children',
|
|
|
isLeaf:'isLeaf'
|
|
|
}"
|
|
|
- :allow-drag="canDragHandle"
|
|
|
+ :allow-drag="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_move')"
|
|
|
:allow-drop="canDropHandle"
|
|
|
:current-node-key="select_node"
|
|
|
:default-expanded-keys="defaultShowNodes"
|
|
@@ -102,7 +100,7 @@
|
|
|
<div
|
|
|
class="text_oneLine"
|
|
|
:style="`width:${
|
|
|
- (select_node === data.UniqueCode && node.Nodewidth) || ''
|
|
|
+ select_node === data.UniqueCode ? '60%' :'100%'
|
|
|
}`"
|
|
|
>
|
|
|
<span v-if="data.IndexCode">{{data.IndexName}}</span>
|
|
@@ -115,26 +113,26 @@
|
|
|
<img
|
|
|
src="~@/assets/img/data_m/move_ico.png"
|
|
|
v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_move')"
|
|
|
- style="width: 14px; height: 14px; margin-right: 5px"
|
|
|
+ style="width: 16px; height: 16px; margin-right: 5px"
|
|
|
@click.stop="clickClassifyHandle('move', data, node)"
|
|
|
/>
|
|
|
<img
|
|
|
src="~@/assets/img/set_m/add.png"
|
|
|
- style="width: 14px; height: 14px;
|
|
|
+ style="width: 16px; height: 16px;
|
|
|
margin-right: 5px"
|
|
|
- v-if="node.level===1"
|
|
|
+ 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="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_edit')"
|
|
|
+ v-if="node.level!==3&&permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_edit')"
|
|
|
alt=""
|
|
|
- style="width: 14px; height: 14px; margin-right: 5px"
|
|
|
+ style="width: 16px; height: 16px; margin-right: 5px"
|
|
|
@click.stop="clickClassifyHandle('edit', data, node)"
|
|
|
/>
|
|
|
<img
|
|
|
src="~@/assets/img/set_m/del.png"
|
|
|
- v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_del')"
|
|
|
+ v-if="node.level!==3&&permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_del')"
|
|
|
alt=""
|
|
|
style="width: 14px; height: 14px"
|
|
|
@click.stop="clickClassifyHandle('del', data, node)"
|
|
@@ -143,8 +141,8 @@
|
|
|
</div>
|
|
|
</el-tree>
|
|
|
|
|
|
- <div class="add-cont" @click="addClassifyHandle" >
|
|
|
- <!-- v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_add')" -->
|
|
|
+ <div class="add-cont" @click="addClassifyHandle" v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_add')">
|
|
|
+
|
|
|
<img
|
|
|
src="~@/assets/img/set_m/add_ico.png"
|
|
|
alt=""
|
|
@@ -160,59 +158,71 @@
|
|
|
v-loading="dataloading"
|
|
|
:element-loading-text="$t('Table.data_loading')"
|
|
|
>
|
|
|
- <div class="right-header">
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
- <el-table
|
|
|
+ <template v-if="!selectEdb">
|
|
|
+ <div class="right-header">
|
|
|
+ <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
|
|
|
- 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-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"
|
|
@@ -221,6 +231,15 @@
|
|
|
@handleCurrentChange="handlePageChange"
|
|
|
/>
|
|
|
</div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <edbDataDetail
|
|
|
+ ref="edbDetailRef"
|
|
|
+ :id="selectEdb"
|
|
|
+ @handle="handleEdb"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -244,7 +263,21 @@
|
|
|
<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-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: 'ClassifyId',
|
|
|
+ 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%"
|
|
@@ -266,29 +299,56 @@
|
|
|
</div>
|
|
|
</m-dialog>
|
|
|
|
|
|
- <!-- 指标弹窗 -->
|
|
|
- <target-dialog
|
|
|
- :isOpenDialog.sync="addTargetDialog"
|
|
|
- :classifyList="classifyList"
|
|
|
- :edbForm="edbForm"
|
|
|
- @successCallback="addSuccessCallback"
|
|
|
+ <!-- 批量入库 -->
|
|
|
+ <addToBaseDia
|
|
|
+ :isShow.sync="isAddToBaseDia"
|
|
|
+ :list="addToBaseList"
|
|
|
+ @success="() => { listCheckAllChange(false);handlePageChange(1)}"
|
|
|
/>
|
|
|
- <!-- 批量添加指标弹窗 -->
|
|
|
- <batch-add-edb-dia :isOpenDialog.sync="batchAddDiaShow"
|
|
|
- :classifyList="classifyList"
|
|
|
- @successCallback="addSuccessCallback"/>
|
|
|
- <!-- 批量添加至指标库弹窗 -->
|
|
|
- <batchAddIndicsDia
|
|
|
- :isOpenDialog="isBatchAddIndicsDiaShow"
|
|
|
- @close="isBatchAddIndicsDiaShow=false"
|
|
|
+
|
|
|
+ <!-- 批量编辑index分类 -->
|
|
|
+ <batchEditIndexDia
|
|
|
+ :isShow.sync="isBatchEditIndexDia"
|
|
|
+ :list="addToBaseList"
|
|
|
+ :classifyList="classifyList"
|
|
|
+ @success="getClassify"
|
|
|
/>
|
|
|
+
|
|
|
<!-- 单个添加至指标库弹窗 -->
|
|
|
<addIndicsDia
|
|
|
- :isOpenDialog="isAddIndicsDiaShow"
|
|
|
- :edbData="currentIndicData"
|
|
|
- @close="isAddIndicsDiaShow=false;"
|
|
|
- @addCallback="isAddIndicsDiaShow=false;"
|
|
|
+ :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>
|
|
|
+ <li v-for="(item,index) in (existEdbList||batchDelList)" :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" 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>
|
|
@@ -296,9 +356,14 @@
|
|
|
<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, },
|
|
|
+ components: { mDialog,edbDataDetail,mPage,addIndicsDia,addToBaseDia,batchEditIndexDia },
|
|
|
computed: {
|
|
|
exportGlapi() {
|
|
|
// 数据导出接口
|
|
@@ -323,6 +388,28 @@ export default {
|
|
|
{ label: this.$t('Edb.Detail.e_update_time'),key: 'ModifyTime', },
|
|
|
]
|
|
|
},
|
|
|
+
|
|
|
+ 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_all_msg'),//本次添加的指标均已在指标库中,请勿重复添加!
|
|
|
+ 2:this.$t('YsDataPage.haved_some_msg'),//指标库中已存在以下指标,会自动过滤!
|
|
|
+ 3: this.$t('SciHongqiPage.del_msg')
|
|
|
+ }[key]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ leftSearchVal(nval) {
|
|
|
+ if(!nval) return
|
|
|
+
|
|
|
+ this.selectEdb = nval;
|
|
|
+ this.selectClassify = 0;
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -332,6 +419,7 @@ export default {
|
|
|
|
|
|
selectClassify:0,
|
|
|
leftSearchVal: "",
|
|
|
+ searchOptions: [],
|
|
|
classifyList: [],
|
|
|
defaultShowNodes: [], //展开节点
|
|
|
|
|
@@ -340,8 +428,14 @@ export default {
|
|
|
total:0,
|
|
|
page_size: 10,
|
|
|
page_no: 1,
|
|
|
+ filterObj: {
|
|
|
+ checkAll: false,
|
|
|
+ checkSome: false,
|
|
|
+ },
|
|
|
+ isSelectAll: false, //真正意义上的全选或不全选
|
|
|
+ checkedList: [], //不全选勾选中的 或 全选取消勾的
|
|
|
+ selectionReactCancel:false,//手动设置选中
|
|
|
|
|
|
- index_code: "", //添加指标后的code,无论是否加载出来,无论是否加载成功
|
|
|
select_node: "",
|
|
|
|
|
|
/* 分类弹窗 */
|
|
@@ -358,27 +452,225 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
|
|
|
- addTargetDialog: false, //指标弹窗
|
|
|
- edbForm: {},
|
|
|
-
|
|
|
//批量添加指标弹窗
|
|
|
- batchAddDiaShow:false,
|
|
|
+ isAddToBaseDia: false,
|
|
|
+ addToBaseList: [],//可加入的指标
|
|
|
+ existEdbList: [],//已存在的指标
|
|
|
+ batchDelList: [],
|
|
|
|
|
|
- isBatchAddIndicsDiaShow:false, //批量添加至指标库弹窗
|
|
|
isAddIndicsDiaShow:false,//单个添加至指标库弹窗
|
|
|
currentIndicData:{},//当前选中指标
|
|
|
+
|
|
|
+ //批量编辑
|
|
|
+ isBatchEditIndexDia: false,
|
|
|
+
|
|
|
+ /* 提示弹窗 */
|
|
|
+ isHintDialogShow: false,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getClassify();
|
|
|
- this.getEdbList();
|
|
|
+ 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'));
|
|
|
+ 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){
|
|
|
+ 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: item.ClassifyId,
|
|
|
+ parent_classify_name:"",
|
|
|
+ parent_classify_id: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async handleEditEdbApi() {
|
|
|
+ const res = await zhuochuangRedStageInterface.edbEdit({
|
|
|
+ BaseFromSciHqIndexId: this.classifyForm.indexId,
|
|
|
+ ClassifyId: this.classifyForm.classify_id
|
|
|
+ })
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+ this.$message.success(/* "保存成功" */this.$t('MsgPrompt.saved_msg'));
|
|
|
+ this.cancelDialogHandle();
|
|
|
+ this.getClassify()
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 加入指标库 */
|
|
|
+ handleAddToBase(item){
|
|
|
+ //打开弹窗
|
|
|
+ this.currentIndicData = {
|
|
|
+ ...item,
|
|
|
+ FrequencyName: item.Frequency,
|
|
|
+ UnitName: item.Unit
|
|
|
+ }
|
|
|
+ this.isAddIndicsDiaShow = true
|
|
|
+ },
|
|
|
+
|
|
|
+ intoBaseBack() {
|
|
|
+ this.isAddIndicsDiaShow = false
|
|
|
+ if(this.selectedEdb){
|
|
|
+ this.$refs.edbDetailRef.edbInfo.EdbExist=1
|
|
|
+ }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(() => {
|
|
|
/* 处理树展开和选中 */
|
|
@@ -390,6 +682,16 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ filterNodes(arr) {
|
|
|
+ arr.length &&
|
|
|
+ arr.forEach((item) => {
|
|
|
+ item.Children&&item.Children.length && this.filterNodes(item.Children);
|
|
|
+ if (!item.Children||!item.Children.length) {
|
|
|
+ delete item.Children;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
//指标懒加载
|
|
|
async getLazyTreeData(node,resolve){
|
|
|
let arr=[]
|
|
@@ -414,34 +716,141 @@ export default {
|
|
|
},
|
|
|
|
|
|
/* 获取数据 */
|
|
|
- async getEdbList() {
|
|
|
+ async getEdbList(type='pageChange') {
|
|
|
const res = await zhuochuangRedStageInterface.getEdbList({
|
|
|
PageSize: this.page_size,
|
|
|
- CurrentIndex: this.page_no
|
|
|
+ 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()
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- handlePageChange(page) {
|
|
|
- this.page_no = page;
|
|
|
- this.getEdbList()
|
|
|
+ /* 设置当页数据勾选状态 */
|
|
|
+ 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)
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- lookDetailHandle() {
|
|
|
+ //整列选
|
|
|
+ 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.ClassifyId;
|
|
|
+ this.selectClassify = data.BaseFromSciHqIndexId?0:data.ClassifyId;
|
|
|
this.selectEdb = data.BaseFromSciHqIndexId;
|
|
|
- this.index_code = data.IndexCode;
|
|
|
+
|
|
|
+ if(this.selectClassify){
|
|
|
+ this.page_no = 1;
|
|
|
+ this.getEdbList();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/* 数据导出 */
|
|
@@ -474,17 +883,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- // 选中左侧搜索值
|
|
|
- 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(
|
|
|
{
|
|
@@ -496,20 +894,6 @@ export default {
|
|
|
},
|
|
|
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 = {
|
|
@@ -520,7 +904,6 @@ export default {
|
|
|
node.level === 2 ? (this.currentLang==='zh'?node.parent.data.ClassifyName:node.parent.data.ClassifyNameEn) : "",
|
|
|
parent_classify_id: node.level === 2 ? ParentId : "",
|
|
|
};
|
|
|
- }
|
|
|
},
|
|
|
|
|
|
/* 删除分类 */
|
|
@@ -529,23 +912,15 @@ export default {
|
|
|
node
|
|
|
) {
|
|
|
this.$confirm(
|
|
|
- `${
|
|
|
- node.level === 3
|
|
|
- ? this.$t('SteelChemicalPage.del_edb_msg')
|
|
|
- : this.$t('SteelChemicalPage.del_classify_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,
|
|
|
- });
|
|
|
+ ).then(async () => {
|
|
|
+ let res = await zhuochuangRedStageInterface.classifyDel({
|
|
|
+ ClassifyId,
|
|
|
+ });
|
|
|
|
|
|
if (res.Ret !== 200) return;
|
|
|
|
|
@@ -583,13 +958,20 @@ export default {
|
|
|
|
|
|
cancelDialogHandle() {
|
|
|
this.$refs.classifyFormRef.clearValidate();
|
|
|
- this.classifyForm.classify_name = "";
|
|
|
+ this.classifyForm = {
|
|
|
+ title: "添加分类",
|
|
|
+ classify_name: "",
|
|
|
+ parent_classify_name: "",
|
|
|
+ parent_classify_id: "",
|
|
|
+ };
|
|
|
this.openClassifyDia = false;
|
|
|
},
|
|
|
|
|
|
/* 保存分类 */
|
|
|
async saveClassifyHandle() {
|
|
|
await this.$refs.classifyFormRef.validate();
|
|
|
+
|
|
|
+ if(this.classifyForm.indexId) return this.handleEditEdbApi();
|
|
|
|
|
|
let params = {
|
|
|
ClassifyName: this.classifyForm.classify_name,
|
|
@@ -610,23 +992,6 @@ export default {
|
|
|
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(";"));
|
|
@@ -653,11 +1018,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- /* 判断节点是否能被拖拽 */
|
|
|
- canDragHandle({data}) {
|
|
|
- return true
|
|
|
- },
|
|
|
-
|
|
|
/* 判断节点是否能被拖入 */
|
|
|
canDropHandle(draggingNode, dropNode, type) {
|
|
|
let canDrop = false;
|
|
@@ -882,7 +1242,10 @@ export default {
|
|
|
flex:1;
|
|
|
padding: 30px;
|
|
|
position: relative;
|
|
|
-
|
|
|
+ .right-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -895,6 +1258,17 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
+.hint-dialog-wrap{
|
|
|
+ padding-bottom:30px;
|
|
|
+ .hint-item{
|
|
|
+ cursor: pointer;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ &:hover{
|
|
|
+ color:#409EFF;
|
|
|
+ text-decoration: underline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
.sciHongqiData-page {
|
|
@@ -934,5 +1308,8 @@ export default {
|
|
|
.el-tree-node__content {
|
|
|
padding-right: 10px !important;
|
|
|
}
|
|
|
+ .el-cascader .el-input {
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|