Merge remote-tracking branch 'origin/dev' into build

# Conflicts:
#	packages/bigscreen/designer/components/Add.vue
This commit is contained in:
aixianling
2022-08-31 16:32:37 +08:00
5 changed files with 70 additions and 207 deletions

View File

@@ -150,27 +150,28 @@ export default {
},
methods: {
getInfo() {
let {id} = this.$route.query
id && this.instance.post(`${this.urlPrefix}/appdiylargescreen/queryLargeScreenProjectDetailById?id=${id}`).then(res => {
if (res?.data) {
this.form = {
...res.data
}
if (res.data.relationLsIds) {
this.tableData = res.data.lsList.map(v => {
let conf = JSON.parse(v.config || '') || {}
return {
id: v.id,
title: v.title,
dv: conf.custom || '',
meta: JSON.stringify(conf.meta),
isCustom: !!conf.custom,
status: v.status
}
})
this.total = res.data.lsList.length
methods: {
getInfo() {
let {id} = this.$route.query
if (!id) return
this.instance.post(`${this.urlPrefix}/appdiylargescreen/queryLargeScreenProjectDetailById?id=${id}`).then(res => {
if (res?.data) {
this.form = {
...res.data
}
if (res.data.relationLsIds) {
this.tableData = res.data.lsList.map(v => {
let conf = JSON.parse(v.config || '') || {}
return {
id: v.id,
title: v.title,
dv: conf.custom || '',
meta: JSON.stringify(conf.meta),
isCustom: !!conf.custom,
status: v.status
}
})
this.total = res.data.lsList.length
this.$nextTick(() => {
this.rowDrop()
@@ -180,14 +181,13 @@ export default {
})
},
onStatusChange(id) {
id && this.instance.post(`${this.urlPrefix}/appdiylargescreen/enableLargeScreen?id=${id}`).then(res => {
if (res.code === 0) {
this.getInfo()
this.$message.success('操作成功')
}
})
},
onStatusChange (id) {
this.instance.post(`${this.urlPrefix}/appdiylargescreen/enableLargeScreen?id=${id}`).then(res => {
if (res.code === 0) {
this.$message.success('操作成功')
}
})
},
rowDrop() {
const tbody = document.querySelector('.el-table__body-wrapper tbody')
@@ -200,21 +200,37 @@ export default {
})
},
toViewer(id) {
this.$router.push({query: {id}, hash: "#preview"})
},
onChange(e) {
const ids = this.tableData.map(v => v.id)
if (ids.indexOf(e.id) < 0) {
this.tableData.push({
title: e.title,
id: e.id
toViewer(id) {
this.$router.push({query: {id}, hash: "#preview"})
},
onChange(e) {
const ids = this.tableData.map(v => v.id)
if (ids.indexOf(e.id) < 0) {
this.tableData.push({
title: e.title,
id: e.id,
status: '1'
})
} else {
const index = this.tableData.findIndex(v => v.id === e.id)
this.$set(this.tableData[index], 'title', e.title)
}
this.$nextTick(() => {
if (this.$route.query.id) {
const ids = this.tableData.map(v => v.id).join(',')
const names = this.tableData.map(v => v.name).join(',')
this.instance.post(`${this.urlPrefix}/appdiylargescreen/addOrUpdateLargeScreenProject`, {
...this.form,
relationLsIds: ids,
relationLsNames: names
}).then(res => {
if (res.code == 0) {
}
})
}
})
} else {
const index = this.tableData.findIndex(v => v.id === e.id)
this.$set(this.tableData[index], 'title', e.title)
}
},
},
add() {
this.query = {

View File

@@ -919,6 +919,7 @@ export default {
flex: 1;
padding: 0 10px;
background: #0A0B0D;
overflow-y: auto;
.layout-left__right--item {
margin-top: 10px;