shanbinzhang 3 months ago
parent
commit
6349f294b5

+ 54 - 0
src/api/modules/chartApi.js

@@ -1468,6 +1468,27 @@ const edbCollectInterface = {
 		getCollectEdb: params => {
 			return http.get('/datamanage/edb_collect/list',params)
 		},
+
+		/**
+		 * 批量收藏
+		 * @param {*} params 
+		 * @returns 
+		 * "KeyWord": "螺纹",
+		 * ClassifyId
+				"EdbIdList": [
+					89
+				],
+				"NoEdbIdList": [
+					71
+				],
+				"IsSelectAll": true,
+				"CollectClassifyIdList": [
+					50
+				]
+		 */
+		collectEdbBatch: params => {
+			return http.post('/datamanage/edb_collect/batch_collect',params)
+		}
 }
 
 
@@ -1688,6 +1709,23 @@ const edbBaseV2Interface = {
 		 */
 		moveOwnBatch: params => {
 			return http.post('/datamanage/edb_info/batch_move',params)
+		},
+
+		/**
+		 * 移动公开分类
+		 * @param {*} params 
+		 * "ClassifyId": 4,
+			"ParentClassifyId": 4,
+			"EdbInfoId": 102011,
+			"PrevClassifyId": 0,
+			"NextClassifyId": 5,
+			"PrevEdbInfoId": 102012,
+			"NextEdbInfoId": 0,
+			"ClassifyType":2
+		 * @returns 
+		 */
+		movePublicClassify: params => {
+			return http.post('/datamanage/edb_public/edb_classify/move',params)
 		}
 
 }
@@ -1905,6 +1943,22 @@ const chartBaseV2Interface = {
 		return http.post('/datamanage/chart_info/batch_move',params)
 	},
 
+	/**
+	 * 移动公开分类
+	 * @param {*} params 
+	 *"ClassifyId": 8,
+    "ParentClassifyId": 8,
+    "ChartInfoId": 1218,
+    "PrevClassifyId": 0,
+    "NextClassifyId": 0,
+    "PrevChartInfoId": 1217,
+    "NextChartInfoId": 0
+	 * @returns 
+	 */
+	movePublicClassify: params => {
+		return http.post('/datamanage/chart_public/chart_classify/move',params)
+	},
+
 
 	/* ====收藏==== */
 

+ 1 - 1
src/components/notificationMsg.vue

@@ -312,7 +312,7 @@ export default {
                 'chart': approveInterence.readPublicMsg,
             }
             if(!apiMap[this.activeName]) return 
-            const res = await apiMap[this.activeName]({MessageId:msg.Id})
+            const res = await apiMap[this.activeName]({MessageId: this.activeName==='third'?msg.DataPermissionMessageId:msg.Id})
 
             if(res.Ret!==200) return 
             this.getMsgList()

+ 18 - 6
src/views/dataEntry_manage/chartSetting.vue

@@ -932,6 +932,7 @@ export default {
 			],
 			classifyShowType:'own',
       currentTreeName: 'own',//当前点击的分类树 4块 列表请求接口不同  own public collect sharedReceive sharedSend
+      select_shared_User: 0,//点击收到共享的用户名
 			
 			collectClassifys:[],//收藏目录
 			//指标收藏弹窗
@@ -1091,6 +1092,7 @@ export default {
     /* 节点变化时 */
     nodeChange({data, node,treeName}) {
       this.currentTreeName=treeName;
+      this.select_shared_User = treeName==='sharedReceive' ? (data.UserId||0) : 0;
       this.search_txt = '';
       sessionStorage.removeItem('beforeOptions');
       //详情时判断是否是本人添加图表 若不是不用做保存校验 新增时要进入保存校验逻辑
@@ -1367,7 +1369,7 @@ export default {
     },
 
     // 移动的为一、二、三级目录
-		handleMoveCatalogue(b,a,i,e){
+		async handleMoveCatalogue(b,a,i,e){
 			let list=a.parent.childNodes,targetIndex=0,PrevClassifyId=0,NextClassifyId=0,ParentClassifyId=0;
 
 			list.forEach((item,index)=>{
@@ -1408,17 +1410,26 @@ export default {
 				}
 			}
 
-      dataBaseInterface.chartClassifyMove({
+      let params = {
         ClassifyId: b.data.ChartClassifyId,
         ParentClassifyId: ParentClassifyId,
         PrevClassifyId: PrevClassifyId,
         NextClassifyId:NextClassifyId
-      }).then((res) => {
+      }
+
+      const res = this.classifyShowType === 'public'
+        ? await chartBaseV2Interface.movePublicClassify({
+            ...params,
+            ChartInfoId: 0,
+            PrevChartInfoId: 0,
+            NextChartInfoId: 0
+          })
+        : await dataBaseInterface.chartClassifyMove(params)
+
         if (res.Ret === 200) {
           this.$message.success(this.$t('MsgPrompt.move_success_msg'));
         }
         this.getTreeData();
-      });
 		},
 
 		// 移动的为指标层 四级
@@ -1599,7 +1610,7 @@ export default {
 
       // //将指标添加进标签列表中
       const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo;
-      if(['own','public'].includes(this.classifyShowType)) {
+      if(['own'].includes(this.classifyShowType)) {
 
         this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId).reverse();
         this.changeTreeNode()
@@ -2330,7 +2341,8 @@ export default {
 					FilterSource: this.currentTreeName==='sharedReceive' ? 1 : 0,
           PageSize: this.public_page_size,
           CurrentIndex: this.public_page_no,
-          ClassifyId: this.default_classify || 0,
+          ClassifyId: Number(this.select_shared_User?0:this.default_classify),
+					UserId:this.select_shared_User
 				})
       }else if(this.classifyShowType==='own'&&this.currentTreeName==='collect'){ //收藏列表
 				res = await chartBaseV2Interface.getCollectChart({

+ 3 - 3
src/views/dataEntry_manage/databaseComponents/batchComputedV2.vue

@@ -283,7 +283,7 @@
 						>
 						</el-option>
 					</el-select>
-                    <el-cascader
+                    <!-- <el-cascader
                         v-model="filter.user"
                         :placeholder="$t('EtaBasePage.table_col_creator')"
                         :options="sysUserOpts"
@@ -294,7 +294,7 @@
                         filterable
                         style="width:240px"
                         @change="handleFilter"
-                    />
+                    /> -->
                     <el-input 
                         :placeholder="$t('Edb.InputHolderAll.input_name_orid')" 
                         v-model="filter.keyword"
@@ -882,7 +882,7 @@ export default {
 		},
         // 获取指标分类
         async getClassifyOpt(){
-            const res=await dataBaseInterface.menuListV3({ClassifyType:-1})
+            const res=await dataBaseInterface.menuListV3({ClassifyType:2})
             if (res.Ret !== 200) return
             this.filterNodes(res.Data.AllNodes||[]);
 			this.classifyOpt = res.Data.AllNodes || [];

+ 26 - 13
src/views/dataEntry_manage/databaseComponents/edbCollectDia.vue

@@ -60,6 +60,10 @@ export default {
       type: String,
       default: 'edb'
     },
+    batchParams: { //批量收藏时的筛选条件
+      type: Object,
+      default: null
+    }
 	},
   computed: {
     collectPath() {
@@ -110,20 +114,29 @@ export default {
     async saveHandle() {
       if(!this.checkedClassifys.length) return this.$message.warning('请选择分类');
 
-      const res = this.source === 'edb'
-        ? await edbCollectInterface.edbCollect({
-            EdbInfoId: this.id,
-            ClassifyIdList: this.checkedClassifys
-          })
-        : await chartBaseV2Interface.chartCollect({
-            ChartInfoId: this.id,
-            ClassifyIdList: this.checkedClassifys
-          })
-        if(res.Ret !== 200) return 
-        this.$message.success('收藏成功')
+      let res;
+      if(this.batchParams && this.source === 'edb') {
+        res = await edbCollectInterface.collectEdbBatch({
+          ...this.batchParams,
+          CollectClassifyIdList: this.checkedClassifys
+        })
+      }else if(this.source === 'edb' && this.id) {
+        res = await edbCollectInterface.edbCollect({
+          EdbInfoId: this.id,
+          ClassifyIdList: this.checkedClassifys
+        })
+      }else if (this.source === 'chart') {
+        res = await chartBaseV2Interface.chartCollect({
+          ChartInfoId: this.id,
+          ClassifyIdList: this.checkedClassifys
+        })
+      }
+
+      if(res.Ret !== 200) return 
+      this.$message.success('收藏成功')
 
-        this.$emit('confirm',this.checkedClassifys);
-        this.cancelHandle();
+      this.$emit('confirm',this.checkedClassifys);
+      this.cancelHandle();
     },
     
 		cancelHandle() {

+ 28 - 2
src/views/dataEntry_manage/databaseComponents/edbTableList.vue

@@ -55,17 +55,25 @@
             @click="$emit('refresh',row)" 
           >刷新</el-button>
           <el-button 
-            v-if="$parent.isEdbBtnShow('edit')&&row.Button.OpButton"
+            v-if="$parent.isEdbBtnShow('edit')&&row.Button&&row.Button.OpButton"
             type="text"
             @click="$emit('edit',row)"
           >编辑</el-button>
           <el-button
+            v-if="!isShowRemoveCollectBtn"
             type="text"
             @click="$emit('collect',row)"
           >收藏</el-button>
 
+          <el-button
+            type="text"
+            @click="$emit('remove-collect',row)"
+            style="color:#C54322"
+            v-if="isShowRemoveCollectBtn"
+          >移出</el-button>
+
           <el-button 
-            v-if="$parent.isEdbBtnShow('deleteEdb')&&row.Button.DeleteButton"
+            v-if="$parent.isEdbBtnShow('deleteEdb')&&row.Button&&row.Button.DeleteButton"
             type="text" 
             @click="$emit('remove',row)"
             style="color:#C54322;"
@@ -117,6 +125,12 @@ export default {
     },
     pageSize: {
       type: Number
+    },
+    classifyShowType: {
+      type:String
+    },
+    treeName: {
+      type: String
     }
   },
   computed: {
@@ -173,6 +187,10 @@ export default {
 
     tableH() {
       return this.isBasicBase ? 'calc(100vh - 250px)' : 'calc(100vh - 360px)';
+    },
+    
+    isShowRemoveCollectBtn() {
+      return this.classifyShowType==='own' && this.treeName==='collect'
     }
   },
   data() {
@@ -191,6 +209,14 @@ export default {
     
   },
   methods:{
+    handleBatchCollect(){
+      this.$emit('collect',{
+        type:'batch',
+        IsSelectAll: this.isSelectAll,
+        NoEdbIdList: this.isSelectAll ? this.checkedList.map(_ =>_.EdbInfoId) : [],
+        EdbIdList: this.isSelectAll ? [] : this.checkedList.map(_ =>_.EdbInfoId)
+      })
+    },
 
     pageChange(page) {
       this.$emit('page-change',page)

+ 40 - 21
src/views/dataEntry_manage/databaseList.vue

@@ -286,6 +286,8 @@
 				<edbTableList
 					ref="edbTableListRef"
 					:isBasicBase="isBasicBase"
+					:classifyShowType="classifyShowType"
+					:treeName="currentTreeName"
 					:tableLoading="tableLoading"
 					:list="chartList"
 					:total="Total"
@@ -297,6 +299,7 @@
 					@edit="item =>{editNode({},item)}"
 					@collect="handleCollectEdb"
 					@remove="item =>{removeNode({},item)}"
+					@remove-collect="handleRemoveCollect"
 				/>
 			</div>
 
@@ -646,6 +649,7 @@
 			ref="edbCollectRef"
 			:show.sync="isOpenEdbCollectDia"
 			:id="collectEdbForm.edbId"
+			:batchParams="collectEdbForm.batchParams"
 			:add_ids="collectEdbForm.collectClassifyIdList"
 			@confirm="handleCollectSuccess"
 		/>
@@ -881,7 +885,8 @@ export default {
 				{ label: '公开指标',key: 'public' },
 			],
 			classifyShowType:'own',
-			currentTreeName: 'own',//当前点击的分类树 4块 列表请求接口不同  own public collect sharedReceive sharedSend,
+			currentTreeName: 'own',//当前点击的分类树 4块 列表请求接口不同  own public collect sharedReceive shared,
+			select_shared_User:0,//点击收到共享的用户名
 			
 			collectClassifys:[],//收藏目录
 			//指标收藏弹窗
@@ -1204,7 +1209,8 @@ export default {
 					FilterSource: this.currentTreeName==='sharedReceive' ? 1 : 0,
 					PageSize:this.PageSize,
 					CurrentIndex:this.CurrentIndex,
-					ClassifyId:this.select_classifyId,
+					ClassifyId:this.select_shared_User?0:this.select_classifyId,
+					UserId:this.select_shared_User
 				})
 			}else if(this.classifyShowType==='own'&&this.currentTreeName==='collect'){ //收藏列表
 				res = await edbCollectInterface.getCollectEdb({
@@ -1407,11 +1413,9 @@ export default {
 		},
 		/* 节点变化时  treeName记录点击的是哪块的分类 own public collect sharedReceive shared*/ 
 		nodeChange({data,node,treeName}) { 
-			// if(this.classifyShowType === 'shared') { //点的是收到共享的用户名 过滤
 
-			// }
-			
 			this.currentTreeName=treeName;
+			this.select_shared_User = treeName==='sharedReceive' ? (data.UserId||0) : 0;
 			this.search_txt = '';
 			this.select_classifyId = !data.EdbInfoId?data.ClassifyId:0;
 			this.select_node = data.UniqueCode;
@@ -1698,6 +1702,7 @@ export default {
 					if(this.selected_edbid) {
 						this.selected_edbid = 0;
 					}else {
+						this.select_classifyId = 0;
 						this.getEdbChartList();
 					}
 					this.getTreeData();
@@ -1726,7 +1731,7 @@ export default {
 			return canDrop
 		},
 		/* 拖拽完成 */
-		dropOverHandle(b,a,i,e) {
+		async dropOverHandle(b,a,i,e) {
 			// 被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置
 			console.log(b,a,i);
 			const isEDB=b.data.EdbCode?true:false
@@ -1789,17 +1794,16 @@ export default {
 				ClassifyType: this.isBasicBase ? 0 : 2
 			}
 			console.log(params);
-			dataBaseInterface.classifyMoveSort(params).then(res=>{
-				if(res.Ret===200){
-					// this.$message.success('移动成功!')
-					this.$message.success(this.$t('MsgPrompt.move_sort_success'))
-				}
-				this.getTreeData()
-				if(this.selected_edbid){
-					this.getDataList();
-				}
-				
-			})
+			const res = this.classifyShowType === 'public'
+				? await edbBaseV2Interface.movePublicClassify(params)
+				: await dataBaseInterface.classifyMoveSort(params);
+
+			if(res.Ret!==200) return
+				// this.$message.success('移动成功!')
+			this.$message.success(this.$t('MsgPrompt.move_sort_success'))
+
+			this.getTreeData();
+			this.selected_edbid && this.getDataList();
 		},
 
 		/* 拖拽覆盖添加背景色 */
@@ -2255,10 +2259,25 @@ export default {
 
 		/* 收藏指标 */
 		handleCollectEdb(info) {
-			this.collectEdbForm = {
-				edbId: info.EdbInfoId,
-				collectClassifyIdList: info.CollectClassifyIdList||[]
-			},
+			if(info.type&&info.type==='batch') { //批量收藏
+				const { IsSelectAll,NoEdbIdList,EdbIdList } = info;
+				this.collectEdbForm = {
+					edbId: 0,
+					batchParams: {
+						ClassifyId: this.select_classifyId,
+						KeyWord: this.search_txt,
+						IsSelectAll,
+						NoEdbIdList,
+						EdbIdList
+					},
+					collectClassifyIdList: []
+				}
+			}else {
+				this.collectEdbForm = {
+					edbId: info.EdbInfoId,
+					collectClassifyIdList: info.CollectClassifyIdList||[]
+				}
+			}
 			this.isOpenEdbCollectDia = true
 		},
 

+ 22 - 12
src/views/dataEntry_manage/sharedComponents/setSharedDia.vue

@@ -18,7 +18,7 @@
         inline
       >
         <el-form-item label="共享权限">
-          <el-radio-group v-model="formData.type">
+          <el-radio-group v-model="formData.type" @change="changeSharedType">
             <el-radio :label="1">仅查看</el-radio>
             <el-radio :label="2">可编辑</el-radio>
           </el-radio-group>
@@ -89,6 +89,7 @@
 import { edbBaseV2Interface,chartBaseV2Interface } from '@/api/modules/chartApi';
 import { traverseTree } from "@/utils/commonOptions";
 import { operateAuthInterface,departInterence } from '@/api/modules/setApi';
+import { escape } from '@antv/x6/lib/util/string/string';
 export default {
   props: {
     show: {
@@ -107,10 +108,7 @@ export default {
       if(!nval) return
       this.getUserList()
 
-      //单设置回显用户
-      if(this.checkedParams.EdbInfoId || this.checkedParams.ChartInfoId ) {
-        this.getSharedUser()
-      }
+
     }
   },
   computed: {
@@ -135,6 +133,7 @@ export default {
       },
       selectUserList: [],
       usersOptions: [],
+      allSetUsersArr: [],//单指标的所有设置用户
 
       isOpenHintDia: false,
     }
@@ -146,6 +145,7 @@ export default {
         users: []
       };
       this.selectUserList = [];
+      this.allSetUsersArr = [];
       this.isOpenHintDia = false;
       this.$emit('update:show',false);
     },
@@ -188,14 +188,20 @@ export default {
 
       if(res.Ret !== 200) return
       
-      this.formData = {
-        type: res.Data.ShareType||1,
-        users: res.Data.List ? res.Data.List.map(_ => String(_.SysUserId)) : []
-      };
+      this.allSetUsersArr = res.Data.List || [];
+      this.changeSharedType();
+    },
+
+    changeSharedType() {
+      if(this.allSetUsersArr.length) {
+        this.formData.users = this.allSetUsersArr.filter(_ => _.ShareType===this.formData.type).map(_ => String(_.SysUserId));
 
-      this.$nextTick(() => {
-        this.checkUser()
-      })
+        this.$nextTick(() => {
+          this.checkUser()
+        })
+      }else {
+        this.formData.users = [];
+      }
     },
 
       /* 获取用户列表 */
@@ -217,6 +223,10 @@ export default {
       )
       
       this.filterTreeEmpty({Children:this.usersOptions})
+      //单设置回显用户
+      if(this.checkedParams.EdbInfoId || this.checkedParams.ChartInfoId ) {
+        this.getSharedUser()
+      }
     },
 
      // 递归处理数组