From 6a481c205f2e6c1ba95eb2bfc9b3f4cd949b1ceb Mon Sep 17 00:00:00 2001 From: TimSpan Date: Tue, 3 Dec 2024 16:56:34 +0800 Subject: [PATCH 01/10] Fix Bug --- policeManagement/package-lock.json | 6 ++- policeManagement/package.json | 1 + policeManagement/src/views/query/index.tsx | 61 ++++++++++++++-------- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/policeManagement/package-lock.json b/policeManagement/package-lock.json index 63a6f29..0bc69dd 100644 --- a/policeManagement/package-lock.json +++ b/policeManagement/package-lock.json @@ -12,6 +12,7 @@ "@vueuse/core": "^11.2.0", "ant-design-vue": "^4.2.3", "axios": "^1.7.5", + "dayjs": "^1.11.13", "jsencrypt": "^3.3.2", "lodash-es": "^4.17.21", "pinia": "^2.2.2", @@ -1950,8 +1951,9 @@ }, "node_modules/dayjs": { "version": "1.11.13", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", - "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", + "license": "MIT" }, "node_modules/de-indent": { "version": "1.0.2", diff --git a/policeManagement/package.json b/policeManagement/package.json index d57c43b..0f9aafb 100644 --- a/policeManagement/package.json +++ b/policeManagement/package.json @@ -14,6 +14,7 @@ "@vueuse/core": "^11.2.0", "ant-design-vue": "^4.2.3", "axios": "^1.7.5", + "dayjs": "^1.11.13", "jsencrypt": "^3.3.2", "lodash-es": "^4.17.21", "pinia": "^2.2.2", diff --git a/policeManagement/src/views/query/index.tsx b/policeManagement/src/views/query/index.tsx index 9bb02d4..846b4ec 100644 --- a/policeManagement/src/views/query/index.tsx +++ b/policeManagement/src/views/query/index.tsx @@ -1,3 +1,4 @@ +import dayjs from 'dayjs' import { TableProMaxProps, TableProMaxSlots } from '@/types/components/table' import { EnterprisesUnitPagerQueryParams, securityUnitIdListPagerVo, securityUnitIdListParams, PoliceUnitPagerVo } from '@/types/views/unitManage/police/policeUnit.ts' import { reactive, ref, h } from 'vue' @@ -34,10 +35,23 @@ const _formParams = reactive({ homeAddress: '', remark: '', }) - +const cardBlur = () => { + let value = _formParams.idCard + if (!value?.length || value.length < 18) { + _formParams.dateOfBirth = '' + return + } + const birthDate = value.substring(6, 14) + const year = birthDate.substring(0, 4) + const month = birthDate.substring(4, 6) + const day = birthDate.substring(6, 8) + var _data = new Date(parseInt(year), parseInt(month) - 1, parseInt(day)) + _formParams.dateOfBirth = dayjs(_data).format('YYYY-MM-DD HH:mm:ss') + console.log('🚀 ~ cardBlur ~ _data:', _formParams.dateOfBirth) +} const searchSecurityUnitId = debounce(async () => { if (process.env.NODE_ENV === 'development') { - // console.log('process.env.NODE_ENV === development') + console.log('process.env.NODE_ENV === development') const res = await axios.get(`https://www.hnjinglian.cn:5678/common/querySecurityNumberByIdCard?idCard=${_formParams.idCard}`) if (res.data?.data?.hasOwnProperty('bayzh')) { _formParams.securityNumber = res.data.data.bayzh @@ -47,13 +61,15 @@ const searchSecurityUnitId = debounce(async () => { } } else { const res = await api.get('/common/querySecurityNumberByIdCard', { idCard: _formParams.idCard }) - if (res.data?.data?.hasOwnProperty('bayzh')) { - _formParams.securityNumber = res.data.data.bayzh - message.success(res.data.message) + console.log(res) + if (res.data?.hasOwnProperty('bayzh')) { + _formParams.securityNumber = res.data.bayzh + message.success(res.message) } else { message.error('未查询到保安证件号') } } + cardBlur() }, 300) const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) => { // console.log('🚀 ~ saveOrUpdateEnterprisesUnit ~ params:', params) @@ -165,28 +181,31 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) = ..._formParams, }) message.success(resp.message) + clearForm() callback && callback() }, onCancel: async () => { - _formParams.snowFlakeId = '' - _formParams.serviceProjectId = '' - _formParams.securityUnitId = '' - _formParams.name = '' - _formParams.photo = '' - _formParams.telephone = '' - _formParams.workPost = '' - _formParams.sex = '' - _formParams.nativePlace = '' - _formParams.idCard = '' - _formParams.dateOfBirth = '' - _formParams.securityNumber = '' - _formParams.noSecurityNumberDesc = '' - _formParams.homeAddress = '' - _formParams.remark = '' + clearForm() }, }) } - +const clearForm = () => { + _formParams.snowFlakeId = '' + _formParams.serviceProjectId = '' + _formParams.securityUnitId = '' + _formParams.name = '' + _formParams.photo = '' + _formParams.telephone = '' + _formParams.workPost = '' + _formParams.sex = '' + _formParams.nativePlace = '' + _formParams.idCard = '' + _formParams.dateOfBirth = '' + _formParams.securityNumber = '' + _formParams.noSecurityNumberDesc = '' + _formParams.homeAddress = '' + _formParams.remark = '' +} export const showEnterprisesUnit = (record_) => { // console.log('🚀 ~ showEnterprisesUnit ~ record_:', record_) const _tableRef = ref>(null) From be4e84919b2d3f750778dd08fbf01ead9c575c36 Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Wed, 11 Dec 2024 11:27:16 +0800 Subject: [PATCH 02/10] =?UTF-8?q?refactor(login):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E5=BA=94=E7=94=A8=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将静态文本"超级后台"替换为动态显示的 appInfo.appName - 在登录页面的标题和 logo 文本中使用动态应用名称 - 引入 __APP_INFO 常量以获取应用信息 --- superManagement/src/views/login.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/superManagement/src/views/login.vue b/superManagement/src/views/login.vue index b2cabb2..c52b7a6 100644 --- a/superManagement/src/views/login.vue +++ b/superManagement/src/views/login.vue @@ -2,13 +2,13 @@
Logo -
超级后台
+
{{ appInfo.appName}}