31001
This commit is contained in:
		| @@ -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() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user