licp
2024-05-14 ef48e4b7a4d34e63ffd2cb23c406f4da6eb72ed7
优化消息管理,标准库管理
已修改9个文件
185 ■■■■■ 文件已修改
src/assets/api/controller.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/a5-laboratory-management.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b2-standard.vue 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b3-classes.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/index-index.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/notice-detail.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/notice.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -264,6 +264,7 @@
  page:"/performanceShift/page",//绩效管理-班次-分页查询
  update:"/performanceShift/update",//绩效管理-班次-班次状态修改
  pageYear:"/performanceShift/pageYear",//绩效管理-班次-年份分页查询
  export:"/performanceShift/export",//绩效管理-班次-导出
}
const auxiliaryWorkingHours = {
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -571,7 +571,7 @@
        const mySet1 = new Set();
        this.tableLists = this.currentSample.insProduct.filter(m => {
          let num0 = mySet1.size;
          if (m.templateId != null) {
          if (m.templateId != null&&m.template != null) {
            mySet1.add(JSON.stringify({
              template: m.template,
              templateId: m.templateId
src/components/view/a5-laboratory-management.vue
@@ -244,8 +244,8 @@
            children:[]
          },
          {
            value:'额外类型',
            label:'额外类型',
            value:'报告类型',
            label:'报告类型',
            children:null
          },
        ],
src/components/view/b2-standard.vue
@@ -58,7 +58,7 @@
  }
  .product_table .el-table {
    height: 100%;
    height: calc(100% - 35px) !important;
  }
  .sort {
@@ -161,8 +161,9 @@
        </el-table>
      </el-row>
      <el-row class="product_table" v-loading="tableLoad2">
        <el-table :data="productList" ref="productTable" style="width: 100%;" height="100%" tooltip-effect="dark" stripe
          :fit="true" border @selection-change="handleSelectionChange" :row-class-name="tableRowClassName"
        <el-table :data="pagedData" ref="productTable" style="width: 100%;" height="100%" tooltip-effect="dark" stripe
          :fit="true" border
          @selection-change="handleSelectionChange" :row-class-name="tableRowClassName"
          @select="upProductSelect" @select-all="handleAll">
          <el-table-column type="selection" width="65">
          </el-table-column>
@@ -231,6 +232,14 @@
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
        style="position: absolute;right: 16px;bottom: 1px;"
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-size="pageSize"
          layout="total, prev, pager, next, jumper"
          :total="total">
        </el-pagination>
      </el-row>
    </div>
    <el-dialog title="分类添加" :visible.sync="addDia" width="400px">
@@ -428,7 +437,29 @@
        sectionLoad: false,
        sectionRow: null,
        sectionList: [],
        templateList: []
        templateList: [],
        total:0,
        pageSize:100,
        currentPage:1,
      }
    },
    computed: {
      pagedData() {
        const start = (this.currentPage - 1) * this.pageSize;
        const end = start + this.pageSize;
        return this.productList.slice(start, end);
      },
    },
    watch:{
      pagedData:{
        deep:true,
        handler(val){
          setTimeout(() => {
            val.forEach(a => {
              if (a.state == 1) this.toggleSelection(a)
            })
          }, 300)
        }
      }
    },
    mounted() {
@@ -912,11 +943,12 @@
          tree: this.selectTree
        }).then(res => {
          this.productList = res.data
          setTimeout(() => {
            this.productList.forEach(a => {
              if (a.state == 1) this.toggleSelection(a)
            })
          }, 300)
          this.total = this.productList.length;
          // setTimeout(() => {
          //   this.productList.forEach(a => {
          //     if (a.state == 1) this.toggleSelection(a)
          //   })
          // }, 300)
          this.tableLoad2 = false
        })
      },
@@ -955,13 +987,13 @@
      },
      handleAll(e) {
        if (e.length > 0) {
          this.productList.map(m => {
          this.productList = this.productList.map(m => {
            m.state = 0
            this.upProductSelect(null, m)
            return m
          })
        } else {
          this.productList.map(m => {
          this.productList = this.productList.map(m => {
            m.state = 1
            this.upProductSelect(null, m)
            return m
@@ -1039,6 +1071,9 @@
          this.templateList = res.data
        })
      },
      handleCurrentChange(val) {
        this.currentPage = val;
      },
    }
  }
</script>
src/components/view/b3-classes.vue
@@ -44,7 +44,7 @@
      <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
    </div>
    <div class="search_thing btns" style="padding-left: 30px;">
      <el-button size="small" type="primary" v-if="downPower">导 出</el-button>
      <el-button size="small" type="primary" v-if="downPower" @click="handleDown" :loading="downLoading">导 出</el-button>
      <el-button size="small" type="primary" @click="schedulingVisible = true" v-if="addPower">排 班</el-button>
    </div>
  </div>
@@ -286,7 +286,8 @@
      pageLoading: false, // 组件loading的展示,默认为true
      finishLoding: false, // 加载完成,显示已经没有更多了
      monthList:[],
      yearList:[]
      yearList:[],
      downLoading:false,
    }
  },
  watch: {
@@ -516,6 +517,40 @@
        this.refresh()
      })
    },
    handleDown(){
      let year = this.query.year.getFullYear()
      let time = '';
      if(this.query.month){
        let month = this.query.month>9?this.query.month:'0'+this.query.month
        time = year+'-'+month+'-01 00:00:00'
      }else{
        time = year+'-01-01 00:00:00'
      }
      this.downLoading = true
      this.$axios.get(this.$api.performanceShift.export+`?time=${time}&userName=${this.query.userName}&laboratory=${this.query.laboratory}&isMonth=${this.query.month?true:false}`,{responseType: 'blob'}).then(res => {
        this.$message.success('下载成功')
        this.downLoading = false
        const blob = new Blob([res], {
          type: 'application/force-download'
        })
        let fileName="";
        if(this.query.month){
          fileName = year +'-'+this.query.month+' 班次信息'
        }else{
          fileName = year+' 班次汇总'
        }
        const filename = decodeURI(fileName+'.xlsx')
        // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件
        const elink = document.createElement('a')
        elink.download = filename
        elink.style.display = 'none'
        elink.href = URL.createObjectURL(blob)
        document.body.appendChild(elink)
        elink.click()
        URL.revokeObjectURL(elink.href) // 释放URL 对象
        document.body.removeChild(elink)
      })
    },
    selectEnumByCategory() {
      this.$axios.post(this.$api.enums.selectEnumByCategory, {
        category: "班次类型"
src/components/view/index-index.vue
@@ -439,7 +439,8 @@
        pageSize: 8, // 一页7条
        total: null,
        listLoading: true, // 组件loading的展示,默认为true
        finishLoding: false // 加载完成,显示已经没有更多了
        finishLoding: false, // 加载完成,显示已经没有更多了
        timer:null
            }
        },
    watch:{
@@ -458,12 +459,20 @@
            setInterval(() => {
                this.nowTime()
            }, 1000)
      this.init();
      this.weekdays = this.getWeekdaysForNextWeek()
      this.getScheduleByMe()
      this.init();
      this.currentPage = 1;
      this.list = [];
      this.getList();
      this.getScheduleByMe()
      this.timer&&clearInterval(this.timer)
      this.timer = setInterval(() => {
        this.init();
        this.currentPage = 1;
        this.list = [];
        this.getList();
        this.getScheduleByMe()
      },1000*60*10)
        },
        methods: {
      getList(){
@@ -623,10 +632,11 @@
        let weekdays = [];
        for (let i = 0; i < 7; i++) {
          let date = new Date();
          date.setDate(date.getDate() + i); // 今天之后的日子
          date.setDate(date.getDate() - i); // 今天之后的日子
          let day = date.getDay(); // 0-6 代表星期日到星期六
          weekdays.push(day);
        }
        weekdays.reverse()
        weekdays = weekdays.map(m=>{
          let day =''
          switch (m) {
@@ -691,5 +701,8 @@
      })
    },
        },
    deactivated(){
      this.timer&&clearInterval(this.timer)
    }
    }
</script>
src/components/view/notice-detail.vue
@@ -1,7 +1,7 @@
<template>
  <div class="notice-detail-page">
    <div class="notice-detail-head">
      <h4 style="margin-bottom: 16px;">{{ noticeInfo.theme }} <el-tag style="margin-left: 10px;" :type="options.find(m=>m.value==noticeInfo.messageType).type" v-if="options.find(m=>m.value==noticeInfo.messageType)">{{ options.find(m=>m.value==noticeInfo.messageType).label }}</el-tag></h4>
      <h4 style="margin-bottom: 16px;" v-if="noticeInfo.theme">{{ noticeInfo.theme }} <el-tag style="margin-left: 10px;" :type="options.find(m=>m.value==noticeInfo.messageType).type" v-if="options.find(m=>m.value==noticeInfo.messageType)">{{ options.find(m=>m.value==noticeInfo.messageType).label }}</el-tag></h4>
      <p style="font-size: 12px;color: #999;margin-bottom: 20px;">
        <!-- <span>消息类型:审批&nbsp; </span> -->
        <span>发送人:{{ noticeInfo.createUser }} </span>
@@ -41,15 +41,11 @@
      options:[]
    }
  },
  created(){
    this.noticeInfo = JSON.parse(sessionStorage.getItem("noticeInfo"));
  },
  mounted(){
    this.noticeInfo = JSON.parse(sessionStorage.getItem("noticeInfo"));
    this.noticeInfo = JSON.parse(localStorage.getItem("noticeInfo"));
    this.$bus.$on("change", (msg) => {
      this.noticeInfo = JSON.parse(msg);
      console.log(this.noticeInfo);
      sessionStorage.setItem("noticeInfo", msg);
      localStorage.setItem("noticeInfo", msg);
    });
    this.getTypeDicts()
  },
@@ -69,7 +65,11 @@
<style scoped>
.notice-detail-page{
  height: calc(100% - 30px);
  overflow-y: auto;
  padding: 16px 0;
}
.notice-detail-page::-webkit-scrollbar {
  width: 0;
}
.notice-detail-head{
  background: #fff;
@@ -83,9 +83,9 @@
  box-sizing: border-box;
  padding: 8px 20px 20px;
  background: rgba(0,0,0, 0.03);
  box-shadow: 0 0 10px 10px #fff;
  /* box-shadow: 0 0 10px 10px #fff; */
  border-radius: 4px;
  height: calc(100% - 192px - 22px);
  min-height: calc(100% - 192px - 22px);
}
.notice-detail-head-content div{
  border-radius: 8px;
@@ -98,6 +98,6 @@
}
.notice-content{
  height: 100%;
  height: 600px;
}
</style>
src/view/index.vue
@@ -393,7 +393,7 @@
        <el-button type="primary" @click="handleEdit">确 定</el-button>
      </span>
    </el-dialog>
    <notice ref="notice" />
    <notice ref="notice" @goNoticeDetail="checkForUnreadData()" />
    </div>
</template>
src/view/notice.vue
@@ -37,7 +37,8 @@
      <scroll-pagination @load="refresh" :finishLoding="finishLoding">
        <div class="notice-content-item" v-for="(m,i) in list" :key="i">
          <div class="btns" v-if="m">
            <el-dropdown style="margin-right: 20px;" trigger="click" @command="e=>handleDropdown(e,m)" v-if="m.messageType==2||m.messageType==3">
            <!-- v-if="m.messageType==2||m.messageType==3" -->
            <el-dropdown style="margin-right: 20px;" trigger="click" @command="e=>handleDropdown(e,m)" v-if="false">
              <span class="el-dropdown-link">
                <span class="more" style="line-height: 26px;display: inline-block;">&middot;&middot;&middot;</span>
              </span>
@@ -192,6 +193,7 @@
        this.list = [];
        this.currentPage = 1;
        this.refresh();
        this.$emit('goNoticeDetail')
      })
    },
    handleDropdown(e,row){
@@ -222,38 +224,6 @@
        })
      }).catch(() => {})
    },
    // 滚动触底加载
    scrollFn() {
      let clientHeight = document.documentElement.clientHeight - 18; //可视区域
      let scrollHeight = document.body.scrollHeight; // 滚动文档高度
      let scrollTop = parseInt(document.documentElement.scrollTop); // 已滚动的高度
      let height = 300;
      if (
        scrollTop + clientHeight >= scrollHeight - height &&
        scrollHeight != 0
      ) {
        if (!this.finishLoding&&this.currentPage*this.pageSize<this.total) {
          this.currentPage = this.currentPage + 1;
          this.refresh();
        }
      } else {
        return false;
      }
    },
    throttle(fn, wait) {
      // 封装函数进行节流
      var timer = null;
      return function () {
        var context = this;
        var args = arguments;
        if (!timer) {
          timer = setTimeout(function () {
            fn.apply(context, args);
            timer = null;
          }, wait);
        }
      };
    },
    handleType(){
      this.list = [];
      this.currentPage = 1;
@@ -274,9 +244,6 @@
        this.refresh();
      })
    }
  },
  destroyed() {
    window.removeEventListener("scroll", this.throttle(), false);
  },
}
</script>