From 3b9152e2a21078c444d377cc93fb45aadd669e94 Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Fri, 27 May 2022 17:18:02 +0800
Subject: [PATCH] =?UTF-8?q?=E6=94=BF=E7=AD=96=E6=B3=95=E8=A7=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/regulations/index.js | 2 +-
src/views/regulations/index.vue | 48 ++++++++++++++++++++-------------
2 files changed, 31 insertions(+), 19 deletions(-)
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;
},
}
}