From 36edc3204b466b440d7ef302aad76ca2e3eb5001 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 30 May 2022 17:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E7=A4=BA=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/notice/index.js | 2 +- src/views/notice/index.vue | 141 ++++++++++++++++++++++---------- src/views/regulations/index.vue | 36 +++++++- 3 files changed, 130 insertions(+), 49 deletions(-) diff --git a/src/api/notice/index.js b/src/api/notice/index.js index 2f68a80..e88c8d2 100644 --- a/src/api/notice/index.js +++ b/src/api/notice/index.js @@ -37,7 +37,7 @@ export function save(data) { export function del(id) { return request({ url: '/api/admin/article/notice-destroy', - method: 'post', + method: 'get', params:{ id } diff --git a/src/views/notice/index.vue b/src/views/notice/index.vue index ed4faac..b2729d9 100644 --- a/src/views/notice/index.vue +++ b/src/views/notice/index.vue @@ -20,11 +20,19 @@ @@ -49,17 +57,18 @@ - + + + + + + + + + + + @@ -78,24 +87,33 @@ - - + + + + + + + + + + + + + + + + + 点击上传 + + +
- +
@@ -139,7 +157,8 @@ return { selects:{ noticeType:[], - noticeMain:[] + noticeMain:[], + streetType:[] }, uploadOther: { token: "" @@ -156,10 +175,17 @@ form: { from_id:"", type_id:"", + area_id:"", title:"", - content:"", + content:"", + link: "", + author:"", + status:1, + author_date:'', + files_list: [] }, - tableData: [], + tableData: [], + fileList: [], rules: { }, tableHeight: 900, @@ -170,16 +196,23 @@ field: "title", title: "公告名称", type: "string", + }, + { + field: "status", + title: "状态", + type: "status", + width: 200, + align: "status" }, { - field: "autor", + field: "author", title: "发布者", type: "string", width: 200, align: "center" }, { - field: "date", + field: "author_date", title: "发布时间", type: "string", width: 200, @@ -216,6 +249,11 @@ getparameteritem("notice-main").then(res => { this.selects.noticeMain = res.detail; + }); + + getparameteritem("streetList").then(res => { + this.selects.streetType = res.detail; + this.form.area_id = res.detail[0].id; }); }, load() { @@ -230,17 +268,25 @@ console.log(error) reject(error) }) - }, info(obj) { var that = this; - // getdaily(obj.id).then(res => { - // let result = Object.assign(that.form, res); - // that.form = result; - - // }).catch(error => { - // //reject(error) - // }) + get(obj.id).then(res => { + let result = Object.assign(that.form, res); + that.form = result; + let _files = []; + for (var mod of result.files) { + let m = Object.assign({}, mod); + m.url = mod.upload.url; + m.name = mod.upload.original_name; + m.id = mod.upload.id; + _files.push(m); + } + that.fileList = _files; + this.$refs.tiny.setContent(result.content); + }).catch(error => { + //reject(error) + }) }, edit(obj) { this.form = this.$options.data().form; @@ -284,7 +330,9 @@ }); }, resetForm(formName) { - var that = this; + var that = this; + this.fileList = []; + this.$refs.tiny.setContent(""); this.$refs[formName].resetFields(); that.dialogFormVisible = false; }, @@ -343,9 +391,8 @@ listUrl.push({ 'upload_id': m.id }); - } - this.form.file_list = listUrl; + this.form.files_list = listUrl; }, } } @@ -354,5 +401,9 @@ diff --git a/src/views/regulations/index.vue b/src/views/regulations/index.vue index eb256ec..d46c417 100644 --- a/src/views/regulations/index.vue +++ b/src/views/regulations/index.vue @@ -24,6 +24,11 @@ + +
+
待审核
+
通过
+
不通过
{{scope.row[column.field]}}
@@ -78,8 +83,17 @@ + + + + + + + + - + @@ -139,7 +153,8 @@ return { selects: { regulationLevel: [], - regulationImpor: [], + regulationImpor: [], + regulationType:[] }, uploadOther: { token: "" @@ -160,6 +175,8 @@ content: "", link: "", author:"", + type_id:"", + status:1, author_date:'', files_list: [] }, @@ -174,6 +191,13 @@ field: "title", title: "政策名称", type: "string", + }, + { + field: "status", + title: "状态", + type: "status", + width: 200, + align: "status" }, { field: "author", @@ -220,7 +244,13 @@ getparameteritem("regulation-impor").then(res => { this.selects.regulationImpor = res.detail; - }); + }); + + getparameteritem("regulation-type").then(res => { + this.selects.regulationType = res.detail; + this.form.type_id = res.detail[0].id; + }); + }, load() { listPolicy({