|
@@ -3,25 +3,27 @@
|
|
<div class="header">
|
|
<div class="header">
|
|
<div class="left-btn">
|
|
<div class="left-btn">
|
|
<el-button
|
|
<el-button
|
|
- v-permission="permissionBtn.dataSourcePermission.mysteelData_batchAddEdb"
|
|
|
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.sciHongqi_batch_addBase"
|
|
type="primary"
|
|
type="primary"
|
|
size="medium"
|
|
size="medium"
|
|
@click="isBatchAddIndicsDiaShow = true"
|
|
@click="isBatchAddIndicsDiaShow = true"
|
|
><!-- 批量加入指标库 -->{{$t('SteelChemicalPage.batch_add_edb_btn')}}</el-button>
|
|
><!-- 批量加入指标库 -->{{$t('SteelChemicalPage.batch_add_edb_btn')}}</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-permission="permissionBtn.dataSourcePermission.mysteelData_batchAddEdb"
|
|
|
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.sciHongqi_batch_del"
|
|
type="primary"
|
|
type="primary"
|
|
- size="medium"
|
|
|
|
|
|
+ size="medium"
|
|
|
|
+ plain
|
|
@click="isBatchAddIndicsDiaShow = true"
|
|
@click="isBatchAddIndicsDiaShow = true"
|
|
>批量删除</el-button>
|
|
>批量删除</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-permission="permissionBtn.dataSourcePermission.mysteelData_batchAddEdb"
|
|
|
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.sciHongqi_batch_edit"
|
|
type="primary"
|
|
type="primary"
|
|
- size="medium"
|
|
|
|
|
|
+ size="medium"
|
|
|
|
+ plain
|
|
@click="isBatchAddIndicsDiaShow = true"
|
|
@click="isBatchAddIndicsDiaShow = true"
|
|
>批量编辑</el-button>
|
|
>批量编辑</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-permission="permissionBtn.dataSourcePermission.mysteelData_export"
|
|
|
|
|
|
+ v-permission="permissionBtn.dataSourcePermission.sciHongqi_export"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
size="medium"
|
|
size="medium"
|
|
@@ -95,42 +97,44 @@
|
|
@node-collapse="handleNodeCollapse"
|
|
@node-collapse="handleNodeCollapse"
|
|
@current-change="nodeChangeHandle"
|
|
@current-change="nodeChangeHandle"
|
|
@node-drop="dropOverHandle"
|
|
@node-drop="dropOverHandle"
|
|
- @node-drag-end="dropMouseLeave"
|
|
|
|
- @node-drag-leave="dropMouseLeave"
|
|
|
|
- @node-drag-enter="dropMouseOver"
|
|
|
|
>
|
|
>
|
|
<div class="custom-tree-node" slot-scope="{ node, data }">
|
|
<div class="custom-tree-node" slot-scope="{ node, data }">
|
|
- <span
|
|
|
|
|
|
+ <div
|
|
class="text_oneLine"
|
|
class="text_oneLine"
|
|
:style="`width:${
|
|
:style="`width:${
|
|
(select_node === data.UniqueCode && node.Nodewidth) || ''
|
|
(select_node === data.UniqueCode && node.Nodewidth) || ''
|
|
}`"
|
|
}`"
|
|
- >{{ currentLang==='zh' ? data.ClassifyName : (data.ClassifyNameEn||data.ClassifyName) }}</span
|
|
|
|
|
|
+ >
|
|
|
|
+ <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">
|
|
<div v-if="select_node === data.UniqueCode">
|
|
<img
|
|
<img
|
|
src="~@/assets/img/data_m/move_ico.png"
|
|
src="~@/assets/img/data_m/move_ico.png"
|
|
- v-if="data.Button.MoveButton"
|
|
|
|
- alt=""
|
|
|
|
|
|
+ v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_move')"
|
|
style="width: 14px; height: 14px; margin-right: 5px"
|
|
style="width: 14px; height: 14px; margin-right: 5px"
|
|
@click.stop="clickClassifyHandle('move', data, node)"
|
|
@click.stop="clickClassifyHandle('move', data, node)"
|
|
/>
|
|
/>
|
|
<img
|
|
<img
|
|
src="~@/assets/img/set_m/add.png"
|
|
src="~@/assets/img/set_m/add.png"
|
|
- style="width: 14px; height: 14px; margin-right: 5px"
|
|
|
|
|
|
+ style="width: 14px; height: 14px;
|
|
|
|
+ margin-right: 5px"
|
|
|
|
+ v-if="node.level===1"
|
|
@click.stop="clickClassifyHandle('add', data, node)"
|
|
@click.stop="clickClassifyHandle('add', data, node)"
|
|
- v-if="data.Button.AddButton&&permissionBtn.isShowBtn('dataSourcePermission','mysteelData_classifyOpt_add')"
|
|
|
|
/>
|
|
/>
|
|
<img
|
|
<img
|
|
src="~@/assets/img/set_m/edit.png"
|
|
src="~@/assets/img/set_m/edit.png"
|
|
- v-if="data.Button.OpButton&&permissionBtn.isShowBtn('dataSourcePermission','mysteelData_classifyOpt_edit')"
|
|
|
|
|
|
+ v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_edit')"
|
|
alt=""
|
|
alt=""
|
|
style="width: 14px; height: 14px; margin-right: 5px"
|
|
style="width: 14px; height: 14px; margin-right: 5px"
|
|
@click.stop="clickClassifyHandle('edit', data, node)"
|
|
@click.stop="clickClassifyHandle('edit', data, node)"
|
|
/>
|
|
/>
|
|
<img
|
|
<img
|
|
src="~@/assets/img/set_m/del.png"
|
|
src="~@/assets/img/set_m/del.png"
|
|
- v-if="data.Button.DeleteButton&&permissionBtn.isShowBtn('dataSourcePermission','mysteelData_classifyOpt_delete')"
|
|
|
|
|
|
+ v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_del')"
|
|
alt=""
|
|
alt=""
|
|
style="width: 14px; height: 14px"
|
|
style="width: 14px; height: 14px"
|
|
@click.stop="clickClassifyHandle('del', data, node)"
|
|
@click.stop="clickClassifyHandle('del', data, node)"
|
|
@@ -139,7 +143,8 @@
|
|
</div>
|
|
</div>
|
|
</el-tree>
|
|
</el-tree>
|
|
|
|
|
|
- <div class="add-cont" @click="addClassifyHandle" v-if="permissionBtn.isShowBtn('dataSourcePermission','mysteelData_classifyOpt_add')">
|
|
|
|
|
|
+ <div class="add-cont" @click="addClassifyHandle" >
|
|
|
|
+ <!-- v-if="permissionBtn.isShowBtn('dataSourcePermission','sciHongqi_classify_add')" -->
|
|
<img
|
|
<img
|
|
src="~@/assets/img/set_m/add_ico.png"
|
|
src="~@/assets/img/set_m/add_ico.png"
|
|
alt=""
|
|
alt=""
|
|
@@ -313,7 +318,7 @@ export default {
|
|
return [
|
|
return [
|
|
{ label: this.$t('Edb.Detail.e_id'),key: 'IndexCode' },
|
|
{ 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_name'),key: 'IndexName',minwidthsty:'150px' },
|
|
- { label: this.$t('Edb.Detail.e_fre'),key: 'Frequency',widthsty:'100px' },
|
|
|
|
|
|
+ { label: this.$t('Edb.Detail.e_fre'),key: 'Frequency' },
|
|
{ label: this.$t('Edb.Detail.e_unit'),key: 'Unit', },
|
|
{ label: this.$t('Edb.Detail.e_unit'),key: 'Unit', },
|
|
{ label: this.$t('Edb.Detail.e_update_time'),key: 'ModifyTime', },
|
|
{ label: this.$t('Edb.Detail.e_update_time'),key: 'ModifyTime', },
|
|
]
|
|
]
|
|
@@ -323,14 +328,11 @@ export default {
|
|
return {
|
|
return {
|
|
isLeftWrapShow:true,
|
|
isLeftWrapShow:true,
|
|
dataloading: false,
|
|
dataloading: false,
|
|
- exportBase:
|
|
|
|
- process.env.VUE_APP_API_ROOT +
|
|
|
|
- "/datamanage/mysteel_chemical/export/dataList", //数据导出接口
|
|
|
|
|
|
+ exportBase:process.env.VUE_APP_API_ROOT + "/datamanage/export/sciHqList", //数据导出接口
|
|
|
|
|
|
selectClassify:0,
|
|
selectClassify:0,
|
|
leftSearchVal: "",
|
|
leftSearchVal: "",
|
|
classifyList: [],
|
|
classifyList: [],
|
|
- dynamicNode: null,
|
|
|
|
defaultShowNodes: [], //展开节点
|
|
defaultShowNodes: [], //展开节点
|
|
|
|
|
|
selectEdb: 0,
|
|
selectEdb: 0,
|
|
@@ -435,21 +437,14 @@ export default {
|
|
|
|
|
|
/* 改变节点 */
|
|
/* 改变节点 */
|
|
nodeChangeHandle(data, node) {
|
|
nodeChangeHandle(data, node) {
|
|
- if (this.dataloading)
|
|
|
|
- return this.$message(this.$t('MsgPrompt.request_frequency'));
|
|
|
|
- this.dynamicNode = node;
|
|
|
|
|
|
+
|
|
this.select_node = data.UniqueCode;
|
|
this.select_node = data.UniqueCode;
|
|
this.selectClassify = data.ClassifyId;
|
|
this.selectClassify = data.ClassifyId;
|
|
this.selectEdb = data.BaseFromSciHqIndexId;
|
|
this.selectEdb = data.BaseFromSciHqIndexId;
|
|
- this.index_code = data.IndexCode
|
|
|
|
-
|
|
|
|
- this.rightShow = false;
|
|
|
|
- this.leftSearchVal = "";
|
|
|
|
-
|
|
|
|
- this.resetNodeStyle(node);
|
|
|
|
|
|
+ this.index_code = data.IndexCode;
|
|
},
|
|
},
|
|
|
|
|
|
- /* 钢联数据导出 */
|
|
|
|
|
|
+ /* 数据导出 */
|
|
exportClick() {
|
|
exportClick() {
|
|
this.btnload = true;
|
|
this.btnload = true;
|
|
|
|
|
|
@@ -636,6 +631,169 @@ export default {
|
|
escapeStr(str) {
|
|
escapeStr(str) {
|
|
return str.replace(/#/g, escape("#")).replace(/;/g, escape(";"));
|
|
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;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 判断节点是否能被拖拽 */
|
|
|
|
+ canDragHandle({data}) {
|
|
|
|
+ return true
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 判断节点是否能被拖入 */
|
|
|
|
+ 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();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ },
|
|
},
|
|
},
|
|
|
|
|
|
};
|
|
};
|