|
|
@@ -73,11 +73,27 @@
|
|
|
@click="deleteUrlInput(4)" class="formLabelDelIcon"></el-button>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="上级网系:" :label-width="formLabelWidth" prop="website_column_arr_id"
|
|
|
+ <el-form-item label="网站属性:" :label-width="formLabelWidth" prop="website_column_arr_id"
|
|
|
class="custom-align-right">
|
|
|
<el-cascader v-model="form.website_column_arr_id" :props="{ checkStrictly: true }"
|
|
|
:options="website_column_arr"></el-cascader>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="网站类型:" :label-width="formLabelWidth" prop="web_type"
|
|
|
+ class="custom-align-right">
|
|
|
+ <el-select v-model="form.web_type" clearable placeholder="请选择网站类型">
|
|
|
+ <el-option label="法治调研类" :value="1"></el-option>
|
|
|
+ <el-option label="资讯信息类" :value="2"></el-option>
|
|
|
+ <el-option label="舆情测控类" :value="3"></el-option>
|
|
|
+ <el-option label="发展促进类" :value="4"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否核心站:" :label-width="formLabelWidth" prop="is_core"
|
|
|
+ class="custom-align-right">
|
|
|
+ <el-radio-group v-model="form.is_core">
|
|
|
+ <el-radio :label="1">是</el-radio>
|
|
|
+ <el-radio :label="0">否</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="网站logo:" prop="logo" :label-width="formLabelWidth"
|
|
|
:class="['custom-form-item']" class="custom-align-right">
|
|
|
<div class="uploaderBox">
|
|
|
@@ -174,6 +190,66 @@
|
|
|
</template>
|
|
|
<el-input v-model="form.ad_key" autocomplete="off" @change="checkWebsiteName(form.ad_key,0)" placeholder="请输入网站名称缩写" :disabled="website_column_arr_id.includes(3)"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="网站二维码:" prop="qr_code" :label-width="formLabelWidth"
|
|
|
+ :class="['custom-form-item']" class="custom-align-right">
|
|
|
+ <div class="uploaderBox">
|
|
|
+ <!--图片上传组件 start ------------------------------------------------------------>
|
|
|
+ <div class="avatar-upload-container" @mouseenter="hovering = true"
|
|
|
+ @mouseleave="hovering = false">
|
|
|
+ <!-- 上传组件 -->
|
|
|
+ <el-upload class="avatar-uploader" action="#" :show-file-list="false"
|
|
|
+ :before-upload="beforeAvatarUpload5">
|
|
|
+ <!-- 预览图片 -->
|
|
|
+ <img v-if="logoUrl_5" :src="logoUrl_5" class="avatar">
|
|
|
+ <!-- 上传图标 -->
|
|
|
+ <!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
|
|
+ <div v-else class="chooseImgDiv">
|
|
|
+ <div>
|
|
|
+ <img src="@/assets/public/upload/noImage.png">
|
|
|
+ <div>选择图片</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <input type="hidden" name="qr_code" v-model="form.qr_code">
|
|
|
+ </el-upload>
|
|
|
+ <!-- 删除按钮,当鼠标悬浮时显示 -->
|
|
|
+ <div v-if="hovering && logoUrl_5" class="delete-button" @click="handleDelete5">
|
|
|
+ <i class="el-icon-delete"></i>
|
|
|
+ </div>
|
|
|
+ <span class="photo_tips">请上传网站二维码,不大于500K。</span>
|
|
|
+ </div>
|
|
|
+ <!--图片上传组件 end ------------------------------------------------------------>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="网站首页图:" prop="index_img" :label-width="formLabelWidth"
|
|
|
+ :class="['custom-form-item']" class="custom-align-right">
|
|
|
+ <div class="uploaderBox">
|
|
|
+ <!--图片上传组件 start ------------------------------------------------------------>
|
|
|
+ <div class="avatar-upload-container" @mouseenter="hovering = true"
|
|
|
+ @mouseleave="hovering = false">
|
|
|
+ <!-- 上传组件 -->
|
|
|
+ <el-upload class="avatar-uploader" action="#" :show-file-list="false"
|
|
|
+ :before-upload="beforeAvatarUpload6">
|
|
|
+ <!-- 预览图片 -->
|
|
|
+ <img v-if="logoUrl_6" :src="logoUrl_6" class="avatar">
|
|
|
+ <!-- 上传图标 -->
|
|
|
+ <!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
|
|
+ <div v-else class="chooseImgDiv">
|
|
|
+ <div>
|
|
|
+ <img src="@/assets/public/upload/noImage.png">
|
|
|
+ <div>选择图片</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <input type="hidden" name="index_img" v-model="form.index_img">
|
|
|
+ </el-upload>
|
|
|
+ <!-- 删除按钮,当鼠标悬浮时显示 -->
|
|
|
+ <div v-if="hovering && logoUrl_6" class="delete-button" @click="handleDelete6">
|
|
|
+ <i class="el-icon-delete"></i>
|
|
|
+ </div>
|
|
|
+ <span class="photo_tips">请上传网站首页图,不大于500K。</span>
|
|
|
+ </div>
|
|
|
+ <!--图片上传组件 end ------------------------------------------------------------>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
@@ -426,6 +502,8 @@ export default {
|
|
|
{ url: "", show: false }
|
|
|
],
|
|
|
website_column_arr_id: [],//需要提交的上级网系 数组
|
|
|
+ web_type:null,//网站类型
|
|
|
+ is_core:null,//是否核心网站
|
|
|
//city_arr_id:[0],//需要提交的城市id
|
|
|
logo: "",//logo地址 提交文件换取地址
|
|
|
title: "",//需要提交的网站标题
|
|
|
@@ -433,6 +511,8 @@ export default {
|
|
|
description: "",//需要提交的网站描述
|
|
|
suffix: "",//需要提交的网站后缀
|
|
|
ad_key: "",//需要提交的网站名称缩写
|
|
|
+ qr_code: "",//需要提交的二维码地址
|
|
|
+ index_img: "",//需要提交的首页图片地址
|
|
|
//template_id:""//选择的网站皮肤
|
|
|
},
|
|
|
//3.2 表单验证规则
|
|
|
@@ -465,6 +545,8 @@ export default {
|
|
|
logoUrl_2: '',
|
|
|
logoUrl_3: '',
|
|
|
logoUrl_4: '',
|
|
|
+ logoUrl_5: '',
|
|
|
+ logoUrl_6: '',
|
|
|
hovering: false, // 鼠标悬浮状态 悬浮时显示删除
|
|
|
//3.5 模板列表
|
|
|
TemplateList: [],
|
|
|
@@ -545,12 +627,12 @@ export default {
|
|
|
this.form.keywords = newTags.join(',');
|
|
|
},
|
|
|
//设置图片格式 __网站LOGO__
|
|
|
- beforeAvatarUpload(file) {
|
|
|
+ beforeAvatarUpload(file,type) {
|
|
|
const isJPG = file.type === 'image/jpeg';
|
|
|
const isPNG = file.type === 'image/png';
|
|
|
const isGIF = file.type === 'image/gif';
|
|
|
const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
-
|
|
|
+ console.log(type)
|
|
|
if (!isJPG && !isPNG && !isGIF) {
|
|
|
this.$message.error('上传缩略图只能是 JPG 或 PNG 或 GIF 格式!');
|
|
|
return false;
|
|
|
@@ -711,26 +793,107 @@ export default {
|
|
|
// 阻止默认的上传行为
|
|
|
return false;
|
|
|
},
|
|
|
+ //二维码图片
|
|
|
+ beforeAvatarUpload5(file) {
|
|
|
+ const isJPG = file.type === 'image/jpeg';
|
|
|
+ const isPNG = file.type === 'image/png';
|
|
|
+ const isGIF = file.type === 'image/gif';
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
+
|
|
|
+ if (!isJPG && !isPNG && !isGIF) {
|
|
|
+ this.$message.error('上传缩略图只能是 JPG 或 PNG 或 GIF 格式!');
|
|
|
+ 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.logoUrl_5 = res.data.imgUrl;//显示缩略图
|
|
|
+ this.form.qr_code = res.data.imgUrl;//提供表单地址
|
|
|
+ console.log('888888888888888----------------',res.data.imgUrl)
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '网络错误,请重试!'
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ // 阻止默认的上传行为
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ //网站首页图片
|
|
|
+ beforeAvatarUpload6(file) {
|
|
|
+ const isJPG = file.type === 'image/jpeg';
|
|
|
+ const isPNG = file.type === 'image/png';
|
|
|
+ const isGIF = file.type === 'image/gif';
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
+
|
|
|
+ if (!isJPG && !isPNG && !isGIF) {
|
|
|
+ this.$message.error('上传缩略图只能是 JPG 或 PNG 或 GIF 格式!');
|
|
|
+ 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.logoUrl_6 = res.data.imgUrl;//显示缩略图
|
|
|
+ this.form.index_img = res.data.imgUrl;//提供表单地址
|
|
|
+ console.log(res.data.imgUrl)
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '网络错误,请重试!'
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ // 阻止默认的上传行为
|
|
|
+ return false;
|
|
|
+ },
|
|
|
handleDelete() {
|
|
|
// 删除图片
|
|
|
+ this.form.logo = '';
|
|
|
this.logoUrl = ''; // 清空图片 URL
|
|
|
},
|
|
|
handleDelete1() {
|
|
|
// 删除图片
|
|
|
+ this.ruleForm.project_logo = '';
|
|
|
this.logoUrl_1 = ''; // 清空图片 URL
|
|
|
},
|
|
|
handleDelete2() {
|
|
|
// 删除图片
|
|
|
+ this.ruleForm.company_logo = '';
|
|
|
this.logoUrl_2 = ''; // 清空图片 URL
|
|
|
},
|
|
|
handleDelete3() {
|
|
|
// 删除图片
|
|
|
+ this.ruleForm.service_qq_img = '';
|
|
|
this.logoUrl_3 = ''; // 清空图片 URL
|
|
|
},
|
|
|
handleDelete4() {
|
|
|
// 删除图片
|
|
|
+ this.ruleForm.communications_img = '';
|
|
|
this.logoUrl_4 = ''; // 清空图片 URL
|
|
|
},
|
|
|
+ handleDelete5() {
|
|
|
+ // 删除图片
|
|
|
+ this.form.qr_code = '';
|
|
|
+ this.logoUrl_5 = ''; // 清空图片 URL
|
|
|
+ },
|
|
|
+ handleDelete6() {
|
|
|
+ // 删除图片
|
|
|
+ this.form.index_img = '';
|
|
|
+ this.logoUrl_6 = ''; // 清空图片 URL
|
|
|
+ },
|
|
|
//取消添加或编辑
|
|
|
goCancel() {
|
|
|
this.$message({
|
|
|
@@ -756,6 +919,8 @@ export default {
|
|
|
//还原表单
|
|
|
this.form.website_name = "";
|
|
|
this.form.website_column_arr_id = "";
|
|
|
+ this.form.web_type = null;
|
|
|
+ this.form.is_core = null;
|
|
|
this.form.website_url = [
|
|
|
{ url: "", show: true },
|
|
|
{ url: "", show: false },
|
|
|
@@ -780,6 +945,11 @@ export default {
|
|
|
this.form.keywords = "";
|
|
|
this.tags = [];
|
|
|
this.form.ad_key = ""; // 网站名称缩写
|
|
|
+ this.form.index_img = ""; // 网站二维码
|
|
|
+ this.form.qr_code = ""; // 网站首页图片
|
|
|
+ this.logoUrl_5 = "";
|
|
|
+ this.logoUrl_6 = "";
|
|
|
+
|
|
|
},
|
|
|
//3.1 获得所有网系
|
|
|
getwebsiteColumn() {
|
|
|
@@ -877,7 +1047,7 @@ export default {
|
|
|
//循环完毕 重置提交的url
|
|
|
this.form.website_url = webSiteArray;
|
|
|
//console.log(webSiteArray)
|
|
|
- console.log(this.form)
|
|
|
+ console.log('3333',this.form)
|
|
|
//提交表单
|
|
|
this.$store.dispatch('pool/addWebsite', this.form).then(res => {
|
|
|
|
|
|
@@ -1100,6 +1270,12 @@ export default {
|
|
|
//回显logo
|
|
|
this.form.logo = res.data.logo;
|
|
|
this.logoUrl = res.data.logo;
|
|
|
+ // 回显网站二维码
|
|
|
+ this.form.qr_code = res.data.qr_code;
|
|
|
+ this.logoUrl_5 = res.data.qr_code;
|
|
|
+ // 回显网站首页图片
|
|
|
+ this.form.index_img = res.data.index_img;
|
|
|
+ this.logoUrl_6 = res.data.index_img;
|
|
|
//回显url
|
|
|
let that = this;
|
|
|
if (res.data.website_url == null) {
|
|
|
@@ -1119,10 +1295,14 @@ export default {
|
|
|
console.log(res.data.title, res.data.keywords, res.data.description)
|
|
|
this.form.title = res.data.title;
|
|
|
this.form.keywords = res.data.keywords;
|
|
|
+ this.form.web_type = res.data.web_type;
|
|
|
+ this.form.is_core = res.data.is_core;
|
|
|
this.tags = res.data.keywords ? res.data.keywords.split(',') : [];
|
|
|
this.form.description = res.data.description;
|
|
|
this.form.suffix = res.data.suffix;
|
|
|
this.form.ad_key = res.data.ad_key; // 网站名称缩写
|
|
|
+ // this.form.ad_key = res.data.ad_key; // 网站名称缩写
|
|
|
+ // this.form.ad_key = res.data.ad_key; // 网站名称缩写
|
|
|
//回显模板信息
|
|
|
// this.form.template_id = res.data.template_id;
|
|
|
// this.TemplateName = res.data.template_name;
|