From d8bf602f74b8c9462fda855d4a675bec7f465668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9E=E5=AE=9D=E5=B1=B1?= <1253070437@qq.com> Date: Tue, 13 May 2025 00:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=89=8D=E7=AB=AF=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E6=8D=A2=E8=A1=8C=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/XnUpload/index.vue | 24 ++++------ snowy-admin-web/src/utils/tool.js | 48 ++++++++++--------- snowy-admin-web/src/views/biz/group/form.vue | 10 +++- 3 files changed, 43 insertions(+), 39 deletions(-) diff --git a/snowy-admin-web/src/components/XnUpload/index.vue b/snowy-admin-web/src/components/XnUpload/index.vue index 3f48ca85..aa9b7bf4 100644 --- a/snowy-admin-web/src/components/XnUpload/index.vue +++ b/snowy-admin-web/src/components/XnUpload/index.vue @@ -61,7 +61,7 @@ - + @@ -70,13 +70,11 @@ - - 您的浏览器不支持video标签哦,请联系管理员 - - - + { resultArrayValue.value.push(data.response.data) }) emit('update:value', resultArrayValue) - emit('onSuccessful',resultArrayValue) + emit('onSuccessful', resultArrayValue) emit('onChange', resultArrayValue) } } diff --git a/snowy-admin-web/src/utils/tool.js b/snowy-admin-web/src/utils/tool.js index 8784f807..3205c054 100644 --- a/snowy-admin-web/src/utils/tool.js +++ b/snowy-admin-web/src/utils/tool.js @@ -179,39 +179,41 @@ tool.generateString = (length = 8) => { tool.parseTime = (time, cFormat) => { if (time == null || time.length === 0) { - return '' + return '' } const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' let date if (typeof time === 'object') { - date = time + date = time } else { - if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { - time = parseInt(time) - } - if ((typeof time === 'number') && (time.toString().length === 10)) { - time = time * 1000 - } - date = new Date(time) + if (typeof time === 'string' && /^[0-9]+$/.test(time)) { + time = parseInt(time) + } + if (typeof time === 'number' && time.toString().length === 10) { + time = time * 1000 + } + date = new Date(time) } const formatObj = { - y: date.getFullYear(), - m: date.getMonth() + 1, - d: date.getDate(), - h: date.getHours(), - i: date.getMinutes(), - s: date.getSeconds(), - a: date.getDay() + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() } const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { - let value = formatObj[key] - // Note: getDay() returns 0 on Sunday - if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } - if (result.length > 0 && value < 10) { - value = '0' + value - } - return value || 0 + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { + return ['日', '一', '二', '三', '四', '五', '六'][value] + } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 }) return time_str } diff --git a/snowy-admin-web/src/views/biz/group/form.vue b/snowy-admin-web/src/views/biz/group/form.vue index 1be0f789..70f4bb58 100644 --- a/snowy-admin-web/src/views/biz/group/form.vue +++ b/snowy-admin-web/src/views/biz/group/form.vue @@ -14,7 +14,13 @@ - +