|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="mainBox">
|
|
<div class="mainBox">
|
|
<div class="layerBox">
|
|
<div class="layerBox">
|
|
- <tableTitle :name="tableDivTitle"/>
|
|
|
|
|
|
+ <tableTitle :name="tableDivTitle" />
|
|
<el-form :model="form" ref="form" :rules="formRules" label-position="left" label-width="120px">
|
|
<el-form :model="form" ref="form" :rules="formRules" label-position="left" label-width="120px">
|
|
<div class="formDiv">
|
|
<div class="formDiv">
|
|
<el-form-item label="资讯题目:" prop="title" class="custom-align-right">
|
|
<el-form-item label="资讯题目:" prop="title" class="custom-align-right">
|
|
@@ -16,12 +16,15 @@
|
|
<el-input v-model="form.title" autocomplete="off" placeholder="请输入资讯标题"></el-input>
|
|
<el-input v-model="form.title" autocomplete="off" placeholder="请输入资讯标题"></el-input>
|
|
<el-checkbox v-model="form.islink">是否使用外链</el-checkbox>
|
|
<el-checkbox v-model="form.islink">是否使用外链</el-checkbox>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <div v-if="form.islink==true">
|
|
|
|
|
|
+ <div v-if="form.islink == true">
|
|
<el-form-item label="站点名称:" prop="cat_arr_id" class="custom-align-right">
|
|
<el-form-item label="站点名称:" prop="cat_arr_id" class="custom-align-right">
|
|
- <el-cascader :key="parentKey" v-model="form.web_site_id" placeholder="请选择站点名称" :options="creatNews_nav_pool_arr" @change="creatNews_nav_pool_change_fun(form.web_site_id)" filterable clearable></el-cascader>
|
|
|
|
|
|
+ <el-cascader :key="parentKey" v-model="form.web_site_id" placeholder="请选择站点名称"
|
|
|
|
+ :options="creatNews_nav_pool_arr" @change="creatNews_nav_pool_change_fun(form.web_site_id)" filterable
|
|
|
|
+ clearable></el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
|
|
|
|
- <el-cascader :key="parentKey_2" v-model="form.cat_arr_id" placeholder="请选择要绑定的父级导航" :props="parentData_2" filterable clearable></el-cascader>
|
|
|
|
|
|
+ <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
|
|
|
|
+ <el-cascader :key="parentKey_2" v-model="form.cat_arr_id" placeholder="请选择要绑定的父级导航" :props="parentData_2"
|
|
|
|
+ filterable clearable></el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
|
|
<!-- <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
|
|
<el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的导航池名称" :props="parentData" filterable clearable></el-cascader>
|
|
<el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的导航池名称" :props="parentData" filterable clearable></el-cascader>
|
|
@@ -33,22 +36,26 @@
|
|
<el-input v-model="form.author" autocomplete="off" placeholder="请输入作者"></el-input>
|
|
<el-input v-model="form.author" autocomplete="off" placeholder="请输入作者"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
- <div v-if="form.islink==false">
|
|
|
|
- <div v-if="creatNews_user_type!=10000">
|
|
|
|
|
|
+ <div v-if="form.islink == false">
|
|
|
|
+ <div v-if="creatNews_user_type != 10000">
|
|
<el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
|
|
<el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
|
|
- <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的导航池名称" :props="parentData" filterable clearable></el-cascader>
|
|
|
|
|
|
+ <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的导航池名称" :props="parentData"
|
|
|
|
+ filterable clearable></el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- <div v-if="creatNews_user_type==10000">
|
|
|
|
|
|
+ <div v-if="creatNews_user_type == 10000">
|
|
<el-form-item label="站点名称:" prop="cat_arr_id" class="custom-align-right">
|
|
<el-form-item label="站点名称:" prop="cat_arr_id" class="custom-align-right">
|
|
- <el-cascader :key="parentKey" v-model="form.web_site_id" placeholder="请选择站点名称" :options="creatNews_nav_pool_arr" @change="creatNews_nav_pool_change_fun(form.web_site_id)" filterable clearable></el-cascader>
|
|
|
|
|
|
+ <el-cascader :key="parentKey" v-model="form.web_site_id" placeholder="请选择站点名称"
|
|
|
|
+ :options="creatNews_nav_pool_arr" @change="creatNews_nav_pool_change_fun(form.web_site_id)"
|
|
|
|
+ filterable clearable></el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
|
|
|
|
- <el-cascader :key="parentKey_2" v-model="form.cat_arr_id" placeholder="请选择要绑定的父级导航" :props="parentData_2" filterable clearable></el-cascader>
|
|
|
|
|
|
+ <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
|
|
|
|
+ <el-cascader :key="parentKey_2" v-model="form.cat_arr_id" placeholder="请选择要绑定的父级导航"
|
|
|
|
+ :props="parentData_2" filterable clearable></el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
- <el-form-item label="推荐等级:" class="custom-align-right" >
|
|
|
|
|
|
+ <el-form-item label="推荐等级:" class="custom-align-right">
|
|
<el-select v-model="form.level" clearable placeholder="请选择推荐等级..">
|
|
<el-select v-model="form.level" clearable placeholder="请选择推荐等级..">
|
|
<el-option label="头条" :value="1"></el-option>
|
|
<el-option label="头条" :value="1"></el-option>
|
|
<el-option label="轮播图" :value="2"></el-option>
|
|
<el-option label="轮播图" :value="2"></el-option>
|
|
@@ -57,9 +64,11 @@
|
|
<el-option label="资讯推荐" :value="5"></el-option>
|
|
<el-option label="资讯推荐" :value="5"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="缩略图:" class="custom-align-right" prop="imgUrl" v-if="form.level==2||form.level==3">
|
|
|
|
|
|
+ <el-form-item label="缩略图:" class="custom-align-right" prop="imgUrl"
|
|
|
|
+ v-if="form.level == 2 || form.level == 3">
|
|
<div class="uploaderBox">
|
|
<div class="uploaderBox">
|
|
- <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeAvatarUpload">
|
|
|
|
|
|
+ <el-upload class="avatar-uploader" action="#" :show-file-list="false"
|
|
|
|
+ :before-upload="beforeAvatarUpload">
|
|
<!-- <img v-if="imgUrl" :src="imgUrl" class="avatar">
|
|
<!-- <img v-if="imgUrl" :src="imgUrl" class="avatar">
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
|
<!-- 预览图片 -->
|
|
<!-- 预览图片 -->
|
|
@@ -96,7 +105,8 @@
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
- <el-input type="textarea" v-model="form.introduce" class="custom-textarea" placeholder="请输入资讯描述"></el-input>
|
|
|
|
|
|
+ <el-input type="textarea" v-model="form.introduce" class="custom-textarea"
|
|
|
|
+ placeholder="请输入资讯描述"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div class="QuillTitle">
|
|
<div class="QuillTitle">
|
|
<span>* </span>资讯内容:
|
|
<span>* </span>资讯内容:
|
|
@@ -110,10 +120,12 @@
|
|
<textarea v-model="editorHtml" style="width: 100%; height: 400px;"></textarea>
|
|
<textarea v-model="editorHtml" style="width: 100%; height: 400px;"></textarea>
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
- <quill-editor ref="quillEditor" v-model="form.content" :options="editorOptions" class="my-quill-editor"/>
|
|
|
|
|
|
+ <quill-editor ref="quillEditor" v-model="form.content" :options="editorOptions"
|
|
|
|
+ class="my-quill-editor" />
|
|
</div>
|
|
</div>
|
|
<!-- 多图上传隐藏的input -->
|
|
<!-- 多图上传隐藏的input -->
|
|
- <input type="file" ref="multiFileInput" @change="handleMultipleFiles" multiple hidden accept="image/jpeg, image/png" />
|
|
|
|
|
|
+ <input type="file" ref="multiFileInput" @change="handleMultipleFiles" multiple hidden
|
|
|
|
+ accept="image/jpeg, image/png" />
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="作者:" prop="author" class="custom-align-right">
|
|
<el-form-item label="作者:" prop="author" class="custom-align-right">
|
|
@@ -128,7 +140,7 @@
|
|
<el-radio :label="0">否</el-radio>
|
|
<el-radio :label="0">否</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <div v-if="form.is_original==0">
|
|
|
|
|
|
+ <div v-if="form.is_original == 0">
|
|
<el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
|
|
<el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
|
|
<el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称"></el-input>
|
|
<el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -137,52 +149,57 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div class="disclaimerBox">
|
|
<div class="disclaimerBox">
|
|
<div class="disclaimerTitle">
|
|
<div class="disclaimerTitle">
|
|
- <img src="@/assets/public/check.png"/>同意《免责声明》:
|
|
|
|
|
|
+ <img src="@/assets/public/check.png" />同意《免责声明》:
|
|
<!-- <el-checkbox v-model="disclaimer" disabled="disabled"></el-checkbox> -->
|
|
<!-- <el-checkbox v-model="disclaimer" disabled="disabled"></el-checkbox> -->
|
|
</div>
|
|
</div>
|
|
- <div class="disclaimerText">本文来源于网络转载,仅供学习交流使用,不构成商业目的。版权归原作者所有,如涉及作品内容、版权和其他问题,请在30日内与本站联系,我们将在第一时间处理。</div>
|
|
|
|
|
|
+ <div class="disclaimerText">
|
|
|
|
+ 本文来源于网络转载,仅供学习交流使用,不构成商业目的。版权归原作者所有,如涉及作品内容、版权和其他问题,请在30日内与本站联系,我们将在第一时间处理。</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div v-if="form.is_original==1">
|
|
|
|
|
|
+ <div v-if="form.is_original == 1">
|
|
<el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
|
|
<el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
|
|
- <el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称" disabled="disabled"></el-input>
|
|
|
|
|
|
+ <el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称"
|
|
|
|
+ disabled="disabled"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
- <el-form-item label="资讯状态:" class="custom-align-right" style="width: 100%;">
|
|
|
|
|
|
+ <el-form-item label="资讯状态:" class="custom-align-right" style="width: 100%;" v-if="creatNews_user_type == 10000">
|
|
<el-select v-model="form.status" placeholder="请选择..">
|
|
<el-select v-model="form.status" placeholder="请选择..">
|
|
<el-option label="已发布" :value="1"></el-option>
|
|
<el-option label="已发布" :value="1"></el-option>
|
|
<el-option label="待发布" :value="0"></el-option>
|
|
<el-option label="待发布" :value="0"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="是否开启投票:" prop="is_survey" class="custom-align-right">
|
|
<el-form-item label="是否开启投票:" prop="is_survey" class="custom-align-right">
|
|
- <el-radio-group v-model="form.is_survey" >
|
|
|
|
|
|
+ <el-radio-group v-model="form.is_survey">
|
|
<el-radio :label="1">是</el-radio>
|
|
<el-radio :label="1">是</el-radio>
|
|
<el-radio :label="0">否</el-radio>
|
|
<el-radio :label="0">否</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <div v-if="form.is_survey==1">
|
|
|
|
|
|
+ <div v-if="form.is_survey == 1">
|
|
<el-form-item label="问卷标题:" prop="survey_name" class="custom-align-right">
|
|
<el-form-item label="问卷标题:" prop="survey_name" class="custom-align-right">
|
|
<el-input v-model="form.survey_name" autocomplete="off" placeholder="请输入问卷标题"></el-input>
|
|
<el-input v-model="form.survey_name" autocomplete="off" placeholder="请输入问卷标题"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="选项:" prop="survey_type" class="custom-align-right">
|
|
<el-form-item label="选项:" prop="survey_type" class="custom-align-right">
|
|
- <el-radio-group v-model="form.survey_type" >
|
|
|
|
|
|
+ <el-radio-group v-model="form.survey_type">
|
|
<el-radio :label="0">单选</el-radio>
|
|
<el-radio :label="0">单选</el-radio>
|
|
<el-radio :label="1">多选</el-radio>
|
|
<el-radio :label="1">多选</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="" class="custom-align-right">
|
|
|
|
|
|
+ <el-form-item label="" class="custom-align-right">
|
|
<div v-for="(input, index) in inputList" :key="index">
|
|
<div v-for="(input, index) in inputList" :key="index">
|
|
- <div class="formLabelFloatBox">
|
|
|
|
- <el-input autocomplete="off" v-model="input.value" maxlength="150" :label-width="formLabelWidth" placeholder="">
|
|
|
|
- <template slot="prepend">{{ index+1 }}</template>
|
|
|
|
- </el-input>
|
|
|
|
- <el-button type="info" icon="el-icon-plus" circle size="mini" @click="addInput(index)" class="formLabeladdIcon"></el-button>
|
|
|
|
- <el-button type="info" icon="el-icon-delete" circle size="mini" @click="deleteInput(index)" class="formLabelDelIcon"></el-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="formLabelFloatBox">
|
|
|
|
+ <el-input autocomplete="off" v-model="input.value" maxlength="150" :label-width="formLabelWidth"
|
|
|
|
+ placeholder="">
|
|
|
|
+ <template slot="prepend">{{ index + 1 }}</template>
|
|
|
|
+ </el-input>
|
|
|
|
+ <el-button type="info" icon="el-icon-plus" circle size="mini" @click="addInput(index)"
|
|
|
|
+ class="formLabeladdIcon"></el-button>
|
|
|
|
+ <el-button type="info" icon="el-icon-delete" circle size="mini" @click="deleteInput(index)"
|
|
|
|
+ class="formLabelDelIcon"></el-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="" class="custom-align-right">
|
|
|
|
- <el-checkbox v-model="checked">允许用户自己填写</el-checkbox>
|
|
|
|
|
|
+ <el-form-item label="" class="custom-align-right">
|
|
|
|
+ <el-checkbox v-model="checked">允许用户自己填写</el-checkbox>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -192,14 +209,14 @@
|
|
</div>
|
|
</div>
|
|
<div class="bottomBtnBox">
|
|
<div class="bottomBtnBox">
|
|
<el-button type="info" @click="returnPage">返回</el-button>
|
|
<el-button type="info" @click="returnPage">返回</el-button>
|
|
- <el-button type="primary" @click="editToServe" v-if="editStatus==true">确定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="editToServe" v-if="editStatus == true">确定</el-button>
|
|
<el-button type="primary" @click="addToServe" v-else>发布资讯</el-button>
|
|
<el-button type="primary" @click="addToServe" v-else>发布资讯</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getWebSiteId,getUseType} from '@/utils/auth'
|
|
|
|
|
|
+import { getWebSiteId, getUseType } from '@/utils/auth'
|
|
//表格标题
|
|
//表格标题
|
|
import tableTitle from './components/tableTitle';
|
|
import tableTitle from './components/tableTitle';
|
|
//引入公用样式
|
|
//引入公用样式
|
|
@@ -223,25 +240,25 @@ export default {
|
|
tableTitle
|
|
tableTitle
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
-
|
|
|
|
|
|
+
|
|
//0.全局操作 start ------------------------------------------------------------>
|
|
//0.全局操作 start ------------------------------------------------------------>
|
|
//表单验证
|
|
//表单验证
|
|
- const validateEmpty = (rule,value,callback) => {
|
|
|
|
|
|
+ const validateEmpty = (rule, value, callback) => {
|
|
if (value == '') {
|
|
if (value == '') {
|
|
callback(new Error('该项不能为空!'))
|
|
callback(new Error('该项不能为空!'))
|
|
} else {
|
|
} else {
|
|
callback()
|
|
callback()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- const validateArray = (rule,value,callback) => {
|
|
|
|
|
|
+ const validateArray = (rule, value, callback) => {
|
|
if (value.length == 0) {
|
|
if (value.length == 0) {
|
|
callback(new Error('该项不能为空!'))
|
|
callback(new Error('该项不能为空!'))
|
|
} else {
|
|
} else {
|
|
callback()
|
|
callback()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- const validateRadio = (rule,value,callback) => {
|
|
|
|
- if (value!='1'||value!='0') {
|
|
|
|
|
|
+ const validateRadio = (rule, value, callback) => {
|
|
|
|
+ if (value != '1' || value != '0') {
|
|
callback()
|
|
callback()
|
|
} else {
|
|
} else {
|
|
callback()
|
|
callback()
|
|
@@ -250,80 +267,80 @@ export default {
|
|
let self = this;
|
|
let self = this;
|
|
//0.全局操作 end ------------------------------------------------------------>
|
|
//0.全局操作 end ------------------------------------------------------------>
|
|
return {
|
|
return {
|
|
- websiteid:0,
|
|
|
|
- creatNews_pid_num:"0",//请求子导航用的pid
|
|
|
|
- creatNews_nav_pool_arr:[],//
|
|
|
|
- creatNews_add_nav_pool_arr:[],//
|
|
|
|
- creatNews_son_website_id_num:"",
|
|
|
|
- checked:false,
|
|
|
|
|
|
+ websiteid: 0,
|
|
|
|
+ creatNews_pid_num: "0",//请求子导航用的pid
|
|
|
|
+ creatNews_nav_pool_arr: [],//
|
|
|
|
+ creatNews_add_nav_pool_arr: [],//
|
|
|
|
+ creatNews_son_website_id_num: "",
|
|
|
|
+ checked: false,
|
|
formLabelWidth: '80px',//表单的长度
|
|
formLabelWidth: '80px',//表单的长度
|
|
//1.表单项 start ------------------------------------------------------------>
|
|
//1.表单项 start ------------------------------------------------------------>
|
|
- editStatus:false,
|
|
|
|
- tableDivTitle:"添加资讯",
|
|
|
|
- disclaimer:true,//免责声明
|
|
|
|
|
|
+ editStatus: false,
|
|
|
|
+ tableDivTitle: "添加资讯",
|
|
|
|
+ disclaimer: true,//免责声明
|
|
//提交表单
|
|
//提交表单
|
|
- creatNews_user_type:0,//判断用户类型'
|
|
|
|
|
|
+ creatNews_user_type: 0,//判断用户类型'
|
|
form: {
|
|
form: {
|
|
- user_type:"??",//判断用户类型'
|
|
|
|
- cat_arr_id:0,//导航池名称
|
|
|
|
- nav_add_pool_id:[],//导航池子级
|
|
|
|
|
|
+ user_type: "??",//判断用户类型'
|
|
|
|
+ cat_arr_id: 0,//导航池名称
|
|
|
|
+ nav_add_pool_id: [],//导航池子级
|
|
//1.1使用了外链
|
|
//1.1使用了外链
|
|
title: '',//资讯标题
|
|
title: '',//资讯标题
|
|
- islink:0,//是否使用外链 0非 1是
|
|
|
|
- linkurl:"",//外链地址
|
|
|
|
|
|
+ islink: 0,//是否使用外链 0非 1是
|
|
|
|
+ linkurl: "",//外链地址
|
|
//1.2没有使用外链
|
|
//1.2没有使用外链
|
|
- cat_arr_id:'',//导航池名称
|
|
|
|
- level:"",//推荐等级
|
|
|
|
- imgurl:"",//缩略图
|
|
|
|
- keyword:"",//关键词
|
|
|
|
- introduce:"",//描述
|
|
|
|
- content:"",//内容
|
|
|
|
- author:"",//作者
|
|
|
|
- hits:"",//浏览量
|
|
|
|
- is_original:0,//是否为原创 0非 1是
|
|
|
|
- copyfrom:"",//来源名称
|
|
|
|
- fromurl:"",//来源地址
|
|
|
|
- status:0,//状态 0待发布 1已发布 404已删除
|
|
|
|
|
|
+ cat_arr_id: '',//导航池名称
|
|
|
|
+ level: "",//推荐等级
|
|
|
|
+ imgurl: "",//缩略图
|
|
|
|
+ keyword: "",//关键词
|
|
|
|
+ introduce: "",//描述
|
|
|
|
+ content: "",//内容
|
|
|
|
+ author: "",//作者
|
|
|
|
+ hits: "",//浏览量
|
|
|
|
+ is_original: 0,//是否为原创 0非 1是
|
|
|
|
+ copyfrom: "",//来源名称
|
|
|
|
+ fromurl: "",//来源地址
|
|
|
|
+ status: 0,//状态 0待发布 1已发布 404已删除 如果是普通用户,这里始终为0
|
|
web_site_id: 0,
|
|
web_site_id: 0,
|
|
- is_survey:1,//调查问卷:0:否;1:是;
|
|
|
|
- survey_name:"",//问卷名称
|
|
|
|
- suvey_array:"",//选项名称集合
|
|
|
|
- survey_type:0 //0:单选 1:复选
|
|
|
|
|
|
+ is_survey: 1,//调查问卷:0:否;1:是;
|
|
|
|
+ survey_name: "",//问卷名称
|
|
|
|
+ suvey_array: "",//选项名称集合
|
|
|
|
+ survey_type: 0 //0:单选 1:复选
|
|
},
|
|
},
|
|
//1.2 表单验证规则
|
|
//1.2 表单验证规则
|
|
formRules: {
|
|
formRules: {
|
|
//导航池名称不能为空
|
|
//导航池名称不能为空
|
|
- cat_arr_id:[{required:true,trigger:'blur',validator:validateArray}],
|
|
|
|
|
|
+ cat_arr_id: [{ required: true, trigger: 'blur', validator: validateArray }],
|
|
//资讯名称不能为空
|
|
//资讯名称不能为空
|
|
- title:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ title: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//如果使用了外链,外链地址不能为空
|
|
//如果使用了外链,外链地址不能为空
|
|
- linkurl:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ linkurl: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//导航池名称不能为空
|
|
//导航池名称不能为空
|
|
- cat_arr_id:[{required:true,trigger:'blur',validator:validateArray}],
|
|
|
|
|
|
+ cat_arr_id: [{ required: true, trigger: 'blur', validator: validateArray }],
|
|
//推荐等级不能为空
|
|
//推荐等级不能为空
|
|
//level:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
//level:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
//关键词不能为空
|
|
//关键词不能为空
|
|
- keyword:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ keyword: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//描述不能为空
|
|
//描述不能为空
|
|
- introduce:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ introduce: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//内容不能为空
|
|
//内容不能为空
|
|
- content:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ content: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//作者不能为空
|
|
//作者不能为空
|
|
- author:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ author: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//是否原创不能为空
|
|
//是否原创不能为空
|
|
- is_original:[{required:true,trigger:'blur',validator:validateRadio}],
|
|
|
|
|
|
+ is_original: [{ required: true, trigger: 'blur', validator: validateRadio }],
|
|
//来源名称和地址不能为空
|
|
//来源名称和地址不能为空
|
|
- copyfrom:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
- fromurl:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ copyfrom: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ fromurl: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//缩略图不能为空
|
|
//缩略图不能为空
|
|
- imgUrl:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
- level:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ imgUrl: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
|
|
+ level: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//是否开启投票
|
|
//是否开启投票
|
|
- is_survey:[{required:true,trigger:'blur',validator:validateRadio}],
|
|
|
|
|
|
+ is_survey: [{ required: true, trigger: 'blur', validator: validateRadio }],
|
|
//问卷标题
|
|
//问卷标题
|
|
- survey_name:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
|
|
|
+ survey_name: [{ required: true, trigger: 'blur', validator: validateEmpty }],
|
|
//选项
|
|
//选项
|
|
- survey_type:[{required:true,trigger:'blur',validator:validateRadio}],
|
|
|
|
|
|
+ survey_type: [{ required: true, trigger: 'blur', validator: validateRadio }],
|
|
},
|
|
},
|
|
//1.3富文本编辑器配置
|
|
//1.3富文本编辑器配置
|
|
showHtml: false, //用于保存源码内容
|
|
showHtml: false, //用于保存源码内容
|
|
@@ -340,8 +357,8 @@ export default {
|
|
['bold', 'italic', 'underline', 'strike'], // 加粗、斜体、下划线、删除线
|
|
['bold', 'italic', 'underline', 'strike'], // 加粗、斜体、下划线、删除线
|
|
[{ 'color': [] }, { 'background': [] }], // 文字颜色、背景颜色
|
|
[{ 'color': [] }, { 'background': [] }], // 文字颜色、背景颜色
|
|
[{ 'script': 'sub' }, { 'script': 'super' }], // 上标、下标
|
|
[{ 'script': 'sub' }, { 'script': 'super' }], // 上标、下标
|
|
- [{ 'list': 'ordered'}, { 'list': 'bullet' }], // 列表
|
|
|
|
- [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
|
|
|
|
|
|
+ [{ 'list': 'ordered' }, { 'list': 'bullet' }], // 列表
|
|
|
|
+ [{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
|
|
[{ 'align': [] }], // 对齐方式
|
|
[{ 'align': [] }], // 对齐方式
|
|
['blockquote', 'code-block'], // 引用、代码块
|
|
['blockquote', 'code-block'], // 引用、代码块
|
|
['link', 'image', 'video'], // 链接、图片、视频
|
|
['link', 'image', 'video'], // 链接、图片、视频
|
|
@@ -352,7 +369,7 @@ export default {
|
|
image: () => {
|
|
image: () => {
|
|
this.handleImageClick();
|
|
this.handleImageClick();
|
|
},
|
|
},
|
|
- showHtml: function() {
|
|
|
|
|
|
+ showHtml: function () {
|
|
this.$emit('toggleSourceMode');
|
|
this.$emit('toggleSourceMode');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -368,13 +385,13 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//1.4图片上传
|
|
//1.4图片上传
|
|
- imgUrl:"",//在页面上显示缩略图
|
|
|
|
|
|
+ imgUrl: "",//在页面上显示缩略图
|
|
//获取父级导航池
|
|
//获取父级导航池
|
|
- parentKey:0,//获取父级导航
|
|
|
|
|
|
+ parentKey: 0,//获取父级导航
|
|
parentData: {
|
|
parentData: {
|
|
checkStrictly: true,
|
|
checkStrictly: true,
|
|
lazy: true,
|
|
lazy: true,
|
|
- async lazyLoad (node, resolve) {
|
|
|
|
|
|
+ async lazyLoad(node, resolve) {
|
|
const { level, data } = node;
|
|
const { level, data } = node;
|
|
if (data && data.children && data.children.length !== 0) {
|
|
if (data && data.children && data.children.length !== 0) {
|
|
return resolve(node)
|
|
return resolve(node)
|
|
@@ -383,12 +400,12 @@ export default {
|
|
|
|
|
|
let parentId;
|
|
let parentId;
|
|
parentId = level == 0 ? 0 : data.value;
|
|
parentId = level == 0 ? 0 : data.value;
|
|
-
|
|
|
|
|
|
+
|
|
let parames = {
|
|
let parames = {
|
|
- 'website_id':getWebSiteId(),
|
|
|
|
- 'pid':parentId
|
|
|
|
|
|
+ 'website_id': getWebSiteId(),
|
|
|
|
+ 'pid': parentId
|
|
}
|
|
}
|
|
- self.$store.dispatch('pool/get_creatNews_nav_son_actions',parames).then(res=> {
|
|
|
|
|
|
+ self.$store.dispatch('pool/get_creatNews_nav_son_actions', parames).then(res => {
|
|
if (res.data) {
|
|
if (res.data) {
|
|
const nodes = res.data.map(item => ({
|
|
const nodes = res.data.map(item => ({
|
|
value: item.category_id,
|
|
value: item.category_id,
|
|
@@ -402,28 +419,28 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- parentKey_2:0,//获取父级导航
|
|
|
|
- parentData_2: {
|
|
|
|
|
|
+ parentKey_2: 0,//获取父级导航
|
|
|
|
+ parentData_2: {
|
|
checkStrictly: true,
|
|
checkStrictly: true,
|
|
lazy: true,
|
|
lazy: true,
|
|
- async lazyLoad (node, resolve) {
|
|
|
|
|
|
+ async lazyLoad(node, resolve) {
|
|
const { level, data } = node;
|
|
const { level, data } = node;
|
|
if (data && data.children && data.children.length !== 0) {
|
|
if (data && data.children && data.children.length !== 0) {
|
|
return resolve(node)
|
|
return resolve(node)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
let parentId;
|
|
let parentId;
|
|
|
|
|
|
- if(self.ifwebsitId == true){
|
|
|
|
|
|
+ if (self.ifwebsitId == true) {
|
|
console.log("网站选择已经改变!")
|
|
console.log("网站选择已经改变!")
|
|
parentId = 0;
|
|
parentId = 0;
|
|
self.ifwebsitId = false;
|
|
self.ifwebsitId = false;
|
|
self.cat_arr_id = [];
|
|
self.cat_arr_id = [];
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
parentId = level == 0 ? 0 : data.value;
|
|
parentId = level == 0 ? 0 : data.value;
|
|
self.ifwebsitId = false;
|
|
self.ifwebsitId = false;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
console.log(123123)
|
|
console.log(123123)
|
|
console.log(self.form.web_site_id)
|
|
console.log(self.form.web_site_id)
|
|
// if(data!=undefined){
|
|
// if(data!=undefined){
|
|
@@ -431,14 +448,14 @@ export default {
|
|
// }else{
|
|
// }else{
|
|
// parentId = self.creatNews_pid_num.toString();
|
|
// parentId = self.creatNews_pid_num.toString();
|
|
// }
|
|
// }
|
|
-
|
|
|
|
|
|
+
|
|
let parames = {
|
|
let parames = {
|
|
- 'website_id':self.form.web_site_id,
|
|
|
|
- 'pid':parentId
|
|
|
|
|
|
+ 'website_id': self.form.web_site_id,
|
|
|
|
+ 'pid': parentId
|
|
}
|
|
}
|
|
-
|
|
|
|
- self.$store.dispatch('pool/get_creatNews_nav_son_actions',parames).then(res=> {
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ self.$store.dispatch('pool/get_creatNews_nav_son_actions', parames).then(res => {
|
|
|
|
+
|
|
if (res.data) {
|
|
if (res.data) {
|
|
const nodes = res.data.map(item => ({
|
|
const nodes = res.data.map(item => ({
|
|
value: item.category_id,
|
|
value: item.category_id,
|
|
@@ -457,7 +474,7 @@ export default {
|
|
]
|
|
]
|
|
//表单项 end ------------------------------------------------------------>
|
|
//表单项 end ------------------------------------------------------------>
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -465,9 +482,9 @@ export default {
|
|
//---------------------------
|
|
//---------------------------
|
|
addInput(index) {
|
|
addInput(index) {
|
|
// 在当前索引后插入一个新的输入框对象
|
|
// 在当前索引后插入一个新的输入框对象
|
|
- if(this.inputList.length>10){
|
|
|
|
- this.$message.warning('最多只能添加10个文本框');
|
|
|
|
- return false;
|
|
|
|
|
|
+ if (this.inputList.length > 10) {
|
|
|
|
+ this.$message.warning('最多只能添加10个文本框');
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
this.inputList.splice(index + 1, 0, { value: '' });
|
|
this.inputList.splice(index + 1, 0, { value: '' });
|
|
},
|
|
},
|
|
@@ -498,7 +515,7 @@ export default {
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|
|
formData.append('file', file);
|
|
formData.append('file', file);
|
|
|
|
|
|
- this.$store.dispatch('pool/uploadFile',formData).then(res=> {
|
|
|
|
|
|
+ this.$store.dispatch('pool/uploadFile', formData).then(res => {
|
|
this.imgUrl = res.data.imgUrl;//显示缩略图
|
|
this.imgUrl = res.data.imgUrl;//显示缩略图
|
|
this.form.imgurl = res.data.imgUrl;//提供表单地址
|
|
this.form.imgurl = res.data.imgUrl;//提供表单地址
|
|
console.log(res.data.imgUrl)
|
|
console.log(res.data.imgUrl)
|
|
@@ -513,10 +530,10 @@ export default {
|
|
return false;
|
|
return false;
|
|
},
|
|
},
|
|
//1.2 提交表单
|
|
//1.2 提交表单
|
|
- addToServe(){
|
|
|
|
|
|
+ addToServe() {
|
|
|
|
|
|
- if(this.form.islink==false){
|
|
|
|
- if(this.form.is_survey==1){
|
|
|
|
|
|
+ if (this.form.islink == false) {
|
|
|
|
+ if (this.form.is_survey == 1) {
|
|
const hasEmptyInput = this.inputList.some(input => input.value === '');
|
|
const hasEmptyInput = this.inputList.some(input => input.value === '');
|
|
if (hasEmptyInput) {
|
|
if (hasEmptyInput) {
|
|
// 如果有输入框为空,弹出提示信息
|
|
// 如果有输入框为空,弹出提示信息
|
|
@@ -524,11 +541,11 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
const inputLists = this.inputList.map(input => input.value);
|
|
const inputLists = this.inputList.map(input => input.value);
|
|
- const allowList = [this.checked?1:0,""];
|
|
|
|
- if(this.checked){
|
|
|
|
|
|
+ const allowList = [this.checked ? 1 : 0, ""];
|
|
|
|
+ if (this.checked) {
|
|
inputLists.push(allowList);
|
|
inputLists.push(allowList);
|
|
}
|
|
}
|
|
- if(inputLists.length<=2){
|
|
|
|
|
|
+ if (inputLists.length <= 2) {
|
|
this.$message.error('投票答案必须大于2条');
|
|
this.$message.error('投票答案必须大于2条');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -541,22 +558,22 @@ export default {
|
|
// return false;
|
|
// return false;
|
|
//提交之前先判断是否为外链
|
|
//提交之前先判断是否为外链
|
|
//如果使用了外链,清理掉除了外链以外的内容
|
|
//如果使用了外链,清理掉除了外链以外的内容
|
|
- if(this.form.islink==true){
|
|
|
|
|
|
+ if (this.form.islink == true) {
|
|
this.form.islink = 1;
|
|
this.form.islink = 1;
|
|
this.cleatForm(1)
|
|
this.cleatForm(1)
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.form.islink = 0;
|
|
this.form.islink = 0;
|
|
}
|
|
}
|
|
//如果推荐等级为空,则设置为0
|
|
//如果推荐等级为空,则设置为0
|
|
- if(this.form.level==""){
|
|
|
|
|
|
+ if (this.form.level == "") {
|
|
this.form.level = 0;
|
|
this.form.level = 0;
|
|
}
|
|
}
|
|
//先进行验证
|
|
//先进行验证
|
|
this.$refs.form.validate(valid => {
|
|
this.$refs.form.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
//console.log(this.form)
|
|
//console.log(this.form)
|
|
- this.$store.dispatch('news/addArticle',this.form).then(res=> {
|
|
|
|
- if(res.code==200){
|
|
|
|
|
|
+ this.$store.dispatch('news/addArticle', this.form).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
//汇报结果
|
|
//汇报结果
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
@@ -565,7 +582,7 @@ export default {
|
|
this.cleatForm(2);
|
|
this.cleatForm(2);
|
|
//返回列表页
|
|
//返回列表页
|
|
this.returnPage()
|
|
this.returnPage()
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'error',
|
|
type: 'error',
|
|
message: "资讯发布失败,请稍后再试!"
|
|
message: "资讯发布失败,请稍后再试!"
|
|
@@ -581,8 +598,8 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//1.3 清理表单
|
|
//1.3 清理表单
|
|
- cleatForm(type){
|
|
|
|
- if(type==1){
|
|
|
|
|
|
+ cleatForm(type) {
|
|
|
|
+ if (type == 1) {
|
|
//使用了外链,进行部分表单清理
|
|
//使用了外链,进行部分表单清理
|
|
//this.form.cat_arr_id = "";
|
|
//this.form.cat_arr_id = "";
|
|
this.form.level = "";
|
|
this.form.level = "";
|
|
@@ -597,7 +614,7 @@ export default {
|
|
this.form.fromurl = "";
|
|
this.form.fromurl = "";
|
|
this.form.status = "";
|
|
this.form.status = "";
|
|
}
|
|
}
|
|
- if(type==2){
|
|
|
|
|
|
+ if (type == 2) {
|
|
//完全清理表单
|
|
//完全清理表单
|
|
this.form.title = "";
|
|
this.form.title = "";
|
|
this.form.islink = "";
|
|
this.form.islink = "";
|
|
@@ -619,7 +636,7 @@ export default {
|
|
//提交表单 end ------------------------------------------------------------>
|
|
//提交表单 end ------------------------------------------------------------>
|
|
|
|
|
|
//2.跳转操作 start ------------------------------------------------------------>
|
|
//2.跳转操作 start ------------------------------------------------------------>
|
|
- returnPage(){
|
|
|
|
|
|
+ returnPage() {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: '/articleList',
|
|
path: '/articleList',
|
|
});
|
|
});
|
|
@@ -636,16 +653,16 @@ export default {
|
|
console.log(res);
|
|
console.log(res);
|
|
this.form.title = res.data.title;
|
|
this.form.title = res.data.title;
|
|
//判断是否使用了外链
|
|
//判断是否使用了外链
|
|
- if(res.data.islink==1){
|
|
|
|
|
|
+ if (res.data.islink == 1) {
|
|
this.form.islink = true;
|
|
this.form.islink = true;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.form.islink = false;
|
|
this.form.islink = false;
|
|
}
|
|
}
|
|
//不是原创的时候显示来源
|
|
//不是原创的时候显示来源
|
|
- if(res.data.is_original==1){
|
|
|
|
|
|
+ if (res.data.is_original == 1) {
|
|
this.form.is_original = 1;
|
|
this.form.is_original = 1;
|
|
this.form.copyfrom = "本网";
|
|
this.form.copyfrom = "本网";
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.form.is_original = 0;
|
|
this.form.is_original = 0;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.form.is_original = 0;
|
|
this.form.is_original = 0;
|
|
@@ -655,9 +672,9 @@ export default {
|
|
this.form.linkurl = res.data.linkurl;
|
|
this.form.linkurl = res.data.linkurl;
|
|
}
|
|
}
|
|
//如果推荐等级为0 不再回显等级
|
|
//如果推荐等级为0 不再回显等级
|
|
- if(res.data.level==0){
|
|
|
|
|
|
+ if (res.data.level == 0) {
|
|
this.form.level = "";
|
|
this.form.level = "";
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.form.level = res.data.level;
|
|
this.form.level = res.data.level;
|
|
}
|
|
}
|
|
//回显站点名称
|
|
//回显站点名称
|
|
@@ -685,18 +702,18 @@ export default {
|
|
this.form.is_survey = res.data.is_survey;
|
|
this.form.is_survey = res.data.is_survey;
|
|
this.form.survey_type = res.data.survey_type;
|
|
this.form.survey_type = res.data.survey_type;
|
|
this.inputList = [];
|
|
this.inputList = [];
|
|
- if(res.data.survey_array.length>0){
|
|
|
|
|
|
+ if (res.data.survey_array.length > 0) {
|
|
res.data.survey_array.forEach(item => {
|
|
res.data.survey_array.forEach(item => {
|
|
- if(item.is_other==0){
|
|
|
|
- this.inputList.push({"value":item.choice_name});
|
|
|
|
- }else{
|
|
|
|
|
|
+ if (item.is_other == 0) {
|
|
|
|
+ this.inputList.push({ "value": item.choice_name });
|
|
|
|
+ } else {
|
|
this.checked = true
|
|
this.checked = true
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
- this.inputList.push({"value":""});
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.inputList.push({ "value": "" });
|
|
}
|
|
}
|
|
- console.log( this.inputList)
|
|
|
|
|
|
+ console.log(this.inputList)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
async loadCascaderPath(path) {
|
|
async loadCascaderPath(path) {
|
|
@@ -721,11 +738,11 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//1.3提交修改
|
|
//1.3提交修改
|
|
- editToServe(){
|
|
|
|
|
|
+ editToServe() {
|
|
|
|
|
|
//不使用外联 验证投票逻辑
|
|
//不使用外联 验证投票逻辑
|
|
- if(this.form.islink==false){
|
|
|
|
- if(this.form.is_survey==1){
|
|
|
|
|
|
+ if (this.form.islink == false) {
|
|
|
|
+ if (this.form.is_survey == 1) {
|
|
const hasEmptyInput = this.inputList.some(input => input.value === '');
|
|
const hasEmptyInput = this.inputList.some(input => input.value === '');
|
|
if (hasEmptyInput) {
|
|
if (hasEmptyInput) {
|
|
// 如果有输入框为空,弹出提示信息
|
|
// 如果有输入框为空,弹出提示信息
|
|
@@ -733,11 +750,11 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
const inputLists = this.inputList.map(input => input.value);
|
|
const inputLists = this.inputList.map(input => input.value);
|
|
- const allowList = [this.checked?1:0,""];
|
|
|
|
- if(this.checked){
|
|
|
|
|
|
+ const allowList = [this.checked ? 1 : 0, ""];
|
|
|
|
+ if (this.checked) {
|
|
inputLists.push(allowList);
|
|
inputLists.push(allowList);
|
|
}
|
|
}
|
|
- if(inputLists.length<2){
|
|
|
|
|
|
+ if (inputLists.length < 2) {
|
|
this.$message.error('投票答案必须大于2条');
|
|
this.$message.error('投票答案必须大于2条');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -746,11 +763,11 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
console.log(this.form)
|
|
console.log(this.form)
|
|
- if(this.form.islink==1){
|
|
|
|
|
|
+ if (this.form.islink == 1) {
|
|
this.cleatForm(1)
|
|
this.cleatForm(1)
|
|
}
|
|
}
|
|
//如果推荐等级为空,则设置为0
|
|
//如果推荐等级为空,则设置为0
|
|
- if(this.form.level==""){
|
|
|
|
|
|
+ if (this.form.level == "") {
|
|
this.form.level = 0;
|
|
this.form.level = 0;
|
|
}
|
|
}
|
|
//添加要修改的id
|
|
//添加要修改的id
|
|
@@ -759,10 +776,10 @@ export default {
|
|
this.$refs.form.validate(valid => {
|
|
this.$refs.form.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
//console.log(this.form)
|
|
//console.log(this.form)
|
|
- this.$store.dispatch('news/updateArticle',this.form).then(res=> {
|
|
|
|
- if(res.code!=200){
|
|
|
|
|
|
+ this.$store.dispatch('news/updateArticle', this.form).then(res => {
|
|
|
|
+ if (res.code != 200) {
|
|
this.$message.error("修改失败,请稍后再试!");
|
|
this.$message.error("修改失败,请稍后再试!");
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
//汇报结果
|
|
//汇报结果
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
@@ -782,10 +799,10 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//1.4 修改是否原创
|
|
//1.4 修改是否原创
|
|
- changeIsOriginal(){
|
|
|
|
- if(this.form.is_original==1){
|
|
|
|
|
|
+ changeIsOriginal() {
|
|
|
|
+ if (this.form.is_original == 1) {
|
|
this.form.copyfrom = "本网";
|
|
this.form.copyfrom = "本网";
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.form.copyfrom = "";
|
|
this.form.copyfrom = "";
|
|
this.form.fromurl = "";
|
|
this.form.fromurl = "";
|
|
}
|
|
}
|
|
@@ -896,116 +913,79 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//富文本编辑器 end ------------------------------------------------------------>
|
|
//富文本编辑器 end ------------------------------------------------------------>
|
|
-
|
|
|
|
-
|
|
|
|
- get_creatNews_form_id_fun(){//判断用户类型ajax
|
|
|
|
-
|
|
|
|
- this.$store.dispatch('public/getInfo').then(res=> {
|
|
|
|
- // console.log("res======",res)
|
|
|
|
- this.form.user_type = res.data.type_id;
|
|
|
|
-
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: '网络错误,请重试!'
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // console.log("this.form.user_type==",this.form);
|
|
|
|
- // console.log("this.form.user_type==2",this.form.user_type);
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- get_creatNews_nav_pool_arr_fun(){//xx
|
|
|
|
- this.$store.dispatch('pool/get_creatNews_nav_actions',{page:1,pageSize:666666}).then(res=> {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- res.data.rows.forEach(( per_obj ) => {
|
|
|
|
-
|
|
|
|
- let new_per = {
|
|
|
|
- label: per_obj.website_name,
|
|
|
|
- value: per_obj.id,
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.creatNews_nav_pool_arr.push( new_per )
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: '网络错误,请重试!'
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- creatNews_nav_pool_change_fun(){
|
|
|
|
- //开启导航池级联选择器
|
|
|
|
- this.ifwebsitId = true;
|
|
|
|
- console.log(this.ifwebsitId)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //xx 导航池级
|
|
|
|
- let that = this;
|
|
|
|
-
|
|
|
|
- this.form.web_site_id = this.form.web_site_id[0]
|
|
|
|
-
|
|
|
|
- that.parentKey_2 += 1;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- this.$store.dispatch('pool/get_creatNews_nav_son_actions',{pid:String(this.creatNews_pid_num),website_id:String(this.form.web_site_id)}).then(res=> {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if(res.data.length==0){//没有导航池子级
|
|
|
|
- // alert("没有导航池子级");
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.creatNews_add_nav_pool_arr=res.data;
|
|
|
|
-
|
|
|
|
- this.creatNews_add_nav_pool_arr.forEach(( per_obj ) => {
|
|
|
|
- per_obj.label=per_obj.name,
|
|
|
|
- per_obj.value=per_obj.id,
|
|
|
|
-
|
|
|
|
- this.creatNews_pid_num=per_obj.category_id
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: '网络错误,请重试!'
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
|
|
+ get_creatNews_form_id_fun() {//判断用户类型ajax
|
|
|
|
+ this.$store.dispatch('public/getInfo').then(res => {
|
|
|
|
+ // console.log("res======",res)
|
|
|
|
+ this.form.user_type = res.data.type_id;
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'info',
|
|
|
|
+ message: '网络错误,请重试!'
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ // console.log("this.form.user_type==",this.form);
|
|
|
|
+ // console.log("this.form.user_type==2",this.form.user_type);
|
|
|
|
+ },
|
|
|
|
+ get_creatNews_nav_pool_arr_fun() {//xx
|
|
|
|
+ this.$store.dispatch('pool/get_creatNews_nav_actions', { page: 1, pageSize: 666666 }).then(res => {
|
|
|
|
+ res.data.rows.forEach((per_obj) => {
|
|
|
|
+ let new_per = {
|
|
|
|
+ label: per_obj.website_name,
|
|
|
|
+ value: per_obj.id,
|
|
|
|
+ }
|
|
|
|
+ this.creatNews_nav_pool_arr.push(new_per)
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'info',
|
|
|
|
+ message: '网络错误,请重试!'
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ creatNews_nav_pool_change_fun() {
|
|
|
|
+ //开启导航池级联选择器
|
|
|
|
+ this.ifwebsitId = true;
|
|
|
|
+ console.log(this.ifwebsitId)
|
|
|
|
+ //xx 导航池级
|
|
|
|
+ let that = this;
|
|
|
|
+ this.form.web_site_id = this.form.web_site_id[0]
|
|
|
|
+ that.parentKey_2 += 1;
|
|
|
|
+ this.$store.dispatch('pool/get_creatNews_nav_son_actions', { pid: String(this.creatNews_pid_num), website_id: String(this.form.web_site_id) }).then(res => {
|
|
|
|
+ if (res.data.length == 0) {//没有导航池子级
|
|
|
|
+ // alert("没有导航池子级");
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.creatNews_add_nav_pool_arr = res.data;
|
|
|
|
+ this.creatNews_add_nav_pool_arr.forEach((per_obj) => {
|
|
|
|
+ per_obj.label = per_obj.name,
|
|
|
|
+ per_obj.value = per_obj.id,
|
|
|
|
+ this.creatNews_pid_num = per_obj.category_id
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'info',
|
|
|
|
+ message: '网络错误,请重试!'
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ },
|
|
},
|
|
},
|
|
-
|
|
|
|
- mounted(){
|
|
|
|
|
|
+ mounted() {
|
|
this.creatNews_user_type = getUseType()
|
|
this.creatNews_user_type = getUseType()
|
|
- this.websiteid= getWebSiteId()
|
|
|
|
|
|
+ this.websiteid = getWebSiteId()
|
|
|
|
|
|
console.log(123456)
|
|
console.log(123456)
|
|
console.log(this.websiteid)
|
|
console.log(this.websiteid)
|
|
|
|
|
|
- this.get_creatNews_form_id_fun()//
|
|
|
|
- this.get_creatNews_nav_pool_arr_fun()//
|
|
|
|
-
|
|
|
|
|
|
+ this.get_creatNews_form_id_fun()
|
|
|
|
+ this.get_creatNews_nav_pool_arr_fun()
|
|
|
|
+
|
|
//1.判断是新建还是回显
|
|
//1.判断是新建还是回显
|
|
- if(this.$route.query.id!=undefined){
|
|
|
|
|
|
+ if (this.$route.query.id != undefined) {
|
|
this.editId = this.$route.query.id;
|
|
this.editId = this.$route.query.id;
|
|
this.editStatus = true;
|
|
this.editStatus = true;
|
|
console.log("编辑新闻!")
|
|
console.log("编辑新闻!")
|
|
this.getMainData();
|
|
this.getMainData();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.editStatus = false;
|
|
this.editStatus = false;
|
|
console.log("添加新闻!")
|
|
console.log("添加新闻!")
|
|
}
|
|
}
|
|
@@ -1051,101 +1031,125 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
- //文本编辑器
|
|
|
|
- .QuillTitle {
|
|
|
|
- line-height: 36px;
|
|
|
|
- font-size: 14px;
|
|
|
|
- color: #606266;
|
|
|
|
- font-weight:bold;
|
|
|
|
- padding-left: 30px;
|
|
|
|
- span{
|
|
|
|
- color: #ff4949
|
|
|
|
- }
|
|
|
|
- .QuillModelBtn {
|
|
|
|
- display: inline-block;
|
|
|
|
- margin-left: 10px;
|
|
|
|
- font-size: 12px;
|
|
|
|
- color: #999;
|
|
|
|
- cursor: pointer;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .editor-container {
|
|
|
|
- height: 420px;
|
|
|
|
- padding-bottom:20px;
|
|
|
|
- }
|
|
|
|
- .my-quill-editor {
|
|
|
|
- height: 320px;
|
|
|
|
- }
|
|
|
|
- .ql-editor {
|
|
|
|
- height: 320px;
|
|
|
|
- }
|
|
|
|
|
|
+//文本编辑器
|
|
|
|
+.QuillTitle {
|
|
|
|
+ line-height: 36px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #606266;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ padding-left: 30px;
|
|
|
|
|
|
- /* 富文本对齐方式 */
|
|
|
|
- .ql-align-center{
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
- .ql-align-right{
|
|
|
|
- text-align: right;
|
|
|
|
- }
|
|
|
|
- .ql-indent-1{
|
|
|
|
- padding-left: 16px;
|
|
|
|
- }
|
|
|
|
- .ql-indent-2{
|
|
|
|
- padding-left: 32px;
|
|
|
|
- }
|
|
|
|
- .ql-indent-3{
|
|
|
|
- padding-left: 48px;
|
|
|
|
|
|
+ span {
|
|
|
|
+ color: #ff4949
|
|
}
|
|
}
|
|
- .ql-indent-4{
|
|
|
|
- padding-left: 64px;
|
|
|
|
- }
|
|
|
|
- .ql-indent-5{
|
|
|
|
- padding-left: 80px;
|
|
|
|
- }
|
|
|
|
- .ql-indent-6{
|
|
|
|
- padding-left: 96px;
|
|
|
|
- }
|
|
|
|
- .ql-indent-7{
|
|
|
|
- padding-left: 112px;
|
|
|
|
- }
|
|
|
|
- .ql-indent-8{
|
|
|
|
- padding-left: 128px;
|
|
|
|
|
|
+
|
|
|
|
+ .QuillModelBtn {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #999;
|
|
|
|
+ cursor: pointer;
|
|
}
|
|
}
|
|
|
|
+}
|
|
|
|
|
|
|
|
+.editor-container {
|
|
|
|
+ height: 420px;
|
|
|
|
+ padding-bottom: 20px;
|
|
|
|
+}
|
|
|
|
|
|
- //执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
|
|
|
|
- ::v-deep .custom-form-item > .el-form-item__label {
|
|
|
|
- line-height: 140px !important;
|
|
|
|
- }
|
|
|
|
- ::v-deep .custom-textarea .el-textarea__inner {
|
|
|
|
- resize: none; /* 禁止用户拖拽调整大小 */
|
|
|
|
- }
|
|
|
|
- ::v-deep .custom-align-right .el-form-item__label {
|
|
|
|
- text-align: right; /* 设置标签文字右对齐 */
|
|
|
|
- }
|
|
|
|
- ::v-deep .el-select {
|
|
|
|
- width: 100%; /* 禁止用户拖拽调整大小 */
|
|
|
|
- }
|
|
|
|
- ::v-deep .el-input-group__prepend {
|
|
|
|
- color: black !important;
|
|
|
|
|
|
+.my-quill-editor {
|
|
|
|
+ height: 320px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-editor {
|
|
|
|
+ height: 320px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* 富文本对齐方式 */
|
|
|
|
+.ql-align-center {
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-align-right {
|
|
|
|
+ text-align: right;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-indent-1 {
|
|
|
|
+ padding-left: 16px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-indent-2 {
|
|
|
|
+ padding-left: 32px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-indent-3 {
|
|
|
|
+ padding-left: 48px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-indent-4 {
|
|
|
|
+ padding-left: 64px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-indent-5 {
|
|
|
|
+ padding-left: 80px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-indent-6 {
|
|
|
|
+ padding-left: 96px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-indent-7 {
|
|
|
|
+ padding-left: 112px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ql-indent-8 {
|
|
|
|
+ padding-left: 128px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+//执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
|
|
|
|
+::v-deep .custom-form-item>.el-form-item__label {
|
|
|
|
+ line-height: 140px !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+::v-deep .custom-textarea .el-textarea__inner {
|
|
|
|
+ resize: none;
|
|
|
|
+ /* 禁止用户拖拽调整大小 */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+::v-deep .custom-align-right .el-form-item__label {
|
|
|
|
+ text-align: right;
|
|
|
|
+ /* 设置标签文字右对齐 */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+::v-deep .el-select {
|
|
|
|
+ width: 100%;
|
|
|
|
+ /* 禁止用户拖拽调整大小 */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+::v-deep .el-input-group__prepend {
|
|
|
|
+ color: black !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.formLabelFloatBox {
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .formLabeladdIcon {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 45px;
|
|
|
|
+ top: 5px;
|
|
|
|
+ width: 38px;
|
|
|
|
+ height: 24px;
|
|
}
|
|
}
|
|
- .formLabelFloatBox {
|
|
|
|
- margin-bottom: 10px;
|
|
|
|
- position: relative;
|
|
|
|
- .formLabeladdIcon {
|
|
|
|
- position: absolute;
|
|
|
|
- right:45px;
|
|
|
|
- top:5px;
|
|
|
|
- width:38px;
|
|
|
|
- height:24px;
|
|
|
|
- }
|
|
|
|
- .formLabelDelIcon {
|
|
|
|
- position: absolute;
|
|
|
|
- right:5px;
|
|
|
|
- top:5px;
|
|
|
|
- width:38px;
|
|
|
|
- height:24px;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ .formLabelDelIcon {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 5px;
|
|
|
|
+ top: 5px;
|
|
|
|
+ width: 38px;
|
|
|
|
+ height: 24px;
|
|
}
|
|
}
|
|
- //执行v-deep穿透scope选择器 end------------------------------------------------------------>*/
|
|
|
|
-</style>
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//执行v-deep穿透scope选择器 end------------------------------------------------------------>*/</style>
|