|
@@ -18,6 +18,12 @@
|
|
|
style="width: 200px ;margin-top: 10px;margin-left: 17px"
|
|
|
placeholder="结束日期"
|
|
|
/>
|
|
|
+ <el-input
|
|
|
+ v-model="keyword"
|
|
|
+ placeholder="关键字"
|
|
|
+ clearable
|
|
|
+ style="width: 200px ;margin-top: 10px;margin-left: 17px">
|
|
|
+ </el-input>
|
|
|
<el-button
|
|
|
class="filter-item"
|
|
|
style="margin-left: 10px;"
|
|
@@ -29,7 +35,7 @@
|
|
|
</div>
|
|
|
<y-page-list-layout>
|
|
|
<el-table :data="tableData" slot="table" style="width: 100%;" border="border" height="900px" :row-style="{height:'100px'}">
|
|
|
- <el-table-column v-if="tableData.length>0" label="日期" width="150px" align="center" fixed>
|
|
|
+ <el-table-column v-if="tableData!=null && tableData.length>0" label="日期" width="150px" align="center" fixed>
|
|
|
<template slot-scope="{row}">
|
|
|
<span>{{row.logDate}}</span>
|
|
|
</template>
|
|
@@ -40,8 +46,8 @@
|
|
|
<div class="content" v-if = "g.userName===name" v-for="(g,index) in l.logs" >
|
|
|
<div class="info">
|
|
|
<el-tooltip class="item" effect="dark" content="点击回复" placement="right-start">
|
|
|
- <div id="info-item" type="info" effect="dark" @click="openDialog(g)">
|
|
|
- {{ index+1 }}、{{g.taskSituation}}
|
|
|
+ <div id="info-item" type="info" effect="dark" @click="openDialog(g)" v-html="g.taskSituation">
|
|
|
+ {{ index+1 }}、
|
|
|
</div>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
@@ -96,7 +102,6 @@
|
|
|
br: '<br/>',
|
|
|
activeName: 'first',
|
|
|
vLoading: false,
|
|
|
- listQuery:{},
|
|
|
scope: false,
|
|
|
tableData: [],
|
|
|
dates:[],
|
|
@@ -104,7 +109,8 @@
|
|
|
dialogFormVisible: false,
|
|
|
postForm:{},
|
|
|
startDate:null,
|
|
|
- endDate:null
|
|
|
+ endDate:null,
|
|
|
+ keyword:null,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -121,6 +127,33 @@
|
|
|
},
|
|
|
},
|
|
|
methods:{
|
|
|
+ // 搜索关键词高亮方法
|
|
|
+ changeColor(result) {
|
|
|
+ //result为接口返回的数据
|
|
|
+ result.map((item, index) => {
|
|
|
+ if (this.keyword) {
|
|
|
+ /**
|
|
|
+ * 使用正则表达式进行全文匹配关键词
|
|
|
+ * ig : 表示 全文查找 ,忽略大小写
|
|
|
+ * i : 忽略大小写
|
|
|
+ * g : 全文查找
|
|
|
+ *
|
|
|
+ * 使用字符串的replace方法进行替换
|
|
|
+ * stringObject.replace('被替换的值',替换的值)
|
|
|
+ title和name是你要高亮的字段
|
|
|
+ */
|
|
|
+ let replaceReg = new RegExp(this.keyword, "ig");
|
|
|
+ let replaceString = `<span style="color: #ed4014;font-weight: bold">${this.keyword}</span>`;
|
|
|
+ item.list.forEach(x=>{
|
|
|
+ x.logs.forEach(y=>{
|
|
|
+ y.taskSituation = y.taskSituation.replace(replaceReg, replaceString);
|
|
|
+ });
|
|
|
+ x.userName = x.userName.replace(replaceReg, replaceString);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.tableData = result;
|
|
|
+ },
|
|
|
openDialog(g){
|
|
|
this.dialogVisible = true;
|
|
|
this.replyForm.bizTableId = g.id;
|
|
@@ -164,7 +197,7 @@
|
|
|
getLogs(){
|
|
|
this.tableData = null;
|
|
|
this.userNames = [];
|
|
|
- this.$api.marketLog.collect({startDate:this.startDate, endDate:this.endDate}).then(res=>{
|
|
|
+ this.$api.marketLog.collect({startDate:this.startDate, endDate:this.endDate, keyword:this.keyword}).then(res=>{
|
|
|
this.tableData = res.data;
|
|
|
const us = this.userNames;
|
|
|
const d = this.tableData;
|
|
@@ -173,6 +206,7 @@
|
|
|
});
|
|
|
this.userNames = Array.from(new Set(us));
|
|
|
this.tableData = this.groupByDate(d, 'logDate');
|
|
|
+ this.changeColor(this.tableData);
|
|
|
});
|
|
|
},
|
|
|
groupByDate(list, key){
|