From a857a5abd3525287221f813cea77bb78cd6c7e01 Mon Sep 17 00:00:00 2001
From: zhaoxiaoqiang <287285524@qq.com>
Date: Thu, 07 Sep 2023 15:32:52 +0800
Subject: [PATCH] 新增推广位项目选择
---
src/views/qyp-project-management/index.vue | 76 +++++++++++++++++++++++++------------
1 files changed, 51 insertions(+), 25 deletions(-)
diff --git a/src/views/qyp-project-management/index.vue b/src/views/qyp-project-management/index.vue
index c13b62b..5f7d8f8 100644
--- a/src/views/qyp-project-management/index.vue
+++ b/src/views/qyp-project-management/index.vue
@@ -91,19 +91,21 @@
</el-radio-group>
</el-form-item>
<el-form-item label="项目背景图" v-if="addProd" ref="backFilePath" prop="backFilePath">
- <uploadImg v-if="addProd" @sendList="imgSet($event,'backFilePath')" :disabled="disabled" :defaultList="ruleForm.backFilePath"></uploadImg>
+ <uploadImg v-if="addProd" @sendList="imgSet($event,'backFilePath')" :disabled="disabled" :defaultList="backFilePath"></uploadImg>
</el-form-item>
<el-form-item label="项目宣传标语" ref="logoFilePath" prop="logoFilePath">
- <uploadImg v-if="addProd" @sendList="imgSet($event,'logoFilePath')" :disabled="disabled" :defaultList="ruleForm.logoFilePath"></uploadImg>
+ <uploadImg v-if="addProd" @sendList="imgSet($event,'logoFilePath')" :disabled="disabled" :defaultList="logoFilePath"></uploadImg>
</el-form-item>
<el-form-item label="项目优惠券图片" ref="titleFilePath" prop="titleFilePath">
- <uploadImg v-if="addProd" @sendList="imgSet($event,'titleFilePath')" :disabled="disabled" :defaultList="ruleForm.titleFilePath"></uploadImg>
+ <uploadImg v-if="addProd" @sendList="imgSet($event,'titleFilePath')" :disabled="disabled" :defaultList="titleFilePath"></uploadImg>
</el-form-item>
<el-form-item label="会员权益" ref="qyFilePath">
- <uploadImg v-if="addProd" @sendList="imgSet($event,'qyFilePath')" :disabled="disabled" :defaultList="ruleForm.qyFilePath"></uploadImg>
+ <uploadImg v-if="addProd" @sendList="imgSet($event,'qyFilePath')" :disabled="disabled" :defaultList="qyFilePath"></uploadImg>
</el-form-item>
<el-form-item label="活动规则" prop="ruleContent">
- <tinymce v-model="ruleForm.ruleContent" :disabled="disabled" :height="300" />
+ <div :class="{'tinymce_disable':disabled}">
+ <tinymce v-if="addProd" v-model="ruleForm.ruleContent" :disabled="disabled" :height="300" />
+ </div>
</el-form-item>
<el-form-item style="text-align:right;" v-if="!disabled">
<el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
@@ -179,7 +181,8 @@
{
lable: "项目链接",
prop: "projUrl",
- align: "center"
+ align: "center",
+ width: "300",
},
{
lable: "创建时间",
@@ -197,6 +200,7 @@
lable: "项目描述",
prop: "projDesc",
align: "center",
+ width: "240",
},
{
lable: "",
@@ -264,8 +268,7 @@
backFilePath:[],
logoFilePath:[],
titleFilePath:[],
- qyFilePath:[],
- ruleFilePath:[]
+ qyFilePath:[]
},
rules: {
projName: [
@@ -295,14 +298,19 @@
qyFilePath: [
{ required: true, trigger: 'change' ,validator: qyFilePathImage }
],
- ruleFilePath: [
- { required: true, trigger: 'change',validator: ruleFilePathImage }
- ],
+ // ruleFilePath: [
+ // { required: true, trigger: 'change',validator: ruleFilePathImage }
+ // ],
ruleContent:[
{ required: true, message: '请输入活动规则', trigger: 'blur', }
]
},
- title:"新增项目"
+ title:"新增项目",
+ backFilePath:[],
+ logoFilePath:[],
+ titleFilePath:[],
+ qyFilePath:[],
+ ruleFilePath:[]
}
},
watch:{
@@ -315,12 +323,16 @@
projUrl:"",
projDesc:"",
status:"",
+ ruleContent:'',
backFilePath:[],
logoFilePath:[],
titleFilePath:[],
qyFilePath:[],
- ruleFilePath:[]
};
+ this.backFilePath = [];
+ this.logoFilePath = [];
+ this.titleFilePath = [];
+ this.qyFilePath = [];
this.$refs['ruleForm'].resetFields();
}
},
@@ -354,6 +366,7 @@
},
addProduct(){
this.title = '新增项目';
+ this.ruleForm.ruleContent = '';
this.addProd = true;
this.disabled = false;
},
@@ -394,13 +407,13 @@
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
- let {backFilePath,logoFilePath,titleFilePath,qyFilePath,ruleFilePath,projId} = this.ruleForm;
+ let {backFilePath,logoFilePath,titleFilePath,qyFilePath,projId} = this.ruleForm;
let method = {projectUpdata,projectAdd};
let data = {};
if(projId){
- data = {...this.ruleForm,backFilePath:backFilePath[0],logoFilePath:logoFilePath[0],titleFilePath:titleFilePath[0],qyFilePath:qyFilePath[0],ruleFilePath:ruleFilePath[0]}
+ data = {...this.ruleForm};
}else{
- data = {...this.ruleForm,backFilePath:backFilePath[0],logoFilePath:logoFilePath[0],titleFilePath:titleFilePath[0],qyFilePath:qyFilePath[0],ruleFilePath:ruleFilePath[0]}
+ data = {...this.ruleForm,backFilePath:backFilePath[0],logoFilePath:logoFilePath[0],titleFilePath:titleFilePath[0],qyFilePath:qyFilePath[0]}
}
method[projId?"projectUpdata":"projectAdd"](data).then(res=>{
this.$message.success("创建成功");
@@ -426,12 +439,11 @@
},
getProductDetail(projId,type){
projectDtl({projId:projId}).then(({body})=>{
- let {backFilePath,logoFilePath,titleFilePath,qyFilePath,ruleFilePath} = body;
- body.backFilePath = this.setDefaultImg(backFilePath,'backFilePath');
- body.logoFilePath = this.setDefaultImg(logoFilePath,'logoFilePath');
- body.titleFilePath = this.setDefaultImg(titleFilePath,"titleFilePath");
- body.qyFilePath =qyFilePath? this.setDefaultImg(qyFilePath,"qyFilePath"):[];
- body.ruleFilePath = this.setDefaultImg(ruleFilePath,"ruleFilePath");
+ let {backFilePath,logoFilePath,titleFilePath,qyFilePath} = body;
+ this.backFilePath = this.setDefaultImg(backFilePath,'backFilePath');
+ this.logoFilePath = this.setDefaultImg(logoFilePath,'backFilePath');
+ this.titleFilePath = this.setDefaultImg(titleFilePath,'titleFilePath');
+ this.qyFilePath = this.setDefaultImg(qyFilePath,'backFilePath');
this.ruleForm = body;
this.$nextTick(()=>{
this.addProd = true;
@@ -439,9 +451,13 @@
})
},
setDefaultImg(url,type){
- let backArr = [url].map((n,index)=>{
- return {url:n,filePath:n,uid:type+index,fileId:type+index,fileName:n,name:n};
- });
+ let backArr = [];
+ if(url){
+ backArr = [url].map((n,index)=>{
+ return {url:n,filePath:n,uid:type+index,fileId:type+index,fileName:n,name:n};
+ });
+ }
+
return backArr
}
}
@@ -476,6 +492,16 @@
.tips{
color: #f56c6c;
}
+ .tinymce_disable{
+ position:relative;
+ left:0;
+ top:0;
+ opacity:.5;
+ width:100%;//根据自己的富文本宽调整
+ background-color:#000;
+ z-index:998;
+ pointer-events: none;
+ }
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0