YangJian0701 1 年之前
父节点
当前提交
49f18a8159
共有 3 个文件被更改,包括 7 次插入2 次删除
  1. 0 1
      components.d.ts
  2. 1 1
      package.json
  3. 6 0
      src/utils/common.ts

+ 0 - 1
components.d.ts

@@ -50,7 +50,6 @@ declare module '@vue/runtime-core' {
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
-    ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     ElTabPane: typeof import('element-plus/es')['ElTabPane']
     ElTabs: typeof import('element-plus/es')['ElTabs']

+ 1 - 1
package.json

@@ -16,7 +16,7 @@
     "axios": "^1.3.4",
     "dayjs": "^1.11.7",
     "el-table-infinite-scroll": "^3.0.1",
-    "element-plus": "^2.3.0",
+    "element-plus": "^2.3.4",
     "js-md5": "^0.7.3",
     "nprogress": "^0.2.0",
     "pinia": "^2.0.33",

+ 6 - 0
src/utils/common.ts

@@ -96,6 +96,12 @@ export const flatMenuListGet = (menuList: any) => {
  * @param time
  */
 export const getFormatDuration = (time: number) => {
+  
+  let h = parseInt(time / 60).toString().padStart(2,'0')
+  let m = parseInt(time % 60).toString().padStart(2,'0')
+  console.log('时间',time,h,m)
+  return (h == '00' ?'':h+'小时') + (m < 0 ?m.substring(1,3) +'分':m+'分')
+
   let hour = 0
   let minute = 0
   let result = ''