From 487ae4e26fbbfbdf45f465f304a405572d0a76ec Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Mar 2021 16:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BF=E7=AD=96=E5=8F=91=E5=B8=83=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E7=9B=B8=E5=85=B3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/policy.js | 14 +++++++++- src/views/firstPages/policy.vue | 46 ++++++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/api/policy.js b/src/api/policy.js index b6483ab..95c57e8 100644 --- a/src/api/policy.js +++ b/src/api/policy.js @@ -1,5 +1,6 @@ import request from '@/utils/request' const policy = '/enterprise/policy' +const policyArea = '/policy/policy' export function PolicyDetail(data) { return request({ @@ -30,6 +31,7 @@ export function PolicyUpdate(data) { imgUrl: data.imgUrl, intro: data.intro, title: data.title, + pushDep: data.pushDep, titleUrl: data.titleUrl, type: data.type } @@ -61,8 +63,18 @@ export function PolicyAdd(data) { intro: data.intro, publishTime: data.publishTime, title: data.title, - titleUrl: data.titleUrl + titleUrl: data.titleUrl, + publishDepartId: data.pushDep, } } }) } + + +export function getAreaBranch() { + return request({ + url: `/gateway${policyArea}/area`, + method: 'post', + data: {} + }) +} diff --git a/src/views/firstPages/policy.vue b/src/views/firstPages/policy.vue index b21a5f6..12deda2 100644 --- a/src/views/firstPages/policy.vue +++ b/src/views/firstPages/policy.vue @@ -185,6 +185,16 @@ + + + + @@ -289,6 +299,16 @@ + + + + @@ -337,6 +357,8 @@ export default { show111: false, total: 0, listLoading: true, + cascader: '', + cascader1: '', data: { title: '', auditStatus: '', @@ -366,17 +388,29 @@ export default { titleUrl: '', imgUrl: '', content: '', - intro: '' - } + intro: '', + pushDep: '' + }, + options: [] } }, computed: { ...mapGetters(['name']) }, - created() { - this.getList() + async created() { + await this.getList() + await api.getAreaBranch().then(res => { + this.options = res + }) }, methods: { + handleChange(value) { + this.temp.pushDep = value[value.length - 1] + console.log(this.temp) + }, + handleChange1(value) { + this.addPolicy.pushDep = value[value.length - 1] + }, async Search() { const that = this that.listLoading = true @@ -435,6 +469,7 @@ export default { handleUpdate(row) { const that = this that.temp = Object.assign({}, row) // copy obj + console.log(that.temp) that.temp.timestamp = new Date(that.temp.timestamp) that.dialogStatus = 'update' for (const key in that.typeList) { @@ -464,6 +499,7 @@ export default { } await api.PolicyUpdate(that.temp).then(res => { this.getList() + this.cascader = '' that.dialogFormVisible = false }) }, @@ -471,6 +507,7 @@ export default { this.listLoading = true detail.auditStatus = num await api.PolicyUpdate(detail).then(res => { + this.cascader = '' this.listLoading = false }) }, @@ -501,6 +538,7 @@ export default { } } api.PolicyAdd(that.addPolicy).then(res => { + this.cascader1 = '' that.dialogFormVisible1 = false }) },