Browse Source

Merge branch 'fix'

Karsa 1 year ago
parent
commit
2dfbf473b0

+ 27 - 34
src/views/dataEntry_manage/chartSetting.vue

@@ -1055,7 +1055,7 @@ export default {
     resetNodeStyle: _.debounce(function (node) {
       const tree = $('.target_tree')[0];
       let width = tree.offsetWidth;
-      let label_wid = width > 500 ? 'auto' : width <= 250 ? 80 : 0.58 * width;
+      let label_wid = width > 500 ? 'auto' : width <= 250 ? 80 : 0.4 * width;
       this.$set(node, 'Nodewidth', label_wid + 'px');
     }, 300),
     /* 双击label出现input修改框 */
@@ -1166,42 +1166,35 @@ export default {
              * 1 关联图表一
              * 2 有子目录无图表
              */
-            if (res.Data.DeleteStatus === 1)
-              this.$confirm('该分类下关联图表不可删除', '删除失败', {
+            const deleteLabelMap = {
+              1: '该分类下关联图表不可删除',
+              2: '确认删除当前分类及包含的子分类吗?',
+              4: res.Data.TipsMsg
+            }
+
+            if([1,4].includes(res.Data.DeleteStatus)) this.$confirm(
+                deleteLabelMap[res.Data.DeleteStatus],
+                '删除失败',
+                {
                 confirmButtonText: '知道了',
-                showCancelButton: false,
-                type: 'error',
-              });
-            else if (res.Data.DeleteStatus === 0 && !data.ChartInfoId)
-              this.$confirm('确定删除当前分类吗?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
-              })
-                .then(() => {
-                  this.delHandle(data.ChartClassifyId, data.ChartInfoId);
-                })
-                .catch(() => {});
-            else if (res.Data.DeleteStatus === 0 && data.ChartInfoId)
-              this.$confirm('删除后该图表将不能再引用,确认删除吗?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
+                showCancelButton:false,
+                type: 'error'
               })
-                .then(() => {
-                  this.delHandle(data.ChartClassifyId, data.ChartInfoId, 1);
-                })
-                .catch(() => {});
-            else if (res.Data.DeleteStatus === 2)
-              this.$confirm('确认删除当前分类及包含的子分类吗?', '提示', {
+            else if([0,2].includes(res.Data.DeleteStatus)) this.$confirm(
+                res.Data.DeleteStatus === 2 
+                ? deleteLabelMap[res.Data.DeleteStatus]
+                : data.ChartInfoId?'删除后该图表将不能再引用,确认删除吗?':'确定删除当前分类吗?', 
+                '提示',
+                {
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
-                type: 'warning',
-              })
-                .then(() => {
-                  this.delHandle(data.ChartClassifyId, data.ChartInfoId);
-                })
-                .catch(() => {});
+                type: 'warning'
+              }).then(() => {
+                res.Data.DeleteStatus === 0 && data.ChartInfoId 
+                ? this.delHandle(data.ChartClassifyId, data.ChartInfoId, 1)
+                : this.delHandle(data.ChartClassifyId, data.ChartInfoId);
+              }).catch(() => {         
+              });
           }
         });
     },
@@ -2651,7 +2644,7 @@ export default {
       }
       .main-left {
         width: 400px;
-        min-width: 300px;
+        min-width: 350px;
         background: #fff;
         margin-right: 20px;
         border: 1px solid #ececec;

+ 13 - 27
src/views/dataEntry_manage/databaseList.vue

@@ -990,6 +990,7 @@ export default {
 		resetNodeStyle: _.debounce(function(node) {
 			const tree = $('.target_tree')[0];
 			let width = tree.offsetWidth;
+			console.log(width)
 			// let label_wid = width > 500 ? 'auto' : (width <= 300 && width < 360) ?  100 : 0.7*width;
 			let label_wid =
 				width > 500
@@ -1190,40 +1191,25 @@ export default {
 					 * 1 关联指标
 					 * 2 有子目录无指标
 					*/
+					const deleteLabelMap = {
+						1: '该目录关联指标不可删除',
+						2: '确认删除当前目录及包含的子目录吗?',
+						3: '当前指标已用作画图,不可删除',
+						4: res.Data.TipsMsg
+					}
+
 					if([1,3,4].includes(res.Data.DeleteStatus)) this.$confirm(
-							res.Data.DeleteStatus === 1 ? '该目录关联指标不可删除' 
-							: res.Data.DeleteStatus === 3 ? '当前指标已用作画图,不可删除'
-							: res.Data.TipsMsg,
+							deleteLabelMap[res.Data.DeleteStatus],
 							'删除失败',
 							{
 							confirmButtonText: '知道了',
 							showCancelButton:false,
 							type: 'error'
 						})
-					else if(res.Data.DeleteStatus === 0 && !data.EdbCode) this.$confirm(
-							'确定删除当前目录吗?', 
-							'提示',
-							{
-							confirmButtonText: '确定',
-							cancelButtonText: '取消',
-							type: 'warning'
-						}).then(() => {
-							this.delHandle(data.ClassifyId,data.EdbInfoId);
-						}).catch(() => {         
-						});
-					else if(res.Data.DeleteStatus === 0 && data.EdbCode) this.$confirm(
-							'删除后指标和指标值均不可使用,确认删除吗?', 
-							'提示',
-							{
-							confirmButtonText: '确定',
-							cancelButtonText: '取消',
-							type: 'warning'
-						}).then(() => {
-							this.delHandle(data.ClassifyId,data.EdbInfoId);
-						}).catch(() => {         
-						});
-					else if(res.Data.DeleteStatus === 2) this.$confirm(
-							'确认删除当前目录及包含的子目录吗?', 
+					else if([0,2].includes(res.Data.DeleteStatus)) this.$confirm(
+							res.Data.DeleteStatus === 2 
+							? deleteLabelMap[res.Data.DeleteStatus]
+							: data.EdbCode?'删除后指标和指标值均不可使用,确认删除吗?':'确定删除当前目录吗?', 
 							'提示',
 							{
 							confirmButtonText: '确定',

+ 49 - 15
src/views/predictEdb_manage/predictEdb.vue

@@ -823,21 +823,55 @@ export default {
 
 			const { Data } = await preDictEdbInterface.classifyDelCheck({ ClassifyId,EdbInfoId })
 
-			const { DeleteStatus } = Data;
-
-			DeleteStatus === 1 
-			? this.$confirm('该分类下关联指标不可删除', '删除失败', {
-				confirmButtonText: '知道了',
-				showCancelButton: false,
-				type: 'error',
-			}) : DeleteStatus === 0 && !EdbInfoId
-			?  this.$confirm('确定删除当前分类吗?', '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning',
-			}).then(() => {
-				this.delApi(ClassifyId, EdbInfoId)
-			}): null;
+			const { DeleteStatus,TipsMsg } = Data;
+
+			// DeleteStatus === 1 
+			// ? this.$confirm('该分类下关联指标不可删除', '删除失败', {
+			// 	confirmButtonText: '知道了',
+			// 	showCancelButton: false,
+			// 	type: 'error',
+			// }) : DeleteStatus === 0 && !EdbInfoId
+			// ?  this.$confirm('确定删除当前分类吗?', '提示', {
+			// 	confirmButtonText: '确定',
+			// 	cancelButtonText: '取消',
+			// 	type: 'warning',
+			// }).then(() => {
+			// 	this.delApi(ClassifyId, EdbInfoId)
+			// }): null;
+
+			/**
+			 * 0 可删除
+			 * 1 关联指标
+			 * 2 有子目录无指标
+			*/
+			const deleteLabelMap = {
+				1: '该目录关联指标不可删除',
+				2: '确认删除当前目录及包含的子目录吗?',
+				3: '当前指标已用作画图,不可删除',
+				4: TipsMsg
+			}
+
+			if([1,3,4].includes(DeleteStatus)) this.$confirm(
+					deleteLabelMap[DeleteStatus],
+					'删除失败',
+					{
+					confirmButtonText: '知道了',
+					showCancelButton:false,
+					type: 'error'
+				})
+			else if([0,2].includes(DeleteStatus)) this.$confirm(
+					DeleteStatus === 2 
+					? deleteLabelMap[DeleteStatus]
+					: EdbInfoId?'删除后指标和指标值均不可使用,确认删除吗?':'确定删除当前目录吗?', 
+					'提示',
+					{
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.delApi(ClassifyId, EdbInfoId)
+				}).catch(() => {         
+				});
 
     },