Merge remote-tracking branch 'origin/main'

This commit is contained in:
wangyilin 2024-12-19 10:13:50 +08:00
commit 79b50df5ac
10 changed files with 1190 additions and 2184 deletions

BIN
.DS_Store vendored

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@
"@vueuse/core": "^11.2.0", "@vueuse/core": "^11.2.0",
"ant-design-vue": "^4.2.3", "ant-design-vue": "^4.2.3",
"axios": "^1.7.5", "axios": "^1.7.5",
"dayjs": "^1.11.13",
"jsencrypt": "^3.3.2", "jsencrypt": "^3.3.2",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"pinia": "^2.2.2", "pinia": "^2.2.2",

View File

@ -6,6 +6,7 @@ type DictType =
| 'IsEnable' | 'IsEnable'
| 'IsOrNot' | 'IsOrNot'
| 'Sex' | 'Sex'
| 'EducationLevel'
export const initEnums = () => { export const initEnums = () => {
api.get<Record<DictType, SelectNodeVo<any>[]>>('/common/enums').then(resp => { api.get<Record<DictType, SelectNodeVo<any>[]>>('/common/enums').then(resp => {

View File

@ -131,6 +131,7 @@ export interface securityUnitIdListParams {
securityNumber?: string; securityNumber?: string;
noSecurityNumberDesc?: string; noSecurityNumberDesc?: string;
homeAddress?: string; homeAddress?: string;
educationLevel?: string;
} }
export interface securityUnitIdListPagerVo { export interface securityUnitIdListPagerVo {
snowFlakeId?: string; snowFlakeId?: string;

View File

@ -1,3 +1,4 @@
import dayjs from 'dayjs'
import { TableProMaxProps, TableProMaxSlots } from '@/types/components/table' import { TableProMaxProps, TableProMaxSlots } from '@/types/components/table'
import { EnterprisesUnitPagerQueryParams, securityUnitIdListPagerVo, securityUnitIdListParams, PoliceUnitPagerVo } from '@/types/views/unitManage/police/policeUnit.ts' import { EnterprisesUnitPagerQueryParams, securityUnitIdListPagerVo, securityUnitIdListParams, PoliceUnitPagerVo } from '@/types/views/unitManage/police/policeUnit.ts'
import { reactive, ref, h } from 'vue' import { reactive, ref, h } from 'vue'
@ -33,27 +34,45 @@ const _formParams = reactive<securityUnitIdListParams>({
noSecurityNumberDesc: '', noSecurityNumberDesc: '',
homeAddress: '', homeAddress: '',
remark: '', remark: '',
educationLevel: '',
}) })
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 () => { const searchSecurityUnitId = debounce(async () => {
if (process.env.NODE_ENV === 'development') { 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}`) const res = await axios.get(`https://www.hnjinglian.cn:5678/common/querySecurityNumberByIdCard?idCard=${_formParams.idCard}`)
if (res.data?.data?.hasOwnProperty('bayzh')) { if (res.data?.data?.hasOwnProperty('bayzh')) {
_formParams.securityNumber = res.data.data.bayzh _formParams.securityNumber = res.data.data.bayzh
_formParams.name = res.data.name
message.success(res.data.message) message.success(res.data.message)
} else { } else {
message.error('未查询到保安证件号') message.error('未查询到保安证件号')
} }
} else { } else {
const res = await api.get<any>('/common/querySecurityNumberByIdCard', { idCard: _formParams.idCard }) const res = await api.get<any>('/common/querySecurityNumberByIdCard', { idCard: _formParams.idCard })
if (res.data?.data?.hasOwnProperty('bayzh')) { console.log(res)
_formParams.securityNumber = res.data.data.bayzh if (res.data?.hasOwnProperty('bayzh')) {
message.success(res.data.message) _formParams.securityNumber = res.data.bayzh
_formParams.name = res.data.name
message.success(res.message)
} else { } else {
message.error('未查询到保安证件号') message.error('未查询到保安证件号')
} }
} }
cardBlur()
}, 300) }, 300)
const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) => { const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) => {
// console.log('🚀 ~ saveOrUpdateEnterprisesUnit ~ params:', params) // console.log('🚀 ~ saveOrUpdateEnterprisesUnit ~ params:', params)
@ -69,6 +88,7 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) =
_formParams.telephone = params.telephone.originalValue _formParams.telephone = params.telephone.originalValue
_formParams.workPost = params.workPost _formParams.workPost = params.workPost
_formParams.sex = params.sex.value _formParams.sex = params.sex.value
_formParams.educationLevel = params.educationLevel.value
_formParams.nativePlace = params.nativePlace _formParams.nativePlace = params.nativePlace
_formParams.idCard = params.idCard.originalValue _formParams.idCard = params.idCard.originalValue
_formParams.dateOfBirth = params.dateOfBirth _formParams.dateOfBirth = params.dateOfBirth
@ -109,7 +129,7 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) =
telephone: { telephone: {
type: 'input', type: 'input',
label: '手机号', label: '手机号',
required: true, // required: true,
}, },
sex: { sex: {
type: 'radioGroup', type: 'radioGroup',
@ -117,10 +137,18 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) =
required: true, required: true,
options: [...dictSelectNodes('Sex')], options: [...dictSelectNodes('Sex')],
}, },
educationLevel: {
type: 'radioGroup',
label: '文化程度',
required: true,
options: [...dictSelectNodes('EducationLevel')],
},
securityNumber: { securityNumber: {
type: 'input', type: 'input',
label: '保安证号', label: '保安证号',
required: true, // required: true,
}, },
dateOfBirth: { dateOfBirth: {
type: 'datePicker', type: 'datePicker',
@ -165,9 +193,15 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) =
..._formParams, ..._formParams,
}) })
message.success(resp.message) message.success(resp.message)
clearForm()
callback && callback() callback && callback()
}, },
onCancel: async () => { onCancel: async () => {
clearForm()
},
})
}
const clearForm = () => {
_formParams.snowFlakeId = '' _formParams.snowFlakeId = ''
_formParams.serviceProjectId = '' _formParams.serviceProjectId = ''
_formParams.securityUnitId = '' _formParams.securityUnitId = ''
@ -183,10 +217,9 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) =
_formParams.noSecurityNumberDesc = '' _formParams.noSecurityNumberDesc = ''
_formParams.homeAddress = '' _formParams.homeAddress = ''
_formParams.remark = '' _formParams.remark = ''
}, _formParams.educationLevel = ''
})
}
}
export const showEnterprisesUnit = (record_) => { export const showEnterprisesUnit = (record_) => {
// console.log('🚀 ~ showEnterprisesUnit ~ record_:', record_) // console.log('🚀 ~ showEnterprisesUnit ~ record_:', record_)
const _tableRef = ref<ComponentExposed<typeof TableProMax>>(null) const _tableRef = ref<ComponentExposed<typeof TableProMax>>(null)

View File

@ -369,9 +369,9 @@ const formParams = ref<{
remark?: string remark?: string
}>({ }>({
name: '', name: '',
enterprisesUnitId: null, enterprisesUnitId: '',
type: 'security', type: 'security',
securityUnitId: null, securityUnitId: '',
}) })
const securityUnitIdList = ref<any>([]) const securityUnitIdList = ref<any>([])
const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdateParams_>>({ const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdateParams_>>({
@ -547,13 +547,13 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) =>
{ {
dataIndex: 'serviceArea', dataIndex: 'serviceArea',
title: '服务区域面积', title: '服务区域面积',
width: 60, width: 120,
ellipsis: true, ellipsis: true,
}, },
{ {
dataIndex: 'buildingTotal', dataIndex: 'buildingTotal',
title: '楼栋数量', title: '楼栋数量',
width: 60, width: 100,
ellipsis: true, ellipsis: true,
}, },
@ -566,13 +566,13 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) =>
{ {
dataIndex: 'staffTotal', dataIndex: 'staffTotal',
title: '工作人员数量', title: '工作人员数量',
width: 60, width: 120,
ellipsis: true, ellipsis: true,
}, },
{ {
dataIndex: 'securityUserTotal', dataIndex: 'securityUserTotal',
title: '保安人员数量', title: '保安人员数量',
width: 60, width: 120,
ellipsis: true, ellipsis: true,
}, },
{ {

View File

@ -2,7 +2,6 @@ package com.changhu.module.miniProgram.pojo.params;
import com.changhu.common.db.enums.Sex; import com.changhu.common.db.enums.Sex;
import com.changhu.common.validator.annotation.IdCard; import com.changhu.common.validator.annotation.IdCard;
import com.changhu.common.validator.annotation.IsMobile;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
@ -34,8 +33,6 @@ public class SecurityUserSaveOrUpdateParams {
@Schema(description = "名称") @Schema(description = "名称")
private String name; private String name;
@NotBlank(message = "手机号不能为空")
@IsMobile
@Schema(description = "手机号") @Schema(description = "手机号")
private String telephone; private String telephone;

View File

@ -32,7 +32,7 @@
"@vitejs/plugin-vue": "^5.1.2", "@vitejs/plugin-vue": "^5.1.2",
"@vitejs/plugin-vue-jsx": "^4.0.1", "@vitejs/plugin-vue-jsx": "^4.0.1",
"terser": "^5.36.0", "terser": "^5.36.0",
"typescript": "^5.5.3", "typescript": "5.6.2",
"unplugin-vue-components": "^0.27.4", "unplugin-vue-components": "^0.27.4",
"vite": "^5.4.1", "vite": "^5.4.1",
"vue-tsc": "^2.0.29" "vue-tsc": "^2.0.29"

View File

@ -2,13 +2,13 @@
<div class="root"> <div class="root">
<div class="header"> <div class="header">
<img src="@/assets/vue.svg" alt="Logo" height="33" width="33"/> <img src="@/assets/vue.svg" alt="Logo" height="33" width="33"/>
<div class="logo-text">超级后台</div> <div class="logo-text">{{ appInfo.appName}}</div>
</div> </div>
<div class="container"> <div class="container">
<div class="left-banner"></div> <div class="left-banner"></div>
<div class="login-card"> <div class="login-card">
<div class="title"> <div class="title">
欢迎来到超级后台 欢迎来到{{ appInfo.appName}}
</div> </div>
<a-tabs class="account-tab" v-model:active-key="activeKey"> <a-tabs class="account-tab" v-model:active-key="activeKey">
<a-tab-pane :key="0" tab="账号登录"> <a-tab-pane :key="0" tab="账号登录">
@ -42,6 +42,7 @@ import TelephoneLogin from '@/components/login/TelephoneLogin.vue';
import {ref} from "vue"; import {ref} from "vue";
const activeKey = ref(0) const activeKey = ref(0)
const appInfo = __APP_INFO
</script> </script>