This commit is contained in:
yanran200730
2022-08-31 15:16:35 +08:00
parent dd8e0b8f5f
commit 564a4e57d8

View File

@@ -152,6 +152,7 @@
methods: { methods: {
getInfo() { getInfo() {
let {id} = this.$route.query let {id} = this.$route.query
if (!id) return
this.instance.post(`${this.urlPrefix}/appdiylargescreen/queryLargeScreenProjectDetailById?id=${id}`).then(res => { this.instance.post(`${this.urlPrefix}/appdiylargescreen/queryLargeScreenProjectDetailById?id=${id}`).then(res => {
if (res?.data) { if (res?.data) {
this.form = { this.form = {
@@ -182,7 +183,6 @@
onStatusChange (id) { onStatusChange (id) {
this.instance.post(`${this.urlPrefix}/appdiylargescreen/enableLargeScreen?id=${id}`).then(res => { this.instance.post(`${this.urlPrefix}/appdiylargescreen/enableLargeScreen?id=${id}`).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.getInfo()
this.$message.success('操作成功') this.$message.success('操作成功')
} }
}) })
@@ -207,12 +207,28 @@
if (ids.indexOf(e.id) < 0) { if (ids.indexOf(e.id) < 0) {
this.tableData.push({ this.tableData.push({
title: e.title, title: e.title,
id: e.id id: e.id,
status: '1'
}) })
} else { } else {
const index = this.tableData.findIndex(v => v.id === e.id) const index = this.tableData.findIndex(v => v.id === e.id)
this.$set(this.tableData[index], 'title', e.title) 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) {
}
})
}
})
}, },
add() { add() {