From e24c707ba13733903c310334fb0bbee1667ca4f6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 20 八月 2022 22:24:46 +0800 Subject: [PATCH] 2022-08-20 --- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index f2461f4..048b71d 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -14,6 +14,7 @@ import zhCN from '@/locales/zh-CN/main.js' import enUS from '@/locales/en-US/main.js' import CusSwitch from './cusSwitch' +import Encrypts from '@/components/encrypts' import '@/assets/css/table.scss' import './index.scss' @@ -301,9 +302,13 @@ content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}` } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) { content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}` + } else if (col.textFormat === 'encryption') { + content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span> } - content = (col.prefix || '') + content + (col.postfix || '') + if (col.textFormat !== 'encryption') { + content = (col.prefix || '') + content + (col.postfix || '') + } } if (col.marks) { @@ -722,9 +727,13 @@ content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}` } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) { content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}` + } else if (col.textFormat === 'encryption') { + content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span> } - content = (col.prefix || '') + content + (col.postfix || '') + if (col.textFormat !== 'encryption') { + content = (col.prefix || '') + content + (col.postfix || '') + } } if (col.marks) { -- Gitblit v1.8.0