|
|
@@ -430,6 +430,44 @@
|
|
|
end-placeholder="结束日期"
|
|
|
:default-time="['12:00:00', '08:00:00']">
|
|
|
</el-date-picker>
|
|
|
+ </div>
|
|
|
+ <div class="el-form-item" style="align-items:flex-start;">
|
|
|
+ <label class="el-form-item__label" style="width: 100px;flex-shrink: 0;">自定义分类</label>
|
|
|
+ <div style="">
|
|
|
+ <el-button size="mini" type="primary" @click="addType()">添加分类</el-button>
|
|
|
+ <div v-if="editCyInfo.typeL && editCyInfo.typeL.length" style="margin-top: 10px;">
|
|
|
+ <div v-for="(item,index) in editCyInfo.typeL" :key="item.id">
|
|
|
+ <div style="display: flex;gap: 20px;">
|
|
|
+ <div style="display: flex;align-items: center;gap: 10px;">
|
|
|
+ <el-input
|
|
|
+ v-if="item.eit == 0"
|
|
|
+ v-model="editCyInfo.typeL[index].name" placeholder="请输入内容">
|
|
|
+ </el-input>
|
|
|
+ <span v-else>{{ item.name }}</span>
|
|
|
+ </div>
|
|
|
+ <span class="btn" @click="Deltype(index)">删除</span>
|
|
|
+ <span class="btn" v-if="item.eit == 0" @click="editCyInfo.typeL[index].eit = 1">确定</span>
|
|
|
+ <span class="btn" v-else @click="editCyInfo.typeL[index].eit = 0">编辑</span>
|
|
|
+ </div>
|
|
|
+ <div class="tagL">
|
|
|
+ <template v-if="item.children.length">
|
|
|
+ <span style="display: flex;gap: 10px;align-items: center;" v-for="(i,ind) in item.children" :key="i.id">
|
|
|
+ <el-input
|
|
|
+ v-if="i.eit == 0"
|
|
|
+ v-model="editCyInfo.typeL[index].children[ind].name" placeholder="请输入内容">
|
|
|
+ </el-input>
|
|
|
+ <span v-else>{{ i.name }}</span>
|
|
|
+ <span class="btn" @click="Deltag(index,ind)">删除</span>
|
|
|
+ <span class="btn" v-if="i.eit == 0" @click="editCyInfo.typeL[index].children[ind].eit = 1">确定</span>
|
|
|
+ <span class="btn" v-else @click="editCyInfo.typeL[index].children[ind].eit = 0">编辑</span>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <span @click="Addtag(index)">添加</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="el-form-item">
|
|
|
<label class="el-form-item__label" style="width: 100px">banner</label>
|
|
|
@@ -553,7 +591,7 @@ export default {
|
|
|
cyloading:false,
|
|
|
|
|
|
// 社区添加与修改所存储的信息
|
|
|
- editCyInfo:{name:'',banner:'',evatime:''},
|
|
|
+ editCyInfo:{name:'',banner:'',evatime:'',typeL:[]},
|
|
|
// 添加与修改社区共用一个弹框 0是添加信息 1 修改信息
|
|
|
isedit:0,
|
|
|
// 添加与修改社区弹框
|
|
|
@@ -624,6 +662,27 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ addType(){
|
|
|
+ this.editCyInfo.typeL.push({
|
|
|
+ id: Date.now(),
|
|
|
+ name: '',
|
|
|
+ eit: 0,
|
|
|
+ children: []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ Deltype(ind){
|
|
|
+ this.editCyInfo.typeL.splice(ind,1)
|
|
|
+ },
|
|
|
+ Deltag(index,ind){
|
|
|
+ this.editCyInfo.typeL[index].children.splice(ind,1)
|
|
|
+ },
|
|
|
+ Addtag(index){
|
|
|
+ this.editCyInfo.typeL[index].children.push({
|
|
|
+ id: Date.now(),
|
|
|
+ name: '',
|
|
|
+ eit:0,
|
|
|
+ })
|
|
|
+ },
|
|
|
// 表头的背景色
|
|
|
headerCellStyle() {
|
|
|
return { backgroundColor: "#f1f1f1" };
|
|
|
@@ -1093,6 +1152,7 @@ export default {
|
|
|
e.evatime = JSON.parse(e.evatime)
|
|
|
e.evatime2 = e.evatime.map(dateStr => this.formatDateCy(dateStr)).join('——')
|
|
|
}
|
|
|
+ e.typeL = JSON.parse(e.typeL)
|
|
|
});
|
|
|
this.cytableData = data
|
|
|
console.log('this.cytableData',this.cytableData);
|
|
|
@@ -1144,6 +1204,7 @@ export default {
|
|
|
oid:this.cyInfo.id,
|
|
|
ban: this.editCyInfo.banner,
|
|
|
eva: this.editCyInfo.evatime ? JSON.stringify(this.editCyInfo.evatime) : '',
|
|
|
+ typ: (this.editCyInfo.typeL && this.editCyInfo.typeL.length) ? JSON.stringify(this.editCyInfo.typeL) : '',
|
|
|
};
|
|
|
addCommunity(params)
|
|
|
.then(async (response) => {
|
|
|
@@ -1162,7 +1223,7 @@ export default {
|
|
|
});
|
|
|
this.dialogcyADD = false;
|
|
|
this.getCy()
|
|
|
- this.editCyInfo = {name:'',banner:'',evatime:''};
|
|
|
+ this.editCyInfo = {name:'',banner:'',evatime:'',typeL:[]};
|
|
|
}
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
@@ -1178,6 +1239,7 @@ export default {
|
|
|
nam: this.editCyInfo.name,
|
|
|
ban: this.editCyInfo.banner,
|
|
|
eva: this.editCyInfo.evatime ? JSON.stringify(this.editCyInfo.evatime) : '',
|
|
|
+ typ: (this.editCyInfo.typeL && this.editCyInfo.typeL.length) ? JSON.stringify(this.editCyInfo.typeL) : '',
|
|
|
};
|
|
|
console.log('params',params);
|
|
|
|
|
|
@@ -1198,7 +1260,7 @@ export default {
|
|
|
});
|
|
|
this.dialogcyADD = false;
|
|
|
this.getCy()
|
|
|
- this.editCyInfo = {name:'',banner:'',evatime:''};
|
|
|
+ this.editCyInfo = {name:'',banner:'',evatime:'',typeL:[]};
|
|
|
}
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
@@ -1436,7 +1498,7 @@ export default {
|
|
|
},
|
|
|
handleClose2(){
|
|
|
this.editCyInfo = ''
|
|
|
- this.editCyInfo = {name:'',banner:'',evatime:''};
|
|
|
+ this.editCyInfo = {name:'',banner:'',evatime:'',typeL:[]};
|
|
|
this.dialogcyADD=false;
|
|
|
this.dialogcyperson = false
|
|
|
}
|
|
|
@@ -1605,4 +1667,28 @@ export default {
|
|
|
position: absolute;top: 0;right: 5px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+ .custom-tree-node {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 14px;
|
|
|
+ padding-right: 8px;
|
|
|
+ }
|
|
|
+ .tagL{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 5px;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .tagL span{
|
|
|
+ background: aqua;
|
|
|
+ padding: 5px 3px;
|
|
|
+ border-radius: 5px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+ .btn{
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
</style>
|