Commit dc0de44f authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 86e6c42f 735049b2
......@@ -239,8 +239,7 @@ export default {
let res = await getHomeInfo({});
let { data, code } = res.data;
if (code === 1) {
// data.hotWords = data.hotWords.split(",");
// data.hotWords = data.hotWords.map((v) => v.hotwords);
data.hotWords = data.hotWords.map((v) => v.hotwords);
this.homeInfo = data;
this.matterList = data.matterList;
this.datumList = data.datumList;
......
// 基础设置api
import request from '@/utils/request'
import request from "@/utils/request";
// 查看基础设置
export const getBaseSetInfo = (data) => {
return request({
url: "/sampleform/baseset/list",
method: "post",
data,
});
return request({
url: "/sampleform/baseset/list",
method: "post",
data,
});
};
// 保存基础设置
export const saveBaseSet = (data) => {
return request({
url: "/sampleform/baseset/save",
method: "post",
data,
});
return request({
url: "/sampleform/baseset/save",
method: "post",
data,
});
};
......@@ -7,89 +7,59 @@
<div class="header">
<span class="mr15 title">热门搜索词汇</span>
<span class="tips"
>点击热门词汇,自动检索。系统默认展示搜索量最多的10个词,每个词展示6个汉字,支持手动修改。</span
>点击热门词汇,自动检索。系统默认展示搜索量最多的10个词,每个词展示6个汉字,支持手动修改。</span
>
</div>
<!-- 标签 -->
<div class="mt20">
<template v-for="item in baseSetInfo.hotwords">
<el-tooltip
class="item"
effect="dark"
:key="item.id"
:content="item.hotwords"
v-if="item.hotwords.length > 6"
placement="top-start"
class="item"
effect="dark"
:key="item.id"
:content="item.hotwords"
v-if="item.hotwords.length > 6"
placement="top-start"
>
<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"
size="small"
v-else
closable
:disable-transitions="false"
@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 }}
</el-tag>
</template>
<el-input
class="input-new-tag"
v-if="inputVisible"
v-model="inputValue"
ref="saveTagInput"
size="mini"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
class="input-new-tag"
v-if="inputVisible"
v-model="inputValue"
ref="saveTagInput"
size="mini"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
>
</el-input>
<el-button v-else class="button-new-tag" size="mini" @click="showInput"
>+ 添加词汇
</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>
>+ 添加词汇
</el-button>
</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">
<el-button size="small" type="primary" @click="handleOk"
>确定
</el-button
>
>确定
</el-button>
<el-button size="small" @click="handleReset">重置</el-button>
</div>
</el-card>
......@@ -97,15 +67,15 @@
</template>
<script>
import {getBaseSetInfo, saveBaseSet} from "@/api/baseSet";
import { getBaseSetInfo, saveBaseSet } from "@/api/baseSet";
import local from "@/utils/local";
export default {
data() {
return {
siteId: local.getLocal("writeSiteId")
? local.getLocal("writeSiteId")
: "",
siteId: local.getLocal("sampleSiteId")
? local.getLocal("sampleSiteId")
: "",
inputVisible: false,
inputValue: "",
newSourceEnumData: {},
......@@ -125,23 +95,21 @@ export default {
let res = await getBaseSetInfo({
siteId: this.siteId,
});
console.log("res:", res)
console.log("res lens:", res.data.data.data.length)
if (res.data.code === 1) {
this.newSourceEnumData = res.data.dict.newsSource
this.newSourceEnumData = res.data.dict.newsSource;
if (res.data.data.data.length > 0) {
this.baseSetInfo.hotwords = res.data.data.data[0].hotwordList;
this.baseSetInfo.printDisplay = res.data.data.data[0].printDisplay;
this.baseSetInfo.newsSource = res.data.data.data[0].newsSource + "";
}
}
},
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() {
......@@ -157,15 +125,16 @@ export default {
handleInputConfirm() {
let inputValue = this.inputValue;
if (inputValue) {
let list = this.baseSetInfo.hotwords.filter(i => i.hotwords === inputValue);
let list = this.baseSetInfo.hotwords.filter(
(i) => i.hotwords === inputValue
);
if (list.length == 0) {
let obj = {}
obj.hotwords = inputValue
obj.siteId = this.siteId
obj.searchCount = 0
obj.wordsSource = 1
let obj = {};
obj.hotwords = inputValue;
obj.siteId = this.siteId;
obj.searchCount = 0;
obj.wordsSource = 1;
this.baseSetInfo.hotwords.push(obj);
}
}
......@@ -179,14 +148,13 @@ export default {
hotwordList: this.baseSetInfo.hotwords,
siteId: this.siteId,
});
let {code, msg} = res.data;
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
} else {
this.getBaseSetInfo();
}
//保存热门词汇
},
// 重置
......
......@@ -286,12 +286,12 @@ import TableHeader from "@/components/TableHeader.vue";
import AddMatter from "./modal/AddMatter.vue";
import { mapGetters } from "vuex";
import {
getMatterList,
// getMatterList,
createMatter,
getWriteMatterList,
delMatter,
recommendMatter,
getMatterSubList
getMatterSubList,
} from "@/api/matter";
import local from "@/utils/local";
export default {
......@@ -327,7 +327,7 @@ export default {
};
},
created() {
this.getMatterList();
this.getMatterSubList();
this.getWriteMatterList();
},
computed: {
......@@ -353,23 +353,23 @@ export default {
}
},
// 获取一体化事项列表
async getMatterList() {
this.loadingRight = true;
let res = await getMatterList({
page: this.rightCurrent,
size: this.rightSize,
matterName: this.rightSearch,
deptCode: this.departmentRight,
siteId: this.siteId,
});
this.loadingRight = false;
if (res.data.code === 1) {
let { total, data } = res.data.data;
this.rightTableData = data;
this.rightTotal = total;
this.$refs.rightTable.bodyWrapper.scrollTop = 0;
}
},
// async getMatterList() {
// this.loadingRight = true;
// let res = await getMatterList({
// page: this.rightCurrent,
// size: this.rightSize,
// matterName: this.rightSearch,
// deptCode: this.departmentRight,
// siteId: this.siteId,
// });
// this.loadingRight = false;
// if (res.data.code === 1) {
// let { total, data } = res.data.data;
// this.rightTableData = data;
// this.rightTotal = total;
// this.$refs.rightTable.bodyWrapper.scrollTop = 0;
// }
// },
// 获取样表系统事项列表
async getWriteMatterList() {
......@@ -482,14 +482,14 @@ export default {
// 右边搜索
handleSearchRight() {
this.rightCurrent = 1;
this.getMatterList();
this.getMatterSubList();
},
// 右边重置
rightReset() {
this.rightSearch = "";
this.departmentRight = "";
this.rightCurrent = 1;
this.getMatterList();
this.getMatterSubList();
},
// 右边勾选
handleSelectionChangeRight(select) {
......@@ -503,19 +503,19 @@ export default {
this.$message.success(msg);
this.rightSelectedRowKeys = [];
this.$refs.rightTable.clearSelection();
this.getMatterList();
this.getMatterSubList();
this.getWriteMatterList();
}
},
// 右边翻页
rightChangePagination(cur) {
this.rightCurrent = cur;
this.getMatterList();
this.getMatterSubList();
},
// 右边改变每页显示数量
rightChangeSize(size) {
this.rightSize = size;
this.getMatterList();
this.getMatterSubList();
},
// 批量加入
handleAllJoin() {
......
......@@ -86,8 +86,8 @@ export default {
deptId: "", // 部门id
deptCode: "", // 部门编号
matterNo: "", // 事项编号
siteId: local.getLocal("writeSiteId")
? local.getLocal("writeSiteId")
siteId: local.getLocal("sampleSiteId")
? local.getLocal("sampleSiteId")
: "",
source: 1, // 1为手动添加,
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