|
@@ -10,11 +10,12 @@
|
|
<div class="formDiv">
|
|
<div class="formDiv">
|
|
<el-form-item label="常规模板类型:" :label-width="formLabelWidth" prop="role_id" class="custom-align-right">
|
|
<el-form-item label="常规模板类型:" :label-width="formLabelWidth" prop="role_id" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-checkbox-group v-model="form.template_base_type">
|
|
|
|
|
|
+ <el-checkbox-group v-model="form.page_type">
|
|
<el-checkbox label="1" disabled>首页</el-checkbox>
|
|
<el-checkbox label="1" disabled>首页</el-checkbox>
|
|
<el-checkbox label="2">分类页</el-checkbox>
|
|
<el-checkbox label="2">分类页</el-checkbox>
|
|
<el-checkbox label="3">列表页</el-checkbox>
|
|
<el-checkbox label="3">列表页</el-checkbox>
|
|
<el-checkbox label="4">详情页</el-checkbox>
|
|
<el-checkbox label="4">详情页</el-checkbox>
|
|
|
|
+ <el-checkbox label="5">搜索页</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -22,13 +23,13 @@
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
<div class="labelTitleStyle">
|
|
<div class="labelTitleStyle">
|
|
单页模板类型:
|
|
单页模板类型:
|
|
- <el-tooltip class="item" effect="dark" content="说明文字" placement="top">
|
|
|
|
|
|
+ <el-tooltip class="item" effect="dark" content="该类型仅供底部导航栏使用" placement="top">
|
|
<i class="el-icon-question"></i>
|
|
<i class="el-icon-question"></i>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
- <el-checkbox-group v-model="form.template_special_type">
|
|
|
|
- <el-checkbox label="1">自定义列表页</el-checkbox>
|
|
|
|
- <el-checkbox label="2" disabled>自定义详情页</el-checkbox>
|
|
|
|
|
|
+ <el-checkbox-group v-model="form.page_type">
|
|
|
|
+ <el-checkbox label="6">自定义列表页</el-checkbox>
|
|
|
|
+ <el-checkbox label="7" disabled>自定义详情页</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -37,40 +38,36 @@
|
|
<div class="layerBox">
|
|
<div class="layerBox">
|
|
<tableTitle :name="templateInfoTitle"/>
|
|
<tableTitle :name="templateInfoTitle"/>
|
|
<div class="formDiv">
|
|
<div class="formDiv">
|
|
- <el-form-item label="网站声明:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="网站声明:" :label-width="formLabelWidth" prop="statement" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.statement" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="主办单位:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="主办单位:" :label-width="formLabelWidth" prop="organizer" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.organizer" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="版权信息:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="版权信息:" :label-width="formLabelWidth" prop="copyright_information" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.copyright_information" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="联系电话:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="联系电话:" :label-width="formLabelWidth" prop="contact_number" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.contact_number" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="公司地址:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="公司地址:" :label-width="formLabelWidth" prop="company_address" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.company_address" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="项目LOGO:" class="custom-align-right">
|
|
<el-form-item label="项目LOGO:" class="custom-align-right">
|
|
<div class="uploaderBox">
|
|
<div class="uploaderBox">
|
|
- <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeAvatarUpload">
|
|
|
|
- <!-- <img v-if="imgUrl" :src="imgUrl" class="avatar">
|
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
|
|
|
|
|
+ <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="projectLogoUpload">
|
|
<!-- 预览图片 -->
|
|
<!-- 预览图片 -->
|
|
- <img v-if="form.project_img_src" :src="form.project_img_src" class="avatar">
|
|
|
|
- <!-- 上传图标 -->
|
|
|
|
- <!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
|
|
|
|
|
+ <img v-if="project_logo_src" :src="project_logo_src" class="avatar">
|
|
<div v-else class="chooseImgDiv">
|
|
<div v-else class="chooseImgDiv">
|
|
<div>
|
|
<div>
|
|
<img src="@/assets/public/upload/noImage.png">
|
|
<img src="@/assets/public/upload/noImage.png">
|
|
@@ -80,25 +77,21 @@
|
|
</el-upload>
|
|
</el-upload>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="项目名称:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="项目名称:" :label-width="formLabelWidth" prop="project_name" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.project_name" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="项目网址:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="项目网址:" :label-width="formLabelWidth" prop="project_url" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.project_url" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="公司LOGO:" class="custom-align-right">
|
|
<el-form-item label="公司LOGO:" class="custom-align-right">
|
|
<div class="uploaderBox">
|
|
<div class="uploaderBox">
|
|
- <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeAvatarUpload">
|
|
|
|
- <!-- <img v-if="imgUrl" :src="imgUrl" class="avatar">
|
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
|
|
|
|
|
+ <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="companyLogoUpload">
|
|
<!-- 预览图片 -->
|
|
<!-- 预览图片 -->
|
|
- <img v-if="form.project_img_src" :src="form.project_img_src" class="avatar">
|
|
|
|
- <!-- 上传图标 -->
|
|
|
|
- <!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
|
|
|
|
|
+ <img v-if="company_logo_src" :src="company_logo_src" class="avatar">
|
|
<div v-else class="chooseImgDiv">
|
|
<div v-else class="chooseImgDiv">
|
|
<div>
|
|
<div>
|
|
<img src="@/assets/public/upload/noImage.png">
|
|
<img src="@/assets/public/upload/noImage.png">
|
|
@@ -108,34 +101,44 @@
|
|
</el-upload>
|
|
</el-upload>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="公司名称:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="公司名称:" :label-width="formLabelWidth" prop="company_name" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.company_name" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="公司网址:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="公司网址:" :label-width="formLabelWidth" prop="company_url" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.company_url" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="网站备案号:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="网站备案号:" :label-width="formLabelWidth" prop="icp_number" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.icp_number" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="网安备案号:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="网站备链接:" :label-width="formLabelWidth" prop="icp_number_url" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.icp_number_url" placeholder="请输入.."></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="网安备案号:" :label-width="formLabelWidth" prop="record_number" class="custom-align-right">
|
|
|
|
+ <div class="formLabelFloatBox">
|
|
|
|
+ <el-input type="text" v-model="form.record_number" placeholder="请输入.."></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="网安备案号链接" :label-width="formLabelWidth" prop="record_number_url" class="custom-align-right">
|
|
|
|
+ <div class="formLabelFloatBox">
|
|
|
|
+ <el-input type="text" v-model="form.record_number_url" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="客服QQ号1:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="客服QQ号:" :label-width="formLabelWidth" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.customer_service_qq" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="客服QQ号2:" :label-width="formLabelWidth" prop="website_statement" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="通联QQ号:" :label-width="formLabelWidth" class="custom-align-right">
|
|
<div class="formLabelFloatBox">
|
|
<div class="formLabelFloatBox">
|
|
- <el-input type="text" v-model="form.website_statement" placeholder="请输入.."></el-input>
|
|
|
|
|
|
+ <el-input type="text" v-model="form.communications" placeholder="请输入.."></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
@@ -143,7 +146,8 @@
|
|
</el-form>
|
|
</el-form>
|
|
<div class="bottomBtnBox">
|
|
<div class="bottomBtnBox">
|
|
<el-button type="info" @click="goToWebsite">返回</el-button>
|
|
<el-button type="info" @click="goToWebsite">返回</el-button>
|
|
- <el-button type="primary" @click="goToStyle">下一步</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="editData" v-if="this.$route.query.step!=undefined">编辑并进入下一步</el-button>
|
|
|
|
+ <el-button type="primary" @click="addData" v-else>保存并进入下一步</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -163,13 +167,6 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
// 配置验证规则:用于表单验证
|
|
// 配置验证规则:用于表单验证
|
|
- const validatePassword = (rule, value, callback) => {
|
|
|
|
- if (value.length < 6) {
|
|
|
|
- callback(new Error('密码不能低于6位!'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
const validateEmpty = (rule,value,callback) => {
|
|
const validateEmpty = (rule,value,callback) => {
|
|
if (value.length == 0) {
|
|
if (value.length == 0) {
|
|
callback(new Error('该项不能为空!'))
|
|
callback(new Error('该项不能为空!'))
|
|
@@ -184,14 +181,43 @@ export default {
|
|
formLabelWidth:"120px",
|
|
formLabelWidth:"120px",
|
|
editId:"",
|
|
editId:"",
|
|
form:{
|
|
form:{
|
|
- template_base_type:["1"],//常规类型
|
|
|
|
- template_special_type:["2"],//特殊类型
|
|
|
|
- website_statement:"",//网站声明
|
|
|
|
- project_img_src:"",
|
|
|
|
|
|
+ website_id:"",//网站id
|
|
|
|
+ page_type:["1","7"],//页面类型
|
|
|
|
+ statement:"",//网站声明
|
|
|
|
+ organizer:"",//主办单位
|
|
|
|
+ copyright_information:"",//版权信息
|
|
|
|
+ contact_number:"",//联系电话
|
|
|
|
+ company_address:"",//公司地址
|
|
|
|
+ project_logo:"",//项目logo
|
|
|
|
+ project_name:"",//项目名称
|
|
|
|
+ project_url:"",//项目网址
|
|
|
|
+ company_logo:"",//公司logo
|
|
|
|
+ company_name:"",//公司名称
|
|
|
|
+ company_url:"",//公司网址
|
|
|
|
+ icp_number:"",//网站备案号
|
|
|
|
+ icp_number_url:"",//网站备案号链接
|
|
|
|
+ record_number:"",//网安备案号
|
|
|
|
+ record_number_url:"",//网安备案号链接
|
|
|
|
+ customer_service_qq:"",//客服qq客服
|
|
|
|
+ communications:"",//通联qq客服
|
|
},
|
|
},
|
|
|
|
+ project_logo_src:"",//项目logo缩略图
|
|
|
|
+ company_logo_src:"",//公司logo缩略图
|
|
//配置from表单验证规则
|
|
//配置from表单验证规则
|
|
loginRules: {
|
|
loginRules: {
|
|
- website_statement: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
|
|
+ statement: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ organizer: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ copyright_information: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ contact_number: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ company_address: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ project_name: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ project_url: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ company_name: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ company_url: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ icp_number: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ record_number: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ icp_number_url: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ record_number_url: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
}
|
|
}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -200,11 +226,17 @@ export default {
|
|
//上一步
|
|
//上一步
|
|
goToWebsite(){
|
|
goToWebsite(){
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- path: '/webSite'
|
|
|
|
|
|
+ path: '/templateList'
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//下一步
|
|
//下一步
|
|
goToStyle(){
|
|
goToStyle(){
|
|
|
|
+ //先判断表达能否提交
|
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: '/templateStyle',
|
|
path: '/templateStyle',
|
|
query: {
|
|
query: {
|
|
@@ -215,82 +247,153 @@ export default {
|
|
//0.全局操作 end ------------------------------------------------------------>
|
|
//0.全局操作 end ------------------------------------------------------------>
|
|
|
|
|
|
//1.提交表单 start ------------------------------------------------------------>
|
|
//1.提交表单 start ------------------------------------------------------------>
|
|
- //提交表单
|
|
|
|
|
|
+ //1.1提交表单
|
|
addData(){
|
|
addData(){
|
|
- console.log(this.form);
|
|
|
|
- //1.先验证用户是否已经存在
|
|
|
|
- this.$store.dispatch('template/addBasic',this.form).then(res=>{
|
|
|
|
- if(res.code==200){
|
|
|
|
- this.$message.success('基本信息添加成功!请选择模板风格');
|
|
|
|
- //进入下一步
|
|
|
|
- this.goToStyle();
|
|
|
|
|
|
+ this.form.website_id = this.$route.query.website_id;
|
|
|
|
+ //console.log(this.form);
|
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.$store.dispatch('template/addWebsiteTemplateintel',this.form).then(res=>{
|
|
|
|
+ if(res.code==200){
|
|
|
|
+ this.$message.success('网站基本信息保存成功!');
|
|
|
|
+ //跳转到风格选择页面
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/templateStyle',
|
|
|
|
+ query: {
|
|
|
|
+ website_id: this.$route.query.website_id,
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- }).catch(error=>{
|
|
|
|
- this.$message.error('网络错误,请重试!');
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //提交表单 start ------------------------------------------------------------>
|
|
|
|
-
|
|
|
|
- //2.编辑表单 start ------------------------------------------------------------>
|
|
|
|
- //获得用户信息
|
|
|
|
- getUserInfo(){
|
|
|
|
- this.$store.dispatch('userMember/getUser',{id:this.editId}).then(res=>{
|
|
|
|
- console.log(res);
|
|
|
|
- //回显数据
|
|
|
|
- this.form.type_id = res.data.type_id;
|
|
|
|
- this.form.user_name = res.data.user_name;
|
|
|
|
- this.form.role_id = res.data.role_id;
|
|
|
|
- this.form.real_name = res.data.real_name;
|
|
|
|
- this.form.mobile = res.data.mobile;
|
|
|
|
- this.form.gender = res.data.gender + "";
|
|
|
|
-
|
|
|
|
- }).catch(error=>{
|
|
|
|
|
|
+ //1.2上传项目logo
|
|
|
|
+ projectLogoUpload(file) {
|
|
|
|
+ const isJPG = file.type === 'image/jpeg';
|
|
|
|
+ const isPNG = file.type === 'image/png';
|
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
|
+ if (!isJPG && !isPNG) {
|
|
|
|
+ this.$message.error('上传图片只能是 JPG 或 PNG 格式!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!isLt2M) {
|
|
|
|
+ this.$message.error('上传图片大小不能超过 2MB!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ const formData = new FormData();
|
|
|
|
+ formData.append('file', file);
|
|
|
|
+ this.$store.dispatch('pool/uploadFile',formData).then(res=> {
|
|
|
|
+ this.project_logo_src = res.data.imgUrl;//显示缩略图
|
|
|
|
+ this.form.project_logo = res.data.imgUrl;//提供表单地址
|
|
|
|
+ console.log(res.data.imgUrl)
|
|
|
|
+ }).catch(() => {
|
|
this.$message({
|
|
this.$message({
|
|
- type: 'info',
|
|
|
|
|
|
+ type: 'warning',
|
|
message: '网络错误,请重试!'
|
|
message: '网络错误,请重试!'
|
|
});
|
|
});
|
|
})
|
|
})
|
|
|
|
+ // 阻止默认的上传行为
|
|
|
|
+ return false;
|
|
},
|
|
},
|
|
- //修改用户
|
|
|
|
- editData(){
|
|
|
|
- this.$store.dispatch('userMember/verifyUserInfo',{id:this.editId,user_name:this.form.user_name}).then(res=>{
|
|
|
|
- if(res.code==0){
|
|
|
|
- this.form.id = this.editId;
|
|
|
|
- delete this.form.password;
|
|
|
|
- delete this.form.confirm_password;
|
|
|
|
- //如果code为0表示用户不存在,提交表单
|
|
|
|
- this.$store.dispatch('userMember/updateUser',this.form).then(res=>{
|
|
|
|
- console.log(res);
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '用户添加成功!'
|
|
|
|
- });
|
|
|
|
- this.goList();
|
|
|
|
- })
|
|
|
|
- }else if(res.code==200){
|
|
|
|
- //如果code==200 表示用户存在,阻止进一步提交
|
|
|
|
- this.$message({
|
|
|
|
- type: 'warning',
|
|
|
|
- message: '该账号已被注册,请更换其他账号!'
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }).catch(error=>{
|
|
|
|
|
|
+ //1.3上传公司logo
|
|
|
|
+ companyLogoUpload(file) {
|
|
|
|
+ const isJPG = file.type === 'image/jpeg';
|
|
|
|
+ const isPNG = file.type === 'image/png';
|
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
|
+ if (!isJPG && !isPNG) {
|
|
|
|
+ this.$message.error('上传图片只能是 JPG 或 PNG 格式!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!isLt2M) {
|
|
|
|
+ this.$message.error('上传图片大小不能超过 2MB!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ const formData = new FormData();
|
|
|
|
+ formData.append('file', file);
|
|
|
|
+ this.$store.dispatch('pool/uploadFile',formData).then(res=> {
|
|
|
|
+ this.company_logo_src = res.data.imgUrl;//显示缩略图
|
|
|
|
+ this.form.company_logo = res.data.imgUrl;//提供表单地址
|
|
|
|
+ console.log(res.data.imgUrl)
|
|
|
|
+ }).catch(() => {
|
|
this.$message({
|
|
this.$message({
|
|
- type: 'info',
|
|
|
|
|
|
+ type: 'warning',
|
|
message: '网络错误,请重试!'
|
|
message: '网络错误,请重试!'
|
|
});
|
|
});
|
|
})
|
|
})
|
|
|
|
+ // 阻止默认的上传行为
|
|
|
|
+ return false;
|
|
},
|
|
},
|
|
- //编辑表单 end ------------------------------------------------------------>
|
|
|
|
|
|
+ //提交表单 start ------------------------------------------------------------>
|
|
|
|
+
|
|
|
|
+ //2.编辑表单 start ------------------------------------------------------------>
|
|
|
|
+ //2.1回显数据
|
|
|
|
+ getWebsiteBase(website_id){
|
|
|
|
+ this.$store.dispatch('template/getWebsiteTemplateintel',{website_id:website_id}).then(res=>{
|
|
|
|
+ if(res.code==200){
|
|
|
|
+ this.form.website_id = res.data.website_id;//网站id
|
|
|
|
+ this.form.page_type = res.data.page_type;//页面类型
|
|
|
|
+ this.form.statement = res.data.statement;//网站声明
|
|
|
|
+ this.form.organizer = res.data.organizer;//主办单位
|
|
|
|
+ this.form.copyright_information = res.data.copyright_information;//版权信息
|
|
|
|
+ this.form.contact_number = res.data.contact_number;//联系电话
|
|
|
|
+ this.form.company_address = res.data.company_address;//公司地址
|
|
|
|
+ this.form.project_logo = res.data.project_logo;//项目logo
|
|
|
|
+ this.project_logo_src = res.data.project_logo;//项目logo缩略图
|
|
|
|
+ this.form.project_name = res.data.project_name;//项目名称
|
|
|
|
+ this.form.project_url = res.data.project_url;//项目网址
|
|
|
|
+ this.form.company_logo = res.data.company_logo;//公司logo
|
|
|
|
+ this.company_logo_src = res.data.company_logo;//公司logo缩略图
|
|
|
|
+ this.form.company_name = res.data.company_name;//公司名称
|
|
|
|
+ this.form.company_url = res.data.company_url;//公司网址
|
|
|
|
+ this.form.icp_number = res.data.icp_number;//网站备案号
|
|
|
|
+ this.form.icp_number_url = res.data.icp_number_url;//网站备案号链接
|
|
|
|
+ this.form.record_number = res.data.record_number;//网安备案号
|
|
|
|
+ this.form.record_number_url = res.data.record_number_url;//网安备案号链接
|
|
|
|
+ this.form.customer_service_qq = res.data.customer_service_qq;//客服qq客服
|
|
|
|
+ this.form.communications = res.data.communications;//通联qq客服
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //2.2提交编辑的数据
|
|
|
|
+ editData(){
|
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.$store.dispatch('template/upWebsiteTemplateintel',this.form).then(res=>{
|
|
|
|
+ if(res.code==200){
|
|
|
|
+ this.$message.success('网站基本信息编辑成功!');
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/templateStyle',
|
|
|
|
+ query: {
|
|
|
|
+ website_id: this.$route.query.website_id,
|
|
|
|
+ step:this.$route.query.step
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //2.编辑表单 end ------------------------------------------------------------>
|
|
|
|
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
//1.展示步骤
|
|
//1.展示步骤
|
|
this.$store.commit('template/showStepStatus');
|
|
this.$store.commit('template/showStepStatus');
|
|
//2.判断是新建还是回显
|
|
//2.判断是新建还是回显
|
|
- if(this.$route.query.id!=undefined){
|
|
|
|
- this.editId = this.$route.query.id;
|
|
|
|
|
|
+ if(this.$route.query.step!=undefined){
|
|
console.log("编辑模板!")
|
|
console.log("编辑模板!")
|
|
|
|
+ if(this.$route.query.website_id){
|
|
|
|
+ this.getWebsiteBase(this.$route.query.website_id);
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error("无法编辑,缺少关键参数!");
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
console.log("添加模板基本信息!")
|
|
console.log("添加模板基本信息!")
|
|
}
|
|
}
|