Merge remote-tracking branch 'origin/main'

This commit is contained in:
luozhun 2024-12-11 11:27:26 +08:00
commit ddc0a7362e
13 changed files with 123 additions and 145 deletions

View File

@ -5,11 +5,14 @@
"appid": "touristappid",
"setting": {
"urlCheck": false,
"es6": false,
"es6": true,
"enhance": false,
"minified": true,
"minifyWXSS": true,
"minifyWXML": true,
"compileHotReLoad": false,
"postcss": false,
"minified": false
"postcss": true,
"minified": true
},
"compileType": "miniprogram"
}

View File

@ -24,6 +24,40 @@ const App = createApp({
})
}
},
onShow(){
const updateManager = Taro.getUpdateManager()
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
if (res.hasUpdate) {
// 新版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
})
updateManager.onUpdateReady(function() {
// 新版本已经准备好,可以提示用户更新
Taro.showModal({
title: '更新提示',
content: '发现新版本,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经准备好,调用 applyUpdate 应用新版本
updateManager.applyUpdate()
}
}
}).then(res=>{
console.log(res)
})
})
updateManager.onUpdateFailed(function() {
// 新版本下载失败,可进行一些提示用户的操作
Taro.showModal({
title: '已有新版本',
content: '请删除当前小程序,重新从搜索界面打开获取最新版本',
}).then(res => {
console.log(res)
})
})
}
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
})

View File

@ -10,3 +10,11 @@
height: 140px
}
}
.uploadPictures{
display: flex;
justify-content: center;
align-items: center;
width: 220px;
height: 254px;
border: 2px solid #d5d3d3;
}

View File

@ -1,7 +1,13 @@
<template>
<view class="form">
<nut-form ref="formRef" :model-value="formData" :rules="rules">
<nut-form-item label="头像" prop="avatar">
<nut-form-item label="头像" prop="avatar">
<!-- <view class="uploadPictures" @click="chooseImage">-->
<!-- <view v-if="!formData.photo">-->
<!-- <IconFont name="uploader" size="25" color="#98a7b0"></IconFont>-->
<!-- </view>-->
<!-- <image v-else :src="minioBaseUrl +formData.photo" style="width: 100%; height: 100%"></image>-->
<!-- </view>-->
<view @click="chooseImage" size>
<image v-if="!formData.photo" src="@/assets/logo/avatar1.png" style="width: 50px; height: 50px"></image>
<image v-else :src="minioBaseUrl +formData.photo" style="width: 160px; height: 128px"></image>
@ -29,7 +35,6 @@
<nut-form-item label="工作岗位" prop="workPost">
<nut-input v-model="formData.workPost" placeholder="请输入工作岗位" type="text" />
</nut-form-item>
<nut-form-item label="手机号" prop="telephone">
<nut-input v-model="formData.telephone" placeholder="请输入手机号" type="text" />
</nut-form-item>
@ -85,6 +90,7 @@ import dayjs from 'dayjs'
import { SecurityUserFormParams, securityNumberByIdCard } from '@/types/subPages/projectManager/securityUserForm'
import { FormInstance } from '@nutui/nutui-taro'
import { generateSimpleObjectName, getResignedObjectUrl } from '@/utils'
import {IconFont} from "@nutui/icons-vue-taro";
const SEX = enumSelectNodes('Sex')
const minioBaseUrl = process.env.TARO_APP_MINIO_URL
@ -112,7 +118,6 @@ const rules: FormRules = {
}
useLoad((options) => {
console.log(options)
type.value = options.type
if (type.value === 'QcCodeInput') {
formData.value = {
@ -191,7 +196,7 @@ const chooseImage = () => {
count: 1, //
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
sizeType:['original', 'compressed'],
camera: 'front',
success: async (res) => {
Url.value = res.tempFiles[0].tempFilePath

View File

@ -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",

View File

@ -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",

View File

@ -144,7 +144,7 @@ const props = withDefaults(defineProps<TableProMaxProps<T, P>>(), {
showExpandColumn: undefined,
sticky: undefined,
})
console.log(props)
// console.log(props)
const slots = defineSlots<TableProMaxSlots<T>>()
@ -189,7 +189,7 @@ const {
props.dataCallback,
props.requestError
)
console.log('pageParams', pageParams)
// console.log('pageParams', pageParams)
onMounted(() => props.requestAuto && requestGetTableData(true))

View File

@ -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,7 +35,20 @@ const _formParams = reactive<securityUnitIdListParams>({
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')
@ -47,13 +61,15 @@ const searchSecurityUnitId = debounce(async () => {
}
} else {
const res = await api.get<any>('/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<ComponentExposed<typeof TableProMax>>(null)
@ -232,7 +251,7 @@ export const showEnterprisesUnit = (record_) => {
{
dataIndex: 'securityNumber',
title: '保安证号',
width: 120,
width: 150,
ellipsis: true,
},
{

View File

@ -148,7 +148,7 @@ const columns: TableProps['columns'] = [
]
// const x: number = columns.reduce((a, b) => a + (b.width as number), 0)
const x: number = columns.reduce((a, b) => {
console.log('x_____________________', a, b, b.width)
// console.log('x_____________________', a, b, b.width)
return a + (b.width as number)
}, 0)

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script type="module" src="/src/assets/iconfont/iconfont.js"></script>
<title>Vite + Vue + TS</title>
<title>保安后台</title>
</head>
<body>
<div id="app"></div>

View File

@ -15,14 +15,10 @@
<SystemMenus/>
</a-layout-sider>
<a-layout>
<a-layout-header
class="layout-header"
>
<a-layout-header class="layout-header">
<layout-header v-model:collapsed="collapsed"/>
</a-layout-header>
<a-layout-content
class="layout-content"
>
<a-layout-content class="layout-content" >
<router-view v-slot="{ Component, route }">
<transition appear name="fade-transform" mode="out-in">
<keep-alive :include="keepAliveNames">

View File

@ -159,7 +159,7 @@ const transformData = (val:any,tree:any)=>{
}
// 2
const filter: ShowSearchType['filter'] = (inputValue, path) => {
return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
return path?.some(option => option.label.toLowerCase().indexOf(inputValue?.toLowerCase()) > -1);
};
//

View File

@ -1,114 +1,24 @@
<template>
<div class="search" id="search">
<a-input v-model="valueInput" @input="searchInput" placeholder="请进行搜索"></a-input>
<div v-if="valueInput">
<ul>
<li v-for="item in searchResults" :key="item.id">{{item}}</li>
</ul>
</div>
<div v-else >
没有找到相关结果
</div>
</div>
<AdministrativeDivisionsTree v-model:value="value" :show-search="{ filter }" @change="searchAdministrativeDivisionTree"></AdministrativeDivisionsTree>
</template>
<script setup lang="ts">
import {onMounted, ref,} from "vue";
const valueInput = ref('')
const list = ref([])
const dataList = ref([
{
id:0,
value:'齐家园'
},
{
id:1,
value:'刘德华'
},
{
id:2,
value:'张学友'
},{
id:3,
value:'黎明'
},
{
id:4,
value:'家具城'
},
{
id:5,
value:'左岸春天'
},
{
id:6,
value:'麦德龙商城'
},
{
id:7,
value:'世纪酒店'
},
{
id:8,
value:'四方小学'
},
{
id:9,
value:'海洋半岛'
},
{
id:10,
value:'育英小学'
},
{
id:11,
value:'明德小学'
},{
id:12,
value:'希望小学',
}
])
const searchResults = ref([])
const searchInput = (e:any)=>{
valueInput.value = e.target.value
if (!valueInput.value) {
searchResults.value = []
return;
}else{
searchResults.value = list.value.filter(item =>
item.toLowerCase().includes(valueInput.value.toLowerCase())
);
}
}
// watch(()=>valueInput.value,(value)=>{
// if(!value){
// searchResults.value = []
// }
// })
import AdministrativeDivisionsTree from "@/components/tree/AdministrativeDivisionsTree.vue";
import {ref} from "vue";
import {ShowSearchType} from "ant-design-vue/es/cascader";
onMounted(()=>{
dataList.value.map((item)=>{
return list.value.push(item.value)
})
})
const value = ref([ "110000", "110100", "110116", "110116005" ])
const filter: ShowSearchType['filter'] = (inputValue, path) => {
return path?.some(option => option.label.toLowerCase().indexOf(inputValue?.toLowerCase()) > -1);
};
const searchAdministrativeDivisionTree = (e:Array<string>)=>{
value.value = e as any
}
</script>
<style scoped lang="scss">
.search{
padding: 0 10px;
overflow: hidden;
border: 1px solid #4e71f2;
margin: 1px 5px;
border-radius: 10px;
width: 30%;
.ceShi{
height: 300px;
background: #ccc;
}
}
.nut-input{
padding: 20rpx 20rpx;
margin: 5px 0;
}
</style>