政策申办统计导入
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<el-input v-model="form.title" placeholder="请输入标题" :maxlength="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发布地区" prop="areaId">
|
||||
<ai-area-get :instance="instance" v-model="form.areaId" :root="rootArea" valueLevel="5"/>
|
||||
<ai-area-get :instance="instance" v-model="form.areaId" :root="rootArea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文章类型" prop="moduleId" style="width:50%;">
|
||||
<ai-select v-model="form.moduleId" :selectList="miniTypeList" @change="getNewTypeList"/>
|
||||
@@ -21,7 +21,7 @@
|
||||
<el-form-item label="正文" prop="content" style="width: 100%;">
|
||||
<ai-editor v-model="form.content" :instance="instance"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="封面图片(最多1张)" >
|
||||
<el-form-item label="封面图片" >
|
||||
<ai-uploader
|
||||
:isShowTip="true"
|
||||
:instance="instance"
|
||||
@@ -32,7 +32,7 @@
|
||||
<template slot="tips">最多上传1张图片,单张图片最大10MB<br/>支持.png,.jpg,.jpeg格式</template>
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件附件" prop="fileList">
|
||||
<el-form-item label="附件附件" prop="files">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action
|
||||
@@ -86,7 +86,10 @@ export default {
|
||||
rules() {
|
||||
return {
|
||||
title: [{required: true, message: "请输入标题"}],
|
||||
areaId: [{required: true, message: "请选择发布地区"}],
|
||||
areaId: [
|
||||
{message: "请选择发布地区", required: true, trigger: "blur"},
|
||||
{validator: (r, v, cb) => v && /0{3}$/g.test(v) ? cb('发布地区必须选到村级') : cb(), trigger: "blur"}
|
||||
],
|
||||
moduleId: [{required: true, message: "请选择文章类型"}],
|
||||
categoryId: [{required: true, message: "选择分类"}],
|
||||
}
|
||||
@@ -100,7 +103,7 @@ export default {
|
||||
form: {
|
||||
pictureUrlList: [],
|
||||
pictureUrl: '',
|
||||
file: []
|
||||
files: []
|
||||
},
|
||||
miniTypeList: [],
|
||||
newTypeList: []
|
||||
@@ -112,9 +115,9 @@ export default {
|
||||
const isLt10M = file.file.size / 1024 / 1024 < 10;
|
||||
if (!isLt10M) {
|
||||
this.$message.error("附件大小不超过10mb!");
|
||||
for (let i = 0; i < this.fileList.length; i++) {
|
||||
if (this.fileList[i].uid == file.file.uid) {
|
||||
this.fileList.splice(i, 1);
|
||||
for (let i = 0; i < this.form.files.length; i++) {
|
||||
if (this.form.files[i].uid == file.file.uid) {
|
||||
this.form.files.splice(i, 1);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -124,33 +127,23 @@ export default {
|
||||
this.instance.post(`/admin/file/add`, formData, {withCredentials: false}).then(res => {
|
||||
if (res && res.code == 0) {
|
||||
let img = res.data[0].split(';');
|
||||
this.fileList.forEach((item, index) => {
|
||||
this.form.files.forEach((item, index) => {
|
||||
if (item.uid == file.file.uid) {
|
||||
this.fileList[index].id = img[1];
|
||||
this.form.files[index].id = img[1];
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = fileList;
|
||||
this.form.files = fileList;
|
||||
},
|
||||
handleChange(file, fileList) {
|
||||
this.fileList = fileList;
|
||||
this.form.files = fileList;
|
||||
},
|
||||
back() {
|
||||
this.$router.push({})
|
||||
},
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
id && this.instance.post("/app/apppreventionreturntopoverty/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.form = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs.ruleForm.validate(v => {
|
||||
if (v) {
|
||||
@@ -166,6 +159,23 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
if(!id) {
|
||||
return
|
||||
}
|
||||
id && this.instance.post("/app/apppreventionreturntopoverty/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
if(res.data.pictureUrl) {
|
||||
res.data.pictureUrlList = [{url: res.data.pictureUrl}]
|
||||
}
|
||||
this.form = res.data
|
||||
this.getNewTypeList()
|
||||
}
|
||||
})
|
||||
},
|
||||
getTypeList() {
|
||||
let {parentId} = this.$route.query
|
||||
this.instance.post(`/app/apppublicitycategory/list?categoryType=1&size=100&parentId=${parentId}`).then(res => {
|
||||
@@ -192,7 +202,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getTypeList()
|
||||
// this.getDetail()
|
||||
this.getDetail()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user