刘洋 2 năm trước cách đây
mục cha
commit
481a60e32c

+ 2 - 2
server.config.ts

@@ -4,10 +4,10 @@ const server: ServerOptions = {
   proxy: {
     '^/?(api|file)/': {
       // target: 'http://192.168.10.41:8200',
-      // target: 'http://192.168.10.178: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',
     },
   },

BIN
src/assets/images/append_import.png


BIN
src/assets/images/clear_import.png


BIN
src/assets/images/cur_import_method.png


+ 3 - 0
src/assets/styles/app.scss

@@ -151,4 +151,7 @@ img {
   //     margin-top:3px;
   //   }
   // }
+}
+span.preview{
+  z-index:1;
 }

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

@@ -44,7 +44,15 @@
       :modal="false"
     >
       <div id="my-iframe-mask"></div>
-      <iframe style="width: 100%; height: 100%; prevent-events: pointer" :src="standardRes?.url" alt="" />
+      <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>
   </div>
 </template>

+ 9 - 1
src/directives/dialogResizeImg.ts

@@ -28,6 +28,11 @@ export const dialogResizeImg = {
     const dialogHeaderEl = dragDom.querySelector('.el-dialog__header')
     const img = dragDom.querySelector('.small-img')
 
+    if (!img.src) {
+      dragDom.style.width = minWidth + 'px'
+      dragDom.style.height = minWidth + 'px'
+    }
+
     img.onload = function () {
       // dragDom.style.width = img.clientWidth + 'px'
       if (!keyboardResize) {
@@ -59,7 +64,7 @@ export const dialogResizeImg = {
       dragDom.style.left = JSON.parse(keyboardPositions).left || 0
       dragDom.style.top = JSON.parse(keyboardPositions).top || 0
     }
-    if (keyboardResize) {
+    if (keyboardResize && !!img.src) {
       const localW = JSON.parse(keyboardResize).width
       const localH = JSON.parse(keyboardResize).height
       localW && (dragDom.style.width = localW)
@@ -202,6 +207,9 @@ export const dialogResizeImg = {
     resizeEl.style.bottom = '0px'
     resizeEl.style.zIndex = '99'
     // 鼠标拉伸弹窗
+    if (!img.src) {
+      resizeEl.style.display = 'none'
+    }
 
     resizeEl.onmousedown = (e) => {
       // 记录初始x位置

+ 1 - 1
src/directives/dialogResizeStandard.ts

@@ -44,7 +44,7 @@ export const dialogResizeStandard = {
       localH && (dragDom.style.height = localH)
     } else {
       dragDom.style.height = minHeight + 100 + 'px'
-      dragDom.style.width = '800px'
+      dragDom.style.width = '700px'
     }
 
     // 清除选择头部文字效果

+ 3 - 1
src/layout/LockScreen.vue

@@ -54,7 +54,9 @@ const submit = async () => {
   useFetch('unLockScreen')
     .fetch({ password: form.pwd })
     .then((res) => {
-      mainStore.setLockScreen(false)
+      if (typeof res !== 'undefined') {
+        mainStore.setLockScreen(false)
+      }
     })
   //   await formEl.validate((valid: any, fields: any) => {
   //     console.log(valid, fields)

+ 107 - 0
src/modules/admin-data/paper/components/importMethod.vue

@@ -0,0 +1,107 @@
+<template>
+  <base-dialog v-model="modalVisible" title="选择导入方式" destroy-on-close :width="400">
+    <div class="method-box flex justify-around items-center">
+      <div class="method" :class="{ active: !clear }" @click="setClear(false)">
+        <img class="icon-img" src="../../../../assets/images/append_import.png" />
+        <p>追加导入</p>
+        <img src="../../../../assets/images/cur_import_method.png" class="cur" />
+      </div>
+      <div v-if="checkStatus === 'CHOOSE'" class="method" :class="{ active: !!clear }" @click="setClear(true)">
+        <img class="icon-img" src="../../../../assets/images/clear_import.png" />
+        <p>清空导入</p>
+        <img src="../../../../assets/images/cur_import_method.png" class="cur" />
+      </div>
+    </div>
+    <div class="flex items-center tip">
+      <el-icon style="color: #ce372e; font-size: 16px"><warning-filled /></el-icon>
+      <span>已有数据,是否继续导入?</span>
+    </div>
+    <template #footer>
+      <div class="flex justify-end">
+        <confirm-button @confirm="sureImport" @cancel="cancelImport"></confirm-button>
+      </div>
+    </template>
+
+    <!-- </base-form> -->
+  </base-dialog>
+</template>
+<script setup lang="ts">
+import { ElIcon } from 'element-plus'
+import BaseDialog from '@/components/element/BaseDialog.vue'
+import ConfirmButton from '@/components/common/ConfirmButton.vue'
+import { WarningFilled } from '@element-plus/icons-vue'
+import useVModel from '@/hooks/useVModel'
+const emits = defineEmits(['sure', 'cancel'])
+const props = withDefaults(
+  defineProps<{
+    visible?: boolean
+    checkStatus?: string
+    clear?: boolean
+  }>(),
+  {
+    visible: false,
+    checkStatus: '',
+    clear: false,
+  }
+)
+const modalVisible = useVModel(props, 'visible')
+const clear = useVModel(props, 'clear')
+const setClear = (bool: boolean) => {
+  clear.value = bool
+}
+const cancelImport = () => {
+  modalVisible.value = false
+}
+const sureImport = () => {
+  emits('sure')
+}
+</script>
+<style lang="scss" scoped>
+.tip {
+  color: #666;
+  font-size: 12px;
+  margin-top: 15px;
+  span {
+    margin-left: 4px;
+  }
+}
+.method-box {
+  .method {
+    width: 165px;
+    height: 96px;
+    background: #f5f5f5;
+    border-radius: 4px;
+    border: 2px solid #f5f5f5;
+    cursor: pointer;
+    text-align: center;
+    padding-top: 20px;
+    position: relative;
+    transition: all 0.3s;
+    .cur {
+      display: none;
+      position: absolute;
+      right: -2px;
+      top: -2px;
+      z-index: 1;
+      width: 26px;
+      height: 26px;
+    }
+    .icon-img {
+      width: 28px;
+    }
+    p {
+      color: #333;
+      font-size: 14px;
+      font-weight: bold;
+      margin-top: 4px;
+    }
+    &.active {
+      border: 2px solid #0064ff;
+      background-color: #fff;
+      .cur {
+        display: block;
+      }
+    }
+  }
+}
+</style>

+ 13 - 24
src/modules/admin-data/paper/components/rf.vue

@@ -41,21 +41,12 @@
       <el-button type="primary" :loading="loading" @click="onSubmit">确定导入</el-button>
     </el-form-item>
   </base-form>
-  <base-dialog v-model="importMethodVisible" title="选择导入方式" destroy-on-close :width="350">
-    <!-- <base-form ref="formRef" :model="model" :items="items" :rules="rules" :label-width="useVW(72)"> -->
-    <div style="color: red; font-size: 14px">已有数据,是否继续导入?</div>
-    <el-radio-group v-model="clearMethod" size="large" style="text-align: center">
-      <el-radio label="追加导入" />
-      <el-radio v-if="curCheckStatus === 'CHOOSE'" label="清空导入" />
-    </el-radio-group>
-    <template #footer>
-      <div class="flex justify-end">
-        <confirm-button @confirm="sureImport" @cancel="cancelImport"></confirm-button>
-      </div>
-    </template>
-
-    <!-- </base-form> -->
-  </base-dialog>
+  <import-method
+    v-model:visible="importMethodVisible"
+    v-model:clear="clear"
+    :check-status="curCheckStatus"
+    @sure="sureImport"
+  ></import-method>
 </template>
 
 <script setup lang="ts" name="ImportRF">
@@ -68,9 +59,7 @@ import useForm from '@/hooks/useForm'
 import useOptions from '@/hooks/useOptions'
 import useUploadFile from '@/hooks/useUploadFile'
 import useVW from '@/hooks/useVW'
-import BaseDialog from '@/components/element/BaseDialog.vue'
-import ConfirmButton from '@/components/common/ConfirmButton.vue'
-
+import ImportMethod from './importMethod.vue'
 import type { FormGroup, EpFormItem, EpFormRules } from 'global-type'
 import type { ExtractApiParams } from '@/api/api'
 
@@ -187,17 +176,17 @@ const items = computed<EpFormItem[]>(() => {
   ]
 })
 
-const clearMethod = ref('追加导入')
+// const clearMethod = ref('追加导入')
 const importMethodVisible = ref(false)
 const curCheckStatus = ref('')
 const clear = ref(false)
 const sureImport = () => {
-  clear.value = clearMethod.value === '清空导入'
+  // clear.value = clearMethod.value === '清空导入'
   submitHandler()
 }
-const cancelImport = () => {
-  importMethodVisible.value = false
-}
+// const cancelImport = () => {
+//   importMethodVisible.value = false
+// }
 const submitHandler = async () => {
   showProgress.value = true
   setPercentage(0)
@@ -219,7 +208,7 @@ async function onSubmit() {
       })
       console.log('checkRes:', checkRes)
       curCheckStatus.value = checkRes
-      clearMethod.value = '追加导入'
+      // clearMethod.value = '追加导入'
       clear.value = false
       if (checkRes === 'CHOOSE' || checkRes === 'APPEND') {
         importMethodVisible.value = true

+ 13 - 23
src/modules/admin-data/paper/components/sample.vue

@@ -41,21 +41,12 @@
       <el-button type="primary" :loading="loading" @click="onSubmit">确定导入</el-button>
     </el-form-item>
   </base-form>
-  <base-dialog v-model="importMethodVisible" title="选择导入方式" destroy-on-close :width="350">
-    <!-- <base-form ref="formRef" :model="model" :items="items" :rules="rules" :label-width="useVW(72)"> -->
-    <div style="color: red; font-size: 14px">已有数据,是否继续导入?</div>
-    <el-radio-group v-model="clearMethod" size="large" style="text-align: center">
-      <el-radio label="追加导入" />
-      <el-radio v-if="curCheckStatus === 'CHOOSE'" label="清空导入" />
-    </el-radio-group>
-    <template #footer>
-      <div class="flex justify-end">
-        <confirm-button @confirm="sureImport" @cancel="cancelImport"></confirm-button>
-      </div>
-    </template>
-
-    <!-- </base-form> -->
-  </base-dialog>
+  <import-method
+    v-model:visible="importMethodVisible"
+    v-model:clear="clear"
+    :check-status="curCheckStatus"
+    @sure="sureImport"
+  ></import-method>
 </template>
 
 <script setup lang="ts" name="ImportSample">
@@ -68,8 +59,7 @@ import useForm from '@/hooks/useForm'
 import useOptions from '@/hooks/useOptions'
 import useUploadFile from '@/hooks/useUploadFile'
 import useVW from '@/hooks/useVW'
-import BaseDialog from '@/components/element/BaseDialog.vue'
-import ConfirmButton from '@/components/common/ConfirmButton.vue'
+import ImportMethod from './importMethod.vue'
 
 import type { FormGroup, EpFormItem, EpFormRules } from 'global-type'
 import type { ExtractApiParams } from '@/api/api'
@@ -203,17 +193,17 @@ const items = computed<EpFormItem[]>(() => {
   ]
 })
 
-const clearMethod = ref('追加导入')
+// const clearMethod = ref('追加导入')
 const importMethodVisible = ref(false)
 const curCheckStatus = ref('')
 const clear = ref(false)
 const sureImport = () => {
-  clear.value = clearMethod.value === '清空导入'
+  // clear.value = clearMethod.value === '清空导入'
   submitHandler()
 }
-const cancelImport = () => {
-  importMethodVisible.value = false
-}
+// const cancelImport = () => {
+//   importMethodVisible.value = false
+// }
 const submitHandler = async () => {
   showProgress.value = true
   setPercentage(0)
@@ -235,7 +225,7 @@ async function onSubmit() {
       })
       console.log('checkRes:', checkRes)
       curCheckStatus.value = checkRes
-      clearMethod.value = '追加导入'
+      // clearMethod.value = '追加导入'
       clear.value = false
       if (checkRes === 'CHOOSE' || checkRes === 'APPEND') {
         importMethodVisible.value = true