|
@@ -55,11 +55,12 @@
|
|
|
:props="parentData_2" filterable clearable></el-cascader>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
- <el-form-item label="行政区划:" class="custom-align-right" prop="city_arr_id">
|
|
|
+ <el-form-item label="行政区划:" class="custom-align-right" prop="city_arr_id">
|
|
|
<CityCascader v-model="form.city_arr_id" @update-city-id="update_city_arr_id"></CityCascader>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="行政职能:" class="custom-align-right" prop="department_arr_id">
|
|
|
- <el-cascader :key="searchDepartmentKey" v-model="form.department_arr_id" placeholder="选择导航池所属行政区划" :props="searchDepartmentData" filterable clearable></el-cascader>
|
|
|
+ <el-form-item label="行政职能:" class="custom-align-right" prop="department_arr_id">
|
|
|
+ <el-cascader :key="searchDepartmentKey" v-model="form.department_arr_id" placeholder="选择导航池所属行政区划"
|
|
|
+ :props="searchDepartmentData" filterable clearable></el-cascader>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="推荐等级:" class="custom-align-right">
|
|
|
<el-select v-model="form.level" clearable placeholder="请选择推荐等级..">
|
|
@@ -100,7 +101,8 @@
|
|
|
</el-tooltip>
|
|
|
</span>
|
|
|
</template>
|
|
|
- <el-input v-model="form.keyword" autocomplete="off" placeholder="请输入资讯关键词"></el-input>
|
|
|
+ <tagInput :initialTags="tags" @tags-updated="updateTags"></tagInput>
|
|
|
+ <!-- <el-input v-model="form.keyword" autocomplete="off" placeholder="请输入资讯关键词"></el-input> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="资讯描述:" prop="introduce" class="custom-align-right">
|
|
|
<template #label>
|
|
@@ -224,7 +226,9 @@
|
|
|
<script>
|
|
|
import { getWebSiteId, getUseType } from '@/utils/auth'
|
|
|
//表格标题
|
|
|
-import tableTitle from './components/tableTitle';
|
|
|
+import tableTitle from './components/tableTitle.vue';
|
|
|
+//引入tag标签组件
|
|
|
+import tagInput from '../../components/InputTag/index.vue';
|
|
|
//引入公用样式
|
|
|
import '@/styles/global.less';
|
|
|
//城市级联选择器
|
|
@@ -249,7 +253,8 @@ export default {
|
|
|
components: {
|
|
|
quillEditor,
|
|
|
tableTitle,
|
|
|
- CityCascader
|
|
|
+ CityCascader,
|
|
|
+ tagInput,
|
|
|
},
|
|
|
data() {
|
|
|
|
|
@@ -279,6 +284,7 @@ export default {
|
|
|
let self = this;
|
|
|
//0.全局操作 end ------------------------------------------------------------>
|
|
|
return {
|
|
|
+ tags: [],//标签数组
|
|
|
websiteid: 0,
|
|
|
creatNews_pid_num: "0",//请求子导航用的pid
|
|
|
creatNews_nav_pool_arr: [],//
|
|
@@ -297,9 +303,9 @@ export default {
|
|
|
cat_arr_id: 0,//导航池名称
|
|
|
nav_add_pool_id: [],//导航池子级
|
|
|
city_arr_id: [],//行政区划
|
|
|
- city_id:"",//区划最后一个数字
|
|
|
- department_arr_id:[],//行政职能部门
|
|
|
- department_id:"",//部门最后一个数字
|
|
|
+ city_id: "",//区划最后一个数字
|
|
|
+ department_arr_id: [],//行政职能部门
|
|
|
+ department_id: "",//部门最后一个数字
|
|
|
//1.1使用了外链
|
|
|
title: '',//资讯标题
|
|
|
islink: 0,//是否使用外链 0非 1是
|
|
@@ -481,11 +487,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//行政职能部门
|
|
|
- searchDepartmentKey:0, //列表缓存key
|
|
|
+ searchDepartmentKey: 0, //列表缓存key
|
|
|
searchDepartmentData: {
|
|
|
checkStrictly: true,
|
|
|
lazy: true,
|
|
|
- async lazyLoad (node, resolve) {
|
|
|
+ async lazyLoad(node, resolve) {
|
|
|
const { level, data } = node;
|
|
|
if (data && data.children && data.children.length !== 0) {
|
|
|
return resolve(node)
|
|
@@ -493,9 +499,9 @@ export default {
|
|
|
console.log(level)
|
|
|
let parentId = level == 0 ? 0 : data.value
|
|
|
let parames = {
|
|
|
- 'pid':parentId
|
|
|
+ 'pid': parentId
|
|
|
}
|
|
|
- self.$store.dispatch('pool/getDepartment',parames).then(res=> {
|
|
|
+ self.$store.dispatch('pool/getDepartment', parames).then(res => {
|
|
|
if (res.data) {
|
|
|
const nodes = res.data.map(item => ({
|
|
|
value: item.id,
|
|
@@ -608,10 +614,10 @@ export default {
|
|
|
this.form.city_arr_id = JSON.stringify(this.form.city_arr_id);
|
|
|
|
|
|
//判断用户身份
|
|
|
- if(this.creatNews_user_type==10000){
|
|
|
+ if (this.creatNews_user_type == 10000) {
|
|
|
console.log("用户身份为管理员,无需审核直接发布!")
|
|
|
this.form.status = 1;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log("用户身份为其他用户,提交到审核!")
|
|
|
this.form.status = 0;
|
|
|
this.form.web_site_id = this.websiteid;
|
|
@@ -683,7 +689,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//1.4更新详细地址
|
|
|
- update_city_arr_id(value){
|
|
|
+ update_city_arr_id(value) {
|
|
|
console.log("行政区划ID已更新:", value);
|
|
|
this.form.city_arr_id = value;
|
|
|
},
|
|
@@ -691,11 +697,11 @@ export default {
|
|
|
|
|
|
//2.跳转操作 start ------------------------------------------------------------>
|
|
|
returnPage() {
|
|
|
- if(this.$route.query.to=="examine"){
|
|
|
+ if (this.$route.query.to == "examine") {
|
|
|
this.$router.push({
|
|
|
path: '/examine',
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.$router.push({
|
|
|
path: '/articleList',
|
|
|
});
|
|
@@ -755,6 +761,7 @@ export default {
|
|
|
this.form.imgurl = res.data.imgurl;
|
|
|
this.imgUrl = res.data.imgurl;
|
|
|
this.form.keyword = res.data.keyword;
|
|
|
+ this.tags=res.data.keyword?res.data.keyword.split(","):[];
|
|
|
this.form.introduce = res.data.introduce;
|
|
|
this.form.content = res.data.content;
|
|
|
this.form.author = res.data.author;
|
|
@@ -843,15 +850,15 @@ export default {
|
|
|
this.form.id = this.editId;
|
|
|
|
|
|
//判断用户身份
|
|
|
- if(this.creatNews_user_type==10000){
|
|
|
- if(this.$route.query.to=="examine"){
|
|
|
+ if (this.creatNews_user_type == 10000) {
|
|
|
+ if (this.$route.query.to == "examine") {
|
|
|
//如果是管理员在编辑用户的新闻这里的status需要设置为0
|
|
|
this.form.status = 0;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log("用户身份为管理员,无需审核直接发布!")
|
|
|
this.form.status = 1;
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log("用户身份为其他用户,提交到审核!")
|
|
|
this.form.status = 0;
|
|
|
this.form.web_site_id = this.websiteid;
|
|
@@ -1053,6 +1060,11 @@ export default {
|
|
|
});
|
|
|
})
|
|
|
},
|
|
|
+ updateTags(newTags) {
|
|
|
+ // this.foem.seo_keywords = newTags;
|
|
|
+ this.tags = newTags;
|
|
|
+ this.form.keyword = newTags.join(',');
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.creatNews_user_type = getUseType()
|