feat: 合并 admin/manager 重复页 + 公示意向 + 劳务签署
页合并 (admin/manager 共用, route.path 角色感知): - expert: Experts.vue + ExpertNew.vue (list/new/edit/view 一套) - sponsor-orgs: SponsorOrgs.vue - sponsor-people: SponsorPeople.vue + SponsorPersonNew.vue + SponsorPersonDetail.vue - executor-orgs: ExecutorOrgs.vue - executor-people: ExecutorPeople.vue + ExecutorPersonNew.vue + ExecutorPersonDetail.vue - 给 SponsorPeople / ExecutorPeople op 列补上 查看/编辑 按钮 (潜在 bug 修复) - 详情弹窗统一用 el-descriptions 风格 (替代 admin 旧版 ElMessageBox.alert) 后端: - BizSignController + BizSignServiceImpl + PdfService (劳务签署 PDF 流程) - BizPublicityIntentController (公示意向: 支持/执行) - BizPublicitySupportIntent / BizPublicityExecutionIntent ExportVo - BizMeetingAttendee 字段合并 (bank_region 替代 bankProvince/bankCity) - BizExpert 字段合并 (id_card_attachments CSV, bank_region) - Excel 导入模板精简 (开户行 1 列) 前端: - doctor/SignFill + SignContract + SignSuccess (劳务签署 3 页流程) - ImportResultDialog 通用组件 - IdCardUploader 重构 (单 v-model:idCardAttachments, CSV 格式) - AreaCascader 调整 - Login.vue + AdminLayout.vue + PortalShell.vue + Home.vue 适配 DB: 字段合并 (id_card_front/back → id_card_attachments, bank_province/city → bank_region)
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
<!--
|
||||
身份证正反面上传控件 (仿 hwt-code gr-id-card, 适配 PC 后台)
|
||||
用法 (双 v-model):
|
||||
<id-card-uploader
|
||||
v-model:front-url="form.idCardFrontUrl"
|
||||
v-model:back-url="form.idCardBackUrl"
|
||||
:dir="'ry8080/idcard/'"
|
||||
/>
|
||||
单 v-model, 内部以 CSV "frontUrl,backUrl" 存到一个字段:
|
||||
<id-card-uploader v-model="form.idCardAttachments" />
|
||||
|
||||
readonly=true 时不显示上传按钮, 点击 thumb 弹 el-image 预览
|
||||
上传走 OSS 直传 (utils/oss.js 的 uploadToOss)
|
||||
@@ -47,25 +43,41 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { uploadToOss } from '@/utils/oss'
|
||||
|
||||
/** CSV 拆分: 允许任意空段, 返回 [front, back], 空段视为 '' */
|
||||
function parseCsv(str) {
|
||||
if (!str || typeof str !== 'string') return ['', '']
|
||||
const parts = str.split(',')
|
||||
return [parts[0] || '', parts[1] || '']
|
||||
}
|
||||
|
||||
/** 拼回 CSV: 始终 2 段 (空字符串保留位), 避免 "a" 被读成 ["a",""] 没问题但 "a," 被读成 ["a",""] */
|
||||
function joinCsv(front, back) {
|
||||
return [front || '', back || ''].join(',')
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
frontUrl: { type: String, default: '' },
|
||||
backUrl: { type: String, default: '' },
|
||||
/** CSV 字符串, "frontUrl,backUrl", 任意段为空保留位 */
|
||||
modelValue: { type: String, default: '' },
|
||||
dir: { type: String, default: 'ry8080/idcard/' },
|
||||
readonly: { type: Boolean, default: false },
|
||||
frontPlaceholder: { type: String, default: '/images/id-front.png' },
|
||||
backPlaceholder: { type: String, default: '/images/id-back.png' }
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:frontUrl', 'update:backUrl'])
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const fileInputFront = ref(null)
|
||||
const fileInputBack = ref(null)
|
||||
const uploading = ref({ front: false, back: false })
|
||||
|
||||
// 内部 front/back URL 由 modelValue 派生
|
||||
const frontUrl = computed(() => parseCsv(props.modelValue)[0])
|
||||
const backUrl = computed(() => parseCsv(props.modelValue)[1])
|
||||
|
||||
function handleClick(side) {
|
||||
if (props.readonly) return
|
||||
if (uploading.value[side]) return
|
||||
@@ -88,11 +100,9 @@ async function onFileChange(e, side) {
|
||||
uploading.value[side] = true
|
||||
try {
|
||||
const url = await uploadToOss(file, props.dir)
|
||||
if (side === 'front') {
|
||||
emit('update:frontUrl', url)
|
||||
} else {
|
||||
emit('update:backUrl', url)
|
||||
}
|
||||
const [f, b] = parseCsv(props.modelValue)
|
||||
const next = side === 'front' ? joinCsv(url, b) : joinCsv(f, url)
|
||||
emit('update:modelValue', next)
|
||||
ElMessage.success(side === 'front' ? '身份证正面已上传' : '身份证反面已上传')
|
||||
} catch (err) {
|
||||
ElMessage.error(err.message || '上传失败')
|
||||
@@ -137,4 +147,4 @@ async function onFileChange(e, side) {
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user