刘洋 vor 2 Jahren
Ursprung
Commit
0128b965f2

+ 2 - 2
server.config.ts

@@ -3,11 +3,11 @@ import type { ServerOptions } from 'vite'
 const server: ServerOptions = {
   proxy: {
     '^/?(api|file)/': {
-      // target: 'http://192.168.10.41:8200',
+      target: 'http://192.168.10.41:8200',
       // target: 'http://192.168.10.178:8200',
       // target: 'http://192.168.10.107:8200',
       // target: 'http://cet-test.markingtool.cn',
-      target: 'http://192.168.10.136:80',
+      // target: 'http://192.168.10.136:80',
       // target: 'http://cet-dev.markingtool.cn:8200',
     },
   },

+ 29 - 27
src/components/shared/MarkHeader.vue

@@ -34,7 +34,7 @@
       </div> -->
     </div>
 
-    <base-dialog
+    <!-- <base-dialog
       v-model="standardVisible"
       class="standard-dialog"
       :can-resize="'can-resize3'"
@@ -53,7 +53,8 @@
         "
         alt=""
       />
-    </base-dialog>
+    </base-dialog> -->
+    <standard-dialog v-model="standardVisible" :can-resize="'can-resize3'" resize-key="can-resize3"></standard-dialog>
   </div>
 </template>
 
@@ -70,9 +71,10 @@ import { ElIcon, ElMessage } from 'element-plus'
 import { Close } from '@element-plus/icons-vue'
 import { logout } from '@/utils/shared'
 import { sessionStorage } from '@/plugins/storage'
-import useFetch from '@/hooks/useFetch'
+// import useFetch from '@/hooks/useFetch'
 import BaseDialog from '@/components/element/BaseDialog.vue'
 import LockEntry from '../common/LockEntry.vue'
+import StandardDialog from '@/components/shared/StandardDialog.vue'
 type ButtonType =
   | 'back'
   | 'scale-up'
@@ -316,8 +318,6 @@ const willLogout = async () => {
 //     })
 //   }
 // })
-const { fetch: fetchStandard, result: standardRes } = useFetch('getMarkingStandard')
-fetchStandard()
 </script>
 
 <style scoped lang="scss">
@@ -400,27 +400,29 @@ fetchStandard()
   }
 }
 </style>
+//
 <style lang="scss">
-.standard-dialog {
-  display: flex;
-  flex-direction: column;
-  .el-dialog__body {
-    flex: 1;
-    padding: 2px !important;
-    position: relative;
-    max-height: 150vh !important;
-  }
-  .el-dialog__footer {
-    padding: 0 !important;
-  }
-  #my-iframe-mask {
-    position: absolute;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    top: 0;
-    z-index: 10;
-    display: none;
-  }
-}
+// .standard-dialog {
+//   display: flex;
+//   flex-direction: column;
+//   .el-dialog__body {
+//     flex: 1;
+//     padding: 2px !important;
+//     position: relative;
+//     max-height: 150vh !important;
+//   }
+//   .el-dialog__footer {
+//     padding: 0 !important;
+//   }
+//   #my-iframe-mask {
+//     position: absolute;
+//     left: 0;
+//     right: 0;
+//     bottom: 0;
+//     top: 0;
+//     z-index: 10;
+//     display: none;
+//   }
+// }
+//
 </style>

+ 98 - 0
src/components/shared/StandardDialog.vue

@@ -0,0 +1,98 @@
+<template>
+  <div
+    v-if="visible"
+    v-dialogResizeStandard="resizeKey ? resizeKey : 'can-resize2'"
+    class="standard-dialog"
+    :class="[resizeKey ? resizeKey : 'can-resize2']"
+  >
+    <div class="standard-head">
+      <span>评分标准</span>
+      <div class="head-btn-box flex justify-center items-center" @click="closeDialog">
+        <el-icon><close /></el-icon>
+      </div>
+    </div>
+    <div class="standard-body">
+      <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=""
+      ></iframe>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts" name="StandardDialog">
+import useVModel from '@/hooks/useVModel'
+import { ref, watch } from 'vue'
+import { Close } from '@element-plus/icons-vue'
+import { ElIcon } from 'element-plus'
+import useFetch from '@/hooks/useFetch'
+
+const showDialog = ref(true)
+
+const props = defineProps<{
+  modelValue: boolean
+  resizeKey?: string
+}>()
+const visible = useVModel(props)
+const closeDialog = () => {
+  visible.value = false
+}
+
+const { fetch: fetchStandard, result: standardRes } = useFetch('getMarkingStandard')
+fetchStandard()
+</script>
+//
+<style scoped lang="scss">
+.standard-dialog {
+  display: flex;
+  flex-direction: column;
+  position: fixed;
+  z-index: 500;
+  border-radius: 6px;
+  box-shadow: 0px 12px 32px 4px rgba(0, 0, 0, 0.04), 0px 8px 20px rgba(0, 0, 0, 0.08);
+  .standard-head {
+    background-color: #f8f8f8;
+    border-radius: 6px 6px 0 0;
+    color: #333;
+    font-size: 14px;
+    height: 44px;
+    line-height: 44px;
+    padding: 0 10px;
+    position: relative;
+    .head-btn-box {
+      position: absolute;
+      right: 0;
+      top: 0;
+      width: 44px;
+      height: 44px;
+      z-index: 1;
+      cursor: pointer;
+      &:hover {
+        :deep(i) {
+          color: $color--primary;
+        }
+      }
+    }
+  }
+  .standard-body {
+    flex: 1;
+    padding: 2px;
+    position: relative;
+    #my-iframe-mask {
+      position: absolute;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      top: 0;
+      z-index: 10;
+      display: none;
+    }
+  }
+}
+</style>

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

@@ -121,7 +121,10 @@ const showSendPaper = computed<boolean>(() => {
 })
 
 const allowSend = computed<boolean>(() => {
-  return !!((messageContent.value && checkedUsers.value?.filter((v) => !!v.id)?.length) || replyUserId.value)
+  return !!(
+    (messageContent.value && checkedUsers.value?.filter((v) => !!v.id)?.length) ||
+    (replyUserId.value && messageContent.value)
+  )
 })
 
 const treeRef = ref<InstanceType<typeof ElTree>>()

+ 2 - 2
src/directives/customDialogResizeImg.ts

@@ -73,8 +73,8 @@ export const customDialogResizeImg = {
     img.onerror = function () {
       dragDom.style.width = minWidth + 'px'
       dragDom.style.height = minWidth + 'px'
-      dragDom.style.left = winWidth / 2 - minWidth / 2
-      dragDom.style.top = winHeight / 2 - minWidth / 2
+      dragDom.style.left = winWidth / 2 - minWidth / 2 + 'px'
+      dragDom.style.top = winHeight / 2 - minWidth / 2 + 'px'
       imgError = true
       resizeEl.style.display = 'none'
     }

+ 35 - 5
src/directives/dialogResizeStandard.ts

@@ -1,3 +1,16 @@
+function resetPosition(key: any) {
+  const keyboardResize = localStorage.getItem(key)
+  if (keyboardResize) {
+    const obj = JSON.parse(keyboardResize)
+    if (parseInt(obj.left) < 0) {
+      obj.left = 0
+    }
+    if (parseInt(obj.top) < 0) {
+      obj.top = 0
+    }
+    localStorage.setItem(key, JSON.stringify(obj))
+  }
+}
 export const dialogResizeStandard = {
   mounted(el: any, binding: any, vnode: any) {
     const bValue = binding.value
@@ -13,16 +26,19 @@ export const dialogResizeStandard = {
       detail: '尺寸变化',
       bubbles: false,
     })
+    resetPosition(localKeyMap.positions[bValue])
+    const keyboardPositions = localStorage.getItem(localKeyMap.positions[bValue])
+    const keyboardResize = localStorage.getItem(localKeyMap.resize[bValue])
     // 初始化不最大化
     el.fullscreen = false
     const winHeight = window.innerHeight
     // 弹框可拉伸最小宽高
     const minWidth = 400
     const minHeight = winHeight / 2
-
+    const winWidth = window.innerWidth
     // 弹窗
     const dragDom: any = document.querySelector('.' + binding.value)
-    const dialogHeaderEl = dragDom.querySelector('.el-dialog__header')
+    const dialogHeaderEl = dragDom.querySelector('.standard-head')
 
     el.style.overflow = 'initial'
     dragDom.className += ' el-drag-dialog'
@@ -30,11 +46,19 @@ export const dialogResizeStandard = {
     // dragDom.style.overflow = 'auto'
     dragDom.style.background = '#fff'
 
-    const keyboardPositions = localStorage.getItem(localKeyMap.positions[bValue])
-    const keyboardResize = localStorage.getItem(localKeyMap.resize[bValue])
     if (keyboardPositions) {
       dragDom.style.left = JSON.parse(keyboardPositions).left || 0
       dragDom.style.top = JSON.parse(keyboardPositions).top || 0
+    } else {
+      if (keyboardResize) {
+        const localW = JSON.parse(keyboardResize).width
+        const localH = JSON.parse(keyboardResize).height
+        dragDom.style.left = winWidth / 2 - localW / 2 + 'px'
+        dragDom.style.top = winHeight / 2 - localH / 2 + 'px'
+      } else {
+        dragDom.style.left = winWidth / 2 - 700 / 2 + 'px'
+        dragDom.style.top = winHeight / 2 - (minHeight + 100) / 2 + 'px'
+      }
     }
 
     if (keyboardResize) {
@@ -66,7 +90,7 @@ export const dialogResizeStandard = {
       '<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])
+    // dialogHeaderEl.insertBefore(maxMin, dialogHeaderEl.childNodes[1])
     const moveDown = (e: any) => {
       // 鼠标按下,计算当前元素距离可视区的距离
       const disX = e.clientX - dialogHeaderEl.offsetLeft
@@ -90,6 +114,12 @@ export const dialogResizeStandard = {
         const t = e.clientY - disY
 
         // 移动当前元素
+        // dragDom.style.left = `${
+        //   l + styL < 0 ? 0 : l + styL > winWidth - dragDom.clientWidth ? winWidth - dragDom.clientWidth : l + styL
+        // }px`
+        // dragDom.style.top = `${
+        //   t + styT < 0 ? 0 : t + styT > winHeight - dragDom.clientHeight ? winHeight - dragDom.clientHeight : t + styT
+        // }px`
         dragDom.style.left = `${l + styL}px`
         dragDom.style.top = `${t + styT}px`
 

+ 2 - 1
src/modules/marking/inquiry-result/index.vue

@@ -268,7 +268,8 @@ const {
 watch(current, () => {
   if (current.value) {
     useFetch('viewCustomQuery').fetch({ taskId: current.value.taskId })
-    modelScore.value = [current.value?.headerScore ?? (current.value?.markerScore || 0)]
+    // modelScore.value = [current.value?.headerScore ?? (current.value?.markerScore || 0)]
+    modelScore.value = current.value?.markScores || []
   }
 })
 

+ 4 - 3
src/modules/monitor/system-check/index.vue

@@ -23,7 +23,7 @@
         <div class="flex-1 p-base scroll-auto mark-content-paper img-wrap">
           <img :src="dataUrl" alt="" class="paper-img" :style="{ 'background-color': frontColor }" />
           <p v-if="currentSystemCheckPaper" class="absolute mark-score">
-            {{ currentSystemCheckPaper.headerScore ?? currentSystemCheckPaper.markScore }}
+            {{ currentSystemCheckPaper.headerScore ?? currentSystemCheckPaper.markerScore }}
           </p>
         </div>
         <!-- <scoring-panel-with-confirm
@@ -269,7 +269,7 @@ const formItems = computed<EpFormItem[]>(() => [
 const columns: EpTableColumn[] = [
   { label: '密号', prop: 'secretNumber', width: 100, fixed: 'left' },
   { label: '评卷员', prop: 'markerName', width: 80 },
-  { label: '评卷员给分', prop: 'markScore', width: 80 },
+  { label: '评卷员给分', prop: 'markerScore', width: 80 },
   { label: '组长给分', prop: 'headerScore', width: 70 },
   // { label: '评卷时间', prop: 'markTime', width: 160 },
   { label: '抽查次数', prop: 'checkCount', width: 70 },
@@ -298,7 +298,8 @@ const {
 watch(currentSystemCheckPaper, () => {
   if (currentSystemCheckPaper.value) {
     useFetch('viewSystemSpotPaper').fetch({ id: currentSystemCheckPaper.value.id })
-    modelScore.value = [currentSystemCheckPaper.value?.headerScore ?? (currentSystemCheckPaper.value?.markScore || 0)]
+    // modelScore.value = [currentSystemCheckPaper.value?.headerScore ?? (currentSystemCheckPaper.value?.markScore || 0)]
+    modelScore.value = currentSystemCheckPaper.value?.markScores || []
   }
 })