瀏覽代碼

Merge branch 'xyLog220509' into test

mfmf 3 年之前
父節點
當前提交
227b293c85
共有 6 個文件被更改,包括 72 次插入16 次删除
  1. 1 1
      src/html/loginLogs.html
  2. 22 5
      src/js/appealUserPage.js
  3. 3 3
      src/js/assertTypeDetail.js
  4. 1 1
      src/js/index.js
  5. 22 5
      src/js/qcScore.js
  6. 23 1
      src/js/utils.js

+ 1 - 1
src/html/loginLogs.html

@@ -26,7 +26,7 @@
 				    <input type="text" class="loginIp" style="height: 34px;">
 				</span>
                 <span class="filterItem typeFilter clearfix dataSelectLight">
-                    <span class="fl">操作日期:</span>
+                    <span class="fl">登陆日期:</span>
                     <span class="datapickerBox fl"><input type="text" placeholder="请选择时间" id="datepicker" autocomplete="off" readonly/></span>
                     <span  class="divide fl">-</span>
                     <span class="datapickerBox fl"><input type="text" placeholder="请选择时间" id="datepicker2"  autocomplete="off" readonly/></span>

+ 22 - 5
src/js/appealUserPage.js

@@ -37,6 +37,7 @@ $(function () {
   let global_flaws = [];  //缺陷条目列表缓存
   let global_selectedFlaw = {};    //新增时选中的条目信息
   let global_checkers = [];    //审核人列表
+  let menuList = [];
   getAllModules();
 
   const form = getUrlArgObject("form") || 0;
@@ -163,6 +164,15 @@ $(function () {
         global_check = checkStatus
         global_check_home = mrStatus
         global_check_show = checkShow;
+        const list = JSON.parse(result.menuData)
+        for (let i = 0; i < list.length; i++) {
+          const item = list[i];
+          menuList.push(item.name)
+          for (let j = 0; j < item.sonMode.length; j++) {
+            const it = item.sonMode[j];
+            menuList.push(it.name)
+          }
+        }
         const info = Object.assign(beHospital, result);
         initMenu(JSON.parse(result.menuData));
         // $(".sub-menu>ul>li:first-child.page,.menu-mini>ul>li:first-child.page").addClass("active");
@@ -375,16 +385,23 @@ $(function () {
     $(".page-anchor").on("click", function () {
       const code = $(this).attr("code");
       const pCode = $(this).parents("tr").attr("code").replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, '');
+      const tCode = $(this).parents("tr").attr("code")
+      //菜单同步状态
+      if (menuList.indexOf(tCode) == -1) {
+        console.log(123);
+        $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
+        return;
+      }
       //菜单同步状态
       $(".sub-menu .page[code=" + pCode + "]").parents(".list-1").click();
       $(".sub-menu .page[code=" + pCode + "],.menu-mini .page[code=" + pCode + "").click();
       //缺陷定位
       $(".info-item .cont,.flaw-item,td").removeClass("active");
-      const flawItem = $(".flaw-item .title a[code=" + code + "]");
-      if (!flawItem.length) {
-        $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
-        return;
-      }
+      // const flawItem = $(".flaw-item .title a[code=" + code + "]");
+      // if (!flawItem.length) {
+      //   $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
+      //   return;
+      // }
       $(".flaw-item .title a[code=" + code + "]").click();
       const anch = $(".flaw-item .title a[code=" + code + "]").attr("href");
       if ($(anch)[0]) {

+ 3 - 3
src/js/assertTypeDetail.js

@@ -2,7 +2,7 @@ const $ = require('jquery');
 require("../css/assertTypeDetail.less");
 require('./modal.js');
 const {api} = require('./api.js')
-const {post,getCookie,getUrlArgObjectNew,getUrlArgObject} = require('./utils.js')
+const {post,getCookie,getUrlArgObjectNew,getUrlArgObject,debounce} = require('./utils.js')
 const iconCheck= require("./../images/icon_check.png")
 const iconUnCheck = require("./../images/icon_unchecked.png")
 const arrowUp = require("./../images/arrow_up22.png")
@@ -123,7 +123,7 @@ function bindCheck(){
     })
 }
 
-$('.submit').click(function(){
+$('.submit').click(debounce(function(){
     const qcName = $('.patientNumInp').val().trim();
     if(!qcName){
         $.alerModal({"message":"质控类型不能为空",type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
@@ -204,4 +204,4 @@ $('.submit').click(function(){
     // }).catch((e) =>{
     
     // })
-})
+},300,true))

+ 1 - 1
src/js/index.js

@@ -100,7 +100,7 @@ $(function () {
   $(window).click(function (e) {
     $(".userAction").css("display", "none")
   })
-  $("#changeWord").css("opacity", hasData('FUNC000002') ? '1' : '0.5').hover(function () {
+  $("#changeWord").css("opacity", hasData('FUNC000002') ? '1' : '1').hover(function () {
     $(this).css("color", "#777777")
   })
   if (isPlacefile == 0) {

+ 22 - 5
src/js/qcScore.js

@@ -35,6 +35,7 @@ $(function () {
   let global_modules = {};   //模板数据缓存
   let global_flaws = [];  //缺陷条目列表缓存
   let global_selectedFlaw = {};    //新增时选中的条目信息
+  let menuList = [];
   getAllModules();
   let showCheckBtns = global_code === "YH-ZKHC-HCRWLB";
   window.document.title = (showCheckBtns ? "质控核查-" : "质控评分-") + getUrlArgObject("name");
@@ -188,6 +189,15 @@ $(function () {
         global_check = checkStatus
         global_check_home = mrStatus
         global_check_show = checkShow;//0隐藏操作按钮1显示
+        const list = JSON.parse(result.menuData)
+        for (let i = 0; i < list.length; i++) {
+          const item = list[i];
+          menuList.push(item.name)
+          for (let j = 0; j < item.sonMode.length; j++) {
+            const it = item.sonMode[j];
+            menuList.push(it.name)
+          }
+        }
         check_Operation_WithAppeal = checkOperationWithAppeal;
         const info = Object.assign(beHospital, result);
         initMenu(JSON.parse(result.menuData));
@@ -367,16 +377,23 @@ $(function () {
     $(".page-anchor").on("click", function () {
       const code = $(this).attr("code");
       const pCode = $(this).parents("tr").attr("code").replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, '');
+      const tCode = $(this).parents("tr").attr("code")
+      //菜单同步状态
+      if (menuList.indexOf(tCode) == -1) {
+        console.log(123);
+        $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
+        return;
+      }
       //菜单同步状态
       $(".sub-menu .page[code=" + pCode + "]").parents(".list-1").click();
       $(".sub-menu .page[code=" + pCode + "],.menu-mini .page[code=" + pCode + "").click();
       //缺陷定位
       $(".info-item .cont,.flaw-item,td").removeClass("active");
-      const flawItem = $(".flaw-item .title a[code=" + code + "]");
-      if (!flawItem.length) {
-        $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
-        return;
-      }
+      // const flawItem = $(".flaw-item .title a[code=" + code + "]");
+      // if (!flawItem.length) {
+      //   $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
+      //   return;
+      // }
       $(".flaw-item .title a[code=" + code + "]").click();
       const anch = $(".flaw-item .title a[code=" + code + "]").attr("href");
       if ($(anch)[0]) {

+ 23 - 1
src/js/utils.js

@@ -692,6 +692,27 @@ function getLogoParam() {
   return otherLogoPm + hideLogoPm;
 }
 
+//防抖
+function debounce(func, wait,immediate) {//func是要执行的函数,wait是毫秒数,immediate是是否要执行的参数,true立即执行,false延后执行
+        let timerout;
+        return function () {
+            let context = this;
+            let args = arguments;
+            clearTimeout(timerout)
+            if (immediate){
+                let callNow = !timerout;
+                timerout = setTimeout(() => {
+                    timerout = null;
+                }, wait);
+                if (callNow) func.apply(context, args);
+            } else{
+                timerout = setTimeout(function() {
+                    func.apply(context, args);
+                }, wait);
+            }
+        }
+    }
+
 function toast(msg) {
   return $.alerModal({
     "message": msg,
@@ -755,5 +776,6 @@ module.exports = {
   explainTitle,
   getScoreTabList,
   getLogoParam,
-  toast
+  toast,
+  debounce
 };