From 99a010f21d278498bafd248217c584e101db2d8f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 01 九月 2022 17:27:17 +0800
Subject: [PATCH] 1.自动扫码回车功能接入
---
src/utils/global.js | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/utils/global.js b/src/utils/global.js
index 48fbde4..81c59db 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -8,8 +8,8 @@
// 澶勭悊琛ㄥご鍗曞厓鏍兼牱寮�
export function headerCellStyle() {
const option = {
- // background: '#eee', padding: '0'
- background: '#f8f8fa', padding: '0', color: '#a7a7a7'
+ // background: '#a7a7a7', padding: '0'
+ background: '#f8f8fa', padding: '0', color: '#000', fontWeight: 500
}
return option
}
@@ -24,7 +24,7 @@
return option
}
-// 鏃堕棿澶勭悊鍑芥暟
+// 鏃堕棿澶勭悊鍑芥暟 骞存湀鏃�
export function handleDatetime(value) {
const data = new Date(value)
const month = data.getMonth() < 9 ? '0' + (data.getMonth() + 1) : data.getMonth() + 1
@@ -32,6 +32,25 @@
return data.getFullYear() + '-' + month + '-' + date
}
+// 浜嬩欢澶勭悊鍑芥暟 鏃跺垎绉�
+// 鑾峰彇褰撳墠鏃堕棿
+export function handleDatetime2(value) {
+ const dt = new Date(value)
+ const wk = dt.getDay()
+ const y = dt.getFullYear()
+ const m = (dt.getMonth() + 1 + '').padStart(2, '0')
+ const d = (dt.getDate() + '').padStart(2, '0')
+
+ const hh = (dt.getHours() + '').padStart(2, '0')
+ const mm = (dt.getMinutes() + '').padStart(2, '0')
+ const ss = (dt.getSeconds() + '').padStart(2, '0')
+ const weeks = ['鏄熸湡鏃�', '鏄熸湡涓�', '鏄熸湡浜�', '鏄熸湡涓�', '鏄熸湡鍥�', '鏄熸湡浜�', '鏄熸湡鍏�']
+ const week = weeks[wk]
+
+ // return `${y}-${m}-${d} ${hh}:${mm}:${ss} ${week}`
+ return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
+}
+
// 鑾峰彇瑙勫垯鐢熸垚鐨勭紪鐮�
export async function getNewEncodingRules(encode) {
const res = await NewEncodingRules({ rightcode: encode })
--
Gitblit v1.9.3