wucl 2 anni fa
parent
commit
4906683fd3

+ 0 - 9
src/views/item/itemIndex.vue

@@ -1,13 +1,5 @@
 <template>
   <div class="app-container">
-<!--    <y-data-view-page-layout title="日志首页" class="staff-admin-index">-->
-<!--      <y-data-view-module>-->
-<!--        <y-d-v-over-view title="当天日志数" :typeId="1" :ico="require('@/assets/statics/pg9.png')" :data="[{text:logStaticsInfo.currentDayNum,value:'份'}]"></y-d-v-over-view>-->
-<!--        <y-d-v-over-view title="日志总数" :typeId="2" :ico="require('@/assets/statics/pg9.png')" :data="[{text:logStaticsInfo.totalNum,value:'份'}]" ></y-d-v-over-view>-->
-<!--        <y-d-v-over-view title="最新提交人" :typeId="3" :ico="require('@/assets/statics/pg7.png')" :data="[{text:logStaticsInfo.userName}]" ></y-d-v-over-view>-->
-<!--        <y-d-v-over-view title="最新提交日期" :typeId="4" :ico="require('@/assets/statics/pg10.png')" :data="[{text:logStaticsInfo.logDate}]" ></y-d-v-over-view>-->
-<!--      </y-data-view-module>-->
-<!--    </y-data-view-page-layout>-->
     <div class="title">
       <span style="color: red">{{state}}</span>
       项目进度总览
@@ -59,7 +51,6 @@
         let dft = false;
         const menus = this.$store.getters.permission_menus;
         menus.forEach((item) => {
-          console.log(item.menuCode);
           if (item.menuCode === "_view_item") {
             dft = true;
           }

+ 32 - 0
src/views/item/list.vue

@@ -75,6 +75,26 @@
         >重置
         </el-button>
       </template>
+      <template slot="right">
+        <PermissionButton
+          menu-code="_views_item_export"
+          class-name="filter-item"
+          round
+          type="primary"
+          name="导出"
+          @click="itemExport"
+        >
+        </PermissionButton>
+        <PermissionButton
+          menu-code="_views_item_mine_export"
+          class-name="filter-item"
+          round
+          type="primary"
+          name="导出"
+          @click="itemMineExport"
+        >
+        </PermissionButton>
+      </template>
       <parentTable
         v-loading="listLoading"
         :data="pageData.records"
@@ -288,6 +308,18 @@
       that.getCateList();
     },
     methods: {
+      itemExport(){
+        this.$utils.exportUtil(
+          "/item/export", this.listQuery,
+          "导出"
+        );
+      },
+      itemMineExport(){
+        this.$utils.exportUtil(
+          "/item/mine/export", this.listQuery,
+          "导出"
+        );
+      },
       getCateList(){
         this.$api.dictData.simpleType("项目类型").then(res => {
           this.cateList = res.data

+ 40 - 6
src/views/market/log/rateCollect.vue

@@ -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){