|
@@ -1802,7 +1802,7 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
- 文件题名全局配置
|
|
|
+ <!-- 文件题名全局配置 -->
|
|
|
<el-dialog
|
|
|
title="文件题名全局配置"
|
|
|
:visible.sync="fileTitleVisible"
|
|
@@ -1820,7 +1820,7 @@
|
|
|
<i
|
|
|
class="el-icon-refresh "
|
|
|
style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
|
|
|
- @click="addRow"
|
|
|
+ @click="refreshRow"
|
|
|
></i>
|
|
|
</div>
|
|
|
|
|
@@ -1836,12 +1836,13 @@
|
|
|
prop="roleNameVal">
|
|
|
<template #default="scope">
|
|
|
<el-select
|
|
|
- v-if="scope.row.isEdit"
|
|
|
+ :id="selectDiv"
|
|
|
+ v-if="scope.row.isEdit"
|
|
|
v-model="scope.row.ruleName"
|
|
|
multiple
|
|
|
placeholder="请选择"
|
|
|
style="width: 240px"
|
|
|
- @change="changeRoleName($event,scope.row)"
|
|
|
+ @change="changeRoleName($event,scope.row,scope.index)"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in nodeTypelist"
|
|
@@ -1859,11 +1860,17 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="文件题名范围"
|
|
|
- prop="ruleSizeVal">
|
|
|
-
|
|
|
+ prop="ruleSizeVal"
|
|
|
+
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
|
- <el-link type="warning" @click="chooseFile(scope.$index, scope.row)" v-if="!scope.row.ruleSizeVal">选择题名范围</el-link>
|
|
|
- <span v-else @click="chooseFile(scope.$index, scope.row)" :class="{'orange': scope.row.isEdit}">{{ scope.row.ruleSizeVal }}</span>
|
|
|
+ <div v-if="isShowSize">
|
|
|
+ <span v-if="scope.row.type===1" :class="{'orange': scope.row.isEdit}" @click="chooseFile(scope.$index, scope.row)">所有节点</span>
|
|
|
+ <div v-else>
|
|
|
+ <el-link type="warning" @click="chooseFile(scope.$index, scope.row)" v-if="!scope.row.ruleSizeVal">选择题名范围</el-link>
|
|
|
+ <span v-else @click="chooseFile(scope.$index, scope.row)" :class="{'orange': scope.row.isEdit}">{{ scope.row.ruleSizeVal }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -1889,6 +1896,15 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button>取消</el-button>
|
|
|
+ <el-button type="primary" @click="batchsaveFileSize">
|
|
|
+ 保存
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
<!-- 选择题名范围i -->
|
|
|
<el-dialog
|
|
@@ -1898,18 +1914,15 @@
|
|
|
align-center
|
|
|
append-to-body
|
|
|
>
|
|
|
-
|
|
|
-
|
|
|
<el-form label-position="left" label-width="80px" :model="fileTitleModel" :rules="fileTitleRules" ref="fileTitleRef">
|
|
|
|
|
|
<el-form-item label="题名范围" prop="type">
|
|
|
- <el-radio v-model="fileTitleModel.type" :label="1">所有节点</el-radio><br/>
|
|
|
- <el-radio v-model="fileTitleModel.type" :label="2">部分节点</el-radio>
|
|
|
+ <el-radio v-model="fileTitleModel.type" :label="1" @input="changeRadio">所有节点</el-radio><br/>
|
|
|
+ <el-radio v-model="fileTitleModel.type" :label="2" @input="changeRadio">部分节点</el-radio>
|
|
|
<div v-if="fileTitleModel.type==2" class="warning-text">请选择节点</div>
|
|
|
|
|
|
<el-scrollbar class="h-100p" style="height: 400px;" v-if="fileTitleModel.type==2" v-loading="fileTreeLoading">
|
|
|
<el-tree
|
|
|
-
|
|
|
:data="fileTreeData"
|
|
|
:props="filedefaultProps"
|
|
|
:expand-on-click-node="false"
|
|
@@ -2001,7 +2014,7 @@ import {
|
|
|
getExcelHtml,
|
|
|
} from "@/api/exctab/excelmodel";
|
|
|
import { getStore, setStore } from "@/util/store";
|
|
|
-import { log } from "@antv/g2plot/lib/utils";
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -2339,20 +2352,13 @@ export default {
|
|
|
chooseFileVisible:false,
|
|
|
chooseFileRow: {},
|
|
|
chooseFileIndex: -1,
|
|
|
+ isShowSize:true,
|
|
|
+ selectDiv:Math.random()
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["userInfo"]),
|
|
|
|
|
|
- // dialogTitle: function () {
|
|
|
- // let text = "节点";
|
|
|
- // if (this.leftType == 1) {
|
|
|
- // text = "新增" + text;
|
|
|
- // } else if (this.leftType == 2) {
|
|
|
- // text = "编辑" + text;
|
|
|
- // }
|
|
|
- // return text;
|
|
|
- // },
|
|
|
},
|
|
|
created() {
|
|
|
this.init();
|
|
@@ -4351,8 +4357,11 @@ export default {
|
|
|
fileTitleHandle(){
|
|
|
this.getFileTableData()
|
|
|
this.fileTitleVisible = true;
|
|
|
-
|
|
|
-
|
|
|
+ },
|
|
|
+ changeRadio(val){
|
|
|
+ console.log(val,'val');
|
|
|
+ const fileItem = this.fileTableData[this.chooseFileIndex];
|
|
|
+ this.$set(fileItem, 'type', val);
|
|
|
},
|
|
|
//获取文件题名规则
|
|
|
getFileTableData(){
|
|
@@ -4363,6 +4372,24 @@ export default {
|
|
|
this.fileTableLoading=false
|
|
|
if(res.data.data){
|
|
|
this.fileTableData = res.data.data;
|
|
|
+ this.fileTableData.forEach((element) => {
|
|
|
+ element.roleNameVal = element.nameRule.split(",");
|
|
|
+ element.ruleName=element.nameVaule.split("-")
|
|
|
+ if(element.type===2){
|
|
|
+ const list=element.list
|
|
|
+ let arr=[]
|
|
|
+ let arrId=[]
|
|
|
+ list.forEach((ele) => {
|
|
|
+ arr.push(ele.nodeName)
|
|
|
+ arrId.push(ele.nodeId)
|
|
|
+ });
|
|
|
+ element.ruleSizeVal = arr.join('、');
|
|
|
+ element.ruleSizeValId=arrId
|
|
|
+ }else{
|
|
|
+ element.ruleSizeVal=''
|
|
|
+ element.ruleSizeValId=''
|
|
|
+ }
|
|
|
+ });
|
|
|
}else{
|
|
|
this.fileTableData =[]
|
|
|
}
|
|
@@ -4377,6 +4404,9 @@ export default {
|
|
|
this.fileTreeLoading=false
|
|
|
if(res.data.data){
|
|
|
this.fileTreeData = res.data.data;
|
|
|
+ this.deCheckTreeKeys = this.fileTreeData.filter(node => node.status === 11).map(node => node.id);
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
this.fileTreeData =[]
|
|
|
}
|
|
@@ -4387,10 +4417,9 @@ export default {
|
|
|
const {ruleName}=row
|
|
|
if(ruleName.length>0){
|
|
|
this.chooseFileVisible = true;
|
|
|
+
|
|
|
this.chooseFileIndex= index;
|
|
|
this.deCheckTreeKeys=row.ruleSizeValId
|
|
|
- console.log(row,'row');
|
|
|
-
|
|
|
this.getTitleRangeData()
|
|
|
|
|
|
}else{
|
|
@@ -4401,20 +4430,18 @@ export default {
|
|
|
},
|
|
|
checkFileSize(data,{checkedNodes,checkedKeys}){
|
|
|
let checkedTitles = checkedNodes.map(node => node.nodeName).join('、');
|
|
|
-
|
|
|
- // this.fileTableData[this.chooseFileIndex].ruleSizeVal=checkedTitles
|
|
|
- this.fileTableData[this.chooseFileIndex].isEdit1=false
|
|
|
+ this.fileTableData[this.chooseFileIndex].isEdit1=false
|
|
|
const fileItem = this.fileTableData[this.chooseFileIndex];
|
|
|
this.$set(fileItem, 'ruleSizeVal', checkedTitles);
|
|
|
-
|
|
|
this.$set(fileItem, 'ruleSizeValId', checkedKeys);
|
|
|
|
|
|
},
|
|
|
saveFileSize(){
|
|
|
this.chooseFileVisible = false;
|
|
|
- // this.fileTableData[this.chooseFileIndex].isEdit1=false
|
|
|
- // this.fileTableData[this.chooseFileIndex].isEdit=false
|
|
|
-
|
|
|
+ this.isShowSize=false
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.isShowSize=true
|
|
|
+ },100)
|
|
|
|
|
|
},
|
|
|
editRow(index,row){
|
|
@@ -4422,37 +4449,40 @@ export default {
|
|
|
|
|
|
this.$set(row, "isEdit", true);
|
|
|
this.$set(row, "isEdit1", true);
|
|
|
+ this.fileTitleModel.type=row.type
|
|
|
},
|
|
|
//保存文件题名
|
|
|
saveRow(index,row){
|
|
|
this.$set(row, "isEdit", false);
|
|
|
this.$set(row, "isEdit1", false)
|
|
|
-
|
|
|
- const ruleName=row.ruleName.join('-')
|
|
|
- const ruleSizeVal=row.ruleSizeValId.join(',')
|
|
|
- console.log(ruleName,'ruleName');
|
|
|
-
|
|
|
+ const ruleName=row.ruleName.join('-')
|
|
|
+ let ruleSizeVal=''
|
|
|
+ if(row.type==1){
|
|
|
+ ruleSizeVal=''
|
|
|
+ }else{
|
|
|
+ ruleSizeVal=row.ruleSizeValId.join(',')
|
|
|
+ }
|
|
|
+
|
|
|
let nameRuleDtos={
|
|
|
- nameId:"",
|
|
|
+ nameId:row.nameId,
|
|
|
nameRule:ruleName,
|
|
|
nodeId:ruleSizeVal,
|
|
|
projectId:this.projectid,
|
|
|
- type:2
|
|
|
+ type:this.fileTitleModel.type
|
|
|
}
|
|
|
saveOrUpdateNameRule(
|
|
|
-
|
|
|
[nameRuleDtos]
|
|
|
-
|
|
|
).then((res) => {
|
|
|
if(res.data.code==200){
|
|
|
this.$message.success('保存成功')
|
|
|
+ this.getFileTableData()
|
|
|
}else{
|
|
|
this.$message.error('保存失败')
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
changeRoleName(data,row){
|
|
|
- // 找到对应的 dictValue
|
|
|
+ console.log(data,'data');
|
|
|
const originalData=this.nodeTypelist
|
|
|
const dictKeyToDictValueMap = originalData.reduce((acc, item) => {
|
|
|
acc[item.dictKey] = item.dictValue;
|
|
@@ -4460,13 +4490,58 @@ export default {
|
|
|
}, {});
|
|
|
const result = data.map(dictKey => dictKeyToDictValueMap[dictKey]);
|
|
|
this.$set(row, "roleNameVal", result);
|
|
|
-
|
|
|
+ this.selectDiv=Math.random()
|
|
|
},
|
|
|
addRow(){
|
|
|
this.fileTableData.unshift({isEdit:true,isEdit1:true,})
|
|
|
+ this.fileTitleModel.type=''
|
|
|
+ },
|
|
|
+ refreshRow(){
|
|
|
+ this.getFileTableData()
|
|
|
},
|
|
|
delRow(index,row){
|
|
|
- this.fileTableData.splice(index,1)
|
|
|
+ // this.fileTableData.splice(index,1)
|
|
|
+ deletedNameRule(
|
|
|
+ {nameId:row.nameId}
|
|
|
+ ).then((res) => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ this.$message.success(res.data.msg)
|
|
|
+ this.getFileTableData()
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ batchsaveFileSize(){
|
|
|
+ console.log(this.fileTableData,'this.fileTableData');
|
|
|
+ let saveArr=[]
|
|
|
+ this.fileTableData.forEach((ele)=>{
|
|
|
+ let ruleSizeVal=''
|
|
|
+ if(ele.type==1){
|
|
|
+ ruleSizeVal=''
|
|
|
+ }else{
|
|
|
+ ruleSizeVal=ele.ruleSizeValId.join(',')
|
|
|
+ }
|
|
|
+ const ruleName=ele.ruleName.join('-')
|
|
|
+ saveArr.push({
|
|
|
+ nameId:ele.nameId,
|
|
|
+ nameRule:ruleName,
|
|
|
+ nodeId:ruleSizeVal,
|
|
|
+ projectId:this.projectid,
|
|
|
+ type:ele.type
|
|
|
+ })
|
|
|
+ })
|
|
|
+ saveOrUpdateNameRule(
|
|
|
+ saveArr
|
|
|
+ ).then((res) => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ this.$message.success(res.data.msg)
|
|
|
+ this.getFileTableData()
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
},
|