政策法规

master
lion 4 years ago
parent 68842b9abc
commit 3b9152e2a2

@ -37,7 +37,7 @@ export function save(data) {
export function del(id) { export function del(id) {
return request({ return request({
url: '/api/admin/article/policy-destroy', url: '/api/admin/article/policy-destroy',
method: 'post', method: 'get',
params:{ params:{
id id
} }

@ -50,13 +50,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="发布者" prop="autor"> <el-form-item label="发布者" prop="author">
<el-input v-model="form.autor" placeholder="请填写发布者" autocomplete="off"></el-input> <el-input v-model="form.author" placeholder="请填写发布者" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10" :offset="4"> <el-col :span="10" :offset="4">
<el-form-item label="发布时间" prop="date"> <el-form-item label="发布时间" prop="author_date">
<el-date-picker class="width100" placeholder="请选择发布时间" type="date" v-model="form.date" <el-date-picker class="width100" placeholder="请选择发布时间" type="date" v-model="form.author_date"
value-format="yyyy-MM-dd"> value-format="yyyy-MM-dd">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -96,7 +96,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="内容详情" prop="content"> <el-form-item label="内容详情" prop="content">
<div style="width: 99.9%;"> <div style="width: 99.9%;">
<tinymce ref="tinymce" v-model="form.content" :height="300" /> <tinymce ref="tiny" v-model="form.content" :height="300" />
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -159,6 +159,8 @@
title: "", title: "",
content: "", content: "",
link: "", link: "",
author:"",
author_date:'',
files_list: [] files_list: []
}, },
fileList: [], fileList: [],
@ -174,14 +176,14 @@
type: "string", type: "string",
}, },
{ {
field: "autor", field: "author",
title: "发布者", title: "发布者",
type: "string", type: "string",
width: 200, width: 200,
align: "center" align: "center"
}, },
{ {
field: "date", field: "author_date",
title: "发布时间", title: "发布时间",
type: "string", type: "string",
width: 200, width: 200,
@ -235,13 +237,22 @@
}, },
info(obj) { info(obj) {
var that = this; var that = this;
// getdaily(obj.id).then(res => { get(obj.id).then(res => {
// let result = Object.assign(that.form, res); let result = Object.assign(that.form, res);
// that.form = result; that.form = result;
let _files = [];
// }).catch(error => { for (var mod of result.files) {
// //reject(error) 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) { edit(obj) {
this.form = this.$options.data().form; this.form = this.$options.data().form;
@ -286,6 +297,8 @@
}, },
resetForm(formName) { resetForm(formName) {
var that = this; var that = this;
this.fileList = [];
this.$refs.tiny.setContent("");
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
that.dialogFormVisible = false; that.dialogFormVisible = false;
}, },
@ -333,7 +346,6 @@
return this.$confirm(`确定移除 ${ file.name }`); return this.$confirm(`确定移除 ${ file.name }`);
}, },
handlesuccess(response, file, fileList) { handlesuccess(response, file, fileList) {
console.log(fileList);
let listUrl = []; let listUrl = [];
for (var m of fileList) { for (var m of fileList) {
if (m.response) if (m.response)
@ -346,7 +358,7 @@
}); });
} }
this.form.file_list = listUrl; this.form.files_list = listUrl;
}, },
} }
} }

Loading…
Cancel
Save