|
@@ -16,9 +16,12 @@
|
|
|
<i :class="{'el-icon-d-arrow-left':isLeftWrapShow,'el-icon-d-arrow-right':!isLeftWrapShow}"></i>
|
|
|
</span>
|
|
|
<div class="left-top">
|
|
|
+ <el-button style="margin-left: 0;margin-bottom: 10px;" v-permission="permissionBtn.dataSourcePermission.mysteelData_batchAddEdb"
|
|
|
+ type="primary" size="medium" @click="isBatchAddIndicsDiaShow = true"
|
|
|
+ ><!-- 批量加入指标库 -->{{$t('SteelChemicalPage.batch_add_edb_btn')}}</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
v-permission="permissionBtn.dataSourcePermission.yyzxData_export"
|
|
|
- style="width: 100%"
|
|
|
type="primary"
|
|
|
plain
|
|
|
size="medium"
|
|
@@ -57,13 +60,27 @@
|
|
|
label: 'ClassifyName',
|
|
|
children: 'Child',
|
|
|
}"
|
|
|
+ :default-expanded-keys="defaultShowNodes"
|
|
|
:current-node-key="select_classify"
|
|
|
:expand-on-click-node="false"
|
|
|
check-strictly
|
|
|
highlight-current
|
|
|
empty-text="暂无分类"
|
|
|
+ lazy
|
|
|
+ :load="getLazyTreeData"
|
|
|
+ @node-expand="handleNodeExpand"
|
|
|
+ @node-collapse="handleNodeCollapse"
|
|
|
@current-change="nodeChangeHandle"
|
|
|
>
|
|
|
+ <div slot-scope="{ node, data }" class="custom-tree-node">
|
|
|
+ <div class="text_oneLine" style="width:100%">
|
|
|
+ <span v-if="data.IndexCode">{{data.IndexName}}</span>
|
|
|
+ <span v-else>
|
|
|
+ <!-- {{ currentLang==='zh' ? data.ClassifyName : data.ClassifyNameEn }} -->
|
|
|
+ {{ data.ClassifyName }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</el-tree>
|
|
|
</div>
|
|
|
<span
|
|
@@ -88,6 +105,7 @@
|
|
|
tableType="header"
|
|
|
ref="table"
|
|
|
source="yyzx"
|
|
|
+ @addToLib="addToLib"
|
|
|
@editTarget="editTargetByTable"
|
|
|
/>
|
|
|
</div>
|
|
@@ -101,20 +119,40 @@
|
|
|
</div>
|
|
|
<div v-else class="nodata"></div>
|
|
|
</div>
|
|
|
+ <el-button style="margin-left: 10px;margin-top: 20px;" plain
|
|
|
+ type="primary" size="medium" @click=""
|
|
|
+ ><!-- 批量加入指标库 -->周度</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
<div v-else class="nodata-cont">
|
|
|
<tableNoData :text="$t('Table.prompt_slogan')"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 批量添加至指标库弹窗 -->
|
|
|
+ <batchAddIndicsDia
|
|
|
+ :isOpenDialog="isBatchAddIndicsDiaShow"
|
|
|
+ @close="isBatchAddIndicsDiaShow=false"
|
|
|
+ />
|
|
|
+ <!-- 单个添加至指标库弹窗 -->
|
|
|
+ <addIndicsDia
|
|
|
+ :isOpenDialog="isAddIndicsDiaShow"
|
|
|
+ :edbData="currentIndicData"
|
|
|
+ @close="isAddIndicsDiaShow=false;"
|
|
|
+ @addCallback="intoBaseBack"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import lzTable from "@/components/lzTable.vue";
|
|
|
import { fwmtInterface } from "@/api/api.js";
|
|
|
+import batchAddIndicsDia from "./components/batchAddIndicsDia"
|
|
|
+import addIndicsDia from './components/addIndicsDia.vue';
|
|
|
+import leftMixin from "./mixins/leftMixin.js";
|
|
|
export default {
|
|
|
name: "Fwmt",
|
|
|
- components: { lzTable },
|
|
|
+ mixins: [leftMixin],
|
|
|
+ components: { lzTable, batchAddIndicsDia, addIndicsDia },
|
|
|
data() {
|
|
|
return {
|
|
|
isLeftWrapShow:true,
|
|
@@ -133,6 +171,11 @@ export default {
|
|
|
leftSearchVal: "", //左侧搜索值
|
|
|
leftSearchTradeCode: "", //如果是搜索选择的 则有此code
|
|
|
isShowSingleData: false, //右侧是否展示的是单个指标数据
|
|
|
+ isBatchAddIndicsDiaShow: false, //批量添加指标弹窗
|
|
|
+ currentIndicData:{}, //当前选中指标
|
|
|
+ isAddIndicsDiaShow: false, //单个添加指标弹窗
|
|
|
+ defaultShowNodes: [],
|
|
|
+ repetition: null, // 是否重复请求
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -269,6 +312,65 @@ export default {
|
|
|
$(".right-box")[0].scrollLeft = 0;
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ //指标懒加载
|
|
|
+ async getLazyTreeData(node,resolve){
|
|
|
+ let arr=[]
|
|
|
+ if(node.level===2||node.data.ClassifyId === 0){
|
|
|
+ const res=await fwmtInterface.dataList({
|
|
|
+ ClassifyId: node.data.ClassifyId
|
|
|
+ })
|
|
|
+ if(res.Ret===200){
|
|
|
+ const temarr=res.Data||[]
|
|
|
+ arr=temarr.map(item=>{
|
|
|
+ delete item.ClassifyId
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ isLeaf:true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ arr=node.data.Child||[]
|
|
|
+ }
|
|
|
+ resolve(arr)
|
|
|
+ },
|
|
|
+ // 树节点展开
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取选中指标数据
|
|
|
+ addToLib(data){
|
|
|
+ //添加前校验 ID是否已存在指标库中
|
|
|
+ //打开弹窗
|
|
|
+ this.currentIndicData = data
|
|
|
+ this.isAddIndicsDiaShow = true
|
|
|
+ },
|
|
|
+ //添加指标到库
|
|
|
+ intoBaseBack() {
|
|
|
+ this.isAddIndicsDiaShow = false
|
|
|
+ if(this.selectedEdb){
|
|
|
+ this.$refs.edbDetailRef.getEdbDetail()
|
|
|
+ }else {
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ },
|
|
|
/* 无频度的异常显示处理 7*12*/
|
|
|
nodataDeal() {
|
|
|
this.tableOption = [];
|
|
@@ -332,6 +434,16 @@ export default {
|
|
|
this.getTargetDataList(e.IndexCode);
|
|
|
},
|
|
|
|
|
|
+ /* 添加指标 */
|
|
|
+ addTargetBatch() {
|
|
|
+ this.batchAddDiaShow = true;
|
|
|
+ },
|
|
|
+ /* 添加后回调 */
|
|
|
+ addSuccessCallback({ code, id,selectClassifyNodes,indexCode }) {
|
|
|
+ indexCode && (this.index_code = indexCode)
|
|
|
+ this.getClassify({ code, id,selectClassifyNodes });
|
|
|
+ },
|
|
|
+
|
|
|
getTargetData(code, arr) {
|
|
|
for (const item of arr) {
|
|
|
if (item.BaseFromBaiinfoIndexCode === code) return item;
|
|
@@ -348,16 +460,15 @@ export default {
|
|
|
|
|
|
//改变选中节点
|
|
|
nodeChangeHandle(data, node) {
|
|
|
- if (data.ClassifyId === this.select_classify) return;
|
|
|
+ if (data.ClassifyId === this.repetition || data.IndexCode === this.repetition) return;
|
|
|
this.select_classify = data.ClassifyId;
|
|
|
- if(data.ParentId===0&&data.Child){
|
|
|
- this.rightShow=false
|
|
|
- return
|
|
|
- }
|
|
|
+ this.repetition = data.ClassifyId || data.IndexCode
|
|
|
this.leftSearchVal=''
|
|
|
this.page_no = 1;
|
|
|
this.page_size = 20;
|
|
|
- this.getDataList()
|
|
|
+ if (!data.IndexCode)this.getDataList()
|
|
|
+ // 获取单独指标数据
|
|
|
+ else this.getTargetDataList(data.IndexCode);
|
|
|
},
|
|
|
|
|
|
},
|
|
@@ -539,4 +650,44 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+.smmTarget-container {
|
|
|
+ .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>
|