diff --git a/src/api/regulations/index.js b/src/api/regulations/index.js index 8774aac..0f70bf4 100644 --- a/src/api/regulations/index.js +++ b/src/api/regulations/index.js @@ -37,7 +37,7 @@ export function save(data) { export function del(id) { return request({ url: '/api/admin/article/policy-destroy', - method: 'post', + method: 'get', params:{ id } diff --git a/src/views/regulations/index.vue b/src/views/regulations/index.vue index 8d2c548..eb256ec 100644 --- a/src/views/regulations/index.vue +++ b/src/views/regulations/index.vue @@ -50,13 +50,13 @@ - - + + - - + @@ -96,7 +96,7 @@
- +
@@ -158,7 +158,9 @@ focus_id: "", title: "", content: "", - link: "", + link: "", + author:"", + author_date:'', files_list: [] }, fileList: [], @@ -174,14 +176,14 @@ type: "string", }, { - field: "autor", + field: "author", title: "发布者", type: "string", width: 200, align: "center" }, { - field: "date", + field: "author_date", title: "发布时间", type: "string", width: 200, @@ -235,13 +237,22 @@ }, 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; @@ -285,7 +296,9 @@ }); }, resetForm(formName) { - var that = this; + var that = this; + this.fileList = []; + this.$refs.tiny.setContent(""); this.$refs[formName].resetFields(); that.dialogFormVisible = false; }, @@ -333,7 +346,6 @@ return this.$confirm(`确定移除 ${ file.name }?`); }, handlesuccess(response, file, fileList) { - console.log(fileList); let listUrl = []; for (var m of fileList) { if (m.response) @@ -346,7 +358,7 @@ }); } - this.form.file_list = listUrl; + this.form.files_list = listUrl; }, } }