|
@@ -422,22 +422,22 @@ export default {
|
|
|
//3.2 表单验证规则
|
|
|
formRules: {
|
|
|
//网站名称不能为空
|
|
|
- website_name: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
+ website_name: [{ required: true, trigger: 'blur', message: "该项不能为空!" }],
|
|
|
//网站地址不能为空
|
|
|
'website_url[0].url': [
|
|
|
{ required: true, message: '至少要填写一个网站地址!', trigger: 'blur' },
|
|
|
{ validator: this.validateWebsiteUrl, trigger: 'blur' }
|
|
|
],
|
|
|
//网系不能为空 注意,因为是select框,只有提交的时候才会验证
|
|
|
- website_column_arr_id: [{ type: 'array', required: true, trigger: 'change', message: '必须选择一个网系!', validator: validateColumn }],
|
|
|
+ website_column_arr_id: [{ type: 'array', required: true, trigger: 'change', message: '必须选择一个网系!' }],
|
|
|
//网站标题,关键词,描述不能为空
|
|
|
//city_arr_id:[{required:true,trigger:'blur',validator:validateColumn}],
|
|
|
- title: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
- keywords: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
- description: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
- logo: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
- logoUrl: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
- suffix: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
+ title: [{ required: true, trigger: 'blur', message: "该项不能为空! " }],
|
|
|
+ keywords: [{ required: true, trigger: 'blur', message: "该项不能为空! " }],
|
|
|
+ description: [{ required: true, trigger: 'blur', message: "该项不能为空! " }],
|
|
|
+ logo: [{ required: true, trigger: 'blur', message: "该项不能为空!" }],
|
|
|
+ logoUrl: [{ required: true, trigger: 'blur', message: "该项不能为空!" }],
|
|
|
+ suffix: [{ required: true, trigger: 'blur', message: "该项不能为空!" }],
|
|
|
//template_id:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
},
|
|
|
//3.3 通过api获的的数据 弹窗
|
|
@@ -955,7 +955,7 @@ export default {
|
|
|
type: 'success'
|
|
|
})
|
|
|
this.$router.push({ path: '/webSite' })
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.$message({
|
|
|
message: '网站底部信息修改失败',
|
|
|
type: 'error'
|
|
@@ -1008,48 +1008,49 @@ export default {
|
|
|
// 1.3 通过id判断当前是添加还是编辑
|
|
|
if (this.activeid) {
|
|
|
this.editBtn = true;//显示编辑按钮
|
|
|
- }
|
|
|
- // 1.4 获取网站详情
|
|
|
- this.$store.dispatch('pool/getWebsiteInfo', { id: this.activeid }).then(res => {
|
|
|
- //清除错误状态
|
|
|
- // this.$refs.form.clearValidate();
|
|
|
- console.log(res)
|
|
|
- //回显网站名称
|
|
|
- this.form.website_name = res.data.website_name;
|
|
|
- //回显星系
|
|
|
- this.form.website_column_arr_id = res.data.website_column_arr_id;
|
|
|
- //回显logo
|
|
|
- this.form.logo = res.data.logo;
|
|
|
- this.logoUrl = res.data.logo;
|
|
|
- //回显url
|
|
|
- let that = this;
|
|
|
- if (res.data.website_url == null) {
|
|
|
- //为null什么都不执行
|
|
|
- } else {
|
|
|
- for (let index in res.data.website_url) {
|
|
|
- this.form.website_url[index].url = res.data.website_url[index];
|
|
|
- this.form.website_url[index].show = true;
|
|
|
+ // 1.4 获取网站详情
|
|
|
+ this.$store.dispatch('pool/getWebsiteInfo', { id: this.activeid }).then(res => {
|
|
|
+ //清除错误状态
|
|
|
+ // this.$refs.form.clearValidate();
|
|
|
+ console.log(res)
|
|
|
+ //回显网站名称
|
|
|
+ this.form.website_name = res.data.website_name;
|
|
|
+ //回显星系
|
|
|
+ this.form.website_column_arr_id = res.data.website_column_arr_id;
|
|
|
+ //回显logo
|
|
|
+ this.form.logo = res.data.logo;
|
|
|
+ this.logoUrl = res.data.logo;
|
|
|
+ //回显url
|
|
|
+ let that = this;
|
|
|
+ if (res.data.website_url == null) {
|
|
|
+ //为null什么都不执行
|
|
|
+ } else {
|
|
|
+ for (let index in res.data.website_url) {
|
|
|
+ this.form.website_url[index].url = res.data.website_url[index];
|
|
|
+ this.form.website_url[index].show = true;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- //回显id
|
|
|
- //存放城市id
|
|
|
- //this.form.city_arr_id = res.data.city_arr_id;
|
|
|
- //当cascaderKey的值改变的时候 级联选择器会重置里面的内容
|
|
|
- //this.cascaderKey += 1;
|
|
|
- //回显网站标题,描述,关键词
|
|
|
- console.log(res.data.title, res.data.keywords, res.data.description)
|
|
|
- this.form.title = res.data.title;
|
|
|
- this.form.keywords = res.data.keywords;
|
|
|
- this.tags = res.data.keywords ? res.data.keywords.split(',') : [];
|
|
|
- this.form.description = res.data.description;
|
|
|
- this.form.suffix = res.data.suffix;
|
|
|
- //回显模板信息
|
|
|
- // this.form.template_id = res.data.template_id;
|
|
|
- // this.TemplateName = res.data.template_name;
|
|
|
- // this.TemplateImg = JSON.parse(res.data.template_img)[0];
|
|
|
- })
|
|
|
-
|
|
|
- this.getfootInfo()
|
|
|
+ //回显id
|
|
|
+ //存放城市id
|
|
|
+ //this.form.city_arr_id = res.data.city_arr_id;
|
|
|
+ //当cascaderKey的值改变的时候 级联选择器会重置里面的内容
|
|
|
+ //this.cascaderKey += 1;
|
|
|
+ //回显网站标题,描述,关键词
|
|
|
+ console.log(res.data.title, res.data.keywords, res.data.description)
|
|
|
+ this.form.title = res.data.title;
|
|
|
+ this.form.keywords = res.data.keywords;
|
|
|
+ this.tags = res.data.keywords ? res.data.keywords.split(',') : [];
|
|
|
+ this.form.description = res.data.description;
|
|
|
+ this.form.suffix = res.data.suffix;
|
|
|
+ //回显模板信息
|
|
|
+ // this.form.template_id = res.data.template_id;
|
|
|
+ // this.TemplateName = res.data.template_name;
|
|
|
+ // this.TemplateImg = JSON.parse(res.data.template_img)[0];
|
|
|
+ })
|
|
|
+
|
|
|
+ this.getfootInfo()
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|