|
@@ -58,9 +58,9 @@
|
|
<div
|
|
<div
|
|
class="row-item"
|
|
class="row-item"
|
|
v-for="(item1,index1) in scope.row[item.key]"
|
|
v-for="(item1,index1) in scope.row[item.key]"
|
|
- :key="item1.style.id"
|
|
|
|
|
|
+ :key="item1.styleCss.id"
|
|
dragSelectType="div"
|
|
dragSelectType="div"
|
|
- :dragSelectId="item1.style.id"
|
|
|
|
|
|
+ :dragSelectId="item1.styleCss.id"
|
|
:style="{backgroundColor: item1.delFlag !=0?'#ccc':item1.color}"
|
|
:style="{backgroundColor: item1.delFlag !=0?'#ccc':item1.color}"
|
|
>
|
|
>
|
|
<i style="line-height: 15px;">{{ item1.columnNo }}</i>
|
|
<i style="line-height: 15px;">{{ item1.columnNo }}</i>
|
|
@@ -270,7 +270,7 @@
|
|
align="center"
|
|
align="center"
|
|
label="区域">
|
|
label="区域">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span>{{ scope.row.style && scope.row.style.keyLabel ? scope.row.style.keyLabel : '暂未分区' }}</span>
|
|
|
|
|
|
+ <span>{{ scope.row.styleCss && scope.row.styleCss.keyLabel ? scope.row.styleCss.keyLabel : '暂未分区' }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -561,20 +561,30 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
/** 初始化数据 */
|
|
/** 初始化数据 */
|
|
- initData(list,type){
|
|
|
|
|
|
+ initData(row,list,type){
|
|
|
|
+ if(row.styleCss) {
|
|
|
|
+ this.tableHeader = JSON.parse(row.styleCss).tableHeader
|
|
|
|
+ }
|
|
|
|
+ this.rowAll = row.rows
|
|
|
|
+ //console.log("tableHeader,list===",tableHeader,list)
|
|
|
|
+ //this.tableHeader = JSON.parse(JSON.stringify(tableHeader))
|
|
this.tableDataAll = JSON.parse(JSON.stringify(list))
|
|
this.tableDataAll = JSON.parse(JSON.stringify(list))
|
|
- //this.batchTableList = JSON.parse(JSON.stringify(list))
|
|
|
|
- let listHeader = []
|
|
|
|
- let listTabel = []
|
|
|
|
|
|
+ this.createTableList()
|
|
|
|
+ this.dataProcess() // 数据整理
|
|
},
|
|
},
|
|
dataProcess(){
|
|
dataProcess(){
|
|
let list = JSON.parse(JSON.stringify(this.tableDataAll))
|
|
let list = JSON.parse(JSON.stringify(this.tableDataAll))
|
|
let list1 = JSON.parse(JSON.stringify(this.tableData))
|
|
let list1 = JSON.parse(JSON.stringify(this.tableData))
|
|
list.forEach((item,index)=>{
|
|
list.forEach((item,index)=>{
|
|
- if(item.style && item.style.key) {
|
|
|
|
- list1[item.rowNo-1][item.style.key].push(item)
|
|
|
|
|
|
+ if(item.styleCss && item.styleCss.key && list1[item.rowNo-1][item.styleCss.key]) {
|
|
|
|
+
|
|
|
|
+ list1[item.rowNo-1][item.styleCss.key].push({
|
|
|
|
+ ...item,
|
|
|
|
+ styleCss: item.styleCss ? typeof item.styleCss == 'string' ? JSON.parse(item.styleCss) : item.styleCss : {}
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ console.log("this.tableData===",this.tableData)
|
|
this.tableData = JSON.parse(JSON.stringify(list1))
|
|
this.tableData = JSON.parse(JSON.stringify(list1))
|
|
this.countRegionW()
|
|
this.countRegionW()
|
|
},
|
|
},
|
|
@@ -614,7 +624,7 @@ export default {
|
|
delTableHeader(params,index){
|
|
delTableHeader(params,index){
|
|
let flog = false
|
|
let flog = false
|
|
this.tableDataAll.forEach((item,index)=>{
|
|
this.tableDataAll.forEach((item,index)=>{
|
|
- if(item.style && item.style.key == params.key) {
|
|
|
|
|
|
+ if(item.styleCss && item.styleCss.key == params.key) {
|
|
flog = true
|
|
flog = true
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -771,7 +781,7 @@ export default {
|
|
id: this.currentRow+"_"+this.currentProperty+"_"+i,
|
|
id: this.currentRow+"_"+this.currentProperty+"_"+i,
|
|
name: this.ruleForm1.name.replace('${row}',this.currentRow).replace('${col}',i),
|
|
name: this.ruleForm1.name.replace('${row}',this.currentRow).replace('${col}',i),
|
|
status: this.ruleForm1.seatTypeId,
|
|
status: this.ruleForm1.seatTypeId,
|
|
- style: {
|
|
|
|
|
|
+ styleCss: {
|
|
key: this.currentProperty, // 所属区域的key
|
|
key: this.currentProperty, // 所属区域的key
|
|
keyLabel: this.currentLabel, // 所属区域的名称
|
|
keyLabel: this.currentLabel, // 所属区域的名称
|
|
sort: 0,
|
|
sort: 0,
|
|
@@ -799,7 +809,7 @@ export default {
|
|
rowNo: this.currentRow,
|
|
rowNo: this.currentRow,
|
|
sort: index+1,
|
|
sort: index+1,
|
|
|
|
|
|
- style: {
|
|
|
|
|
|
+ styleCss: {
|
|
key: this.currentProperty, // 所属区域的key
|
|
key: this.currentProperty, // 所属区域的key
|
|
keyLabel: this.currentLabel, // 所属区域的名称
|
|
keyLabel: this.currentLabel, // 所属区域的名称
|
|
sort: 0,
|
|
sort: 0,
|
|
@@ -922,8 +932,8 @@ export default {
|
|
if(this.multipleSelection[i].id == this.tableDataAll[j].id){
|
|
if(this.multipleSelection[i].id == this.tableDataAll[j].id){
|
|
listTabel[j] = {
|
|
listTabel[j] = {
|
|
...this.tableDataAll[j],
|
|
...this.tableDataAll[j],
|
|
- style: {
|
|
|
|
- ...this.tableDataAll[j].style,
|
|
|
|
|
|
+ styleCss: {
|
|
|
|
+ ...this.tableDataAll[j].styleCss,
|
|
key: this.formAll.status, // 所属区域的key
|
|
key: this.formAll.status, // 所属区域的key
|
|
keyLabel: currentLabel, // 所属区域的名称
|
|
keyLabel: currentLabel, // 所属区域的名称
|
|
}
|
|
}
|
|
@@ -953,7 +963,7 @@ export default {
|
|
let list = []
|
|
let list = []
|
|
this.tableDataAll.forEach((item,index)=>{
|
|
this.tableDataAll.forEach((item,index)=>{
|
|
if(this.queryParams.menuName&&this.queryParams.status) {
|
|
if(this.queryParams.menuName&&this.queryParams.status) {
|
|
- if(item.rowNo==this.queryParams.menuName && item.style.key == this.queryParams.status) {
|
|
|
|
|
|
+ if(item.rowNo==this.queryParams.menuName && item.styleCss.key == this.queryParams.status) {
|
|
list.push(item)
|
|
list.push(item)
|
|
}
|
|
}
|
|
}else if(this.queryParams.menuName){
|
|
}else if(this.queryParams.menuName){
|
|
@@ -961,7 +971,7 @@ export default {
|
|
list.push(item)
|
|
list.push(item)
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
- if(item.style.key == this.queryParams.status) {
|
|
|
|
|
|
+ if(item.styleCss.key == this.queryParams.status) {
|
|
list.push(item)
|
|
list.push(item)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1026,8 +1036,16 @@ export default {
|
|
/** 保存座位 */
|
|
/** 保存座位 */
|
|
saveSeat() {
|
|
saveSeat() {
|
|
console.log('this.tableDataAll',this.tableDataAll)
|
|
console.log('this.tableDataAll',this.tableDataAll)
|
|
-
|
|
|
|
- //this.$emit('saveSeat',this.tableDataAll)
|
|
|
|
|
|
+ let list = JSON.parse(JSON.stringify(this.tableDataAll))
|
|
|
|
+ list.forEach((item,index)=>{
|
|
|
|
+ if(item.styleCss) {
|
|
|
|
+ list[index].styleCss = JSON.stringify(item.styleCss)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ let styleCss = {
|
|
|
|
+ tableHeader: this.tableHeader
|
|
|
|
+ }
|
|
|
|
+ this.$emit('saveSeat',list,JSON.stringify(styleCss))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|