yanghao 1 неделя назад
Родитель
Сommit
785ba00863

+ 3 - 0
src/components/mt-dzr/index.vue

@@ -142,6 +142,9 @@ const mt_dzr_vmodel = computed({
 })
 const onMouseDown = (de: MouseTouchEvent) => {
   MtDzrEmits('mousedown', de)
+  if (de.defaultPrevented) {
+    return
+  }
   if (MtDzrProps.lock || MtDzrProps.disabled) {
     return
   }

+ 9 - 1
src/components/mt-edit/components/layout/header-panel/index.vue

@@ -177,7 +177,13 @@
           </el-icon>
         </el-button>
         <el-divider direction="vertical" />
-        <el-button text circle size="small" @click="emits('onSaveClick')">
+        <el-button
+          text
+          circle
+          size="small"
+          :loading="headerPanelProps.saveLoading"
+          :disabled="headerPanelProps.saveLoading"
+          @click="emits('onSaveClick')">
           <el-icon title="保存" :size="20">
             <svg-analysis name="save" />
           </el-icon>
@@ -272,11 +278,13 @@ type HeaderPanelProps = {
   redoEnabled: boolean
   realTimeData: IRealTimeData
   useThumbnail?: boolean
+  saveLoading?: boolean
 }
 const headerPanelProps = withDefaults(defineProps<HeaderPanelProps>(), {
   leftAside: true,
   rightAside: true,
   useThumbnail: false,
+  saveLoading: false,
   selectedItemsId: () => []
 })
 const emits = defineEmits([

+ 30 - 3
src/components/mt-edit/components/layout/main-panel/index.vue

@@ -3,7 +3,9 @@
     <div
       id="mtCanvasArea"
       ref="canvasAreaRef"
-      :class="`canvasArea  ${globalStore.intention == 'runDragCanvas' ? 'cursor-grab' : ''}`"
+      :class="`canvasArea  ${
+        ['beginDragCanvas', 'runDragCanvas'].includes(globalStore.intention) ? 'cursor-grab' : ''
+      }`"
       @drop="onDrop"
       @dragover="onDragOver"
       @touchstart="onDrop($event, true)"
@@ -121,6 +123,7 @@ const canvasAreaRef = ref()
 const selectedAreaRef = ref<InstanceType<typeof SelectedArea>>()
 const dragCanvasRef = ref<InstanceType<typeof DragCanvas>>()
 const dragLineRenderRef = ref<InstanceType<typeof DrawLineRender>>()
+const shortcut_drag_select_item_id = ref('')
 // 是否需要重新计算画布缩放中心点
 const is_need_recal_center = ref(true)
 let is_listen_keydown = false // 是否已经监听了键盘事件
@@ -275,6 +278,11 @@ const onDragOver = (e: DragEvent) => {
 }
 const onRenderCoreMouseDown = (item: IDoneJson, e: MouseEvent) => {
   beginListenerKeyDown()
+  if (isSystemShortcutKey(e)) {
+    shortcut_drag_select_item_id.value = item.lock ? '' : item.id
+    beginDragCanvas(e)
+    return
+  }
   if (globalStore.lock) {
     return
   }
@@ -317,11 +325,15 @@ const onRenderCoreMouseDown = (item: IDoneJson, e: MouseEvent) => {
 }
 const onMouseDown = (e: MouseEvent) => {
   beginListenerKeyDown()
+  if (isSystemShortcutKey(e)) {
+    shortcut_drag_select_item_id.value = ''
+    beginDragCanvas(e)
+    return
+  }
   globalStore.cancelAllSelect()
   // 锁定状态或者右键点击进行画布拖动
   if (globalStore.lock || e.button == 2) {
-    globalStore.setIntention('beginDragCanvas')
-    dragCanvasRef.value?.onMouseDown(e)
+    beginDragCanvas(e)
     return
   }
   if (mainPanelProps.lineAppendEnable) {
@@ -733,6 +745,12 @@ const dragCanvasMouseDown = () => {
   init_drag_offset.x = globalStore.canvasCfg.drag_offset.x
   init_drag_offset.y = globalStore.canvasCfg.drag_offset.y
 }
+const beginDragCanvas = (e: MouseEvent | TouchEvent) => {
+  e.preventDefault()
+  e.stopPropagation()
+  globalStore.setIntention('beginDragCanvas')
+  dragCanvasRef.value?.onMouseDown(e)
+}
 /**
  * 画布拖动移动事件
  * @param move_x
@@ -742,6 +760,7 @@ const dragCanvasMouseMove = (move_x: number, move_y: number) => {
   if (move_x === 0 && move_y === 0) {
     return
   }
+  shortcut_drag_select_item_id.value = ''
   globalStore.setIntention('runDragCanvas')
   // 设置画布偏移
   globalStore.canvasCfg.drag_offset = {
@@ -756,6 +775,14 @@ const dragCanvasMouseUp = () => {
   if (globalStore.intention == 'runDragCanvas') {
     globalStore.setIntention('endDragCanvas')
   } else {
+    if (shortcut_drag_select_item_id.value) {
+      const find_item = globalStore.done_json.find((f) => f.id == shortcut_drag_select_item_id.value)
+      if (find_item) {
+        find_item.active = !find_item.active
+        globalStore.refreshSelectedItemsId()
+      }
+      shortcut_drag_select_item_id.value = ''
+    }
     globalStore.setIntention('none')
   }
 }

+ 4 - 1
src/components/mt-edit/index.vue

@@ -18,6 +18,7 @@
           :redo-enabled="cacheStore.historyIndex < cacheStore.history.length - 1"
           :real-time-data="globalStore.real_time_data"
           :use-thumbnail="mtEidtProps.useThumbnail"
+          :save-loading="mtEidtProps.saveLoading"
           @on-group-click="mainPanelRef?.createGroupItem"
           @on-ungroup-click="mainPanelRef?.onUngroup"
           @on-delete-click="onDeleteClick"
@@ -120,9 +121,11 @@ import { genExportJson, useExportJsonToDoneJson } from './composables'
 import type { IExportJson } from './components/types'
 type MtEditProps = {
   useThumbnail?: boolean
+  saveLoading?: boolean
 }
 const mtEidtProps = withDefaults(defineProps<MtEditProps>(), {
-  useThumbnail: false
+  useThumbnail: false,
+  saveLoading: false
 })
 const emits = defineEmits(['onPreviewClick', 'onReturnClick', 'onSaveClick', 'onThumbnailClick'])
 const slots = useSlots()

+ 0 - 1
src/views/Login/components/QrCodeForm.vue

@@ -88,7 +88,6 @@ const initDingLogin = () => {
     box.querySelector('iframe').style.right = '0'
     box.querySelector('iframe').style.margin = 'auto'
   })
-
   /* new window.DDLogin({
     id: "login_container",
     goto: gotoUrl,

+ 5 - 1
src/views/maotu/edit.vue

@@ -157,10 +157,14 @@ onMounted(() => {
 </script>
 
 <template>
-  <div v-loading="saveLoading" class="w-1/1 h-100vh">
+  <div
+    v-loading="saveLoading"
+    element-loading-text="正在生成缩略图并保存,请稍候"
+    class="w-1/1 h-100vh">
     <mt-edit
       ref="MtEditRef"
       :use-thumbnail="true"
+      :save-loading="saveLoading"
       @on-preview-click="onPreviewClick"
       @on-return-click="onReturnClick"
       @on-save-click="onSaveClick"

+ 18 - 14
src/views/pms/iotrddailyreport/components/NonProductionEfficiency.vue

@@ -52,18 +52,18 @@ let chart: echarts.ECharts | null = null
 const router = useRouter()
 
 const nonProductionTimeFields: [keyof ListItem, string][] = [
-  ['accidentTime', '工程质量'],
-  ['repairTime', '设备故障'],
-  ['selfStopTime', '设备保养'],
-  ['complexityTime', '技术受限'],
-  ['relocationTime', '生产配合'],
-  ['rectificationTime', '生产组织'],
-  ['waitingStopTime', '不可抗力'],
-  ['winterBreakTime', '待命'],
-  ['partyaDesign', '甲方设计'],
-  ['partyaPrepare', '甲方准备'],
-  ['partyaResource', '甲方资源'],
-  ['otherNptTime', '其它']
+  ['accidentTime', '工程质量(H)'],
+  ['repairTime', '设备故障(H)'],
+  ['selfStopTime', '设备保养(H)'],
+  ['complexityTime', '技术受限(H)'],
+  ['relocationTime', '生产配合(H)'],
+  ['rectificationTime', '生产组织(H)'],
+  ['waitingStopTime', '不可抗力(H)'],
+  ['winterBreakTime', '待命(H)'],
+  ['partyaDesign', '甲方设计(H)'],
+  ['partyaPrepare', '甲方准备(H)'],
+  ['partyaResource', '甲方资源(H)'],
+  ['otherNptTime', '其它(H)']
 ]
 
 const getQueryWithoutPage = () => {
@@ -205,7 +205,11 @@ const getPieData = () => {
 }
 
 const getNptFieldPieData = () => {
-  const excludedFields: Array<keyof ListItem> = ['selfStopTime', 'relocationTime', 'winterBreakTime']
+  const excludedFields: Array<keyof ListItem> = [
+    'selfStopTime',
+    'relocationTime',
+    'winterBreakTime'
+  ]
 
   return nonProductionTimeFields
     .filter(([field]) => !excludedFields.includes(field))
@@ -430,7 +434,7 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
             </zm-table-column>
             <zm-table-column
               prop="calendarTime"
-              label="自然时间"
+              label="自然时间(H)"
               min-width="92"
               cover-formatter
               action

+ 25 - 28
src/views/pms/iotrhdailyreport/components/NonProductionEfficiency.vue

@@ -52,18 +52,18 @@ let chart: echarts.ECharts | null = null
 const router = useRouter()
 
 const nonProductionTimeFields: [keyof ListItem, string][] = [
-  ['accidentTime', '工程质量'],
-  ['repairTime', '设备故障'],
-  ['selfStopTime', '设备保养'],
-  ['complexityTime', '技术受限'],
-  ['relocationTime', '生产配合'],
-  ['rectificationTime', '生产组织'],
-  ['waitingStopTime', '不可抗力'],
-  ['winterBreakTime', '待命'],
-  ['partyaDesign', '甲方设计'],
-  ['partyaPrepare', '甲方准备'],
-  ['partyaResource', '甲方资源'],
-  ['otherNptTime', '其它']
+  ['accidentTime', '工程质量(H)'],
+  ['repairTime', '设备故障(H)'],
+  ['selfStopTime', '设备保养(H)'],
+  ['complexityTime', '技术受限(H)'],
+  ['relocationTime', '生产配合(H)'],
+  ['rectificationTime', '生产组织(H)'],
+  ['waitingStopTime', '不可抗力(H)'],
+  ['winterBreakTime', '待命(H)'],
+  ['partyaDesign', '甲方设计(H)'],
+  ['partyaPrepare', '甲方准备(H)'],
+  ['partyaResource', '甲方资源(H)'],
+  ['otherNptTime', '其它(H)']
 ]
 
 const getQueryWithoutPage = () => {
@@ -200,7 +200,11 @@ const getPieData = () => {
 }
 
 const getNptFieldPieData = () => {
-  const excludedFields: Array<keyof ListItem> = ['selfStopTime', 'relocationTime', 'winterBreakTime']
+  const excludedFields: Array<keyof ListItem> = [
+    'selfStopTime',
+    'relocationTime',
+    'winterBreakTime'
+  ]
 
   return nonProductionTimeFields
     .filter(([field]) => !excludedFields.includes(field))
@@ -393,16 +397,14 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
             show-summary
             :summary-method="getSummaries"
             :row-class-name="getClickableRowClassName"
-            @row-click="handleRowClick"
-          >
+            @row-click="handleRowClick">
             <zm-table-column
               prop="name"
               label="队伍"
               min-width="120"
               fixed="left"
               cover-formatter
-              :real-value="formatTeamName"
-            />
+              :real-value="formatTeamName" />
             <zm-table-column
               v-for="[prop, label] in nonProductionTimeFields"
               :key="prop"
@@ -410,40 +412,35 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
               :label="label"
               min-width="92"
               cover-formatter
-              :real-value="(row: ListItem) => formatNumber(row[prop])"
-            />
+              :real-value="(row: ListItem) => formatNumber(row[prop])" />
             <zm-table-column label="npt合计" is-parent>
               <zm-table-column
                 prop="nptTotal"
                 label="时长(H)"
                 min-width="92"
                 cover-formatter
-                :real-value="(row: ListItem) => formatNumber(row.nptTotal)"
-              />
+                :real-value="(row: ListItem) => formatNumber(row.nptTotal)" />
               <zm-table-column
                 prop="nptRate"
                 label="占比"
                 min-width="92"
                 cover-formatter
-                :real-value="formatRate"
-              />
+                :real-value="formatRate" />
             </zm-table-column>
             <zm-table-column
               prop="calendarTime"
-              label="自然时间"
+              label="自然时间(H)"
               min-width="92"
               cover-formatter
               action
-              :real-value="(row: ListItem) => formatNumber(row.calendarTime)"
-            />
+              :real-value="(row: ListItem) => formatNumber(row.calendarTime)" />
           </zm-table>
           <div
             v-else
             ref="chartRef"
             v-loading="loading"
             class="npt-board-container"
-            :style="{ width: `${width}px`, height: `${height}px` }"
-          >
+            :style="{ width: `${width}px`, height: `${height}px` }">
           </div>
         </template>
       </el-auto-resizer>

+ 25 - 28
src/views/pms/iotrydailyreport/components/NonProductionEfficiency.vue

@@ -53,18 +53,18 @@ let chart: echarts.ECharts | null = null
 const router = useRouter()
 
 const nonProductionTimeFields: [keyof ListItem, string][] = [
-  ['accidentTime', '工程质量'],
-  ['repairTime', '设备故障'],
-  ['selfStopTime', '设备保养'],
-  ['complexityTime', '技术受限'],
-  ['relocationTime', '生产配合'],
-  ['rectificationTime', '生产组织'],
-  ['waitingStopTime', '不可抗力'],
-  ['winterBreakTime', '待命'],
-  ['partyaDesign', '甲方设计'],
-  ['partyaPrepare', '甲方准备'],
-  ['partyaResource', '甲方资源'],
-  ['otherNptTime', '其它']
+  ['accidentTime', '工程质量(H)'],
+  ['repairTime', '设备故障(H)'],
+  ['selfStopTime', '设备保养(H)'],
+  ['complexityTime', '技术受限(H)'],
+  ['relocationTime', '生产配合(H)'],
+  ['rectificationTime', '生产组织(H)'],
+  ['waitingStopTime', '不可抗力(H)'],
+  ['winterBreakTime', '待命(H)'],
+  ['partyaDesign', '甲方设计(H)'],
+  ['partyaPrepare', '甲方准备(H)'],
+  ['partyaResource', '甲方资源(H)'],
+  ['otherNptTime', '其它(H)']
 ]
 
 const getQueryWithoutPage = () => {
@@ -206,7 +206,11 @@ const getPieData = () => {
 }
 
 const getNptFieldPieData = () => {
-  const excludedFields: Array<keyof ListItem> = ['selfStopTime', 'relocationTime', 'winterBreakTime']
+  const excludedFields: Array<keyof ListItem> = [
+    'selfStopTime',
+    'relocationTime',
+    'winterBreakTime'
+  ]
 
   return nonProductionTimeFields
     .filter(([field]) => !excludedFields.includes(field))
@@ -399,16 +403,14 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
             show-summary
             :summary-method="getSummaries"
             :row-class-name="getClickableRowClassName"
-            @row-click="handleRowClick"
-          >
+            @row-click="handleRowClick">
             <zm-table-column
               prop="name"
               label="队伍"
               min-width="120"
               fixed="left"
               cover-formatter
-              :real-value="formatTeamName"
-            />
+              :real-value="formatTeamName" />
             <zm-table-column
               v-for="[prop, label] in nonProductionTimeFields"
               :key="prop"
@@ -416,40 +418,35 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
               :label="label"
               min-width="92"
               cover-formatter
-              :real-value="(row: ListItem) => formatNumber(row[prop])"
-            />
+              :real-value="(row: ListItem) => formatNumber(row[prop])" />
             <zm-table-column label="npt合计" is-parent>
               <zm-table-column
                 prop="nptTotal"
                 label="时长(H)"
                 min-width="92"
                 cover-formatter
-                :real-value="(row: ListItem) => formatNumber(row.nptTotal)"
-              />
+                :real-value="(row: ListItem) => formatNumber(row.nptTotal)" />
               <zm-table-column
                 prop="nptRate"
                 label="占比"
                 min-width="92"
                 cover-formatter
-                :real-value="formatRate"
-              />
+                :real-value="formatRate" />
             </zm-table-column>
             <zm-table-column
               prop="calendarTime"
-              label="自然时间"
+              label="自然时间(H)"
               min-width="92"
               cover-formatter
               action
-              :real-value="(row: ListItem) => formatNumber(row.calendarTime)"
-            />
+              :real-value="(row: ListItem) => formatNumber(row.calendarTime)" />
           </zm-table>
           <div
             v-else
             ref="chartRef"
             v-loading="loading"
             class="npt-board-container"
-            :style="{ width: `${width}px`, height: `${height}px` }"
-          >
+            :style="{ width: `${width}px`, height: `${height}px` }">
           </div>
         </template>
       </el-auto-resizer>

+ 25 - 28
src/views/pms/iotrydailyreport/components/XjNonProductionEfficiency.vue

@@ -53,18 +53,18 @@ let chart: echarts.ECharts | null = null
 const router = useRouter()
 
 const nonProductionTimeFields: [keyof ListItem, string][] = [
-  ['accidentTime', '工程质量'],
-  ['repairTime', '设备故障'],
-  ['selfStopTime', '设备保养'],
-  ['complexityTime', '技术受限'],
-  ['relocationTime', '生产配合'],
-  ['rectificationTime', '生产组织'],
-  ['waitingStopTime', '不可抗力'],
-  ['winterBreakTime', '待命'],
-  ['partyaDesign', '甲方设计'],
-  ['partyaPrepare', '甲方准备'],
-  ['partyaResource', '甲方资源'],
-  ['otherNptTime', '其它']
+  ['accidentTime', '工程质量(H)'],
+  ['repairTime', '设备故障(H)'],
+  ['selfStopTime', '设备保养(H)'],
+  ['complexityTime', '技术受限(H)'],
+  ['relocationTime', '生产配合(H)'],
+  ['rectificationTime', '生产组织(H)'],
+  ['waitingStopTime', '不可抗力(H)'],
+  ['winterBreakTime', '待命(H)'],
+  ['partyaDesign', '甲方设计(H)'],
+  ['partyaPrepare', '甲方准备(H)'],
+  ['partyaResource', '甲方资源(H)'],
+  ['otherNptTime', '其它(H)']
 ]
 
 const getQueryWithoutPage = () => {
@@ -206,7 +206,11 @@ const getPieData = () => {
 }
 
 const getNptFieldPieData = () => {
-  const excludedFields: Array<keyof ListItem> = ['selfStopTime', 'relocationTime', 'winterBreakTime']
+  const excludedFields: Array<keyof ListItem> = [
+    'selfStopTime',
+    'relocationTime',
+    'winterBreakTime'
+  ]
 
   return nonProductionTimeFields
     .filter(([field]) => !excludedFields.includes(field))
@@ -399,16 +403,14 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
             show-summary
             :summary-method="getSummaries"
             :row-class-name="getClickableRowClassName"
-            @row-click="handleRowClick"
-          >
+            @row-click="handleRowClick">
             <zm-table-column
               prop="name"
               label="队伍"
               min-width="120"
               fixed="left"
               cover-formatter
-              :real-value="formatTeamName"
-            />
+              :real-value="formatTeamName" />
             <zm-table-column
               v-for="[prop, label] in nonProductionTimeFields"
               :key="prop"
@@ -416,40 +418,35 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
               :label="label"
               min-width="92"
               cover-formatter
-              :real-value="(row: ListItem) => formatNumber(row[prop])"
-            />
+              :real-value="(row: ListItem) => formatNumber(row[prop])" />
             <zm-table-column label="npt合计" is-parent>
               <zm-table-column
                 prop="nptTotal"
                 label="时长(H)"
                 min-width="92"
                 cover-formatter
-                :real-value="(row: ListItem) => formatNumber(row.nptTotal)"
-              />
+                :real-value="(row: ListItem) => formatNumber(row.nptTotal)" />
               <zm-table-column
                 prop="nptRate"
                 label="占比"
                 min-width="92"
                 cover-formatter
-                :real-value="formatRate"
-              />
+                :real-value="formatRate" />
             </zm-table-column>
             <zm-table-column
               prop="calendarTime"
-              label="自然时间"
+              label="自然时间(H)"
               min-width="92"
               cover-formatter
               action
-              :real-value="(row: ListItem) => formatNumber(row.calendarTime)"
-            />
+              :real-value="(row: ListItem) => formatNumber(row.calendarTime)" />
           </zm-table>
           <div
             v-else
             ref="chartRef"
             v-loading="loading"
             class="npt-board-container"
-            :style="{ width: `${width}px`, height: `${height}px` }"
-          >
+            :style="{ width: `${width}px`, height: `${height}px` }">
           </div>
         </template>
       </el-auto-resizer>