Browse Source

代码y优化

刘洋 1 year ago
parent
commit
be386ceccf

+ 1 - 11
src/components/element/BaseDialog.vue

@@ -13,17 +13,7 @@
     <slot />
     <template v-if="props.footer !== false" #footer>
       <template v-if="!!props.canResize">
-        <div
-          v-if="props.canResize == 'can-resize2' || props.canResize == 'can-resize22'"
-          v-dialogResizeImg="props.canResize"
-          class="foot-box"
-        >
-          <slot name="footer"></slot>
-        </div>
-        <div v-else-if="props.canResize == 'can-resize3'" v-dialogResizeStandard="props.canResize" class="foot-box">
-          <slot name="footer"></slot>
-        </div>
-        <div v-else v-dialogResize="props.canResize" class="foot-box">
+        <div v-dialogResize="props.canResize" class="foot-box">
           <slot name="footer"></slot>
         </div>
       </template>

+ 1 - 1
src/components/shared/ImagePreview.vue

@@ -88,7 +88,7 @@ const props = withDefaults(
   {
     modelValue: false,
     url: '',
-    resizeKey: 'can-resize2',
+    resizeKey: 'can-resize-normal-img',
   }
 )
 const visible = useVModel(props)

+ 1 - 21
src/components/shared/MarkHeader.vue

@@ -45,27 +45,7 @@
       </div> -->
     </div>
 
-    <!-- <base-dialog
-      v-model="standardVisible"
-      class="standard-dialog"
-      :can-resize="'can-resize3'"
-      title="评分标准"
-      modal-class="no-mask"
-      center
-      :modal="false"
-    >
-      <div id="my-iframe-mask"></div>
-      <iframe
-        style="width: 100%; height: 100%; prevent-events: pointer"
-        :src="
-          standardRes?.url
-            ? standardRes?.url + '#view=FitH&scrollbar=0&toolbar=0&statusbar=0&messages=0&navpanes=0'
-            : ''
-        "
-        alt=""
-      />
-    </base-dialog> -->
-    <standard-dialog v-model="standardVisible" :can-resize="'can-resize3'" resize-key="can-resize3"></standard-dialog>
+    <standard-dialog v-model="standardVisible"></standard-dialog>
   </div>
 </template>
 

+ 1 - 2
src/components/shared/StandardDialog.vue

@@ -1,5 +1,5 @@
 <template>
-  <div v-if="visible" v-dialogResizeStandard="'can-resize3'" class="standard-dialog can-resize3">
+  <div v-if="visible" v-dialogResizeStandard="'can-resize-standard'" class="standard-dialog can-resize-standard">
     <div class="standard-head">
       <span>评分标准</span>
       <div class="head-btn-box flex justify-center items-center" @click="closeDialog">
@@ -78,7 +78,6 @@ const formItems = computed<any[]>(() => [
 
 const props = defineProps<{
   modelValue: boolean
-  resizeKey?: string
 }>()
 const visible = useVModel(props)
 const closeDialog = () => {

+ 1 - 1
src/components/shared/message/MessageHistory.vue

@@ -15,7 +15,7 @@
   </div>
   <image-preview
     v-model="previewModalVisible"
-    resize-key="can-resize22"
+    resize-key="can-resize-message-img"
     :url="paperPath"
     :is-big="true"
   ></image-preview>

+ 1 - 1
src/components/shared/message/MessageList.vue

@@ -93,7 +93,7 @@
   </div>
   <image-preview
     v-model="previewModalVisible"
-    resize-key="can-resize22"
+    resize-key="can-resize-message-img"
     :url="paperPath"
     :is-big="true"
   ></image-preview>

+ 1 - 1
src/components/shared/message/MessageSend.vue

@@ -67,7 +67,7 @@
   </div>
   <image-preview
     v-model="previewModalVisible"
-    resize-key="can-resize22"
+    resize-key="can-resize-message-img"
     :url="props.paperPath || ''"
     :is-big="true"
   ></image-preview>

+ 6 - 6
src/directives/customDialogResizeImg.ts

@@ -13,16 +13,16 @@ function resetPosition(key: any) {
 }
 export const localKeyMap: any = {
   positions: {
-    'can-resize2': 'cet-preview-positions',
-    'can-resize22': 'cet-preview2-positions',
+    'can-resize-normal-img': 'cet-preview-positions',
+    'can-resize-message-img': 'cet-preview2-positions',
   },
   resize: {
-    'can-resize2': 'cet-preview-resize',
-    'can-resize22': 'cet-preview2-resize',
+    'can-resize-normal-img': 'cet-preview-resize',
+    'can-resize-message-img': 'cet-preview2-resize',
   },
 }
 
-//试卷预览使用(消息里的试卷预览使用的是can-resize22,配置相分离)
+//试卷预览使用(消息里的试卷预览使用的是can-resize-message-img,配置相分离)
 export const customDialogResizeImg = {
   mounted(el: any, binding: any, vnode: any) {
     const bValue = binding.value
@@ -60,7 +60,7 @@ export const customDialogResizeImg = {
 
     img.onload = function () {
       if (!keyboardResize) {
-        // const compareHeight = bValue === 'can-resize22' ? parseInt(maxHeight * 0.9 + '') : parseInt(maxHeight / 2 + '')
+        // const compareHeight = bValue === 'can-resize-message-img' ? parseInt(maxHeight * 0.9 + '') : parseInt(maxHeight / 2 + '')
         // const ratio = (img.clientWidth + 4) / (img.clientHeight + 48)
         // if (img.clientHeight + 48 > compareHeight) {
         //   const dragDomH = compareHeight

+ 3 - 3
src/directives/dialogResize.ts

@@ -4,11 +4,11 @@ export const dialogResize = {
     const localKeyMap: any = {
       positions: {
         'can-resize': 'cet-keyboard-positions',
-        'can-resize2': 'cet-preview-positions',
+        'can-resize-normal-img': 'cet-preview-positions',
       },
       resize: {
         'can-resize': 'cet-keyboard-resize',
-        'can-resize2': 'cet-preview-resize',
+        'can-resize-normal-img': 'cet-preview-resize',
       },
     }
     const resizeEvent = new CustomEvent('drag-resize', {
@@ -18,7 +18,7 @@ export const dialogResize = {
     // 初始化不最大化
     el.fullscreen = false
     // 弹框可拉伸最小宽高
-    const minWidth = binding.value === 'can-resize2' ? 290 : 336
+    const minWidth = binding.value === 'can-resize-normal-img' ? 290 : 336
     const minHeight = 290
     // 当前宽高
     const nowWidth = minWidth

+ 0 - 288
src/directives/dialogResizeImg.ts

@@ -1,288 +0,0 @@
-export const dialogResizeImg = {
-  mounted(el: any, binding: any, vnode: any) {
-    const bValue = binding.value
-    const localKeyMap: any = {
-      positions: {
-        'can-resize2': 'cet-preview-positions',
-        'can-resize22': 'cet-preview2-positions',
-      },
-      resize: {
-        'can-resize2': 'cet-preview-resize',
-        'can-resize22': 'cet-preview2-resize',
-      },
-    }
-    const resizeEvent = new CustomEvent('drag-resize', {
-      detail: '尺寸变化',
-      bubbles: false,
-    })
-    const keyboardPositions = localStorage.getItem(localKeyMap.positions[bValue])
-    const keyboardResize = localStorage.getItem(localKeyMap.resize[bValue])
-    // 初始化不最大化
-    el.fullscreen = false
-    // 弹框可拉伸最小宽高
-    const minWidth = 290
-    const maxHeight = window.innerHeight
-
-    // 弹窗
-    const dragDom: any = document.querySelector('.' + binding.value)
-    const dialogHeaderEl = dragDom.querySelector('.el-dialog__header')
-    const img = dragDom.querySelector('.small-img')
-    let imgError = false
-    const resizeEl = document.createElement('div')
-
-    if (!img.src) {
-      dragDom.style.width = minWidth + 'px'
-      dragDom.style.height = minWidth + 'px'
-    }
-
-    img.onload = function () {
-      // dragDom.style.width = img.clientWidth + 'px'
-      if (!keyboardResize) {
-        const compareHeight = bValue === 'can-resize22' ? parseInt(maxHeight * 0.97 + '') : parseInt(maxHeight / 2 + '')
-        console.log('compareHeight:', compareHeight)
-        console.log('img.clientHeight:', img.clientHeight)
-        const ratio = (img.clientWidth + 4) / (img.clientHeight + 48)
-        if (img.clientHeight + 48 > compareHeight) {
-          const dragDomH = compareHeight
-          // dragDom.style.height = dragDomH + 'px'
-          dragDom.style.width = dragDomH * ratio + 'px'
-          console.log('dragDom.style.width:', dragDom.style.width)
-        }
-      }
-    }
-    img.onerror = function () {
-      dragDom.style.width = minWidth + 'px'
-      dragDom.style.height = minWidth + 'px'
-      imgError = true
-      resizeEl.style.display = 'none'
-    }
-
-    // console.log('img', getComputedStyle(img).width)
-
-    el.style.overflow = 'initial'
-    dragDom.className += ' el-drag-dialog'
-    // 给弹窗加上overflow auto;不然缩小时框内的标签可能超出dialog;
-    // dragDom.style.overflow = 'auto'
-    dragDom.style.background = '#fff'
-
-    if (keyboardPositions && !!img.src) {
-      dragDom.style.left = JSON.parse(keyboardPositions).left || 0
-      dragDom.style.top = JSON.parse(keyboardPositions).top || 0
-    }
-    if (keyboardResize && !!img.src) {
-      const localW = JSON.parse(keyboardResize).width
-      const localH = JSON.parse(keyboardResize).height
-      localW && (dragDom.style.width = localW)
-      localH && (dragDom.style.height = localH)
-      //   dragDom.style.width = JSON.parse(keyboardResize).width || 'auto'
-      //   dragDom.style.height = JSON.parse(keyboardResize).height || 'auto'
-    } else {
-      //   dragDom.style.height = maxHeight / 2 + 'px'
-      // dragDom.style.width = '290px'
-    }
-
-    // 清除选择头部文字效果
-    // eslint-disable-next-line no-new-func
-    dialogHeaderEl.onselectstart = new Function('return false')
-    // 头部加上可拖动cursor
-    dialogHeaderEl.style.cursor = 'move'
-
-    // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
-    const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
-
-    // 头部插入最大化最小化元素
-    const maxMin = document.createElement('button')
-    maxMin.className += ' el-dialog__headerbtn el-dialog__minmax'
-    maxMin.style.right = '40px'
-    maxMin.style.color = '#ffffff'
-    maxMin.title = el.fullscreen ? '还原' : '最大化'
-    maxMin.innerHTML =
-      '<i class=' +
-      (el.fullscreen ? '"el-icon-crop"' : '"el-icon-full-screen"') +
-      ' onMouseOver="this.style.color=\'#409EFF\'" onMouseOut="this.style.color=\'inherit\'"></i>'
-    // dialogHeaderEl.insertBefore(maxMin, dialogHeaderEl.childNodes[1])
-    const moveDown = (e: any) => {
-      // 鼠标按下,计算当前元素距离可视区的距离
-      const disX = e.clientX - dialogHeaderEl.offsetLeft
-      const disY = e.clientY - dialogHeaderEl.offsetTop
-
-      // 获取到的值带px 正则匹配替换
-      let styL: any, styT: any
-
-      // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
-      if (sty.left.includes('%')) {
-        styL = +document.body.clientWidth * (+sty.left.replace(/\\%/g, '') / 100)
-        styT = +document.body.clientHeight * (+sty.top.replace(/\\%/g, '') / 100)
-      } else {
-        styL = +sty.left.replace(/\px/g, '')
-        styT = +sty.top.replace(/\px/g, '')
-      }
-
-      document.onmousemove = function (e) {
-        // 通过事件委托,计算移动的距离
-        const l = e.clientX - disX
-        const t = e.clientY - disY
-
-        // 移动当前元素
-        dragDom.style.left = `${l + styL}px`
-        dragDom.style.top = `${t + styT}px`
-
-        // 将此时的位置传出去
-        // binding.value({x:e.pageX,y:e.pageY})
-      }
-
-      document.onmouseup = function (e) {
-        document.onmousemove = null
-        document.onmouseup = null
-        console.log('dragDom.style.left:', dragDom.style.left, dragDom.style.top)
-        if (!imgError && !!img.src) {
-          localStorage.setItem(
-            localKeyMap.positions[bValue],
-            JSON.stringify({
-              left: dragDom.style.left || 0,
-              top: dragDom.style.top || 0,
-            })
-          )
-        }
-      }
-    }
-    dialogHeaderEl.onmousedown = moveDown
-    // const bodyHeight = 'auto'
-
-    // function setMaxMin() {
-    //   if (el.fullscreen) {
-    //     const i: any = maxMin.querySelector('.el-icon-crop')
-    //     i.classList.remove('el-icon-crop')
-    //     i.classList.add('el-icon-full-screen')
-    //     maxMin.innerHTML = '<i class="el-icon-full-screen"></i>'
-    //     maxMin.title = '最大化'
-    //     dragDom.style.height = nowHight + 'px'
-    //     dragDom.style.width = nowWidth + 'px'
-    //     dragDom.style.marginTop = window.innerHeight * 0.07 + 'px'
-    //     el.fullscreen = false
-    //     dialogHeaderEl.style.cursor = 'move'
-    //     dialogHeaderEl.onmousedown = moveDown
-    //     dragDom.querySelector('.el-dialog__body').style.height = bodyHeight
-    //     hasSetBodyHight = false
-    //   } else {
-    //     const i: any = maxMin.querySelector('.el-icon-full-screen')
-    //     i.classList.remove('el-icon-full-screen')
-    //     i.classList.add('el-icon-crop')
-    //     maxMin.title = '还原'
-    //     bodyHeight = dragDom.querySelector('.el-dialog__body').offsetHeight + 'px'
-    //     nowHight = dragDom.clientHeight
-    //     nowWidth = dragDom.clientWidth
-    //     nowMarginTop = dragDom.style.marginTop
-    //     dragDom.style.left = 0
-    //     dragDom.style.top = 0
-    //     dragDom.style.height = window.innerHeight + 'px'
-    //     dragDom.style.width = '100VW'
-    //     dragDom.style.marginTop = 0
-    //     el.fullscreen = true
-    //     dialogHeaderEl.style.cursor = 'initial'
-    //     dialogHeaderEl.onmousedown = null
-    //     if (!hasSetBodyHight) {
-    //       const footerHeight =
-    //         dragDom.querySelector('.el-dialog__footer') && dragDom.querySelector('.el-dialog__footer').offsetHeight
-    //       dragDom.querySelector('.el-dialog__body').style.height =
-    //         'calc(100% - ' + (dialogHeaderEl.offsetHeight + footerHeight) + 'px)'
-    //       /*          dragDom.querySelector('.el-dialog__body').style.height =
-    //           window.innerHeight*0.9
-    //            - (dialogHeaderEl.offsetHeight + footerHeight) + 'px'*/
-    //       hasSetBodyHight = true
-    //     }
-    //   }
-    //   el.dispatchEvent(resizeEvent)
-    // }
-
-    // 点击放大缩小效果
-    // maxMin.onclick = setMaxMin
-    // 双击头部效果
-    // dialogHeaderEl.ondblclick = setMaxMin
-    // 拉伸
-    dragDom.appendChild(resizeEl)
-    // 在弹窗右下角加上一个10-10px的控制块
-    resizeEl.style.cursor = 'se-resize'
-    resizeEl.style.position = 'absolute'
-    resizeEl.style.height = '10px'
-    resizeEl.style.width = '10px'
-    resizeEl.style.border = '3px solid transparent'
-    resizeEl.style.borderRightColor = '#333'
-    resizeEl.style.borderBottomColor = '#333'
-    resizeEl.style.right = '0px'
-    resizeEl.style.bottom = '0px'
-    resizeEl.style.zIndex = '99'
-    // 鼠标拉伸弹窗
-    if (!img.src) {
-      resizeEl.style.display = 'none'
-    }
-
-    resizeEl.onmousedown = (e) => {
-      // 记录初始x位置
-      const clientX = e.clientX
-      // 鼠标按下,计算当前元素距离可视区的距离
-      const disX = e.clientX - resizeEl.offsetLeft
-      const disY = e.clientY - resizeEl.offsetTop
-      //   let maxClientY = 0
-      //   if (dragDom.style.width) {
-      //     dragDom.style.width = dragDom.style.width - 2
-      //   }
-      let maxWW = 0
-      document.onmousemove = function (e) {
-        e.preventDefault() // 移动时禁用默认事件
-        // 通过事件委托,计算移动的距离
-        const x = e.clientX - disX + (e.clientX - clientX) // 这里 由于elementUI的dialog控制居中的,所以水平拉伸效果是双倍
-        const y = e.clientY - disY
-
-        // console.log('e.clientY:', e.clientY, maxClientY)
-
-        // if (e.clientY > maxClientY && maxClientY > 0) {
-        //   return false
-        // }
-        // if (dragDom.clientHeight >= maxHeight && maxClientY == 0) {
-        //   maxClientY = e.clientY
-        //   console.log('maxClientY:', maxClientY)
-        //   //   return false
-        // }
-        if (dragDom.clientHeight >= maxHeight && maxWW == 0) {
-          maxWW = dragDom.clientWidth
-        }
-        // 比较是否小于最小宽高
-        if (x > maxWW && maxWW > 0) {
-          return
-        }
-        dragDom.style.width = x > minWidth ? `${x}px` : minWidth + 'px'
-        // if (dragDom.clientHeight >= maxHeight && maxClientY == 0) {
-        //   console.log('到了')
-        //   maxClientY = e.clientY
-        // }
-        // dragDom.style.height = y > minHeight ? `${y}px` : minHeight + 'px'
-        // dragDom.style.width = `${x}px`
-        // dragDom.style.height = `${y}px`
-        // if (!hasSetBodyHight) {
-        //   const footerHeight =
-        //     dragDom.querySelector('.el-dialog__footer') && dragDom.querySelector('.el-dialog__footer').offsetHeight
-        //   dragDom.querySelector('.el-dialog__body').style.height =
-        //     'calc(100% - ' + (dialogHeaderEl.offsetHeight + footerHeight) + 'px)'
-        //   hasSetBodyHight = true
-        // }
-      }
-      // 拉伸结束
-      document.onmouseup = function (e) {
-        document.onmousemove = null
-        document.onmouseup = null
-        if (!imgError && !!img.src) {
-          localStorage.setItem(
-            localKeyMap.resize[bValue],
-            JSON.stringify({
-              width: dragDom.style.width || 'auto',
-              height: dragDom.style.height || 'auto',
-            })
-          )
-        }
-
-        el.dispatchEvent(resizeEvent)
-      }
-    }
-  },
-}

+ 2 - 2
src/directives/dialogResizeStandard.ts

@@ -16,10 +16,10 @@ export const dialogResizeStandard = {
     const bValue = binding.value
     const localKeyMap: any = {
       positions: {
-        'can-resize3': 'cet-standard-positions',
+        'can-resize-standard': 'cet-standard-positions',
       },
       resize: {
-        'can-resize3': 'cet-standard-resize',
+        'can-resize-standard': 'cet-standard-resize',
       },
     }
     const resizeEvent = new CustomEvent('drag-resize', {

+ 3 - 5
src/directives/index.ts

@@ -1,5 +1,4 @@
 import { dialogResize } from './dialogResize'
-import { dialogResizeImg } from './dialogResizeImg'
 import { dialogResizeStandard } from './dialogResizeStandard'
 import { customDialogResizeImg } from './customDialogResizeImg'
 import { dragDialog } from './dragDialog'
@@ -7,9 +6,8 @@ import { permBtn } from './permBtn'
 
 export function setupDirectives(app: any) {
   app.directive('dialogResize', dialogResize) //消息框
-  app.directive('dialogResizeImg', dialogResizeImg)
   app.directive('customDialogResizeImg', customDialogResizeImg) //试卷预览
-  app.directive('dialogResizeStandard', dialogResizeStandard)
-  app.directive('dragDialog', dragDialog)
-  app.directive('permBtn', permBtn)
+  app.directive('dialogResizeStandard', dialogResizeStandard) //给分标准弹框使用
+  app.directive('dragDialog', dragDialog) //消息框弹框使用
+  app.directive('permBtn', permBtn) //权限按钮
 }

+ 12 - 53
src/hooks/useOptions.ts

@@ -30,9 +30,6 @@ const useOptions = (
   showAllLabel = true
 ) => {
   const mainStore = useMainStore()
-  const isChooseAllOptionMap = reactive<any>({
-    question: false,
-  })
 
   const userInfo = computed(() => {
     return mainStore?.myUserInfo
@@ -74,23 +71,22 @@ const useOptions = (
     return (v: DataModel[T]) => {
       console.log('changeModelValue', key, v)
       // dataModel[key] = v
-
       if (multGroup && showAllLabel && key === 'group') {
         if (v.includes(undefined)) {
           if (dataModel[key]?.length === groupListWithAll.value.length) {
+            //说明了原本是全选状态,取消勾选了某个不是“全部”的选项
             dataModel[key] = v.filter((item: any) => !!item)
           } else {
+            //说明原本是非全选状态,而点击后包含了“全部”选项, 那么就触发全部勾选逻辑
             dataModel[key] = groupListWithAll.value.map((item: any) => item.value)
           }
         } else {
-          console.log(v, dataModel[key])
-          if (
-            !v.includes(undefined) &&
-            v?.length === groupListWithAll.value.length - 1 &&
-            dataModel[key]?.includes(undefined)
-          ) {
+          if (v?.length === groupListWithAll.value.length - 1 && dataModel[key]?.includes(undefined)) {
             //说明在全部勾选的情况下,点了“全部”,则要全部取消勾选;
             dataModel[key] = []
+          } else if (v?.length === groupListWithAll.value.length - 1) {
+            //说明了在没有点击“全部”的情况下,逐步勾选完了除了“全部”以外的所有选项,那么就要出发全部勾选逻辑,同时给“全部”自动加上勾选
+            dataModel[key] = groupListWithAll.value.map((item: any) => item.value)
           } else {
             dataModel[key] = v.filter((item: any) => !!item)
           }
@@ -198,10 +194,6 @@ const useOptions = (
             : []
           : userInfo.value.markingGroupNumber
       }
-      // if (isExpert.value || isLeader.value) {
-      //   dataModel.question = void 0
-      //   isChooseAllOptionMap.question = true
-      // }
     },
     { immediate: true }
   )
@@ -222,14 +214,10 @@ const useOptions = (
   )
 
   const watchQuestionHandle = () => {
-    isChooseAllOptionMap.question = !dataModel.question
     if (types.includes('group') && dataModel.subject && dataModel.question) {
       // resetGroupList()
       // changeModelValue('group')(void 0)
       getQuestionGroupList({ subjectCode: dataModel.subject, mainNumber: dataModel.question }).then((res: any) => {
-        // if (!userInfo.value?.markingGroupNumber && res && res[0]) {
-        //   changeModelValue('group')(res[0])
-        // }
         changeModelValue('group')(
           multGroup && showAllLabel
             ? groupList.value?.length && (isAdmin.value || isChief.value || isExpert.value || isLeader.value)
@@ -245,23 +233,6 @@ const useOptions = (
     () => dataModel.question,
     () => {
       watchQuestionHandle()
-      // isChooseAllOptionMap.question = !dataModel.question
-      // if (types.includes('group') && dataModel.subject && dataModel.question) {
-      //   // resetGroupList()
-      //   // changeModelValue('group')(void 0)
-      //   getQuestionGroupList({ subjectCode: dataModel.subject, mainNumber: dataModel.question }).then((res: any) => {
-      //     // if (!userInfo.value?.markingGroupNumber && res && res[0]) {
-      //     //   changeModelValue('group')(res[0])
-      //     // }
-      //     changeModelValue('group')(
-      //       multGroup && showAllLabel
-      //         ? groupList.value?.length && (isAdmin.value || isChief.value || isExpert.value || isLeader.value)
-      //           ? [void 0]
-      //           : []
-      //         : void 0
-      //     )
-      //   })
-      // }
     },
     { immediate: true }
   )
@@ -327,24 +298,12 @@ const useOptions = (
     [dataModel, isAdmin, isChief],
     () => {
       if (
-        types.every(
-          // (t) =>
-          //   dataModel[t] ||
-          //   (!dataModel[t] && isChooseAllOptionMap[t]) ||
-          //   (t === 'group' && (isAdmin.value || isChief.value))
-          // (t) => dataModel[t] || (t === 'group' && (isAdmin.value || isChief.value))
-
-          (t) => {
-            // console.log(
-            //   Array.isArray(dataModel[t]) ? dataModel[t].length > 0 : !!dataModel[t],
-            //   t === 'group' && (isAdmin.value || isChief.value || isExpert.value || isLeader.value)
-            // )
-            return (
-              (Array.isArray(dataModel[t]) ? dataModel[t].length > 0 : !!dataModel[t]) ||
-              (t === 'group' && (isAdmin.value || isChief.value || isExpert.value || isLeader.value))
-            )
-          }
-        )
+        types.every((t) => {
+          return (
+            (Array.isArray(dataModel[t]) ? dataModel[t].length > 0 : !!dataModel[t]) ||
+            (t === 'group' && (isAdmin.value || isChief.value || isExpert.value || isLeader.value))
+          )
+        })
       ) {
         nextTick(() => {
           initCallbacks.forEach((cb) => cb(dataModel))

+ 0 - 1
src/layout/PauseMarker.vue

@@ -11,7 +11,6 @@
         </el-form-item> -->
       </el-form>
     </div>
-    <!-- <standard-dialog v-model="standardVisible" :can-resize="'can-resize3'" resize-key="can-resize3"></standard-dialog> -->
     <el-progress type="circle" :percentage="percentage" class="progress" :width="80">
       <span style="color: #fff; font-size: 16px">{{ remainTime }}</span>
     </el-progress>