|
@@ -92,7 +92,7 @@
|
|
|
:load="getLazyTreeData"
|
|
|
@node-expand="handleNodeExpand"
|
|
|
@node-collapse="handleNodeCollapse"
|
|
|
- @current-change="nodeChange"
|
|
|
+ @current-change="(data,node)=>{nodeChange({data,node,treeName:classifyShowType})}"
|
|
|
@node-drop="dropOverHandle"
|
|
|
@node-drag-end="dropMouseLeave"
|
|
|
@node-drag-leave="dropMouseLeave"
|
|
@@ -168,7 +168,7 @@
|
|
|
<span>添加图表分类</span>
|
|
|
</div>
|
|
|
<!-- 移动图表 -->
|
|
|
- <div class="opt-item">
|
|
|
+ <div class="opt-item" @click="isOpenBatchMoveDialog=true">
|
|
|
<img
|
|
|
src="~@/assets/img/set_m/move_batch_ico.png"
|
|
|
alt=""
|
|
@@ -225,7 +225,7 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 共享指标目录 -->
|
|
|
- <div class="tree-cont"
|
|
|
+ <div class="tree-cont shared-cont"
|
|
|
v-else-if="classifyShowType==='shared'"
|
|
|
>
|
|
|
<sharedMenu source="chart"/>
|
|
@@ -466,6 +466,18 @@
|
|
|
<i class="el-icon-share"/> <!-- 分享 -->
|
|
|
{{$t('Chart.chart_share_btn')}}
|
|
|
</li>
|
|
|
+
|
|
|
+ <li
|
|
|
+ class="span-item"
|
|
|
+ @click="handleCollectEdb"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :src="$icons.chart_join_ico"
|
|
|
+ alt=""
|
|
|
+ style="width: 13px; height: 12px; vertical-align: middle"
|
|
|
+ />
|
|
|
+ 收藏
|
|
|
+ </li>
|
|
|
|
|
|
<li
|
|
|
v-permission="permissionBtn.chartLibPermission.chartLib_refresh"
|
|
@@ -644,7 +656,6 @@
|
|
|
<div class="chart-list-item-wrap">
|
|
|
<div class="chart-list-item" v-for="chart in chartPublicList" :key="chart.ChartInfoId">
|
|
|
<div class="chart-item-top" style="position:relative;">
|
|
|
- <!-- <div class="chartEn-mark" v-show="chart.IsEnChart">En</div> -->
|
|
|
<span class="text_oneLine" :style="{'padding-left':chart.IsEnChart?'24px':''}">{{ currentLang === 'en' ? (chart.ChartNameEn||chart.ChartName) : chart.ChartName }}</span>
|
|
|
</div>
|
|
|
<div class="chart-item-img" @click="detailShowHandle(chart)"
|
|
@@ -664,11 +675,11 @@
|
|
|
</div>
|
|
|
<!-- 目录弹窗 -->
|
|
|
<chartDialog
|
|
|
- :isOpenDialog="isOpenDialog"
|
|
|
+ :isOpenDialog.sync="isOpenDialog"
|
|
|
:title="dialog_title"
|
|
|
:formData="dialogForm"
|
|
|
- @closeDia="isOpenDialog = false"
|
|
|
- @sucessCallback="sucessCallback"
|
|
|
+ :classifyShowType="classifyShowType"
|
|
|
+ @sucessCallback="handleConfirmClassify"
|
|
|
/>
|
|
|
<!-- 日期端选择弹窗 -->
|
|
|
<DateChooseDia
|
|
@@ -743,22 +754,22 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
- <!-- 图表收藏弹窗 -->
|
|
|
+ <!-- 图表收藏弹窗 复用指标的-->
|
|
|
<edbCollectDia
|
|
|
source="chart"
|
|
|
ref="edbCollectRef"
|
|
|
:show.sync="isOpenEdbCollectDia"
|
|
|
- :edbId="collectEdbForm.edbId"
|
|
|
+ :id="collectEdbForm.chartId"
|
|
|
:add_ids="collectEdbForm.collectClassifyIdList"
|
|
|
- @success="arr=>{chartInfo.CollectClassifyIdList = arr}"
|
|
|
+ @confirm="arr=>{chartInfo.CollectClassifyIdList = arr}"
|
|
|
/>
|
|
|
|
|
|
- <!-- 添加收藏分类弹窗 -->
|
|
|
+ <!-- 添加收藏分类弹窗 复用指标的-->
|
|
|
<addCollectClassifyDia
|
|
|
source="chart"
|
|
|
:show.sync="isOpenCollectClassifyDia"
|
|
|
:form="collectClassifyForm"
|
|
|
- @confirm="getTreeData();isOpenEdbCollectDia&&$refs.edbCollectRef.getClassify()"
|
|
|
+ @confirm="getCollectClassifys();isOpenEdbCollectDia&&$refs.edbCollectRef.getClassify()"
|
|
|
/>
|
|
|
|
|
|
<!-- 设置公开共享列表弹窗 -->
|
|
@@ -768,16 +779,22 @@
|
|
|
:type="sharedType"
|
|
|
@change="getTreeData"
|
|
|
/>
|
|
|
+
|
|
|
+ <!-- 批量移动接口 -->
|
|
|
+ <batchMoveDialog
|
|
|
+ source="chart"
|
|
|
+ :show.sync="isOpenBatchMoveDialog"
|
|
|
+ :classifyShowType="classifyShowType"
|
|
|
+ @confirm="getTreeData"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { dataBaseInterface, mychartInterface } from '@/api/api.js';
|
|
|
-import {
|
|
|
- copyOtherOptions
|
|
|
-} from '@/utils/defaultOptions';
|
|
|
+import { copyOtherOptions } from '@/utils/defaultOptions';
|
|
|
import { chartSetMixin } from './mixins/chartPublic';
|
|
|
-import { edbCollectInterface } from '@/api/modules/chartApi';
|
|
|
+import { edbCollectInterface,chartBaseV2Interface } from '@/api/modules/chartApi';
|
|
|
import mPage from '@/components/mPage';
|
|
|
import Chart from './components/chart';
|
|
|
import chartDialog from './components/chartDialog';
|
|
@@ -792,6 +809,7 @@ import edbCollectDia from './databaseComponents/edbCollectDia.vue';
|
|
|
import addCollectClassifyDia from './databaseComponents/addCollectClassifyDia.vue';
|
|
|
import sharedMenu from './sharedComponents/sharedMenu.vue';
|
|
|
import setSharedListDialog from './sharedComponents/setSharedListDialog.vue';
|
|
|
+import batchMoveDialog from './components/batchMoveDialog.vue';
|
|
|
export default {
|
|
|
name: '',
|
|
|
components: {
|
|
@@ -808,7 +826,8 @@ export default {
|
|
|
sharedMenu,
|
|
|
setSharedListDialog,
|
|
|
edbCollectDia,
|
|
|
- addCollectClassifyDia
|
|
|
+ addCollectClassifyDia,
|
|
|
+ batchMoveDialog
|
|
|
},
|
|
|
directives: {
|
|
|
drag(el, bindings) {
|
|
@@ -850,7 +869,6 @@ export default {
|
|
|
loading: null,
|
|
|
selected_chartid: '', //当前选中的图表id
|
|
|
selected_chartClassify: '', //当前选中的图表所属分类
|
|
|
- new_label: '', //新的节点label值
|
|
|
select_node: '', //当前选中的节点
|
|
|
/* 右侧 */
|
|
|
chartInfo: {}, //图表信息
|
|
@@ -876,7 +894,7 @@ export default {
|
|
|
publicHaveMove: true, // 是否还有下一页
|
|
|
default_classify: '',
|
|
|
public_page_no: 1,
|
|
|
- public_page_size: 12,
|
|
|
+ public_page_size: 20,
|
|
|
public_total: 0,
|
|
|
chartPublicList: [],
|
|
|
isAddMyChart: false, //加入图库弹窗
|
|
@@ -911,6 +929,7 @@ export default {
|
|
|
{ label: '公共图表',key: 'public' },
|
|
|
],
|
|
|
classifyShowType:'own',
|
|
|
+ currentTreeName: 'own',//当前点击的分类树 4块 列表请求接口不同 own public collect sharedReceive sharedSend
|
|
|
|
|
|
collectClassifys:[],//收藏目录
|
|
|
//指标收藏弹窗
|
|
@@ -923,6 +942,9 @@ export default {
|
|
|
/* 设置共享弹窗 */
|
|
|
isOpenSetSharedDia: false,
|
|
|
sharedType:'',//shared/public
|
|
|
+
|
|
|
+ //批量移动弹窗
|
|
|
+ isOpenBatchMoveDialog: false
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -940,7 +962,7 @@ export default {
|
|
|
if(this.$refs.listChartPage) this.$refs.listChartPage.scrollTop = 0;
|
|
|
if (newval) {
|
|
|
this.public_page_no = 1;
|
|
|
- this.getPublicChartList();
|
|
|
+ this.getChartList();
|
|
|
}
|
|
|
},
|
|
|
selected_chartid(newval) {
|
|
@@ -1024,41 +1046,36 @@ export default {
|
|
|
const LINK_CHART_URL = this.$setting.dynamicOutLinks.ChartViewUrl+'/chartshow';
|
|
|
return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share&lang=${this.currentLang}`
|
|
|
},
|
|
|
-
|
|
|
- leftTabs() {
|
|
|
- return [
|
|
|
- {label: this.$t('EtaChartPage.tab_classify'),val:'目录'},
|
|
|
- {label: this.$t('EtaChartPage.tab_series'),val:'坐标轴'}
|
|
|
- ]
|
|
|
- }
|
|
|
},
|
|
|
methods: {
|
|
|
- getTreeData(params) {
|
|
|
- dataBaseInterface.chartClassify({IsShowMe:this.isOnlyMe}).then((res) => {
|
|
|
- if (res.Ret === 200) {
|
|
|
- this.showData = true;
|
|
|
+ /* 获取目录 我的/公共目录 */
|
|
|
+ async getTreeData(params) {
|
|
|
+ const res = this.classifyShowType === 'public'
|
|
|
+ ? await chartBaseV2Interface.getPublicClassifyBase()
|
|
|
+ : await dataBaseInterface.chartClassify({IsShowMe:this.isOnlyMe});
|
|
|
|
|
|
- const arr=res.Data.AllNodes || [];
|
|
|
- this.treeData = arr.map(item=>{
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- isLeaf:item.Children.length?false:true,
|
|
|
- }
|
|
|
- })
|
|
|
+ if (res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.showData = true;
|
|
|
+ const arr=res.Data.AllNodes || [];
|
|
|
+ this.treeData = arr.map(item=>{
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ isLeaf:item.Children.length?false:true,
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- this.CanOpClassify = res.Data.CanOpClassify;
|
|
|
+ this.CanOpClassify = res.Data.CanOpClassify;
|
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
- /* 新增完成后 处理树展开和选中图表 */
|
|
|
- params && this.selectCurrentNode(params);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ this.$nextTick(() => {
|
|
|
+ /* 新增完成后 处理树展开和选中图表 */
|
|
|
+ params && this.selectCurrentNode(params);
|
|
|
+ });
|
|
|
},
|
|
|
/* 节点变化时 */
|
|
|
- nodeChange(data, node) {
|
|
|
+ nodeChange({data, node,treeName}) {
|
|
|
+ this.currentTreeName=treeName;
|
|
|
this.search_txt = '';
|
|
|
- this.dynamicNode = node;
|
|
|
sessionStorage.removeItem('beforeOptions');
|
|
|
//详情时判断是否是本人添加图表 若不是不用做保存校验 新增时要进入保存校验逻辑
|
|
|
if (
|
|
@@ -1126,11 +1143,6 @@ export default {
|
|
|
this.default_classify = !data.ChartInfoId ? data.ChartClassifyId : '';
|
|
|
},
|
|
|
|
|
|
- // 只看我的 复选框改变事件
|
|
|
- onlyMeHandler(){
|
|
|
- this.getTreeData();
|
|
|
- this.getPublicChartList()
|
|
|
- },
|
|
|
/* 添加一级目录 */
|
|
|
addLevelOneHandle() {
|
|
|
this.dialog_title = '添加';
|
|
@@ -1191,80 +1203,85 @@ export default {
|
|
|
this.isOpenDialog = true;
|
|
|
},
|
|
|
/* 删除节点校验 */
|
|
|
- removeNode(node, data) {
|
|
|
- dataBaseInterface
|
|
|
- .delChartCheck({
|
|
|
- ChartClassifyId: data.ChartClassifyId,
|
|
|
- ChartInfoId: data.ChartInfoId,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.Ret === 200) {
|
|
|
- /**
|
|
|
- * 0 可删除
|
|
|
- * 1 关联图表一
|
|
|
- * 2 有子目录无图表
|
|
|
- */
|
|
|
- const deleteLabelMap = {
|
|
|
- 1: /* '该分类下关联图表不可删除' */this.$t('Chart.OptMsg.classify_del_fail'),
|
|
|
- 2: /* '确认删除当前分类及包含的子分类吗?' */this.$t('Chart.OptMsg.classify_delall_confirm'),
|
|
|
- 4: res.Data.TipsMsg
|
|
|
- }
|
|
|
+ async removeNode(node, data) {
|
|
|
+ const res = this.classifyShowType === 'public'
|
|
|
+ ? await chartBaseV2Interface.delPublicedClassifyCheck({
|
|
|
+ ChartClassifyId: data.ChartClassifyId,
|
|
|
+ ChartInfoId: data.ChartInfoId
|
|
|
+ })
|
|
|
+ : await dataBaseInterface.delChartCheck({
|
|
|
+ ChartClassifyId: data.ChartClassifyId,
|
|
|
+ ChartInfoId: data.ChartInfoId,
|
|
|
+ })
|
|
|
|
|
|
- if([1,4].includes(res.Data.DeleteStatus)) this.$confirm(
|
|
|
- deleteLabelMap[res.Data.DeleteStatus],
|
|
|
- /* '删除失败' */this.$t('Chart.OptMsg.del_fail_tag'),
|
|
|
- {
|
|
|
- confirmButtonText: /* '知道了' */this.$t('Dialog.known'),
|
|
|
- showCancelButton:false,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- else if([0,2].includes(res.Data.DeleteStatus)) this.$confirm(
|
|
|
- res.Data.DeleteStatus === 2
|
|
|
- ? deleteLabelMap[res.Data.DeleteStatus]
|
|
|
- : data.ChartInfoId?this.$t('Chart.OptMsg.chart_del_confirm'):this.$t('Chart.OptMsg.classify_del_confirm'),
|
|
|
- this.$t('Dialog.warn_tit'),
|
|
|
- {
|
|
|
- confirmButtonText: /* '确定' */this.$t('Dialog.confirm_btn'),
|
|
|
- cancelButtonText: /* '取消' */this.$t('Dialog.cancel_btn'),
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- res.Data.DeleteStatus === 0 && data.ChartInfoId
|
|
|
- ? this.delHandle(data.ChartClassifyId, data.ChartInfoId, 1)
|
|
|
- : this.delHandle(data.ChartClassifyId, data.ChartInfoId);
|
|
|
- }).catch(() => {
|
|
|
- });
|
|
|
+ if(res.Ret !==200) return
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 0 可删除
|
|
|
+ * 1 关联图表一
|
|
|
+ * 2 有子目录无图表
|
|
|
+ */
|
|
|
+ const deleteLabelMap = {
|
|
|
+ 1: /* '该分类下关联图表不可删除' */this.$t('Chart.OptMsg.classify_del_fail'),
|
|
|
+ 2: /* '确认删除当前分类及包含的子分类吗?' */this.$t('Chart.OptMsg.classify_delall_confirm'),
|
|
|
+ 4: res.Data.TipsMsg
|
|
|
}
|
|
|
- });
|
|
|
+
|
|
|
+ if([1,4].includes(res.Data.DeleteStatus)) this.$confirm(
|
|
|
+ deleteLabelMap[res.Data.DeleteStatus],
|
|
|
+ /* '删除失败' */this.$t('Chart.OptMsg.del_fail_tag'),
|
|
|
+ {
|
|
|
+ confirmButtonText: /* '知道了' */this.$t('Dialog.known'),
|
|
|
+ showCancelButton:false,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ else if([0,2].includes(res.Data.DeleteStatus)) this.$confirm(
|
|
|
+ res.Data.DeleteStatus === 2
|
|
|
+ ? deleteLabelMap[res.Data.DeleteStatus]
|
|
|
+ : data.ChartInfoId?this.$t('Chart.OptMsg.chart_del_confirm'):this.$t('Chart.OptMsg.classify_del_confirm'),
|
|
|
+ this.$t('Dialog.warn_tit'),
|
|
|
+ {
|
|
|
+ confirmButtonText: /* '确定' */this.$t('Dialog.confirm_btn'),
|
|
|
+ cancelButtonText: /* '取消' */this.$t('Dialog.cancel_btn'),
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ res.Data.DeleteStatus === 0 && data.ChartInfoId
|
|
|
+ ? this.delHandle(data.ChartClassifyId, data.ChartInfoId, 1)
|
|
|
+ : this.delHandle(data.ChartClassifyId, data.ChartInfoId);
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
},
|
|
|
/* 删除方法 */
|
|
|
- delHandle(ChartClassifyId, ChartInfoId, type) {
|
|
|
- dataBaseInterface
|
|
|
- .delChartClassify({
|
|
|
- ChartClassifyId,
|
|
|
- ChartInfoId,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.Ret === 200) {
|
|
|
- this.$message.success(res.Msg);
|
|
|
- if (!res.Data.ChartInfoId) this.selected_chartid = '';
|
|
|
- if(type && res.Data.ChartInfoId){
|
|
|
- this.getTreeData({
|
|
|
- code: res.Data.UniqueCode,
|
|
|
- id: res.Data.ChartInfoId,
|
|
|
- type: res.Data.ChartType,
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.getTreeData();
|
|
|
- }
|
|
|
- //如果router.query里的图表被删除,则清掉参数
|
|
|
- if(Number(this.$route.query.id)===ChartInfoId){
|
|
|
- this.$router.replace({path: '/chartsetting'})
|
|
|
- }
|
|
|
+ async delHandle(ChartClassifyId, ChartInfoId, type) {
|
|
|
+ const res = this.classifyShowType === 'public'
|
|
|
+ ? await chartBaseV2Interface.delPublicedClassify({
|
|
|
+ ChartClassifyId,
|
|
|
+ ChartInfoId,
|
|
|
+ })
|
|
|
+ : await dataBaseInterface.delChartClassify({
|
|
|
+ ChartClassifyId,
|
|
|
+ ChartInfoId,
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res.Ret !== 200) return
|
|
|
+ this.$message.success(res.Msg);
|
|
|
+ if (!res.Data.ChartInfoId) this.selected_chartid = '';
|
|
|
+ if(type && res.Data.ChartInfoId){
|
|
|
+ this.getTreeData({
|
|
|
+ code: res.Data.UniqueCode,
|
|
|
+ id: res.Data.ChartInfoId,
|
|
|
+ type: res.Data.ChartType,
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.getTreeData();
|
|
|
+ }
|
|
|
+ //如果router.query里的图表被删除,则清掉参数
|
|
|
+ if(Number(this.$route.query.id)===ChartInfoId){
|
|
|
+ this.$router.replace({path: '/chartsetting'})
|
|
|
}
|
|
|
- });
|
|
|
},
|
|
|
/* 新增/编辑分类成功 */
|
|
|
- sucessCallback(type) {
|
|
|
+ handleConfirmClassify(type) {
|
|
|
this.isOpenDialog = false;
|
|
|
this.getTreeData();
|
|
|
|
|
@@ -1506,7 +1523,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//绑定el-tree的load属性
|
|
|
- getLazyTreeData (node,resolve,maxLevel=3){
|
|
|
+ async getLazyTreeData (node,resolve,maxLevel=3){
|
|
|
if(node.level===0){
|
|
|
resolve(this.treeData)
|
|
|
}
|
|
@@ -1515,11 +1532,17 @@ export default {
|
|
|
resolve(node.data.Children||[])
|
|
|
}
|
|
|
if(node.level===maxLevel){
|
|
|
- //调接口获取该分类下图表的数据
|
|
|
- dataBaseInterface.getChartListForClassify({
|
|
|
- ChartClassifyId:node.data.ChartClassifyId,
|
|
|
- IsShowMe:this.isOnlyMe
|
|
|
- }).then(res=>{
|
|
|
+
|
|
|
+ //调接口获取该分类下图表的数据
|
|
|
+ const res = this.classifyShowType === 'public'
|
|
|
+ ? await chartBaseV2Interface.getPublicClassifyExpand({
|
|
|
+ ParentId: node.data.ChartClassifyId,
|
|
|
+ })
|
|
|
+ : dataBaseInterface.getChartListForClassify({
|
|
|
+ ChartClassifyId:node.data.ChartClassifyId,
|
|
|
+ IsShowMe:this.isOnlyMe
|
|
|
+ })
|
|
|
+
|
|
|
if(res.Ret===200){
|
|
|
let arr=res.Data.AllNodes||[]
|
|
|
arr=arr.map(item=>{
|
|
@@ -1533,7 +1556,6 @@ export default {
|
|
|
resolve([])
|
|
|
}
|
|
|
this.changeTreeNode()
|
|
|
- })
|
|
|
}
|
|
|
if(node.level>maxLevel){
|
|
|
resolve([])
|
|
@@ -1561,27 +1583,30 @@ export default {
|
|
|
|
|
|
// //将指标添加进标签列表中
|
|
|
const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo;
|
|
|
- this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId).reverse();
|
|
|
- this.changeTreeNode()
|
|
|
-
|
|
|
- //滚动到高亮节点位置
|
|
|
- this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
- setTimeout(() => {
|
|
|
- let node = document.getElementById(`node${this.select_node}`);
|
|
|
- let parent = document.getElementsByClassName('tree-cont')[0];
|
|
|
-
|
|
|
- //parent可视区间:[scrollTop,scrollTop+offsetHeight]
|
|
|
- //node位置:node.offsetTop
|
|
|
- const overTop = node.offsetTop+node.clientHeight+15<parent.scrollTop
|
|
|
- const overBottom = node.offsetTop+node.clientHeight+15>parent.scrollTop+parent.offsetHeight
|
|
|
- console.log(overBottom)
|
|
|
- if(overTop){
|
|
|
- parent.scrollTop = node.offsetTop-30
|
|
|
- }
|
|
|
- if(overBottom){
|
|
|
- parent.scrollTop = node.offsetTop - parent.offsetHeight/2
|
|
|
- }
|
|
|
- },400)
|
|
|
+ if(['own','public'].includes(this.classifyShowType)) {
|
|
|
+
|
|
|
+ this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId).reverse();
|
|
|
+ this.changeTreeNode()
|
|
|
+
|
|
|
+ //滚动到高亮节点位置
|
|
|
+ this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
+ setTimeout(() => {
|
|
|
+ let node = document.getElementById(`node${this.select_node}`);
|
|
|
+ let parent = document.getElementsByClassName('tree-cont')[0];
|
|
|
+
|
|
|
+ //parent可视区间:[scrollTop,scrollTop+offsetHeight]
|
|
|
+ //node位置:node.offsetTop
|
|
|
+ const overTop = node.offsetTop+node.clientHeight+15<parent.scrollTop
|
|
|
+ const overBottom = node.offsetTop+node.clientHeight+15>parent.scrollTop+parent.offsetHeight
|
|
|
+ console.log(overBottom)
|
|
|
+ if(overTop){
|
|
|
+ parent.scrollTop = node.offsetTop-30
|
|
|
+ }
|
|
|
+ if(overBottom){
|
|
|
+ parent.scrollTop = node.offsetTop - parent.offsetHeight/2
|
|
|
+ }
|
|
|
+ },400)
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if(!this.chartInfo.HaveOperaAuth) return
|
|
@@ -1759,18 +1784,17 @@ export default {
|
|
|
|
|
|
searchApi(query,page=1) {
|
|
|
/* 查找列表 */
|
|
|
- dataBaseInterface
|
|
|
- .chartSearchByEs({
|
|
|
- Keyword: query,
|
|
|
- IsShowMe:this.isOnlyMe,
|
|
|
- CurrentIndex: page
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.Ret !== 200) return
|
|
|
- const { List,Paging } = res.Data;
|
|
|
- this.search_have_more = page < Paging.Pages;
|
|
|
- this.searchOptions = page === 1 ? List : [...this.searchOptions,...List];
|
|
|
- });
|
|
|
+ dataBaseInterface.chartSearchByEs({
|
|
|
+ Keyword: query,
|
|
|
+ IsShowMe:this.isOnlyMe,
|
|
|
+ CurrentIndex: page,
|
|
|
+ ChartAuth: this.classifyShowType==='own'?1:2
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.Ret !== 200) return
|
|
|
+ const { List,Paging } = res.Data;
|
|
|
+ this.search_have_more = page < Paging.Pages;
|
|
|
+ this.searchOptions = page === 1 ? List : [...this.searchOptions,...List];
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
/* 聚焦获取当前检索 */
|
|
@@ -2269,26 +2293,45 @@ export default {
|
|
|
},
|
|
|
|
|
|
/* ----------------公用图库part-------------------- */
|
|
|
- getPublicChartList() {
|
|
|
- mychartInterface
|
|
|
- .publicList({
|
|
|
- PageSize: this.public_page_size,
|
|
|
- CurrentIndex: this.public_page_no,
|
|
|
- ChartClassifyId: this.default_classify || 0,
|
|
|
- IsShowMe:this.isOnlyMe
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.Ret !== 200) return;
|
|
|
- this.publicHaveMove = res.Data
|
|
|
- ? this.public_page_no < res.Data.Paging.Pages
|
|
|
- : false;
|
|
|
- this.chartPublicList = res.Data
|
|
|
- ? this.public_page_no === 1
|
|
|
- ? res.Data.List
|
|
|
- : [...this.chartPublicList, ...res.Data.List]
|
|
|
- : [];
|
|
|
- this.public_total = res.Data ? res.Data.Paging.Totals : 0;
|
|
|
- });
|
|
|
+ async getChartList() {
|
|
|
+
|
|
|
+ let res = null;
|
|
|
+
|
|
|
+ if(this.classifyShowType === 'shared') {//共享
|
|
|
+ res = await chartBaseV2Interface.getSharedChartList({
|
|
|
+ FilterSource: this.currentTreeName==='sharedReceive' ? 1 : 0
|
|
|
+ })
|
|
|
+ }else { //其他走es
|
|
|
+ let ChartAuth = 0;
|
|
|
+ if(this.classifyShowType==='own') { //我的
|
|
|
+ ChartAuth = 1;
|
|
|
+ }else if(this.classifyShowType==='public') {//公共
|
|
|
+ ChartAuth = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ let ChartCollect = 0;
|
|
|
+ if(this.classifyShowType==='own'&&this.currentTreeName==='collect') {
|
|
|
+ ChartCollect = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ res = await dataBaseInterface.chartSearchByEs({
|
|
|
+ PageSize: this.public_page_size,
|
|
|
+ CurrentIndex: this.public_page_no,
|
|
|
+ ClassifyId: this.default_classify || 0,
|
|
|
+ Keyword: this.search_txt,
|
|
|
+ ChartAuth,
|
|
|
+ ChartCollect
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ this.publicHaveMove = res.Data
|
|
|
+ ? this.public_page_no < res.Data.Paging.Pages
|
|
|
+ : false;
|
|
|
+ this.chartPublicList = this.public_page_no === 1
|
|
|
+ ? res.Data.List
|
|
|
+ : [...this.chartPublicList, ...res.Data.List];
|
|
|
+ this.public_total = res.Data ? res.Data.Paging.Totals : 0;
|
|
|
},
|
|
|
|
|
|
/* 加载更多 */
|
|
@@ -2301,7 +2344,7 @@ export default {
|
|
|
console.log('scrollHeight:',scrollHeight)
|
|
|
if(scrollTop + clientHeight >= scrollHeight-10 && this.publicHaveMove){
|
|
|
this.public_page_no++;
|
|
|
- this.getPublicChartList();
|
|
|
+ this.getChartList();
|
|
|
}
|
|
|
},300),
|
|
|
|
|
@@ -2341,7 +2384,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
changeTreeNode(){
|
|
|
- this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
+ this.$refs.treeRef&&this.$refs.treeRef.setCurrentKey(this.select_node);
|
|
|
},
|
|
|
|
|
|
// 图表到社区的操作
|
|
@@ -2383,13 +2426,16 @@ export default {
|
|
|
/* 切换分类类型 */
|
|
|
handleChangeClassifyType() {
|
|
|
this.defaultShowNodes = [];
|
|
|
- this.public_page_no = 0;
|
|
|
- this.selected_edbid = 0;
|
|
|
+ this.public_page_no = 1;
|
|
|
+ this.selected_chartid = 0;
|
|
|
+ this.select_node = '';
|
|
|
this.default_classify = 0;
|
|
|
+ this.selected_chartClassify = 0;
|
|
|
this.search_txt = '';
|
|
|
- this.$refs.listChartPage && (this.$refs.listChartPage.scrollTop = 0);
|
|
|
+ this.chartPublicList = [];
|
|
|
|
|
|
- this.getPublicChartList();
|
|
|
+ this.$refs.listChartPage && (this.$refs.listChartPage.scrollTop = 0);
|
|
|
+ this.getChartList();
|
|
|
|
|
|
|
|
|
['own','public'].includes(this.classifyShowType) && this.getTreeData();
|
|
@@ -2398,33 +2444,34 @@ export default {
|
|
|
|
|
|
//获取收藏指标分类
|
|
|
async getCollectClassifys() {
|
|
|
- const res = await edbCollectInterface.getEdbCollectClassify({ParentId:0})
|
|
|
-
|
|
|
- this.collectClassifys = res.Data||[]
|
|
|
+ const res = await chartBaseV2Interface.getChartCollectClassify()
|
|
|
+
|
|
|
+ this.collectClassifys = res.Data
|
|
|
+ ? res.Data.map(_ =>({
|
|
|
+ ..._,
|
|
|
+ ChartClassifyId: _.ClassifyId
|
|
|
+ }))
|
|
|
+ : [];
|
|
|
},
|
|
|
|
|
|
- /* 收藏指标 */
|
|
|
- handleCollectEdb(info) {
|
|
|
+ /* 收藏图表 */
|
|
|
+ handleCollectEdb() {
|
|
|
+ let info = this.chartInfo;
|
|
|
this.collectEdbForm = {
|
|
|
- edbId: info.EdbInfoId,
|
|
|
+ chartId: info.ChartInfoId,
|
|
|
collectClassifyIdList: info.CollectClassifyIdList||[]
|
|
|
},
|
|
|
this.isOpenEdbCollectDia = true
|
|
|
},
|
|
|
|
|
|
- async handleRemoveCollect(item=null) {
|
|
|
- const res = await edbCollectInterface.edbCollectCancel({
|
|
|
- ClassifyId: this.select_classifyId,
|
|
|
- EdbInfoId: item?item.EdbInfoId:this.selected_edbid
|
|
|
+ async handleRemoveCollect() {
|
|
|
+ const res = await chartBaseV2Interface.edbCollectCancel({
|
|
|
+ ClassifyId: this.default_classify,
|
|
|
+ ChartInfoId: this.chartInfo.ChartInfoId
|
|
|
})
|
|
|
|
|
|
if(res.Ret !== 200) return
|
|
|
this.$message.success('取消收藏成功')
|
|
|
- if(this.selected_edbid) {
|
|
|
- this.chartList = []
|
|
|
- this.selected_edbid = 0
|
|
|
- }
|
|
|
- this.getEdbChartList()
|
|
|
},
|
|
|
|
|
|
handleOpenCollectClassify(data=null) {
|
|
@@ -2435,29 +2482,29 @@ export default {
|
|
|
this.isOpenCollectClassifyDia = true
|
|
|
},
|
|
|
|
|
|
- /* 收藏指标拖动 */
|
|
|
+ /* 收藏图表拖动 */
|
|
|
async collectDragOver({oldIndex,newIndex}) {
|
|
|
if(oldIndex===newIndex) return
|
|
|
- let NextEdbInfoId,PrevEdbInfoId;
|
|
|
+ let NextChartInfoId,PrevChartInfoId;
|
|
|
if(newIndex===0){
|
|
|
- PrevEdbInfoId=0
|
|
|
- NextEdbInfoId=this.chartList[newIndex+1].EdbInfoId
|
|
|
+ PrevChartInfoId=0
|
|
|
+ NextChartInfoId=this.chartList[newIndex+1].ChartInfoId
|
|
|
}else if(newIndex===this.chartList.length-1){
|
|
|
- PrevEdbInfoId = this.chartList[newIndex-1].EdbInfoId
|
|
|
- NextEdbInfoId = 0
|
|
|
+ PrevChartInfoId = this.chartList[newIndex-1].ChartInfoId
|
|
|
+ NextChartInfoId = 0
|
|
|
}else{
|
|
|
- PrevEdbInfoId = this.chartList[newIndex-1].EdbInfoId
|
|
|
- NextEdbInfoId = this.chartList[newIndex+1].EdbInfoId
|
|
|
+ PrevChartInfoId = this.chartList[newIndex-1].ChartInfoId
|
|
|
+ NextChartInfoId = this.chartList[newIndex+1].ChartInfoId
|
|
|
}
|
|
|
|
|
|
let params = {
|
|
|
- ClassifyId: this.select_classifyId,
|
|
|
- EdbInfoId: this.chartList[newIndex].EdbInfoId,
|
|
|
- NextEdbInfoId,
|
|
|
- PrevEdbInfoId,
|
|
|
+ ClassifyId: this.default_classify,
|
|
|
+ ChartInfoId: this.chartList[newIndex].ChartInfoId,
|
|
|
+ NextChartInfoId,
|
|
|
+ PrevChartInfoId,
|
|
|
}
|
|
|
|
|
|
- const res = await edbCollectInterface.moveCollectEdb(params)
|
|
|
+ const res = await chartBaseV2Interface.moveCollectChart(params)
|
|
|
if(res.Ret !== 200) return
|
|
|
this.$message.success('移动成功')
|
|
|
},
|
|
@@ -2476,7 +2523,7 @@ export default {
|
|
|
this.getTreeData({code: this.$route.query.code,id: Number(this.$route.query.id)})
|
|
|
} else {
|
|
|
this.getTreeData();
|
|
|
- this.getPublicChartList();
|
|
|
+ this.getChartList();
|
|
|
}
|
|
|
window.addEventListener('resize', this.reloadRightWid);
|
|
|
},
|
|
@@ -2706,8 +2753,10 @@ export default {
|
|
|
}
|
|
|
.tree-cont {
|
|
|
padding: 0 20px 30px;
|
|
|
- // overflow: auto;
|
|
|
height: calc(100vh - 320px);
|
|
|
+ &.shared-cont {
|
|
|
+ height: calc(100vh - 250px);
|
|
|
+ }
|
|
|
}
|
|
|
.target_tree {
|
|
|
font-size: 14px;
|