|
@@ -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;
|