1
This commit is contained in:
parent
62cc90e131
commit
5b1074a8db
@ -106,12 +106,14 @@ public class CommonController
|
||||
String fileUrl = fileService.upload(file);
|
||||
long size = file.getSize()/1024;
|
||||
BufferedImage bufferedImage = ImageIO.read(file.getInputStream());
|
||||
int width = bufferedImage.getWidth();
|
||||
int height = bufferedImage.getHeight();
|
||||
if(null!=bufferedImage){
|
||||
int width = bufferedImage.getWidth();
|
||||
int height = bufferedImage.getHeight();
|
||||
ajax.put("width", width);
|
||||
ajax.put("height", height);
|
||||
}
|
||||
ajax.put("name", file.getOriginalFilename());
|
||||
ajax.put("size", size);
|
||||
ajax.put("width", width);
|
||||
ajax.put("height", height);
|
||||
ajax.put("url", fileUrl);
|
||||
ajax.put("fileName", fileUrl);
|
||||
}
|
||||
|
@ -4,10 +4,14 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
# 主库数据源-点亮开发库
|
||||
# master:
|
||||
# url: jdbc:mysql://82.156.161.160:3306/dl_site_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: site
|
||||
# password: 123456
|
||||
# 主库数据源-客户测试服务器
|
||||
master:
|
||||
# url: jdbc:mysql://124.222.105.7:3306/dl_notice?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://82.156.161.160:3306/dl_site_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://114.132.197.85:3306/dl_site_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: site
|
||||
password: 123456
|
||||
# 从库数据源
|
||||
|
@ -24,10 +24,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="queryListPage" parameterType="BaseTemp" resultMap="BaseTempResult">
|
||||
<include refid="selectBaseTempVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="entity.title != null and entity.title != ''"> and title = #{entity.title}</if>
|
||||
<if test="entity.file != null and entity.file != ''"> and file = #{entity.file}</if>
|
||||
<if test="entity.remark != null and entity.remark != ''"> and remark = #{entity.remark}</if>
|
||||
<if test="entity.tenantId != null and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
@ -12,3 +12,6 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
# websocket
|
||||
VUE_APP_WEBSOCKET = 'ws://localhost:8099/ws/asset/'
|
||||
|
||||
# 产品、文章预览
|
||||
VUE_APP_PREVIEW = 'http://www.lighting-it.cn/admin-preview/'
|
||||
|
@ -9,3 +9,6 @@ VUE_APP_BASE_API = 'http://114.132.197.85:8099'
|
||||
|
||||
# websocket
|
||||
VUE_APP_WEBSOCKET = 'ws://114.132.197.85:8099/ws/asset/'
|
||||
|
||||
# 产品、文章预览
|
||||
VUE_APP_PREVIEW = 'http://www.lighting-it.cn/admin-preview/'
|
||||
|
@ -29,7 +29,7 @@
|
||||
<!-- 文件列表 -->
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
||||
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form @submit.native.prevent :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
@ -9,22 +9,6 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input
|
||||
v-model="queryParams.remark"
|
||||
placeholder="请输入描述"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="站点唯一编码" prop="tenantId">
|
||||
<el-input
|
||||
v-model="queryParams.tenantId"
|
||||
placeholder="请输入站点唯一编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@ -42,17 +26,6 @@
|
||||
v-hasPermi="['base:temp:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['base:temp:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@ -64,26 +37,21 @@
|
||||
v-hasPermi="['base:temp:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['base:temp:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="tempList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
|
||||
<el-table-column label="标题" align="center" prop="title" />
|
||||
<el-table-column label="图片" align="center" prop="file" />
|
||||
<el-table-column label="附件" align="center" prop="file" >
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.file">
|
||||
<el-tag>下载</el-tag>
|
||||
</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column label="站点唯一编码" align="center" prop="tenantId" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -118,15 +86,12 @@
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图片" prop="file">
|
||||
<file-upload v-model="form.file"/>
|
||||
<el-form-item label="附件" prop="file">
|
||||
<file-upload limit="1" v-model="form.file"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="站点唯一编码" prop="tenantId">
|
||||
<el-input v-model="form.tenantId" placeholder="请输入站点唯一编码" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@ -171,9 +136,19 @@ export default {
|
||||
tenantId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
title:null,
|
||||
file:null,
|
||||
remark:null,
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
file: [
|
||||
{ required: true, message: '请选择附件', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -266,7 +241,7 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除模板库编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除?').then(function() {
|
||||
return delTemp(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
|
@ -5,97 +5,163 @@
|
||||
<el-col :span="24">
|
||||
<el-button @click="cancel">返 回</el-button>
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="toggleSideBar">{{ showKeywords ? '关闭' : '打开' }}关键词推荐</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-row :gutter="20">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="栏目名称" prop="catgName">
|
||||
<el-input v-model="form.catgName" placeholder="请输入栏目名称" />
|
||||
<!-- 表单区域-->
|
||||
<el-row>
|
||||
<el-col v-if="showKeywords" :span="8">
|
||||
<el-form :model="formSeo" ref="queryForm" :rules="rulesSeo" size="small" :inline="true" label-width="110px">
|
||||
<el-form-item label="基准词" prop="title">
|
||||
<template v-slot:label>
|
||||
<span>基准词</span>
|
||||
<el-tooltip class="item" effect="dark" content="请输入您的产品名称或新闻标题,尽量不要过于具体或泛化" placement="bottom">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<div class="dl-flex-column">
|
||||
<el-input style="width: 150px" v-model="formSeo.title" placeholder="请输入基准词"/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="栏目类型" prop="catgType">
|
||||
<el-select :disabled="form.catgLevel > 1" v-model="form.catgType" placeholder="请选择通告栏目类型" >
|
||||
<el-form-item label="语言" prop="language">
|
||||
<el-select style="width: 150px" v-model="formSeo.language" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in dict.type.category_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
v-for="item in languageArray"
|
||||
:key="item.content"
|
||||
:label="item.title"
|
||||
:value="item.content"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" type="number" placeholder="请输入排序" />
|
||||
<el-form-item label="国家/地区" prop="country">
|
||||
<el-select v-model="formSeo.country" multiple filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in countryArray"
|
||||
:key="item.content"
|
||||
:label="item.title"
|
||||
:value="item.content"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" :loading="loading" @click="handleQuery">搜索
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-tag type="warning" v-if="keywordsList.length>0">
|
||||
共抓取到{{ keywordsList.length }}个关键词,月搜索量低于{{ searchDown }}的关键词已为您自动忽略
|
||||
</el-tag>
|
||||
<el-table v-loading="loading" :data="keywordsList" max-height="500">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
|
||||
<el-table-column label="关键词" align="center" prop="title"/>
|
||||
<el-table-column label="月搜索量" align="center" prop="searchMonth" width="100">
|
||||
<template slot-scope="scope">
|
||||
<countTo :startVal="0" :endVal="scope.row.searchMonth" :duration="1000"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="竞争程度" align="center" prop="competition" width="80"/>
|
||||
<el-table-column width="60" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
|
||||
<el-button size="mini" type="text">使用</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="handleTitle">添加至title</el-dropdown-item>
|
||||
<el-dropdown-item command="handleKeyword">添加至keyword</el-dropdown-item>
|
||||
<el-dropdown-item command="handleDescription">添加至description</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="showKeywords?16:24">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-row :gutter="20">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="栏目名称" prop="catgName">
|
||||
<el-input v-model="form.catgName" placeholder="请输入栏目名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="栏目类型" prop="catgType">
|
||||
<el-select :disabled="form.catgLevel > 1" v-model="form.catgType" placeholder="请选择通告栏目类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.category_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" type="number" placeholder="请输入排序"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="页面title" prop="title">
|
||||
<el-input type="textarea" v-model="form.title" placeholder="请输入页面title"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="页面keyword" prop="keyword">
|
||||
<el-input type="textarea" v-model="form.keyword" placeholder="请输入页面keyword"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="页面description" prop="description">
|
||||
<el-input type="textarea" v-model="form.description" placeholder="请输入页面description"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="页面title" prop="title">
|
||||
<el-input type="textarea" v-model="form.title" placeholder="请输入页面title" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="页面keyword" prop="keyword">
|
||||
<el-input type="textarea" v-model="form.keyword" placeholder="请输入页面keyword" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="页面description" prop="description">
|
||||
<el-input type="textarea" v-model="form.description" placeholder="请输入页面description" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="form.catgType == 'cp'" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品上方内容" prop="prodUp">
|
||||
<editor v-model="form.prodUp" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品上方内容-移动端" prop="prodDown">
|
||||
<editor v-model="form.prodUpApp" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.catgType == 'cp'" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品下方内容" prop="prodUp">
|
||||
<editor v-model="form.prodDown" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品下方内容-移动端" prop="prodDown">
|
||||
<editor v-model="form.prodDownApp" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row v-if="form.catgType == 'dym' || form.catgType == 'xp'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="内容" prop="content">
|
||||
<editor v-model="form.content" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="内容-移动端" prop="content">
|
||||
<editor v-model="form.contentApp" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
</el-form>
|
||||
<el-row v-if="form.catgType == 'cp'" :gutter="20">
|
||||
<el-col :span="showKeywords?24:12">
|
||||
<el-form-item label="产品上方内容" prop="prodUp">
|
||||
<editor v-model="form.prodUp" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="showKeywords?24:12">
|
||||
<el-form-item label="产品上方内容-移动端" prop="prodDown">
|
||||
<editor v-model="form.prodUpApp" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.catgType == 'cp'" :gutter="20">
|
||||
<el-col :span="showKeywords?24:12">
|
||||
<el-form-item label="产品下方内容" prop="prodUp">
|
||||
<editor v-model="form.prodDown" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="showKeywords?24:12">
|
||||
<el-form-item label="产品下方内容-移动端" prop="prodDown">
|
||||
<editor v-model="form.prodDownApp" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.catgType == 'dym' || form.catgType == 'xp'">
|
||||
<el-col :span="showKeywords?24:12">
|
||||
<el-form-item label="内容" prop="content">
|
||||
<editor :key="showKeywords" v-model="form.content" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="showKeywords?24:12">
|
||||
<el-form-item label="内容-移动端" prop="content">
|
||||
<editor :key="showKeywords" v-model="form.contentApp" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
@ -107,48 +173,83 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addCategory,getCategory} from "@/api/busi/category";
|
||||
import countTo from 'vue-count-to';
|
||||
import { addCategory, getCategory } from '@/api/busi/category'
|
||||
import { listSeo ,getKeywords} from '@/api/base/seo'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
|
||||
export default {
|
||||
name: "categoryForm",
|
||||
name: 'categoryForm',
|
||||
components: { Hamburger , countTo},
|
||||
dicts: ['category_type'],
|
||||
data(){
|
||||
return{
|
||||
data() {
|
||||
return {
|
||||
//弹出层标题
|
||||
title:"",
|
||||
title: '',
|
||||
//表单参数
|
||||
form:{
|
||||
catgName:"",
|
||||
catgType:"",
|
||||
sort:"",
|
||||
title:"",
|
||||
keyword:"",
|
||||
description:"",
|
||||
prodUp:"",
|
||||
prodUpApp:"",
|
||||
prodDown:"",
|
||||
prodDownApp:"",
|
||||
content:"",
|
||||
contentApp:"",
|
||||
form: {
|
||||
catgName: '',
|
||||
catgType: '',
|
||||
sort: '',
|
||||
title: '',
|
||||
keyword: '',
|
||||
description: '',
|
||||
prodUp: '',
|
||||
prodUpApp: '',
|
||||
prodDown: '',
|
||||
prodDownApp: '',
|
||||
content: '',
|
||||
contentApp: ''
|
||||
},
|
||||
id:null,
|
||||
id: null,
|
||||
//列表页入参
|
||||
isChild:false,
|
||||
isChild: false,
|
||||
formSeo: {
|
||||
title: '',
|
||||
needUrl: false,
|
||||
language: '',
|
||||
country:"",
|
||||
},
|
||||
languageArray: [],
|
||||
countryArray: [],
|
||||
//是否显示关键词提示区域
|
||||
showKeywords: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 关键词列表数据
|
||||
keywordsList: [],
|
||||
//月搜索量最低下限
|
||||
searchDown:null,
|
||||
//相似新闻
|
||||
similarityList: [],
|
||||
//表单校验规则
|
||||
rules:{
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, trigger: "blur", message: "请输入栏目编号" }
|
||||
{ required: true, trigger: 'blur', message: '请输入栏目编号' }
|
||||
],
|
||||
catgName: [
|
||||
{ required: true, trigger: "blur", message: "请输入栏目名称" }
|
||||
{ required: true, trigger: 'blur', message: '请输入栏目名称' }
|
||||
],
|
||||
catgType: [
|
||||
{ required: true, trigger: "blur", message: "请选择栏目类型" }
|
||||
{ required: true, trigger: 'blur', message: '请选择栏目类型' }
|
||||
]
|
||||
},
|
||||
rulesSeo:{
|
||||
title: [
|
||||
{ required: true, message: '请输入基准词', trigger: 'blur' }
|
||||
],
|
||||
language: [
|
||||
{ required: true, message: '请选择语言', trigger: 'blur' }
|
||||
],
|
||||
country: [
|
||||
{ required: true, message: '请选择国家', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.$route.query.id){
|
||||
this.initSeo()
|
||||
if (this.$route.query.id) {
|
||||
this.id = this.$route.query.id
|
||||
this.initCategory(this.$route.query.id)
|
||||
} else {
|
||||
@ -156,51 +257,111 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
methods:{
|
||||
|
||||
/**确定按钮*/
|
||||
submitForm(){
|
||||
addCategory(this.form).then((res) => {
|
||||
if (res.code == 200){
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.cancel();
|
||||
methods: {
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.$refs['queryForm'].validate(valid => {
|
||||
if (valid) {
|
||||
this.loading=true
|
||||
let query = JSON.parse(JSON.stringify(this.formSeo))
|
||||
let countryStr = query.country.join()
|
||||
query.country = countryStr
|
||||
getKeywords(query).then(response => {
|
||||
if(!response.data.dataList || response.data.dataList.length==0){
|
||||
this.$modal.msgWarning("未抓取到相关关键词,建议您泛化基准词后重新抓取!")
|
||||
}
|
||||
this.keywordsList = response.data.dataList
|
||||
this.searchDown = response.data.searchDown
|
||||
this.loading=false
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
toggleSideBar() {
|
||||
this.showKeywords = !this.showKeywords
|
||||
},
|
||||
// 更多操作触发
|
||||
handleCommand(command, row) {
|
||||
switch (command) {
|
||||
case 'handleTitle':
|
||||
if(this.form.title){
|
||||
this.form.title+=","+row.title
|
||||
}else{
|
||||
this.form.title=row.title
|
||||
}
|
||||
break
|
||||
case 'handleKeyword':
|
||||
if(this.form.keyword){
|
||||
this.form.keyword+=","+row.title
|
||||
}else{
|
||||
this.form.keyword=row.title
|
||||
}
|
||||
break
|
||||
case 'handleDescription':
|
||||
if(this.form.description){
|
||||
this.form.description+=","+row.title
|
||||
}else{
|
||||
this.form.description=row.title
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
initSeo(){
|
||||
listSeo({ }).then(response => {
|
||||
this.languageArray = response.data.language
|
||||
this.countryArray = response.data.country
|
||||
})
|
||||
},
|
||||
/**确定按钮*/
|
||||
submitForm() {
|
||||
addCategory(this.form).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess('保存成功')
|
||||
this.cancel()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**获取网站栏目分类*/
|
||||
initCategory(id){
|
||||
getCategory(id).then((res)=>{
|
||||
if (res.code == 200){
|
||||
initCategory(id) {
|
||||
getCategory(id).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.form = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**取消按钮*/
|
||||
cancel(){
|
||||
this.reset();
|
||||
cancel() {
|
||||
this.reset()
|
||||
//关闭当前页面
|
||||
this.$store.dispatch("tagsView/delView", this.$route);
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
// 调用全局挂载的方法,关闭当前页
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
/**表单重置*/
|
||||
reset(){
|
||||
reset() {
|
||||
this.form = {
|
||||
catgName:"",
|
||||
catgType:"",
|
||||
sort:"",
|
||||
title:"",
|
||||
keyword:"",
|
||||
description:"",
|
||||
prodUp:"",
|
||||
prodUpApp:"",
|
||||
prodDown:"",
|
||||
prodDownApp:"",
|
||||
content:"",
|
||||
contentApp:"",
|
||||
catgName: '',
|
||||
catgType: '',
|
||||
sort: '',
|
||||
title: '',
|
||||
keyword: '',
|
||||
description: '',
|
||||
prodUp: '',
|
||||
prodUpApp: '',
|
||||
prodDown: '',
|
||||
prodDownApp: '',
|
||||
content: '',
|
||||
contentApp: ''
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,95 +6,192 @@
|
||||
<el-button type="success" @click="saveTmp">暂 存</el-button>
|
||||
<el-button type="primary" @click="submitForm">发 布</el-button>
|
||||
<el-button type="warning" @click="checkContent">相似度检测</el-button>
|
||||
<el-button @click="toggleSideBar">{{ showKeywords ? '关闭' : '打开' }}关键词推荐</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="新闻标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入新闻标题"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="所属分类" prop="catgId">
|
||||
<!-- 表单区域-->
|
||||
<el-row>
|
||||
<el-col v-if="showKeywords" :span="8">
|
||||
<el-form :model="formSeo" ref="queryForm" :rules="rulesSeo" size="small" :inline="true" label-width="110px">
|
||||
<el-form-item label="基准词" prop="title">
|
||||
<template v-slot:label>
|
||||
<span>基准词</span>
|
||||
<el-tooltip class="item" effect="dark" content="请输入您的产品名称或新闻标题,尽量不要过于具体或泛化" placement="bottom">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<div class="dl-flex-column">
|
||||
<treeselect style="width: 200px" v-model="form.catgId" :options="catgOptions" :normalizer="normalizer" :noResultsText="'暂无数据'" placeholder="请选择新闻分类" />
|
||||
<div class="dl-add-catg" @click="goCatgView">添加新闻分类</div>
|
||||
<el-input style="width: 150px" v-model="formSeo.title" placeholder="请输入基准词"/>
|
||||
<div class="dl-add-catg" @click="useProdName">使用新闻标题</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" type="number" placeholder="请输入排序"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="文章来源" prop="newsFrom">
|
||||
<el-input v-model="form.newsFrom" placeholder="请输入文章来源"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="发布日期" prop="publicDate">
|
||||
<el-date-picker
|
||||
v-model="form.publicDate"
|
||||
type="date"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="首页显示" prop="ifReco">
|
||||
<template v-slot:label>
|
||||
<span>首页显示</span>
|
||||
<el-tooltip class="item" effect="dark" content="开启后将在首页优先显示"
|
||||
placement="bottom"
|
||||
<el-form-item label="语言" prop="language">
|
||||
<el-select style="width: 150px" v-model="formSeo.language" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in languageArray"
|
||||
:key="item.content"
|
||||
:label="item.title"
|
||||
:value="item.content"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="结合新闻内容" prop="needUrl">
|
||||
<template v-slot:label>
|
||||
<span>结合新闻内容</span>
|
||||
<el-tooltip class="item" effect="dark" content="请确保已经录入新闻内容并保存!" placement="bottom">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-switch
|
||||
v-model="form.ifReco"
|
||||
v-model="formSeo.needUrl"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="新闻图" prop="mainPic">
|
||||
<el-tag v-if="!form.mainPic" style="cursor: pointer" @click="choosePic('mainPic',1)">图片库选择</el-tag>
|
||||
<image-upload @uploadedImg="uploadedImg" v-model="form.mainPic" :limit="1"/>
|
||||
<el-form-item label="国家/地区" prop="country">
|
||||
<el-select v-model="formSeo.country" multiple filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in countryArray"
|
||||
:key="item.content"
|
||||
:label="item.title"
|
||||
:value="item.content"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="页面title" prop="prodTitle">-->
|
||||
<!-- <el-input v-model="form.prodTitle" placeholder="请输入页面title"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="页面keyword" prop="prodKeyword">-->
|
||||
<!-- <el-input v-model="form.prodKeyword" type="textarea" placeholder="请输入内容"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="页面description" prop="prodDescription">-->
|
||||
<!-- <el-input v-model="form.prodDescription" type="textarea" placeholder="请输入内容"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-form-item label="新闻简介" prop="description">
|
||||
<div class="dl-flex-column">
|
||||
<el-input style="width: 80%" ref="descriptionInput" v-model="form.description" type="textarea"
|
||||
placeholder="请输入内容" @blur="handleBlur"
|
||||
/>
|
||||
<el-tag style="cursor: pointer;margin-left: 10px" @click="insertBr">插入换行符</el-tag>
|
||||
</div>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" :loading="loading" @click="handleQuery">搜索
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="新闻内容">
|
||||
<editor v-model="form.content" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-form>
|
||||
<el-tag type="warning" v-if="keywordsList.length>0">
|
||||
共抓取到{{ keywordsList.length }}个关键词,月搜索量低于{{ searchDown }}的关键词已为您自动忽略
|
||||
</el-tag>
|
||||
<el-table v-loading="loading" :data="keywordsList" max-height="500">
|
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
|
||||
<el-table-column label="关键词" align="center" prop="title"/>
|
||||
<el-table-column label="月搜索量" align="center" prop="searchMonth" width="100">
|
||||
<template slot-scope="scope">
|
||||
<countTo :startVal="0" :endVal="scope.row.searchMonth" :duration="1000"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="竞争程度" align="center" prop="competition" width="80"/>
|
||||
<el-table-column width="60" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
|
||||
<el-button size="mini" type="text">使用</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="handleTitle">添加至title</el-dropdown-item>
|
||||
<el-dropdown-item command="handleKeyword">添加至keyword</el-dropdown-item>
|
||||
<el-dropdown-item command="handleDescription">添加至description</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="showKeywords?16:24">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="新闻标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入新闻标题"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属分类" prop="catgId">
|
||||
<div class="dl-flex-column">
|
||||
<treeselect style="width: 200px" v-model="form.catgId" :options="catgOptions" :normalizer="normalizer"
|
||||
:noResultsText="'暂无数据'" placeholder="请选择新闻分类"
|
||||
/>
|
||||
<div class="dl-add-catg" @click="goCatgView">添加新闻分类</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" type="number" placeholder="请输入排序"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="页面title" prop="prodTitle">
|
||||
<el-input v-model="form.prodTitle" type="textarea" placeholder="请输入页面title"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="页面keyword" prop="prodKeyword">
|
||||
<el-input v-model="form.prodKeyword" type="textarea" placeholder="请输入页面keyword"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="页面description" prop="prodDescription">
|
||||
<el-input v-model="form.prodDescription" type="textarea" placeholder="请输入页面description"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="文章来源" prop="newsFrom">
|
||||
<el-input v-model="form.newsFrom" placeholder="请输入文章来源"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="发布日期" prop="publicDate">
|
||||
<el-date-picker
|
||||
v-model="form.publicDate"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="首页显示" prop="ifReco">
|
||||
<template v-slot:label>
|
||||
<span>首页显示</span>
|
||||
<el-tooltip class="item" effect="dark" content="开启后将在首页优先显示"
|
||||
placement="bottom"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-switch
|
||||
v-model="form.ifReco"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="新闻图" prop="mainPic">
|
||||
<el-tag v-if="!form.mainPic" style="cursor: pointer" @click="choosePic('mainPic',1)">图片库选择</el-tag>
|
||||
<image-upload @uploadedImg="uploadedImg" v-model="form.mainPic" :limit="1"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-form-item label="新闻简介" prop="description">
|
||||
<div class="dl-flex-column">
|
||||
<el-input style="width: 80%" ref="descriptionInput" v-model="form.description" type="textarea"
|
||||
placeholder="请输入内容" @blur="handleBlur"
|
||||
/>
|
||||
<el-tag style="cursor: pointer;margin-left: 10px" @click="insertBr">插入换行符</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="新闻内容">
|
||||
<editor :key="showKeywords" v-model="form.content" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
@ -105,35 +202,47 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<select-pic fileType="news" ref="selectPic" @ok="chooseFun" />
|
||||
<similarity-new :dataList="similarityList" ref="similarityNew"> </similarity-new>
|
||||
<select-pic fileType="news" ref="selectPic" @ok="chooseFun"/>
|
||||
<similarity-new :dataList="similarityList" ref="similarityNew"></similarity-new>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCategory } from "@/api/busi/category";
|
||||
import { listProdNew, getProdNew, delProdNew,getMaxNewSort, addProdNew, updateProdNew,checkContent } from '@/api/busi/new'
|
||||
import selectPic from "@/views/base/pics/selectPic";
|
||||
import countTo from 'vue-count-to';
|
||||
import { listCategory } from '@/api/busi/category'
|
||||
import { listSeo ,getKeywords} from '@/api/base/seo'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
import {
|
||||
listProdNew,
|
||||
getProdNew,
|
||||
delProdNew,
|
||||
getMaxNewSort,
|
||||
addProdNew,
|
||||
updateProdNew,
|
||||
checkContent
|
||||
} from '@/api/busi/new'
|
||||
import selectPic from '@/views/base/pics/selectPic'
|
||||
|
||||
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import SimilarityNew from './similarityNew'
|
||||
|
||||
export default {
|
||||
name: 'newForm',
|
||||
components: { SimilarityNew, Treeselect,selectPic},
|
||||
components: { SimilarityNew, Treeselect, selectPic , Hamburger , countTo},
|
||||
data() {
|
||||
return {
|
||||
//光标位置--简介
|
||||
cursorPos: null,
|
||||
//栏目分类
|
||||
catgOptions:[],
|
||||
catgOptions: [],
|
||||
//当前选择图片的字段
|
||||
nowChooseStr:null,
|
||||
nowChooseStr: null,
|
||||
//图片库数量
|
||||
picsNum:9,
|
||||
picsNum: 9,
|
||||
//还可以上传图片库的数量
|
||||
canPicsNum:9,
|
||||
canPicsNum: 9,
|
||||
previewPrex:process.env.VUE_APP_PREVIEW+"article-page/",
|
||||
// 表单参数
|
||||
form: {
|
||||
id: null,
|
||||
@ -143,14 +252,14 @@ export default {
|
||||
prodKeyword: null,
|
||||
prodDescription: null,
|
||||
newsFrom: null,
|
||||
publicDate:null,
|
||||
publicDate: null,
|
||||
mainPic: null,
|
||||
pics: null,
|
||||
description: null,
|
||||
content: null,
|
||||
sort: null,
|
||||
ifReco: 0,
|
||||
ifPublic: 0,
|
||||
ifReco: false,
|
||||
ifPublic: false,
|
||||
tenantId: null,
|
||||
creator: null,
|
||||
createTime: null,
|
||||
@ -158,10 +267,26 @@ export default {
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
//当前上传的所有图片
|
||||
fileList:[],
|
||||
fileList: []
|
||||
},
|
||||
formSeo: {
|
||||
title: '',
|
||||
needUrl: true,
|
||||
language: '',
|
||||
country:"",
|
||||
},
|
||||
languageArray: [],
|
||||
countryArray: [],
|
||||
//是否显示关键词提示区域
|
||||
showKeywords: true,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 关键词列表数据
|
||||
keywordsList: [],
|
||||
//月搜索量最低下限
|
||||
searchDown:null,
|
||||
//相似新闻
|
||||
similarityList:[],
|
||||
similarityList: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
title: [
|
||||
@ -185,60 +310,143 @@ export default {
|
||||
description: [
|
||||
{ required: true, message: '请输入新闻简介', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
rulesSeo:{
|
||||
title: [
|
||||
{ required: true, message: '请输入基准词', trigger: 'blur' }
|
||||
],
|
||||
language: [
|
||||
{ required: true, message: '请选择语言', trigger: 'blur' }
|
||||
],
|
||||
country: [
|
||||
{ required: true, message: '请选择国家', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initCatg()
|
||||
if(this.$route.query.id){
|
||||
if(this.$route.query.type){
|
||||
this.initSeo()
|
||||
if (this.$route.query.id) {
|
||||
if (this.$route.query.type) {
|
||||
//添加类似
|
||||
this.getProdInfo(this.$route.query.id,this.$route.query.type)
|
||||
}else{
|
||||
this.getProdInfo(this.$route.query.id, this.$route.query.type)
|
||||
} else {
|
||||
//修改
|
||||
this.getProdInfo(this.$route.query.id)
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
this.initData()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goCatgView(){
|
||||
this.$router.push({path:'/busi/category'})
|
||||
useProdName(){
|
||||
this.formSeo.title = this.form.title
|
||||
},
|
||||
initCatg(){
|
||||
//查产品栏目
|
||||
listCategory({catgType:"wz"}).then(response => {
|
||||
response.data.map((item)=>{
|
||||
item.parentId=0
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
if(!this.form.id){
|
||||
this.$modal.msgWarning("请先保存或暂存新闻信息!")
|
||||
return
|
||||
}
|
||||
this.$refs['queryForm'].validate(valid => {
|
||||
if (valid) {
|
||||
this.loading=true
|
||||
let query = JSON.parse(JSON.stringify(this.formSeo))
|
||||
let countryStr = query.country.join()
|
||||
query.country = countryStr
|
||||
if(query.needUrl){
|
||||
query.url=this.previewPrex+this.form.id+"?private=1BC0FFEC2294283E9BDB89E188FCA574"
|
||||
}
|
||||
getKeywords(query).then(response => {
|
||||
if(!response.data.dataList || response.data.dataList.length==0){
|
||||
this.$modal.msgWarning("未抓取到相关关键词,建议您泛化基准词后重新抓取!")
|
||||
}
|
||||
this.keywordsList = response.data.dataList
|
||||
this.searchDown = response.data.searchDown
|
||||
this.loading=false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
toggleSideBar() {
|
||||
this.showKeywords = !this.showKeywords
|
||||
},
|
||||
// 更多操作触发
|
||||
handleCommand(command, row) {
|
||||
switch (command) {
|
||||
case 'handleTitle':
|
||||
if(this.form.prodTitle){
|
||||
this.form.prodTitle+=","+row.title
|
||||
}else{
|
||||
this.form.prodTitle=row.title
|
||||
}
|
||||
break
|
||||
case 'handleKeyword':
|
||||
if(this.form.prodKeyword){
|
||||
this.form.prodKeyword+=","+row.title
|
||||
}else{
|
||||
this.form.prodKeyword=row.title
|
||||
}
|
||||
break
|
||||
case 'handleDescription':
|
||||
if(this.form.prodDescription){
|
||||
this.form.prodDescription+=","+row.title
|
||||
}else{
|
||||
this.form.prodDescription=row.title
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
initSeo(){
|
||||
listSeo({ }).then(response => {
|
||||
this.languageArray = response.data.language
|
||||
this.countryArray = response.data.country
|
||||
})
|
||||
},
|
||||
goCatgView() {
|
||||
this.$router.push({ path: '/busi/category' })
|
||||
},
|
||||
initCatg() {
|
||||
//查新闻栏目
|
||||
listCategory({ catgType: 'wz' }).then(response => {
|
||||
response.data.map((item) => {
|
||||
item.parentId = 0
|
||||
})
|
||||
this.catgOptions = response.data
|
||||
});
|
||||
})
|
||||
},
|
||||
/** 转换树形数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
delete node.children
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.label,
|
||||
children: node.children
|
||||
};
|
||||
}
|
||||
},
|
||||
initData(){
|
||||
initData() {
|
||||
getMaxNewSort({}).then(response => {
|
||||
this.form.sort = response.data
|
||||
})
|
||||
},
|
||||
getProdInfo(id,type){
|
||||
getProdInfo(id, type) {
|
||||
getProdNew(id).then(response => {
|
||||
this.form= response.data
|
||||
if(this.form.pics && this.form.pics.length>0){
|
||||
this.canPicsNum = this.picsNum-this.form.pics.split(",").length
|
||||
this.form = response.data
|
||||
if (this.form.pics && this.form.pics.length > 0) {
|
||||
this.canPicsNum = this.picsNum - this.form.pics.split(',').length
|
||||
}
|
||||
if(type){
|
||||
this.form.id=null
|
||||
if (type) {
|
||||
this.form.id = null
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
@ -248,12 +456,12 @@ export default {
|
||||
*/
|
||||
back() {
|
||||
//关闭当前页面
|
||||
this.$store.dispatch("tagsView/delView", this.$route);
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
// 调用全局挂载的方法,关闭当前页
|
||||
this.$router.go(-1)
|
||||
},
|
||||
//图片上传回调
|
||||
uploadedImg(fileList){
|
||||
uploadedImg(fileList) {
|
||||
this.form.fileList = this.form.fileList.concat(fileList)
|
||||
},
|
||||
handleBlur(e) {
|
||||
@ -273,40 +481,40 @@ export default {
|
||||
}
|
||||
},
|
||||
/** 暂存 */
|
||||
saveTmp(){
|
||||
this.form.ifPublic=0
|
||||
saveTmp() {
|
||||
this.form.ifPublic = false
|
||||
this.saveData()
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.ifPublic=1
|
||||
this.form.ifPublic = true
|
||||
this.saveData()
|
||||
}
|
||||
})
|
||||
},
|
||||
saveData(){
|
||||
saveData() {
|
||||
if (this.form.id != null) {
|
||||
updateProdNew(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
history.back()
|
||||
},1000)
|
||||
}, 1000)
|
||||
})
|
||||
} else {
|
||||
addProdNew(this.form).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
history.back()
|
||||
},1000)
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 图片库上传
|
||||
*/
|
||||
choosePic(str,num){
|
||||
choosePic(str, num) {
|
||||
this.nowChooseStr = str
|
||||
this.$refs.selectPic.show(num)
|
||||
},
|
||||
@ -314,17 +522,17 @@ export default {
|
||||
* 图片库选择图片回调
|
||||
* @param picUrls
|
||||
*/
|
||||
chooseFun(picUrls){
|
||||
if(this.form[this.nowChooseStr]){
|
||||
if(this.form[this.nowChooseStr].length>0){
|
||||
this.form[this.nowChooseStr]+=","+picUrls
|
||||
}else{
|
||||
chooseFun(picUrls) {
|
||||
if (this.form[this.nowChooseStr]) {
|
||||
if (this.form[this.nowChooseStr].length > 0) {
|
||||
this.form[this.nowChooseStr] += ',' + picUrls
|
||||
} else {
|
||||
this.form[this.nowChooseStr] = picUrls
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
this.form[this.nowChooseStr] = picUrls
|
||||
}
|
||||
if(this.nowChooseStr=="pics"){
|
||||
if (this.nowChooseStr == 'pics') {
|
||||
//图片库,计算剩余可上传的图片数量
|
||||
this.listenerPicNum()
|
||||
}
|
||||
@ -332,8 +540,8 @@ export default {
|
||||
/**
|
||||
* 监听图片库数量
|
||||
*/
|
||||
listenerPicNum(){
|
||||
this.canPicsNum = this.picsNum-this.form.pics.split(",").length
|
||||
listenerPicNum() {
|
||||
this.canPicsNum = this.picsNum - this.form.pics.split(',').length
|
||||
},
|
||||
/**
|
||||
* 相似度检测
|
||||
@ -349,13 +557,33 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/deep/.vue-treeselect__input{
|
||||
/deep/ .vue-treeselect__input {
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
|
||||
.dl-add-catg {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
width: 110px;
|
||||
text-align: center;
|
||||
color: #1890ff;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.dl-tooltip-text {
|
||||
color: #495060;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.hamburger-container {
|
||||
line-height: 46px;
|
||||
height: 100%;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
transition: background .3s;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.hamburger-container:hover {
|
||||
background: rgba(0, 0, 0, .025)
|
||||
}
|
||||
</style>
|
||||
|
@ -94,11 +94,7 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品名称" prop="title">
|
||||
<div class="dl-flex-column">
|
||||
<el-input v-model="form.title" placeholder="请输入产品名称"/>
|
||||
<div class="dl-add-catg" style="width: 180px" @click="goCatgView">Google关键词获取</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -177,7 +173,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="产品内容">
|
||||
<editor v-model="form.content" :min-height="192"/>
|
||||
<editor :key="showKeywords" v-model="form.content" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
@ -232,6 +228,7 @@ export default {
|
||||
picsNum: 9,
|
||||
//还可以上传图片库的数量
|
||||
canPicsNum: 9,
|
||||
previewPrex:process.env.VUE_APP_PREVIEW+"products/",
|
||||
// 表单参数
|
||||
form: {
|
||||
id: null,
|
||||
@ -327,6 +324,10 @@ export default {
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
if(!this.form.id){
|
||||
this.$modal.msgWarning("请先保存或暂存产品信息!")
|
||||
return
|
||||
}
|
||||
this.$refs['queryForm'].validate(valid => {
|
||||
if (valid) {
|
||||
this.loading=true
|
||||
@ -334,9 +335,12 @@ export default {
|
||||
let countryStr = query.country.join()
|
||||
query.country = countryStr
|
||||
if(query.needUrl){
|
||||
query.url="https://www.cdtruck.com/truck/dump-truck/china-sinotruk-howo-19m3-6x4-cheap-336hp-10.html"
|
||||
query.url=this.previewPrex+this.form.id+"?private=CAC8F0807B8FB7EA72AF3596600F888A"
|
||||
}
|
||||
getKeywords(query).then(response => {
|
||||
if(!response.data.dataList || response.data.dataList.length==0){
|
||||
this.$modal.msgWarning("未抓取到相关关键词,建议您泛化基准词后重新抓取!")
|
||||
}
|
||||
this.keywordsList = response.data.dataList
|
||||
this.searchDown = response.data.searchDown
|
||||
this.loading=false
|
||||
|
Loading…
Reference in New Issue
Block a user