|
@@ -0,0 +1,799 @@
|
|
|
|
+<template>
|
|
|
|
+<div>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="show"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :modal-append-to-body="false"
|
|
|
|
+ @close="handleClose"
|
|
|
|
+ custom-class="set-shared-dialog fit-screen-dialog"
|
|
|
|
+ center
|
|
|
|
+ top="2vh"
|
|
|
|
+ v-dialogDrag
|
|
|
|
+ :title="type==='shared'?`设置共享${sourceLabel}`:`设置${sourceLabel}公开`"
|
|
|
|
+ >
|
|
|
|
+ <div class="list-wrap">
|
|
|
|
+ <p>
|
|
|
|
+ 选择{{sourceLabel}}(一次选择数量不超过{{MAXAddNUM}})
|
|
|
|
+ </p>
|
|
|
|
+ <div class="filter-wrap">
|
|
|
|
+ <div>
|
|
|
|
+ <el-cascader
|
|
|
|
+ style="width: 240px"
|
|
|
|
+ v-model="filterObj.classify"
|
|
|
|
+ :options="classifyOption"
|
|
|
|
+ clearable
|
|
|
|
+ collapse-tags
|
|
|
|
+ placeholder="选择分类"
|
|
|
|
+ @change="handleFilter"
|
|
|
|
+ :props="cascaderProps"
|
|
|
|
+ :show-all-levels="false"
|
|
|
|
+ :key="cascaderKey"
|
|
|
|
+ ref="classifyRef"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <div>
|
|
|
|
+ 关联子分类
|
|
|
|
+ <el-switch
|
|
|
|
+ v-model="filterObj.relevanceChild"
|
|
|
|
+ :active-value="true"
|
|
|
|
+ :inactive-value="false"
|
|
|
|
+ style="margin-left: 5px;"
|
|
|
|
+ @change="cascaderKey++"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <el-select
|
|
|
|
+ v-if="source==='edb'"
|
|
|
|
+ v-model="filterObj.source"
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ clearable
|
|
|
|
+ multiple
|
|
|
|
+ collapse-tags
|
|
|
|
+ placeholder="请选择数据来源"
|
|
|
|
+ @change="handleFilter"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in sourceOption"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-cascader
|
|
|
|
+ v-if="source==='chart'"
|
|
|
|
+ v-model="filterObj.chartTypes"
|
|
|
|
+ :options="chartTypesOptions"
|
|
|
|
+ :show-all-levels="false"
|
|
|
|
+ clearable
|
|
|
|
+ collapse-tags
|
|
|
|
+ :props="{
|
|
|
|
+ emitPath:false,
|
|
|
|
+ label:'ChartTypeName',
|
|
|
|
+ value:'ChartTypeId',
|
|
|
|
+ children:'Child',
|
|
|
|
+ multiple:true
|
|
|
|
+ }"
|
|
|
|
+ placeholder="图表类型"
|
|
|
|
+ @change="handleFilter"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="filterObj.listStatus"
|
|
|
|
+ style="width: 140px"
|
|
|
|
+ clearable
|
|
|
|
+ multiple
|
|
|
|
+ @change="handleFilter"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ v-for="item in statusOptions"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="filterObj.keyWord"
|
|
|
|
+ :placeholder="`${sourceLabel}名称`"
|
|
|
|
+ style="width: 200px;"
|
|
|
|
+ @change="handleFilter"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <i slot="prefix" class="el-input__icon el-icon-search"/>
|
|
|
|
+ </el-input>
|
|
|
|
+
|
|
|
|
+ <el-checkbox
|
|
|
|
+ label="列表全选"
|
|
|
|
+ v-model="filterObj.checkAll"
|
|
|
|
+ :indeterminate="filterObj.checkSome"
|
|
|
|
+ style="margin-left:10px"
|
|
|
|
+ @change="listCheckAllChange"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <el-button type="primary" style="width:120px" @click="type==='shared'? handleSetShare():handleSetPublic(null,'batch')">批量设置</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="table-wrap">
|
|
|
|
+ <el-table
|
|
|
|
+ :data="list"
|
|
|
|
+ border
|
|
|
|
+ ref="table"
|
|
|
|
+ height="550px"
|
|
|
|
+ v-loading="listLoading"
|
|
|
|
+ @selection-change="selectionChange"
|
|
|
|
+ @select="selectHandle"
|
|
|
|
+ @select-all="selectAllPageHandle"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column type="selection" min-width="50" align="center" :selectable="filterEdbAuth"/>
|
|
|
|
+
|
|
|
|
+ <el-table-column
|
|
|
|
+ :label="item.label"
|
|
|
|
+ align="center"
|
|
|
|
+ v-for="item in tableColumns"
|
|
|
|
+ :key="item.key"
|
|
|
|
+ :width="item.widthsty"
|
|
|
|
+ :min-width="item.minwidthsty"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <!-- 公开状态 -->
|
|
|
|
+ <span v-if="item.key==='PublicStatus'">
|
|
|
|
+ {{ publicStatusLabel.get(row.PublicStatus) }}
|
|
|
|
+ </span>
|
|
|
|
+
|
|
|
|
+ <span v-else>{{ row[item.key] }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <el-button type="text" @click="handleSetShare(row)" v-if="type==='shared'">设置共享</el-button>
|
|
|
|
+
|
|
|
|
+ <el-button type="text" @click="handleSetPublic(row)" v-else-if="type==='public'&&row.PublicStatus===0">设置公开</el-button>
|
|
|
|
+
|
|
|
|
+ <el-button type="text" @click="handleCancelPublic(row)" v-else-if="type==='public'&&row.PublicStatus!==0">撤销</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+ <div style="height:40px;margin:20px 0;">
|
|
|
|
+ <m-page
|
|
|
|
+ class="table-page"
|
|
|
|
+ :total="total"
|
|
|
|
+ :pageSize="filterObj.pageSize"
|
|
|
|
+ :page_no="filterObj.pageNo"
|
|
|
|
+ @handleCurrentChange="pageChange"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 设置共享 -->
|
|
|
|
+ <setSharedDia
|
|
|
|
+ :show.sync="isSetSharedDia"
|
|
|
|
+ :checkedParams="checkedParams"
|
|
|
|
+ :source="source"
|
|
|
|
+ @confirm="handleSetConfirm"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <!-- 设置公开 -->
|
|
|
|
+ <setPublicDia
|
|
|
|
+ :show.sync="isSetPublicDia"
|
|
|
|
+ :checkedParams="checkedParams"
|
|
|
|
+ :source="source"
|
|
|
|
+ @confirm="handleSetConfirm"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <!-- 批量设置公开 -->
|
|
|
|
+ <batchSetPublicDia
|
|
|
|
+ :show.sync="isBatchSetPublicDia"
|
|
|
|
+ :checkedParams="checkedParams"
|
|
|
|
+ :source="source"
|
|
|
|
+ @confirm="handleSetConfirm"
|
|
|
|
+ />
|
|
|
|
+</div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import mPage from '@/components/mPage.vue'
|
|
|
|
+import { dataBaseInterface } from '@/api/api.js';
|
|
|
|
+import { edbBaseV2Interface,chartBaseV2Interface } from '@/api/modules/chartApi';
|
|
|
|
+import setSharedDia from './setSharedDia.vue';
|
|
|
|
+import setPublicDia from './setPublicDia.vue';
|
|
|
|
+import batchSetPublicDia from './batchSetPublicDia.vue';
|
|
|
|
+export default {
|
|
|
|
+ components:{ mPage,setSharedDia,setPublicDia,batchSetPublicDia },
|
|
|
|
+ props:{
|
|
|
|
+ show:{
|
|
|
|
+ type: Boolean
|
|
|
|
+ },
|
|
|
|
+ source: { //指标或图库
|
|
|
|
+ type: String,
|
|
|
|
+ default: 'edb'
|
|
|
|
+ },
|
|
|
|
+ type: { //设置类型 设置共享shared 设置公开public
|
|
|
|
+ type: Number
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed:{
|
|
|
|
+ // 最大添加指标的上限
|
|
|
|
+ MAXAddNUM(){
|
|
|
|
+ let num=100
|
|
|
|
+ return num
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ tableColumns() {
|
|
|
|
+ let columns = [
|
|
|
|
+ {
|
|
|
|
+ label: '指标名称',
|
|
|
|
+ key: 'EdbName',
|
|
|
|
+ minwidthsty: '250px',
|
|
|
|
+ show: this.source==='edb'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '图表名称',
|
|
|
|
+ key: 'ChartName',
|
|
|
|
+ minwidthsty: '250px',
|
|
|
|
+ show: this.source==='chart'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '图表类型',
|
|
|
|
+ key: 'Source',
|
|
|
|
+ show: this.source==='chart'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '计算方式',
|
|
|
|
+ key: 'SourceName',
|
|
|
|
+ widthsty:'100px',
|
|
|
|
+ show: this.source==='edb'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '最新值',
|
|
|
|
+ key: 'EndValue',
|
|
|
|
+ widthsty:'100px',
|
|
|
|
+ show: this.source==='edb'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '频度',
|
|
|
|
+ key: 'Frequency',
|
|
|
|
+ widthsty:'100px',
|
|
|
|
+ show: this.source==='edb'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '共享用户',
|
|
|
|
+ key: 'SharedUserName',
|
|
|
|
+ minwidthsty: '180px',
|
|
|
|
+ show: this.type==='shared'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '公开状态',
|
|
|
|
+ key: 'PublicStatus',
|
|
|
|
+ minwidthsty: '180px',
|
|
|
|
+ show: this.type==='public'
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+
|
|
|
|
+ let filterColumns = columns.filter(_ => _.show);
|
|
|
|
+
|
|
|
|
+ return filterColumns;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ sourceLabel() {
|
|
|
|
+ return this.source==='edb'?'指标':'图表';
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ cascaderProps() {
|
|
|
|
+ let options = this.source === 'chart'
|
|
|
|
+ ? {
|
|
|
|
+ label: 'ChartClassifyName',
|
|
|
|
+ value: 'ChartClassifyId',
|
|
|
|
+ children: 'Children',
|
|
|
|
+ multiple: true,
|
|
|
|
+ emitPath: false,
|
|
|
|
+ checkStrictly: !this.filterObj.relevanceChild
|
|
|
|
+ }
|
|
|
|
+ : {
|
|
|
|
+ label: 'ClassifyName',
|
|
|
|
+ value: 'ClassifyId',
|
|
|
|
+ children: 'Children',
|
|
|
|
+ multiple: true,
|
|
|
|
+ emitPath: false,
|
|
|
|
+ checkStrictly: !this.filterObj.relevanceChild
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return options
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ Idkey() {
|
|
|
|
+ return this.source==='edb'?'EdbInfoId':'ChartInfoId';
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //公开状态
|
|
|
|
+ publicStatusLabel() {
|
|
|
|
+ return new Map([
|
|
|
|
+ [0,''],
|
|
|
|
+ [1,'未公开'],
|
|
|
|
+ [2,'已提交'],
|
|
|
|
+ [3,'已公开'],
|
|
|
|
+ ])
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 状态下拉 */
|
|
|
|
+ statusOptions() {
|
|
|
|
+ const statusMap = new Map([
|
|
|
|
+ ['shared',[
|
|
|
|
+ { label: '未共享',value: 1 },
|
|
|
|
+ { label: '已共享',value: 2 },
|
|
|
|
+ ]],
|
|
|
|
+ ['public',[
|
|
|
|
+ { label: '未公开',value: 1 },
|
|
|
|
+ { label: '已公开',value: 3 },
|
|
|
|
+ ]],
|
|
|
|
+ ])
|
|
|
|
+
|
|
|
|
+ return statusMap.get(this.type)||[]
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ show(n){
|
|
|
|
+ if(!n) return
|
|
|
|
+
|
|
|
|
+ this.getClassifyOpts();
|
|
|
|
+ this.source==='chart' && this.getChartTypes();
|
|
|
|
+ this.source==='edb' && this.getEdbSources();
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.getList('init');
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ filterObj: {
|
|
|
|
+ classify: [],
|
|
|
|
+ relevanceChild:true,
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ source: [],
|
|
|
|
+ chartTypes: [],
|
|
|
|
+ listStatus:[1],
|
|
|
|
+ keyWord: '',
|
|
|
|
+ checkAll: false, //控制全选显示状态
|
|
|
|
+ checkSome: false
|
|
|
|
+ },
|
|
|
|
+ sourceOption: [],
|
|
|
|
+ classifyOption: [],
|
|
|
|
+ cascaderKey:0,
|
|
|
|
+ chartTypesOptions: [],
|
|
|
|
+
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ isSelectAll: false, //真正意义上的全选或不全选
|
|
|
|
+ checkedList: [], //不全选勾选中的 或 全选取消勾的项
|
|
|
|
+ selectionReactCancel:false,//手动设置选中中
|
|
|
|
+
|
|
|
|
+ checkedParams: {},//选项入参
|
|
|
|
+ /* 设置共享弹窗 */
|
|
|
|
+ isSetSharedDia: false,
|
|
|
|
+ /* 设置公开弹窗 */
|
|
|
|
+ isSetPublicDia: false,
|
|
|
|
+ /* 批量设置公开 */
|
|
|
|
+ isBatchSetPublicDia: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ methods: {
|
|
|
|
+
|
|
|
|
+ /* 获取图表类型 */
|
|
|
|
+ getChartTypes() {
|
|
|
|
+ dataBaseInterface.chartTypeList().then(res=>{
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+ this.chartTypesOptions=res.Data.List||[];
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 获取计算指标类型 */
|
|
|
|
+ async getEdbSources() {
|
|
|
|
+ const res = await dataBaseInterface.getDataSource({IsBase:2})
|
|
|
|
+
|
|
|
|
+ if(res.Ret !== 200) return
|
|
|
|
+
|
|
|
|
+ this.sourceOption = res.Data.map(i=>({
|
|
|
|
+ label:i.SourceName,
|
|
|
|
+ value:i.EdbSourceId
|
|
|
|
+ }))
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //个人目录 指标/图库
|
|
|
|
+ async getClassifyOpts() {
|
|
|
|
+ const res = this.source==='edb'
|
|
|
|
+ ? await dataBaseInterface.menuListV3({
|
|
|
|
+ ClassifyType: 2
|
|
|
|
+ })
|
|
|
|
+ : await dataBaseInterface.chartClassify()
|
|
|
|
+
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+
|
|
|
|
+ this.classifyOption = res.Data.AllNodes || [];
|
|
|
|
+ this.filterNodes(this.classifyOption)
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ filterNodes(arr) {
|
|
|
|
+ arr.length && arr.forEach(item => {
|
|
|
|
+ item.Children && item.Children.length && this.filterNodes(item.Children)
|
|
|
|
+ if(!item.Children.length) {
|
|
|
|
+ delete item.Children
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ async getList(type='pageChange') {
|
|
|
|
+ let apiMap = {
|
|
|
|
+ 'edb': this.getEdbList,
|
|
|
|
+ 'chart': this.getChartList
|
|
|
|
+ }
|
|
|
|
+ apiMap[this.source](type)
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //指标列表
|
|
|
|
+ async getEdbList(type) {
|
|
|
|
+ const {
|
|
|
|
+ pageNo,
|
|
|
|
+ pageSize,
|
|
|
|
+ source,
|
|
|
|
+ chartTypes,
|
|
|
|
+ listStatus,
|
|
|
|
+ keyWord,
|
|
|
|
+ } = this.filterObj;
|
|
|
|
+
|
|
|
|
+ let checkedClassify = this.$refs.classifyRef.getCheckedNodes();
|
|
|
|
+ let ClassifyIdList = checkedClassify.length
|
|
|
|
+ ? checkedClassify.map(_ => _.data.ClassifyId)
|
|
|
|
+ : []
|
|
|
|
+
|
|
|
|
+ let params = {
|
|
|
|
+ SourceList:source,
|
|
|
|
+ Keyword: keyWord,
|
|
|
|
+ ClassifyIdList,
|
|
|
|
+ CurrentIndex: pageNo,
|
|
|
|
+ PageSize: pageSize
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const res = this.type === 'shared'
|
|
|
|
+ ? await edbBaseV2Interface.getSharedSearchList({
|
|
|
|
+ EdbShareList: listStatus,
|
|
|
|
+ ...params
|
|
|
|
+ })
|
|
|
|
+ : await edbBaseV2Interface.getPublicSearchList({
|
|
|
|
+ EdbPublicList: listStatus,
|
|
|
|
+ ...params
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ if(res.Ret !== 200) return
|
|
|
|
+ this.list = res.Data.List||[];
|
|
|
|
+ this.total = res.Data.Paging.Totals;
|
|
|
|
+
|
|
|
|
+ if(type==='filter'){
|
|
|
|
+ this.listCheckAllChange(true)
|
|
|
|
+ }else {
|
|
|
|
+ //页码变化 选中项不做清空
|
|
|
|
+ this.checkedSomeSelection()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //图表列表
|
|
|
|
+ async getChartList(type) {
|
|
|
|
+ const {
|
|
|
|
+ pageNo,
|
|
|
|
+ pageSize,
|
|
|
|
+ chartTypes,
|
|
|
|
+ listStatus,
|
|
|
|
+ keyWord,
|
|
|
|
+ } = this.filterObj;
|
|
|
|
+
|
|
|
|
+ let checkedClassify = this.$refs.classifyRef.getCheckedNodes();
|
|
|
|
+ let ClassifyIdList = checkedClassify.length
|
|
|
|
+ ? checkedClassify.map(_ => _.data.ClassifyId)
|
|
|
|
+ : []
|
|
|
|
+
|
|
|
|
+ let params = {
|
|
|
|
+ ChartTypeList:chartTypes,
|
|
|
|
+ Keyword: keyWord,
|
|
|
|
+ ClassifyIdList,
|
|
|
|
+ CurrentIndex: pageNo,
|
|
|
|
+ PageSize: pageSize
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const res = this.type === 'shared'
|
|
|
|
+ ? await chartBaseV2Interface.getSharedSearchList({
|
|
|
|
+ ChartShareList: listStatus,
|
|
|
|
+ ...params
|
|
|
|
+ })
|
|
|
|
+ : await chartBaseV2Interface.getPublicSearchList({
|
|
|
|
+ ChartPublicList: listStatus,
|
|
|
|
+ ...params
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ if(res.Ret !== 200) return
|
|
|
|
+ this.list = res.Data.List||[];
|
|
|
|
+ this.total = res.Data.Paging.Totals;
|
|
|
|
+
|
|
|
|
+ if(type==='filter'){
|
|
|
|
+ this.listCheckAllChange(true)
|
|
|
|
+ }else {
|
|
|
|
+ //页码变化 选中项不做清空
|
|
|
|
+ this.checkedSomeSelection()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleFilter(val) {
|
|
|
|
+ this.filterObj.pageNo = 1;
|
|
|
|
+ if(!val||!val.length) {
|
|
|
|
+ this.isSelectAll = false;
|
|
|
|
+ this.checkedList = [];
|
|
|
|
+ this.filterObj.checkAll = false;
|
|
|
|
+ this.filterObj.checkSome = false;
|
|
|
|
+ }
|
|
|
|
+ this.getList(val.length?'filter':'');
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //设置共享
|
|
|
|
+ handleSetShare(item=null) {
|
|
|
|
+ if(item) {
|
|
|
|
+ this.checkedParams = {
|
|
|
|
+ [this.Idkey]: item[this.Idkey]
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if(!this.checkedList.length && !this.isSelectAll) return this.$message.warning(`请选择${this.sourceLabel}`)
|
|
|
|
+
|
|
|
|
+ const {
|
|
|
|
+ source,
|
|
|
|
+ listStatus,
|
|
|
|
+ chartTypes,
|
|
|
|
+ keyWord,
|
|
|
|
+ } = this.filterObj;
|
|
|
|
+
|
|
|
|
+ let checkedClassify = this.$refs.classifyRef.getCheckedNodes();
|
|
|
|
+ let ClassifyIdList = checkedClassify.length
|
|
|
|
+ ? checkedClassify.map(_ => _.data.ClassifyId)
|
|
|
|
+ : []
|
|
|
|
+
|
|
|
|
+ this.checkedParams = this.source === 'chart'
|
|
|
|
+ ? {
|
|
|
|
+ ChartShareList: listStatus,
|
|
|
|
+ ChartTypeList:chartTypes,
|
|
|
|
+ Keyword: keyWord,
|
|
|
|
+ ClassifyIdList,
|
|
|
|
+ IsSelectAll: this.isSelectAll,
|
|
|
|
+ NoChartIdList: this.isSelectAll ? this.checkedList.map(_ =>_.ChartInfoId) : [],
|
|
|
|
+ ChartIdList: this.isSelectAll ? [] : this.checkedList.map(_ =>_.ChartInfoId)
|
|
|
|
+ }
|
|
|
|
+ : {
|
|
|
|
+ EdbShareList: listStatus,
|
|
|
|
+ SourceList:source,
|
|
|
|
+ Keyword: keyWord,
|
|
|
|
+ ClassifyIdList,
|
|
|
|
+ IsSelectAll: this.isSelectAll,
|
|
|
|
+ NoEdbIdList: this.isSelectAll ? this.checkedList.map(_ =>_.EdbInfoId) : [],
|
|
|
|
+ EdbIdList: this.isSelectAll ? [] : this.checkedList.map(_ =>_.EdbInfoId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.isSetSharedDia = true;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //设置公开
|
|
|
|
+ handleSetPublic(item=null,type="single") {
|
|
|
|
+ if(type==='single') {
|
|
|
|
+ this.checkedParams = {
|
|
|
|
+ [this.Idkey]: item[this.Idkey]
|
|
|
|
+ }
|
|
|
|
+ this.isSetPublicDia = true;
|
|
|
|
+ }else { //批量
|
|
|
|
+ if(!this.checkedList.length && !this.isSelectAll) return this.$message.warning(`请选择${this.sourceLabel}`)
|
|
|
|
+
|
|
|
|
+ const {
|
|
|
|
+ source,
|
|
|
|
+ listStatus,
|
|
|
|
+ chartTypes,
|
|
|
|
+ keyWord,
|
|
|
|
+ } = this.filterObj;
|
|
|
|
+
|
|
|
|
+ let checkedClassify = this.$refs.classifyRef.getCheckedNodes();
|
|
|
|
+ let ClassifyIdList = checkedClassify.length
|
|
|
|
+ ? checkedClassify.map(_ => _.data.ClassifyId)
|
|
|
|
+ : []
|
|
|
|
+
|
|
|
|
+ this.checkedParams = this.source === 'chart'
|
|
|
|
+ ? {
|
|
|
|
+ ChartPublicList: listStatus,
|
|
|
|
+ ChartTypeList:chartTypes,
|
|
|
|
+ Keyword: keyWord,
|
|
|
|
+ ClassifyIdList,
|
|
|
|
+ IsSelectAll: this.isSelectAll,
|
|
|
|
+ NoChartIdList: this.isSelectAll ? this.checkedList.map(_ =>_.ChartInfoId) : [],
|
|
|
|
+ ChartIdList: this.isSelectAll ? [] : this.checkedList.map(_ =>_.ChartInfoId)
|
|
|
|
+ }
|
|
|
|
+ : {
|
|
|
|
+ EdbPublicList: listStatus,
|
|
|
|
+ SourceList:source,
|
|
|
|
+ Keyword: keyWord,
|
|
|
|
+ ClassifyIdList,
|
|
|
|
+ IsSelectAll: this.isSelectAll,
|
|
|
|
+ NoEdbIdList: this.isSelectAll ? this.checkedList.map(_ =>_.EdbInfoId) : [],
|
|
|
|
+ EdbIdList: this.isSelectAll ? [] : this.checkedList.map(_ =>_.EdbInfoId)
|
|
|
|
+ }
|
|
|
|
+ this.isBatchSetPublicDia = true;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 撤销公开 */
|
|
|
|
+ async handleCancelPublic(item) {
|
|
|
|
+ // const res = this.source === 'edb'
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleSetConfirm() {
|
|
|
|
+ this.isSelectAll = false;
|
|
|
|
+ this.checkedList = [];
|
|
|
|
+ this.filterObj.checkAll = false;
|
|
|
|
+ this.filterObj.checkSome = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 设置当页数据勾选状态 */
|
|
|
|
+ checkedSomeSelection() {
|
|
|
|
+ this.selectionReactCancel=true
|
|
|
|
+
|
|
|
|
+ if(!this.isSelectAll){
|
|
|
|
+ this.checkedList.map(_ =>{
|
|
|
|
+ let row = this.list.find(item => item[this.Idkey]==_[this.Idkey])
|
|
|
|
+ if(row){ //设置部分选中
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.$refs.table.toggleRowSelection(row,true)
|
|
|
|
+ },20)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ this.$refs.table &&this.$refs.table.toggleAllSelection()
|
|
|
|
+ this.checkedList.map(_ =>{
|
|
|
|
+ let row = this.list.find(item => item[this.Idkey]==_[this.Idkey])
|
|
|
|
+ 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(_ => _[this.Idkey] === row[this.Idkey]);
|
|
|
|
+
|
|
|
|
+ //全选取消选和不全选选中才有意义
|
|
|
|
+ if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
|
|
|
|
+ this.checkedList.push(row)
|
|
|
|
+ }else {
|
|
|
|
+ this.checkedList=this.checkedList.filter(_ => _[this.Idkey]!==row[this.Idkey])
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //整列选
|
|
|
|
+ selectAllPageHandle(selection){
|
|
|
|
+ if(this.selectionReactCancel) return
|
|
|
|
+
|
|
|
|
+ //当前页是选中还是取消
|
|
|
|
+ let haveChecked = selection && selection.length>0;
|
|
|
|
+
|
|
|
|
+ //全选取消选和不全选选中才有意义
|
|
|
|
+ if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
|
|
|
|
+ this.checkedList = [...this.checkedList,...this.list]
|
|
|
|
+ }else {
|
|
|
|
+
|
|
|
|
+ let pageIds = this.list.map(_ => _[this.Idkey]);
|
|
|
|
+ this.checkedList = this.checkedList.filter(_ => !pageIds.includes(_[this.Idkey]))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 页码改变
|
|
|
|
+ pageChange(page) {
|
|
|
|
+ this.filterObj.pageNo = page;
|
|
|
|
+ this.getList('pageChange')
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleClose() {
|
|
|
|
+ this.filterObj = {
|
|
|
|
+ classify: [],
|
|
|
|
+ relevanceChild:true,
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ source: [],
|
|
|
|
+ chartTypes: [],
|
|
|
|
+ listStatus:[1],
|
|
|
|
+ keyWord: '',
|
|
|
|
+ checkAll: false, //控制全选显示状态
|
|
|
|
+ checkSome: false
|
|
|
|
+ }
|
|
|
|
+ this.list = [];
|
|
|
|
+ this.isSelectAll = false;
|
|
|
|
+ this.checkedList = [];
|
|
|
|
+ this.selectionReactCancel =false;
|
|
|
|
+ this.$emit('update:show',false)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.set-shared-dialog{
|
|
|
|
+ max-width: 1200px;
|
|
|
|
+ width:90vw;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+}
|
|
|
|
+.list-wrap{
|
|
|
|
+ .type-wrap{
|
|
|
|
+ display: flex;
|
|
|
|
+ }
|
|
|
|
+ .table-wrap{
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ }
|
|
|
|
+ .filter-wrap {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+ gap: 10px;
|
|
|
|
+ >div {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ gap: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|