diff --git a/policeManagement/src/components/form/FormProMax.vue b/policeManagement/src/components/form/FormProMax.vue index 63361fe..07e95f5 100644 --- a/policeManagement/src/components/form/FormProMax.vue +++ b/policeManagement/src/components/form/FormProMax.vue @@ -40,12 +40,15 @@ /> + + + @@ -162,7 +165,13 @@ const getResponsive = (item: FormProMaxItemProps): Grid => { } //优先级: 组件本身=》formItem=》label -const getPlaceholder = (item: FormProMaxItemProps) => item.componentsProps?.placeholder ?? item.placeholder ?? (item.type.includes('input') ? `请输入${item.label}` : `请选择${item.label}`) +const getPlaceholder = function (item: FormProMaxItemProps) { + // console.log('getPlaceholder____________________________', item) + // console.log('getPlaceholder_______________________placeholder', item.placeholder) + // console.log(item.componentsProps?.placeholder ?? item.placeholder ?? (item.type.includes('input') ? `请输入${item.label}` : `请选择${item.label}`)) + + return item.componentsProps?.placeholder ?? item.placeholder ?? (item.type.includes('input') ? `请输入${item.label}` : `请选择${item.label}`) +} defineExpose({ validate: (nameList, options) => formProMaxRef.value?.validate(nameList, options), diff --git a/policeManagement/src/views/query/publicUnit.vue b/policeManagement/src/views/query/publicUnit.vue index db20764..2964559 100644 --- a/policeManagement/src/views/query/publicUnit.vue +++ b/policeManagement/src/views/query/publicUnit.vue @@ -17,9 +17,9 @@ - + @@ -31,7 +31,8 @@ import { AutoComplete, Button, Input, message, Modal, Space } from 'ant-design-v import { debounce } from 'lodash-es' import FormProMax from '@/components/form/FormProMax.vue' import api from '@/axios' -import { ref, reactive, computed, onMounted } from 'vue' +// createVNode +import { ref, reactive, computed, onMounted, createVNode } from 'vue' import TableProMax from '@/components/table/TableProMax.vue' import { TableProMaxProps } from '@/types/components/table/index.ts' import { ComponentExposed } from 'vue-component-type-helpers' @@ -41,6 +42,7 @@ import { FormProMaxItemOptions } from '@/types/components/form//index.ts' import { FormExpose } from 'ant-design-vue/es/form/Form' import { serviceProjectSaveOrUpdateParams_ } from '@/types/views/serviceManagement' import { showEnterprisesUnit } from './index.tsx' +var modal: any type _FormType = EnterprisesUnitSaveOrUpdateParams & { contactPersonInfoName?: string contactPersonInfoTelephone?: string @@ -238,6 +240,7 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => { type: 'select', label: '单位类型', required: true, + placeholder: '请选择单位类型', // @ts-ignore options: dictSelectNodes('EnterprisesUnitType'), }, @@ -352,7 +355,7 @@ const netType = computed(() => { const formParams = ref<{ snowFlakeId?: string enterprisesUnitId: string - securityUnitId: string + securityUnitId: string | null administrativeDivisionCodes?: null projectManagerMiniProgramUserId?: string projectManagerMiniProgramUserName?: string @@ -372,7 +375,7 @@ const formParams = ref<{ name: '', enterprisesUnitId: '', type: 'security', - securityUnitId: '', + securityUnitId: null, // 初始值得设置为null,不然 placeholder 显示不出来 }) const securityUnitIdList = ref([]) const formItemOptions = ref>({ @@ -387,6 +390,15 @@ const formItemOptions = ref { + return option.label.toLowerCase().includes(input?.toLowerCase()) + }, + }, }, type: { type: 'radioGroup', @@ -616,7 +628,7 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) => { - visible.value = true + // visible.value = true serviceTitle.value = '编辑服务项目' idNumberDisabled.value = record.twoType.value !== 'outsource' formParams.value.securityUnitId = record.securityUnitId //企事业单位id @@ -635,6 +647,20 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) => formParams.value.houseTotal = record.houseTotal //户数 formParams.value.staffTotal = record.staffTotal //工作人员数量 formParams.value.securityUserTotal = record.securityUserTotal //保安人员数量 + + modal = Modal.confirm({ + title: serviceTitle.value, + icon: createVNode('div'), + width: 600, + centered: true, + content: () => , + onOk: async () => { + await submit() + }, + onCancel: async () => { + await closeModal() + }, + }) }} > 编辑 @@ -676,9 +702,10 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) => } const closeModal = async () => { + console.log(modal) visible.value = false formParams.value = { - securityUnitId: '', + securityUnitId: null, enterprisesUnitId: '', administrativeDivisionCodes: '', name: '', @@ -695,6 +722,9 @@ const closeModal = async () => { enterprisesUnitId.value = '' serviceTitle.value = '新增服务项目' idNumberDisabled.value = false + modal.destroy() + // console.log(modal) + Modal.destroyAll() } const submit = async () => { @@ -704,6 +734,7 @@ const submit = async () => { message.success(resp.message) await _tableRef.value.requestGetTableData() await closeModal() + // modal.destroy() } onMounted(async () => { @@ -711,7 +742,21 @@ onMounted(async () => { securityUnitIdList.value = res.data }) const addService = function (record) { + // modal.destroy() formParams.value.enterprisesUnitId = record.snowFlakeId //企事业单位Id - visible.value = true + // visible.value = true + modal = Modal.confirm({ + title: serviceTitle.value, + icon: createVNode('div'), + width: 600, + centered: true, + content: () => , + onOk: async () => { + await submit() + }, + onCancel: async () => { + await closeModal() + }, + }) } diff --git a/policeSecurityServer/src/main/java/com/changhu/pojo/dto/SecurityUnitUseStatisticsDTO.java b/policeSecurityServer/src/main/java/com/changhu/pojo/dto/SecurityUnitUseStatisticsDTO.java index 8183797..c1784a8 100644 --- a/policeSecurityServer/src/main/java/com/changhu/pojo/dto/SecurityUnitUseStatisticsDTO.java +++ b/policeSecurityServer/src/main/java/com/changhu/pojo/dto/SecurityUnitUseStatisticsDTO.java @@ -43,6 +43,8 @@ public class SecurityUnitUseStatisticsDTO { @Schema(description = "公安单位id") private Long policeUnitId; + @Schema(description = "公安代为代码") + private String policeUnitCode; @Schema(description = "公安单位名称") private String policeUnitName; diff --git a/policeSecurityServer/src/main/java/com/changhu/pojo/dto/ServiceProjectDTO.java b/policeSecurityServer/src/main/java/com/changhu/pojo/dto/ServiceProjectDTO.java index 504fd30..78e6bf6 100644 --- a/policeSecurityServer/src/main/java/com/changhu/pojo/dto/ServiceProjectDTO.java +++ b/policeSecurityServer/src/main/java/com/changhu/pojo/dto/ServiceProjectDTO.java @@ -1,6 +1,7 @@ package com.changhu.pojo.dto; import com.alibaba.fastjson2.annotation.JSONField; +import com.changhu.common.db.enums.EducationLevel; import com.changhu.common.db.enums.ServiceProjectType; import com.changhu.common.db.enums.Sex; import com.changhu.pojo.model.LegalPersonInfo; @@ -81,6 +82,9 @@ public class ServiceProjectDTO { static class SecurityUserInfo { @Schema(description = "id") private Long snowFlakeId; + @JSONField(serializeUsing = MinioPrefixSerializer.class) + @Schema(description = "照片") + private String photo; @Schema(description = "名字") private String name; @Schema(description = "手机号") @@ -103,5 +107,7 @@ public class ServiceProjectDTO { private String remark; @Schema(description = "创建时间") private String createTime; + @Schema(description = "文化程度") + private EducationLevel educationLevel; } } diff --git a/policeSecurityServer/src/main/java/com/changhu/support/fastjson2/serializer/MinioPrefixSerializer.java b/policeSecurityServer/src/main/java/com/changhu/support/fastjson2/serializer/MinioPrefixSerializer.java index 5142540..7dd293d 100644 --- a/policeSecurityServer/src/main/java/com/changhu/support/fastjson2/serializer/MinioPrefixSerializer.java +++ b/policeSecurityServer/src/main/java/com/changhu/support/fastjson2/serializer/MinioPrefixSerializer.java @@ -1,5 +1,6 @@ package com.changhu.support.fastjson2.serializer; +import cn.hutool.core.util.StrUtil; import cn.hutool.extra.spring.SpringUtil; import com.alibaba.fastjson2.JSONWriter; import com.alibaba.fastjson2.writer.ObjectWriter; @@ -22,6 +23,10 @@ public class MinioPrefixSerializer implements ObjectWriter { @Override public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) { - jsonWriter.writeString(minioPrefix + object); + if (object instanceof String path && StrUtil.isNotEmpty(path)) { + jsonWriter.writeString(minioPrefix + object); + } else { + jsonWriter.writeString(""); + } } } diff --git a/policeSecurityServer/src/main/resources/mapper/OpenApiMapper.xml b/policeSecurityServer/src/main/resources/mapper/OpenApiMapper.xml index 450b185..191b8a5 100644 --- a/policeSecurityServer/src/main/resources/mapper/OpenApiMapper.xml +++ b/policeSecurityServer/src/main/resources/mapper/OpenApiMapper.xml @@ -43,42 +43,43 @@ property="securityUserList" />