初步完成 公安后台 保安人员 头像上传 待复测

This commit is contained in:
TimSpan 2024-11-29 16:39:30 +08:00
parent 87c9c7b053
commit 59b58cf6f7
6 changed files with 33 additions and 13 deletions

View File

@ -22,3 +22,7 @@ VITE_APP_RSA_PUBLIC_KEY=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJps/EXxxSpEM1Ix4R
VITE_APP_GAODE_KEY=f379a3f860a68d7438526275d6a94b05 VITE_APP_GAODE_KEY=f379a3f860a68d7438526275d6a94b05
VITE_APP_GAODE_VERSION=2.0 VITE_APP_GAODE_VERSION=2.0
VITE_APP_SECURITY_JS_CODE=432125a0f8d8cad2dac38b77d6f6728f VITE_APP_SECURITY_JS_CODE=432125a0f8d8cad2dac38b77d6f6728f
# minio
VITE_APP_MINIO_URL=http://118.253.177.137:9000
VITE_APP_MINIO_BUCKET=police-security-dev

View File

@ -13,3 +13,7 @@ VITE_APP_RSA_PUBLIC_KEY=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCpu1C3JHZ+Ng/eVVCZ
VITE_APP_GAODE_KEY=f379a3f860a68d7438526275d6a94b05 VITE_APP_GAODE_KEY=f379a3f860a68d7438526275d6a94b05
VITE_APP_GAODE_VERSION=2.0 VITE_APP_GAODE_VERSION=2.0
VITE_APP_SECURITY_JS_CODE=432125a0f8d8cad2dac38b77d6f6728f VITE_APP_SECURITY_JS_CODE=432125a0f8d8cad2dac38b77d6f6728f
# minio
VITE_APP_MINIO_URL=https://www.hnjinglian.cn:9002
VITE_APP_MINIO_BUCKET=police-security

View File

@ -34,6 +34,7 @@ declare module 'vue' {
APagination: typeof import('ant-design-vue/es')['Pagination'] APagination: typeof import('ant-design-vue/es')['Pagination']
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
APopover: typeof import('ant-design-vue/es')['Popover'] APopover: typeof import('ant-design-vue/es')['Popover']
AProgress: typeof import('ant-design-vue/es')['Progress']
ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup'] ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup']
ARangePicker: typeof import('ant-design-vue/es')['RangePicker'] ARangePicker: typeof import('ant-design-vue/es')['RangePicker']
ARow: typeof import('ant-design-vue/es')['Row'] ARow: typeof import('ant-design-vue/es')['Row']

View File

@ -1,15 +1,18 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg"/> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="module" src="/src/assets/iconfont/iconfont.js"></script> <script type="module" src="/src/assets/iconfont/iconfont.js"></script>
<title>Vite + Vue + TS</title> <title>公安后台</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
</body> </body>
</html> </html>

View File

@ -1,8 +1,9 @@
<template> <template>
<div class="simpleUploadDiv"> <div class="simpleUploadDiv">
<a-progress v-if="uploading" type="circle" :percent="percent" /> <a-progress v-if="uploading" type="circle" :percent="percent" />
<a-image height="80%" v-else :src="minioBaseUrl + modelValue" alt="avatar" /> <!-- height="80%" width="80%" -->
<a-button class="btn-success" @click="selectFile">{{ btnLabel }}</a-button> <a-image v-else :src="minioBaseUrl + modelValue" alt="avatar" />
<a-button style="margin-top: 4px" class="btn-success" @click="selectFile">{{ btnLabel }}</a-button>
<input id="myFileInput" type="file" style="display: none" /> <input id="myFileInput" type="file" style="display: none" />
</div> </div>
</template> </template>

View File

@ -14,6 +14,7 @@ import FormProMax from '@/components/form/FormProMax.vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import { SearchOutlined } from '@ant-design/icons-vue' import { SearchOutlined } from '@ant-design/icons-vue'
import axios from 'axios' import axios from 'axios'
import SingleImageFileUpload from '@/components/upload/SingleImageFileUpload.vue'
type _TableProps = TableProMaxProps<securityUnitIdListPagerVo, EnterprisesUnitPagerQueryParams> type _TableProps = TableProMaxProps<securityUnitIdListPagerVo, EnterprisesUnitPagerQueryParams>
const _formParams = reactive<securityUnitIdListParams>({ const _formParams = reactive<securityUnitIdListParams>({
@ -78,8 +79,14 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) =
} }
const _formRef = ref<FormExpose>(null) const _formRef = ref<FormExpose>(null)
const uploadFileRef = ref(null)
const _formOptions = ref<FormProMaxItemOptions<securityUnitIdListParams>>({ const _formOptions = ref<FormProMaxItemOptions<securityUnitIdListParams>>({
photo: {
type: 'custom',
label: '头像',
customRender: () => <SingleImageFileUpload height={200} v-model:value={_formParams.photo} ref={uploadFileRef} />,
},
name: { name: {
type: 'input', type: 'input',
label: '姓名', label: '姓名',
@ -274,7 +281,7 @@ export const showEnterprisesUnit = (record_) => {
onClick={() => onClick={() =>
deleteDataModal(record.name, async () => { deleteDataModal(record.name, async () => {
const resp = await api.delete('/m2/eu/del_security_user_id', { const resp = await api.delete('/m2/eu/del_security_user_id', {
securityUserId: record?.securityUnitId, securityUserId: record?.snowFlakeId,
}) })
message.success(resp.message) message.success(resp.message)
await _tableRef.value?.requestGetTableData() await _tableRef.value?.requestGetTableData()