瀏覽代碼

进度条图标优化

DESKTOP-MINPJAU\Administrator 3 年之前
父節點
當前提交
657f76677d
共有 1 個文件被更改,包括 43 次插入41 次删除
  1. 43 41
      src/components/progress/Index.vue

+ 43 - 41
src/components/progress/Index.vue

@@ -1,7 +1,9 @@
 <template>
   <div style="position: fixed; z-index: 10000">
-    <el-dialog :title="jdt.title" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false" v-model="jdt.isOpen">
-      <el-progress :text-inside="true" :stroke-width="22" :percentage="percentage" :status="percentage === 100 ? 'success' : ''">
+    <el-dialog :title="jdt.title" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
+               v-model="jdt.isOpen">
+      <el-progress :text-inside="true" :stroke-width="22" :percentage="percentage"
+                   :status="percentage === 100 ? 'success' : ''">
         <span>
           {{ cptUpldRsTxt }}
           <i v-show="percentage < 100" class="el-icon-loading"></i>
@@ -19,10 +21,10 @@
             </ul>
           </el-tab-pane>
           <el-tab-pane label="结果" name="结果" v-if="jdt.closeButton">
-            <el-result icon="Success" :title="jdt.title" :sub-title="tips">
+            <el-result icon="SuccessFilled" :title="jdt.title" :sub-title="tips">
               <template #extra>
-                <el-button @click="closeModal" type="warning" icon="Close" index="small"> 关闭 </el-button>
-                <el-button @click="exportExcel" type="primary" icon="Download" index="small"> 导出Excel </el-button>
+                <el-button @click="closeModal" type="warning" icon="Close" index="small"> 关闭</el-button>
+                <el-button @click="exportExcel" type="primary" icon="Download" index="small"> 导出Excel</el-button>
               </template>
             </el-result>
           </el-tab-pane>
@@ -33,13 +35,13 @@
 </template>
 
 <script>
-import { computed, onMounted, ref } from 'vue'
-import { useStore } from 'vuex'
-import { setCallback } from '@/utils/websocket'
-import { Export } from '@/utils/ExportExcel'
-import { makePercentage } from './progUtils'
-import { stringNotBlank } from '@/utils/blank-utils'
-import { reactive, watch } from 'vue'
+import {computed, onMounted, ref} from 'vue'
+import {useStore} from 'vuex'
+import {setCallback} from '@/utils/websocket'
+import {Export} from '@/utils/ExportExcel'
+import {makePercentage} from './progUtils'
+import {stringNotBlank} from '@/utils/blank-utils'
+import {reactive, watch} from 'vue'
 
 export default {
   setup() {
@@ -158,41 +160,41 @@ export default {
     }
 
     watch(
-      () => percentage.value,
-      () => {
-        if (percentage.value === 100) {
-          if (jdtData.value.length > 0) {
-            let success = 0
-            let danger = 0
-            let warning = 0
-            let info = 0
-            jdtData.value.forEach((item) => {
-              if (item.type === 0) {
-                success++
-              } else if (item.type === 1) {
-                danger++
-              } else if (item.type === 2) {
-                warning++
-              } else {
-                info++
-              }
-            })
-            tips.value = `数据上传完成:成功:【${success}】、错误:【${danger}】、内部错误:【${warning}】、未知:【${info}】、总条数:【${jdtData.value.length}】`
-          } else {
-            tips.value = '上传成功'
+        () => percentage.value,
+        () => {
+          if (percentage.value === 100) {
+            if (jdtData.value.length > 0) {
+              let success = 0
+              let danger = 0
+              let warning = 0
+              let info = 0
+              jdtData.value.forEach((item) => {
+                if (item.type === 0) {
+                  success++
+                } else if (item.type === 1) {
+                  danger++
+                } else if (item.type === 2) {
+                  warning++
+                } else {
+                  info++
+                }
+              })
+              tips.value = `数据上传完成:成功:【${success}】、错误:【${danger}】、内部错误:【${warning}】、未知:【${info}】、总条数:【${jdtData.value.length}】`
+            } else {
+              tips.value = '上传成功'
+            }
+            tabName.value = '结果'
           }
-          tabName.value = '结果'
         }
-      }
     )
 
     watch(
-      () => jdt.value.isOpen,
-      () => {
-        if (!jdt.value.isOpen) {
-          closeModal()
+        () => jdt.value.isOpen,
+        () => {
+          if (!jdt.value.isOpen) {
+            closeModal()
+          }
         }
-      }
     )
 
     onMounted(() => {