Commit 7cbde843 authored by “yiyousong”'s avatar “yiyousong”

fix:修改基础设置

parent 69fd105e
// 基础设置api // 基础设置api
import request from '@/utils/request' import request from "@/utils/request";
// 查看基础设置 // 查看基础设置
export const getBaseSetInfo = (data) => { export const getBaseSetInfo = (data) => {
return request({ return request({
url: "/sampleform/hotword/list", url: "/sampleform/baseset/list",
method: "post", method: "post",
data, data,
}); });
}; };
// 保存基础设置 // 保存基础设置
export const saveBaseSet = (data) => { export const saveBaseSet = (data) => {
return request({ return request({
url: "/sampleform/baseset/save", url: "/sampleform/baseset/save",
method: "post", method: "post",
data, data,
}); });
}; };
...@@ -7,89 +7,59 @@ ...@@ -7,89 +7,59 @@
<div class="header"> <div class="header">
<span class="mr15 title">热门搜索词汇</span> <span class="mr15 title">热门搜索词汇</span>
<span class="tips" <span class="tips"
>点击热门词汇,自动检索。系统默认展示搜索量最多的10个词,每个词展示6个汉字,支持手动修改。</span >点击热门词汇,自动检索。系统默认展示搜索量最多的10个词,每个词展示6个汉字,支持手动修改。</span
> >
</div> </div>
<!-- 标签 --> <!-- 标签 -->
<div class="mt20"> <div class="mt20">
<template v-for="item in baseSetInfo.hotwords"> <template v-for="item in baseSetInfo.hotwords">
<el-tooltip <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
:key="item.id" :key="item.id"
:content="item.hotwords" :content="item.hotwords"
v-if="item.hotwords.length > 6" v-if="item.hotwords.length > 6"
placement="top-start" placement="top-start"
> >
<el-tag <el-tag
:key="item.id"
size="small"
closable
:disable-transitions="false"
@close="handleClose(item.hotwords)"
>
{{ `${item.hotwords.slice(0, 6)}...` }}
</el-tag>
</el-tooltip>
<el-tag
:key="item.id" :key="item.id"
size="small" size="small"
v-else
closable closable
:disable-transitions="false" :disable-transitions="false"
@close="handleClose(item.hotwords)" @close="handleClose(item.hotwords)"
>
{{ `${item.hotwords.slice(0, 6)}...` }}
</el-tag>
</el-tooltip>
<el-tag
:key="item.id"
size="small"
v-else
closable
:disable-transitions="false"
@close="handleClose(item.hotwords)"
> >
{{ item.hotwords }} {{ item.hotwords }}
</el-tag> </el-tag>
</template> </template>
<el-input <el-input
class="input-new-tag" class="input-new-tag"
v-if="inputVisible" v-if="inputVisible"
v-model="inputValue" v-model="inputValue"
ref="saveTagInput" ref="saveTagInput"
size="mini" size="mini"
@keyup.enter.native="handleInputConfirm" @keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm" @blur="handleInputConfirm"
> >
</el-input> </el-input>
<el-button v-else class="button-new-tag" size="mini" @click="showInput" <el-button v-else class="button-new-tag" size="mini" @click="showInput"
>+ 添加词汇 >+ 添加词汇
</el-button </el-button>
>
</div>
<div class="mt20">
<p class="title mb20">空白打印材料展示数量</p>
<el-input
size="small"
placeholder="请输入空白打印材料展示数量"
v-model.number="baseSetInfo.printDisplay"
style="width: 250px"
>
<template slot="suffix"></template>
</el-input>
</div> </div>
<!-- <div class="mt20">
<p class="title mb20">新闻来源</p>
<el-radio-group v-model="baseSetInfo.newsSource" size="medium">
<el-radio
v-for='($label, $value) in newSourceEnumData'
:key='$value'
:label="$value"
>{{ $label }}
</el-radio>
</el-radio-group>
</div>-->
<div class="mt50"> <div class="mt50">
<el-button size="small" type="primary" @click="handleOk" <el-button size="small" type="primary" @click="handleOk"
>确定 >确定
</el-button </el-button>
>
<el-button size="small" @click="handleReset">重置</el-button> <el-button size="small" @click="handleReset">重置</el-button>
</div> </div>
</el-card> </el-card>
...@@ -97,15 +67,15 @@ ...@@ -97,15 +67,15 @@
</template> </template>
<script> <script>
import {getBaseSetInfo, saveBaseSet} from "@/api/baseSet"; import { getBaseSetInfo, saveBaseSet } from "@/api/baseSet";
import local from "@/utils/local"; import local from "@/utils/local";
export default { export default {
data() { data() {
return { return {
siteId: local.getLocal("writeSiteId") siteId: local.getLocal("sampleSiteId")
? local.getLocal("writeSiteId") ? local.getLocal("sampleSiteId")
: "", : "",
inputVisible: false, inputVisible: false,
inputValue: "", inputValue: "",
newSourceEnumData: {}, newSourceEnumData: {},
...@@ -125,23 +95,21 @@ export default { ...@@ -125,23 +95,21 @@ export default {
let res = await getBaseSetInfo({ let res = await getBaseSetInfo({
siteId: this.siteId, siteId: this.siteId,
}); });
console.log("res:", res)
console.log("res lens:", res.data.data.data.length)
if (res.data.code === 1) { if (res.data.code === 1) {
this.newSourceEnumData = res.data.dict.newsSource this.newSourceEnumData = res.data.dict.newsSource;
if (res.data.data.data.length > 0) { if (res.data.data.data.length > 0) {
this.baseSetInfo.hotwords = res.data.data.data[0].hotwordList; this.baseSetInfo.hotwords = res.data.data.data[0].hotwordList;
this.baseSetInfo.printDisplay = res.data.data.data[0].printDisplay; this.baseSetInfo.printDisplay = res.data.data.data[0].printDisplay;
this.baseSetInfo.newsSource = res.data.data.data[0].newsSource + ""; this.baseSetInfo.newsSource = res.data.data.data[0].newsSource + "";
} }
} }
}, },
handleClose(tag) { handleClose(tag) {
//删除当前词汇 //删除当前词汇
this.baseSetInfo.hotwords=this.baseSetInfo.hotwords.filter(i=>i.hotwords!=tag) this.baseSetInfo.hotwords = this.baseSetInfo.hotwords.filter(
(i) => i.hotwords != tag
);
}, },
showInput() { showInput() {
...@@ -157,15 +125,16 @@ export default { ...@@ -157,15 +125,16 @@ export default {
handleInputConfirm() { handleInputConfirm() {
let inputValue = this.inputValue; let inputValue = this.inputValue;
if (inputValue) { if (inputValue) {
let list = this.baseSetInfo.hotwords.filter(
let list = this.baseSetInfo.hotwords.filter(i => i.hotwords === inputValue); (i) => i.hotwords === inputValue
);
if (list.length == 0) { if (list.length == 0) {
let obj = {} let obj = {};
obj.hotwords = inputValue obj.hotwords = inputValue;
obj.siteId = this.siteId obj.siteId = this.siteId;
obj.searchCount = 0 obj.searchCount = 0;
obj.wordsSource = 1 obj.wordsSource = 1;
this.baseSetInfo.hotwords.push(obj); this.baseSetInfo.hotwords.push(obj);
} }
} }
...@@ -179,14 +148,13 @@ export default { ...@@ -179,14 +148,13 @@ export default {
hotwordList: this.baseSetInfo.hotwords, hotwordList: this.baseSetInfo.hotwords,
siteId: this.siteId, siteId: this.siteId,
}); });
let {code, msg} = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
} else { } else {
this.getBaseSetInfo(); this.getBaseSetInfo();
} }
//保存热门词汇 //保存热门词汇
}, },
// 重置 // 重置
......
...@@ -286,12 +286,12 @@ import TableHeader from "@/components/TableHeader.vue"; ...@@ -286,12 +286,12 @@ import TableHeader from "@/components/TableHeader.vue";
import AddMatter from "./modal/AddMatter.vue"; import AddMatter from "./modal/AddMatter.vue";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { import {
getMatterList, // getMatterList,
createMatter, createMatter,
getWriteMatterList, getWriteMatterList,
delMatter, delMatter,
recommendMatter, recommendMatter,
getMatterSubList getMatterSubList,
} from "@/api/matter"; } from "@/api/matter";
import local from "@/utils/local"; import local from "@/utils/local";
export default { export default {
...@@ -327,7 +327,7 @@ export default { ...@@ -327,7 +327,7 @@ export default {
}; };
}, },
created() { created() {
this.getMatterList(); this.getMatterSubList();
this.getWriteMatterList(); this.getWriteMatterList();
}, },
computed: { computed: {
...@@ -353,23 +353,23 @@ export default { ...@@ -353,23 +353,23 @@ export default {
} }
}, },
// 获取一体化事项列表 // 获取一体化事项列表
async getMatterList() { // async getMatterList() {
this.loadingRight = true; // this.loadingRight = true;
let res = await getMatterList({ // let res = await getMatterList({
page: this.rightCurrent, // page: this.rightCurrent,
size: this.rightSize, // size: this.rightSize,
matterName: this.rightSearch, // matterName: this.rightSearch,
deptCode: this.departmentRight, // deptCode: this.departmentRight,
siteId: this.siteId, // siteId: this.siteId,
}); // });
this.loadingRight = false; // this.loadingRight = false;
if (res.data.code === 1) { // if (res.data.code === 1) {
let { total, data } = res.data.data; // let { total, data } = res.data.data;
this.rightTableData = data; // this.rightTableData = data;
this.rightTotal = total; // this.rightTotal = total;
this.$refs.rightTable.bodyWrapper.scrollTop = 0; // this.$refs.rightTable.bodyWrapper.scrollTop = 0;
} // }
}, // },
// 获取样表系统事项列表 // 获取样表系统事项列表
async getWriteMatterList() { async getWriteMatterList() {
...@@ -482,14 +482,14 @@ export default { ...@@ -482,14 +482,14 @@ export default {
// 右边搜索 // 右边搜索
handleSearchRight() { handleSearchRight() {
this.rightCurrent = 1; this.rightCurrent = 1;
this.getMatterList(); this.getMatterSubList();
}, },
// 右边重置 // 右边重置
rightReset() { rightReset() {
this.rightSearch = ""; this.rightSearch = "";
this.departmentRight = ""; this.departmentRight = "";
this.rightCurrent = 1; this.rightCurrent = 1;
this.getMatterList(); this.getMatterSubList();
}, },
// 右边勾选 // 右边勾选
handleSelectionChangeRight(select) { handleSelectionChangeRight(select) {
...@@ -503,19 +503,19 @@ export default { ...@@ -503,19 +503,19 @@ export default {
this.$message.success(msg); this.$message.success(msg);
this.rightSelectedRowKeys = []; this.rightSelectedRowKeys = [];
this.$refs.rightTable.clearSelection(); this.$refs.rightTable.clearSelection();
this.getMatterList(); this.getMatterSubList();
this.getWriteMatterList(); this.getWriteMatterList();
} }
}, },
// 右边翻页 // 右边翻页
rightChangePagination(cur) { rightChangePagination(cur) {
this.rightCurrent = cur; this.rightCurrent = cur;
this.getMatterList(); this.getMatterSubList();
}, },
// 右边改变每页显示数量 // 右边改变每页显示数量
rightChangeSize(size) { rightChangeSize(size) {
this.rightSize = size; this.rightSize = size;
this.getMatterList(); this.getMatterSubList();
}, },
// 批量加入 // 批量加入
handleAllJoin() { handleAllJoin() {
......
...@@ -86,8 +86,8 @@ export default { ...@@ -86,8 +86,8 @@ export default {
deptId: "", // 部门id deptId: "", // 部门id
deptCode: "", // 部门编号 deptCode: "", // 部门编号
matterNo: "", // 事项编号 matterNo: "", // 事项编号
siteId: local.getLocal("writeSiteId") siteId: local.getLocal("sampleSiteId")
? local.getLocal("writeSiteId") ? local.getLocal("sampleSiteId")
: "", : "",
source: 1, // 1为手动添加, source: 1, // 1为手动添加,
deptName: "", deptName: "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment