新增个人中心页面

master
doublekou 12 months ago
parent ed5abb7b95
commit 2e1246dadb

@ -3,4 +3,4 @@ VITE_API_TIME_OUT=10000
VITE_PASSWORD_SECRET_KEY===ad-distribute= VITE_PASSWORD_SECRET_KEY===ad-distribute=
VITE_IMAGE_DOMAIN=https://hccake-img.oss-cn-shanghai.aliyuncs.com VITE_IMAGE_DOMAIN=https://hccake-img.oss-cn-shanghai.aliyuncs.com
# 用来回显图片 # 用来回显图片
VITE_SERVERURL=http://39.100.77.21:8000 VITE_SERVERURL=http://39.100.77.21:8001

@ -22,7 +22,7 @@ export function saveConfiguration(saveConfigurationDto: SysConfigurationDTO) {
gender: saveConfigurationDto.gender, gender: saveConfigurationDto.gender,
userId: saveConfigurationDto.userId, userId: saveConfigurationDto.userId,
nickname: saveConfigurationDto.nickname, nickname: saveConfigurationDto.nickname,
phone: saveConfigurationDto.phone, phoneNumber: saveConfigurationDto.phoneNumber,
username: saveConfigurationDto.username username: saveConfigurationDto.username
}) })
} }

@ -12,6 +12,6 @@ export interface SysConfigurationDTO {
userId: number | undefined userId: number | undefined
// jobNumber: number // jobNumber: number
nickname: string | undefined nickname: string | undefined
phone: string | undefined phoneNumber: string | undefined
username: string | undefined username: string | undefined
} }

@ -5,7 +5,17 @@
<header-dropdown v-else overlay-class-name="avatar-dropdown"> <header-dropdown v-else overlay-class-name="avatar-dropdown">
<span :class="[$style.action, $style.account]"> <span :class="[$style.action, $style.account]">
<a-avatar size="small" :class="$style.avatar" :src="currentUser.avatar" alt="avatar" /> <!-- <a-avatar size="small" :class="$style.avatar" :src="currentUser.avatar" alt="avatar" /> -->
<a-avatar
size="small"
:class="$style.avatar"
:src="
userStore.userInfo?.avatar
? envs.VITE_SERVERURL + '/avatar/' + userStore.userInfo?.avatar
: Avatar
"
alt="avatar"
/>
<span :class="[$style.name, 'anticon']">{{ currentUser.nickname }}</span> <span :class="[$style.name, 'anticon']">{{ currentUser.nickname }}</span>
</span> </span>
@ -41,8 +51,9 @@ import { Modal } from 'ant-design-vue'
import { logout } from '@/api/auth' import { logout } from '@/api/auth'
import { useUserStore } from '@/stores/user-store' import { useUserStore } from '@/stores/user-store'
import { loginPath } from '@/config' import { loginPath } from '@/config'
import { fileAbsoluteUrl } from '@/utils/file-utils' // import { fileAbsoluteUrl } from '@/utils/file-utils'
import { useMultiTabStore } from '@/stores/multitab-store' import { useMultiTabStore } from '@/stores/multitab-store'
import Avatar from '@/assets/images/avatar.png'
const multiTabStore = useMultiTabStore() const multiTabStore = useMultiTabStore()
@ -56,13 +67,15 @@ const props = withDefaults(defineProps<GlobalHeaderRightProps>(), {
}) })
const loading = ref(false) const loading = ref(false)
const envs = import.meta.env
const userStore = useUserStore() const userStore = useUserStore()
const currentUser = computed(() => { const currentUser = computed(() => {
const userInfo = userStore.userInfo const userInfo = userStore.userInfo
return { return {
nickname: userInfo?.nickname, nickname: userInfo?.nickname,
avatar: userInfo?.avatar ? fileAbsoluteUrl(userInfo?.avatar) : '' avatar: userInfo?.avatar ? userInfo?.avatar : ''
} }
}) })

@ -113,22 +113,6 @@
:rules="[{ required: true, message: '请输入小区名称', trigger: 'change' }]" :rules="[{ required: true, message: '请输入小区名称', trigger: 'change' }]"
name="detailAddress" name="detailAddress"
> >
<!-- <a-input id="tipinput" ref="detailAddressRef" v-model:value="formModel.detailAddress" autocomplete="off"
placeholder="请输入小区名称" :title="(formModel.address && formModel.address.length < 2) || !formModel.address
? '请先选择省市区'
: ''
" class="custom-tooltip" :disabled="title === '编辑预约' || title === '编辑'" :readonly="title === '详情' ||
title === '分发' ||
(formModel.address && formModel.address.length < 2) ||
!formModel.address
" /> -->
<!-- {{ formModel.address.length }} -->
<!-- :readonly="
title === '详情' ||
title === '分发' ||
(formModel.address && formModel.address.length < 2) ||
!formModel.address
" -->
<a-select <a-select
v-model:value="formModel.detailAddress" v-model:value="formModel.detailAddress"
show-search show-search
@ -441,7 +425,155 @@ import {
import type { CustomerDTO, GeopoliticalCustomersRecord } from '@/api/geopoliticalCustomers/types' import type { CustomerDTO, GeopoliticalCustomersRecord } from '@/api/geopoliticalCustomers/types'
import axios from 'axios' import axios from 'axios'
// //
// import { provincesAndCitiesAndAutonomousRegions } from '@/utils/geopolitical-customers'
//dom:rules = 'rulesData'
// const rulesData = {
// required: true,
// trigger: 'change'
// }
onMounted(() => {
//
provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions
// if (provincesAndCitiesAndAutonomousRegions) {
// const addressArray = JSON.parse(JSON.stringify(provincesAndCitiesAndAutonomousRegions))
// const arr: any[] = []
// addressArray.forEach((item: any) => {
// item.children.forEach((it: any) => {
// if (it.children) {
// delete it.children
// }
// })
// arr.push(item)
// })
// provincesAndCitiesAndAutonomousOptions.value = arr
// }
})
///
const isDisabled = ref(false)
const isReadOnly = ref(false)
const dynamicClass = computed(() => ({
'custom-disabled-style': isDisabled.value,
'custom-readonly-style': isReadOnly.value
}))
///
const reservationTimeisReadOnly = ref(false)
const reservationTimeClass = computed(() => ({
'custom-readonly-style': reservationTimeisReadOnly.value
}))
///
const isDetailAddressDisabled = ref(false)
const isDetailAddressReadOnly = ref(false)
const isDetailAddressReadOnlyDynamicClass = computed(() => ({
'custom-disabled-style': isDetailAddressDisabled.value,
'custom-readonly-style':
isDetailAddressReadOnly.value ||
(formModel.address && formModel.address.length < 2) ||
!formModel.address
}))
const formRef = ref<FormInstance>()
// const city = ref<string | undefined>('')
// const cityAnddistinguish = ref<string | undefined>('')
//
const provincesAndCitiesAndAutonomousOptions: any = ref([])
//change
const addressChange = async (value: any) => {
// console.log(value, 'value')
formModel.detailAddress = ''
if (value) {
formModel.economize = value[0]
formModel.market = value[1]
formModel.distinguish = value[2]
// console.log(value.length, 'value.length')
// if (value.length === 2) {
// formModel.detailAddress = value[0] + value[1]
// } else if (value.length === 3) {
// formModel.detailAddress = value[0] + value[1] + value[2]
// }
console.log('formModel.detailAddress', formModel.detailAddress)
// city.value = value[1].slice(0, -1)
// cityAnddistinguish.value = value[1] + value[2]
// await auto(value[1])
}
}
//(ref)
const radiusOptions = ref<SelectProps['options']>([
{
id: '3000',
name: '3km'
},
{
id: '5000',
name: '5km'
},
{
id: '10000',
name: '10km'
}
])
//change
const radiusChange = (value: SelectValue) => {
formModel.radius = value
}
//
const listData: any = ref([])
//()
const generateTimeSlots = (tradeStartTime: string, tradeEndTime: string) => {
const startHour = Number(tradeStartTime.split(':')[0])
const startMinute = Number(tradeStartTime.split(':')[1])
const endHour = Number(tradeEndTime.split(':')[0])
const endMinute = Number(tradeEndTime.split(':')[1])
const timeSlots = []
for (let hour = startHour; hour <= endHour; hour++) {
for (let minute = 0; minute < 60; minute += 30) {
if (hour === startHour && minute < startMinute) {
continue
}
if (hour === endHour && minute >= endMinute) {
break
}
const startTime = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`
const endTime = `${(hour + Math.floor(minute / 30)).toString().padStart(2, '0')}:${(
(minute + 30) %
60
)
.toString()
.padStart(2, '0')}`
const timeSlot = {
label: `${startTime}~${endTime}`,
value: `${startTime}~${endTime}`
}
timeSlots.push(timeSlot)
}
}
return timeSlots
}
// AMap.Geocoder ,AMap.Geocoder JavaScript API
const newAmapGeocoder = () => {
AMap.plugin('AMap.Geocoder', function () {
geocoder.value = new AMap.Geocoder({
city: '全国' // city adcode citycode
})
})
}
//
const key = ref('435631c2ed6e33af778b42b46b2260ee') //web api const key = ref('435631c2ed6e33af778b42b46b2260ee') //web api
const searchData = (city: string, keywords: string, callback: any) => { const searchData = (city: string, keywords: string, callback: any) => {
axios axios
@ -468,7 +600,7 @@ const searchData = (city: string, keywords: string, callback: any) => {
// //
const searchDataList = ref<any[]>([]) const searchDataList = ref<any[]>([])
// //
let timeout: any let timeout: any
function fetch(val: string, callback: any) { function fetch(val: string, callback: any) {
const dist: string = formModel.distinguish ? formModel.distinguish : formModel.market || '' const dist: string = formModel.distinguish ? formModel.distinguish : formModel.market || ''
@ -496,20 +628,11 @@ function fetch(val: string, callback: any) {
}) })
} }
} }
//
timeout = setTimeout(fake, 300) timeout = setTimeout(fake, 300)
} }
// AMap.Geocoder ,AMap.Geocoder JavaScript API //a-select/()
const newAmapGeocoder = () => {
AMap.plugin('AMap.Geocoder', function () {
geocoder.value = new AMap.Geocoder({
city: '全国' // city adcode citycode
})
})
}
//a-select/
const handleSearch = (val: string) => { const handleSearch = (val: string) => {
if (val) { if (val) {
formModel.detailAddress = val formModel.detailAddress = val
@ -522,24 +645,23 @@ const handleSearch = (val: string) => {
//a-select select //a-select select
const handleSelect = (val: string) => { const handleSelect = (val: string) => {
console.log(val, 'val')
formModel.detailAddress = val formModel.detailAddress = val
// getLocation('')
newAmapGeocoder() newAmapGeocoder()
getCenterMarkerAddress() getCenterMarkerAddress()
} }
// //a-selectselect
const accordingStorenameGetCenter = (pois: any) => { const accordingStorenameGetCenter = (pois: any) => {
isName.value = false isName.value = false
getCenterMarker('select', pois[0].location.lng, pois[0].location.lat) getCenterMarker('select', pois[0].location.lng, pois[0].location.lat)
} }
// //a-selectselect
const accordingAddressGetCenter = () => { const accordingAddressGetCenter = () => {
isName.value = true isName.value = true
newAmapGeocoder() newAmapGeocoder()
getLocation('select') getLocation('select')
} }
//
//
const getLocation = (type: string) => { const getLocation = (type: string) => {
// console.log(address, 'address') // console.log(address, 'address')
const addressValue = const addressValue =
@ -585,6 +707,42 @@ const getLocation = (type: string) => {
}) })
} }
// //
const getCenterMarker = (type: string, lng: number, lat: number) => {
formModel.otherAddressesInfo = `${lng},${lat}`
console.log(lng, lat, 'lng')
//
map.value.setCenter([lng, lat]) //
if (type === 'match' || type === 'select') {
//
map.value.setZoom(12) // 12
}
if (previousMarker.value && type === 'select') {
map.value.remove(markerCenter.value) //
}
//
markerCenter.value = new AMap.Marker({
position: [lng, lat], //
zIndex: 100 // z-index 100
})
//
markerCenter.value.setIcon(
new AMap.Icon({
image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png', // 使 URL
size: new AMap.Size(18, 30), //
imageSize: new AMap.Size(18, 30) //
})
)
markerCenter.value.setMap(map.value) //
previousMarker.value = marker // previousMarker
if (type === 'match') {
pagingQuery(lng, lat)
}
}
//
const getCenterMarkerAddress = () => { const getCenterMarkerAddress = () => {
createSearchService() createSearchService()
const addressValue = formModel.address?.toString().split(',').join('') + formModel.detailAddress const addressValue = formModel.address?.toString().split(',').join('') + formModel.detailAddress
@ -659,145 +817,6 @@ const getCenterMarkerAddress = () => {
}) })
} }
//
// import { provincesAndCitiesAndAutonomousRegions } from '@/utils/geopolitical-customers'
//dom:rules = 'rulesData'
// const rulesData = {
// required: true,
// trigger: 'change'
// }
onMounted(() => {
//
provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions
// if (provincesAndCitiesAndAutonomousRegions) {
// const addressArray = JSON.parse(JSON.stringify(provincesAndCitiesAndAutonomousRegions))
// const arr: any[] = []
// addressArray.forEach((item: any) => {
// item.children.forEach((it: any) => {
// if (it.children) {
// delete it.children
// }
// })
// arr.push(item)
// })
// provincesAndCitiesAndAutonomousOptions.value = arr
// }
})
///
const isDisabled = ref(false)
const isReadOnly = ref(false)
const dynamicClass = computed(() => ({
'custom-disabled-style': isDisabled.value,
'custom-readonly-style': isReadOnly.value
}))
///
const reservationTimeisReadOnly = ref(false)
const reservationTimeClass = computed(() => ({
'custom-readonly-style': reservationTimeisReadOnly.value
}))
///
const isDetailAddressDisabled = ref(false)
const isDetailAddressReadOnly = ref(false)
const isDetailAddressReadOnlyDynamicClass = computed(() => ({
'custom-disabled-style': isDetailAddressDisabled.value,
'custom-readonly-style':
isDetailAddressReadOnly.value ||
(formModel.address && formModel.address.length < 2) ||
!formModel.address
}))
const formRef = ref<FormInstance>()
// const city = ref<string | undefined>('')
// const cityAnddistinguish = ref<string | undefined>('')
//
const provincesAndCitiesAndAutonomousOptions: any = ref([])
//change
const addressChange = async (value: any) => {
// console.log(value, 'value')
formModel.detailAddress = ''
if (value) {
formModel.economize = value[0]
formModel.market = value[1]
formModel.distinguish = value[2]
// console.log(value.length, 'value.length')
// if (value.length === 2) {
// formModel.detailAddress = value[0] + value[1]
// } else if (value.length === 3) {
// formModel.detailAddress = value[0] + value[1] + value[2]
// }
console.log('formModel.detailAddress', formModel.detailAddress)
// city.value = value[1].slice(0, -1)
// cityAnddistinguish.value = value[1] + value[2]
// await auto(value[1])
}
}
//(ref)
const radiusOptions = ref<SelectProps['options']>([
{
id: '3000',
name: '3km'
},
{
id: '5000',
name: '5km'
},
{
id: '10000',
name: '10km'
}
])
//change
const radiusChange = (value: SelectValue) => {
formModel.radius = value
}
//
const listData: any = ref([])
//()
const generateTimeSlots = (tradeStartTime: string, tradeEndTime: string) => {
const startHour = Number(tradeStartTime.split(':')[0])
const startMinute = Number(tradeStartTime.split(':')[1])
const endHour = Number(tradeEndTime.split(':')[0])
const endMinute = Number(tradeEndTime.split(':')[1])
const timeSlots = []
for (let hour = startHour; hour <= endHour; hour++) {
for (let minute = 0; minute < 60; minute += 30) {
if (hour === startHour && minute < startMinute) {
continue
}
if (hour === endHour && minute >= endMinute) {
break
}
const startTime = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`
const endTime = `${(hour + Math.floor(minute / 30)).toString().padStart(2, '0')}:${(
(minute + 30) %
60
)
.toString()
.padStart(2, '0')}`
const timeSlot = {
label: `${startTime}~${endTime}`,
value: `${startTime}~${endTime}`
}
timeSlots.push(timeSlot)
}
}
return timeSlots
}
// //
const lng = ref<number | undefined>() const lng = ref<number | undefined>()
const lat = ref<number | undefined>() const lat = ref<number | undefined>()
@ -910,6 +929,11 @@ const pagingQuery = (lng: number | undefined, lat: number | undefined) => {
const accordingStorenameMatch = (pois: any) => { const accordingStorenameMatch = (pois: any) => {
isName.value = false isName.value = false
getCenterMarker('match', pois[0].location.lng, pois[0].location.lat) getCenterMarker('match', pois[0].location.lng, pois[0].location.lat)
console.log(
pois[0].location.lng,
pois[0].location.lat,
'pois[0].location.lng, pois[0].location.lat'
)
} }
// //
const accordingAddressMatch = () => { const accordingAddressMatch = () => {
@ -1107,9 +1131,9 @@ interface customStoreEntitiesItem {
// //
reservationTime: string reservationTime: string
} }
//, //,
const isSubmit = ref(false) const isSubmit = ref(false)
// //
const submitOperate = () => { const submitOperate = () => {
//address //address
const filteredObj = Object.fromEntries( const filteredObj = Object.fromEntries(
@ -1392,41 +1416,6 @@ const map = ref<any>({})
// AMap.GeocodergetAddress // AMap.GeocodergetAddress
const geocoder = ref<any>({}) const geocoder = ref<any>({})
//
const getCenterMarker = (type: string, lng: number, lat: number) => {
//
map.value.setCenter([lng, lat]) //
if (type === 'match' || type === 'select') {
//
map.value.setZoom(12) // 12
}
if (previousMarker.value && type === 'select') {
map.value.remove(markerCenter.value) //
}
//
markerCenter.value = new AMap.Marker({
position: [lng, lat], //
zIndex: 100 // z-index 100
})
//
markerCenter.value.setIcon(
new AMap.Icon({
image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png', // 使 URL
size: new AMap.Size(18, 30), //
imageSize: new AMap.Size(18, 30) //
})
)
markerCenter.value.setMap(map.value) //
previousMarker.value = marker // previousMarker
if (type === 'match') {
console.log(type, 'type')
pagingQuery(lng, lat)
}
}
const searchService = ref<any>({}) const searchService = ref<any>({})
// //
const createSearchService = () => { const createSearchService = () => {
@ -1443,155 +1432,152 @@ const createSearchService = () => {
// getCenterMarkerAddress('select') // getCenterMarkerAddress('select')
// } // }
const isName = ref<boolean>(false) const isName = ref<boolean>(false)
const selectedTipCurrent = ref<any>() // const selectedTipCurrent = ref<any>()
// // //
const performQuery = (selectedTip: any, detailAddress: string) => { // const performQuery = (selectedTip: any, detailAddress: string) => {
console.log('performQuery') // selectedTipCurrent.value = selectedTip
// //
selectedTipCurrent.value = selectedTip // //
// // const searchService = new AMap.PlaceSearch({
// // // API Key
const searchService = new AMap.PlaceSearch({ // key: '1d3839a0fe4ad113f7d88ec3775107b7',
// API Key // //
key: '1d3839a0fe4ad113f7d88ec3775107b7', // version: '2.0'
// // })
version: '2.0' // const addressValue = formModel.address?.toString().split(',').join('') + selectedTip.name
}) // //
const addressValue = formModel.address?.toString().split(',').join('') + selectedTip.name // searchService.search(addressValue, (status: any, result: any) => {
// // if (status === 'complete' && result.info === 'OK') {
searchService.search(addressValue, (status: any, result: any) => { // //
if (status === 'complete' && result.info === 'OK') { // const pois = result.poiList.pois
// // console.log(pois, 'pois')
const pois = result.poiList.pois // console.log(formModel.detailAddress, 'formModel.detailAddress')
console.log(pois, 'pois') // //
console.log(formModel.detailAddress, 'formModel.detailAddress') // // console.log(pois, 'pois')
// // // console.log(pois[0].location.lng, pois[0].location.lat, 'pois')
// console.log(pois, 'pois') // if (pois[0].name === formModel.detailAddress) {
// console.log(pois[0].location.lng, pois[0].location.lat, 'pois') // isName.value = false
if (pois[0].name === formModel.detailAddress) { // getCenterMarker('select', pois[0].location.lng, pois[0].location.lat)
isName.value = false // formModel.otherAddressesInfo = `${pois[0].location.lng},${pois[0].location.lat}`
getCenterMarker('select', pois[0].location.lng, pois[0].location.lat) // } else {
formModel.otherAddressesInfo = `${pois[0].location.lng},${pois[0].location.lat}` // isName.value = true
} else { // console.log(selectedTipCurrent.value, 'selectedTipCurrent.value')
isName.value = true // // getLocation(selectedTipCurrent.value)
console.log(selectedTipCurrent.value, 'selectedTipCurrent.value') // }
// getLocation(selectedTipCurrent.value) // } else {
} // //
} else { // console.log('')
// // }
console.log('地点搜索失败') // })
} // // if (isName.value) {
}) // // console.log(isName.value, 'isName.value')
// if (isName.value) {
// console.log(isName.value, 'isName.value') // // }
// // const geocoder = new AMap.Geocoder()
// } // // const location = selectedTip.location
// const geocoder = new AMap.Geocoder() // // if (location) {
// const location = selectedTip.location // // // 使
// if (location) { // // geocoder.getAddress(location, function (status: any, result: any) {
// // 使 // // if (status === 'complete' && result.info === 'OK') {
// geocoder.getAddress(location, function (status: any, result: any) { // // //
// if (status === 'complete' && result.info === 'OK') { // // const address = result.regeocode.formattedAddress
// // // // console.log('', address)
// const address = result.regeocode.formattedAddress // // console.log(detailAddress, 'detailAddress')
// console.log('', address)
// console.log(detailAddress, 'detailAddress') // // // ...
// // match()
// // ...
// match() // // // detailAddress = detailAddress.substring(0, 14)
// // // if (detailAddress === '8·') {
// // detailAddress = detailAddress.substring(0, 14) // // // detailAddress = detailAddress.substring(0, detailAddress.indexOf('') + 1)
// // if (detailAddress === '8·') { // // // console.log(detailAddress, 'detailAddress1111')
// // detailAddress = detailAddress.substring(0, detailAddress.indexOf('') + 1) // // // //
// // console.log(detailAddress, 'detailAddress1111') // // // getCenterMarker('select', detailAddress)
// // // // // // formModel.otherAddressesInfo = detailAddress
// // getCenterMarker('select', detailAddress) // // // } else {
// // formModel.otherAddressesInfo = detailAddress // // // //
// // } else { // // // getCenterMarker('select', detailAddress)
// // // // // // formModel.otherAddressesInfo = detailAddress
// // getCenterMarker('select', detailAddress) // // // }
// // formModel.otherAddressesInfo = detailAddress // // }
// // } // // })
// } // // } else {
// }) // // message.info(',')
// } else { // // }
// message.info(',') // }
// }
}
const detailAddress = ref<string>('')
const detailAddressRef = ref()
const auto = async (value: string) => {
await AMap.plugin('AMap.AutoComplete', function () {
console.log(autoComplete.value, 'value')
//AutoComplete;;,
// if (autoComplete.value) {
// autoComplete.value.setCity(value)
// } else {
// Autocomplete
const autoOptions = {
// city: value, //
// city: '330000', //
input: 'tipinput'
// keywords: formModel.address?.toString().split(',').join('') + formModel.detailAddress,
// citylimit: true, //
// noLocation: true //
}
// AMap.AutoComplete
autoComplete.value = new AMap.AutoComplete(autoOptions)
// }
setTimeout(() => {
autoComplete.value?.on('select', (e: any) => {
// detailAddressRef.value.stateValue.getValue()
// detailAddressRef.value.stateValue = 123
console.log(
detailAddressRef.value.stateValue,
'detailAddressRef.value.stateValue.getValue()'
)
console.log(detailAddressRef.value, 'detailAddressRef.value.value')
console.log(e.poi, 'e.poi')
const selectedTip = e.poi //
console.log(
formModel.economize,
formModel.market,
formModel.distinguish,
'formModel.economize && formModel.market && formModel.distinguish'
)
if (formModel.distinguish) {
if (formModel.economize && formModel.market) {
const result = selectedTip.name.replace(
formModel.economize + formModel.market + formModel.distinguish,
''
)
const address = formModel.economize + formModel.market + formModel.distinguish + result // 使 v-model
// formModel.detailAddress = address
const tipInput = document.querySelector('#tipinput') as HTMLElement
tipInput.innerHTML = address
// setTimeout(() => {
// detailAddressRef.value.stateValue = address
// })
console.log(result, 'result')
console.log(formModel.detailAddress, 'formModel.detailAddress')
}
} else {
if (formModel.economize && formModel.market) {
const result = selectedTip.name.replace(formModel.economize + formModel.market, '')
const address = formModel.economize + formModel.market + result // 使 v-model
formModel.detailAddress = address
detailAddressRef.value.stateValue = address
console.log(formModel.detailAddress, 'formModel.detailAddress')
}
}
detailAddress.value = selectedTip.district + selectedTip.address // const detailAddress = ref<string>('')
performQuery(selectedTip, detailAddress.value) // // const detailAddressRef = ref()
}) // const auto = async (value: string) => {
}, 300) // await AMap.plugin('AMap.AutoComplete', function () {
}) // //AutoComplete;;,
} // // if (autoComplete.value) {
// // autoComplete.value.setCity(value)
// // } else {
// // Autocomplete
// const autoOptions = {
// // city: value, //
// // city: '330000', //
// input: 'tipinput'
// // keywords: formModel.address?.toString().split(',').join('') + formModel.detailAddress,
// // citylimit: true, //
// // noLocation: true //
// }
// // AMap.AutoComplete
// autoComplete.value = new AMap.AutoComplete(autoOptions)
// // }
// setTimeout(() => {
// autoComplete.value?.on('select', (e: any) => {
// // detailAddressRef.value.stateValue.getValue()
// // detailAddressRef.value.stateValue = 123
// console.log(
// detailAddressRef.value.stateValue,
// 'detailAddressRef.value.stateValue.getValue()'
// )
// console.log(detailAddressRef.value, 'detailAddressRef.value.value')
// console.log(e.poi, 'e.poi')
// const selectedTip = e.poi //
// console.log(
// formModel.economize,
// formModel.market,
// formModel.distinguish,
// 'formModel.economize && formModel.market && formModel.distinguish'
// )
// if (formModel.distinguish) {
// if (formModel.economize && formModel.market) {
// const result = selectedTip.name.replace(
// formModel.economize + formModel.market + formModel.distinguish,
// ''
// )
// const address = formModel.economize + formModel.market + formModel.distinguish + result // 使 v-model
// // formModel.detailAddress = address
// const tipInput = document.querySelector('#tipinput') as HTMLElement
// tipInput.innerHTML = address
// // setTimeout(() => {
// // detailAddressRef.value.stateValue = address
// // })
// console.log(result, 'result')
// console.log(formModel.detailAddress, 'formModel.detailAddress')
// }
// } else {
// if (formModel.economize && formModel.market) {
// const result = selectedTip.name.replace(formModel.economize + formModel.market, '')
// const address = formModel.economize + formModel.market + result // 使 v-model
// formModel.detailAddress = address
// detailAddressRef.value.stateValue = address
// console.log(formModel.detailAddress, 'formModel.detailAddress')
// }
// }
// detailAddress.value = selectedTip.district + selectedTip.address
// performQuery(selectedTip, detailAddress.value) //
// })
// }, 300)
// })
// }
// //
const initMap = async () => { const initMap = async () => {
@ -1599,7 +1585,7 @@ const initMap = async () => {
// center: [120.1551, 30.2741], // // center: [120.1551, 30.2741], //
zoom: 18 // zoom: 18 //
}) })
await auto('全国') // await auto('')
if (title.value === '编辑预约' || title.value === '编辑') { if (title.value === '编辑预约' || title.value === '编辑') {
// //
getCenterMarker( getCenterMarker(

@ -127,6 +127,7 @@ function store(res: LoginResult) {
// //
const info = res.info const info = res.info
console.log(info, 'info')
const roleCodes = res.attributes?.roleCodes || [] const roleCodes = res.attributes?.roleCodes || []
const permissions = res.attributes?.permissions || [] const permissions = res.attributes?.permissions || []
userStore.userInfo = { userStore.userInfo = {

@ -63,16 +63,18 @@ interface formRuleItem {
pass: Array<object> pass: Array<object>
confirmPass: Array<object> confirmPass: Array<object>
} }
const confirmPass = (rule: any, value: any, callback: any) => { const confirmPass = (rule: any, value: any) => {
if (value) { return new Promise<void>((resolve, reject) => {
if (formModel.pass !== value) { if (value) {
callback(new Error('两次输入的密码不一致')) if (formModel.pass !== value) {
reject('两次输入的密码不一致')
} else {
resolve()
}
} else { } else {
callback() reject('请再次输入密码')
} }
} else { })
callback(new Error('请再次输入密码'))
}
} }
// //
const formRule = ref<formRuleItem>({ const formRule = ref<formRuleItem>({

@ -3,26 +3,19 @@
<a-row :gutter="20"> <a-row :gutter="20">
<a-col :xs="24" :sm="24" :md="10" :lg="10" :xl="10" style="margin-bottom: 10px"> <a-col :xs="24" :sm="24" :md="10" :lg="10" :xl="10" style="margin-bottom: 10px">
<a-card class="box-card" title="个人信息"> <a-card class="box-card" title="个人信息">
<!-- <div slot="header" class="clearfix">
<span>个人信息</span>
</div> -->
<div> <div>
<div v-if="user" style="text-align: center"> <div v-if="user" style="text-align: center">
<div class="a-upload"> <div class="a-upload">
<!-- :src="user.avatarName ? baseApi + '/avatar/' + user.avatarName : Avatar" -->
<!-- {{ 'http://39.100.77.21:8001/avatar/' + currentUser.avatar }} -->
<!-- {{ envs.VITE_SERVERURL + '/avatar/' + currentUser.avatar }} -->
<img <img
:src=" :src="
currentUser.avatar userStore.userInfo?.avatar
? envs.VITE_SERVERURL + '/avatar/' + currentUser.avatar ? envs.VITE_SERVERURL + '/avatar/' + userStore.userInfo?.avatar
: Avatar : Avatar
" "
title="点击上传头像" title="点击上传头像"
class="avatar" class="avatar"
@click="toggleShow" @click="toggleShow"
/> />
<!-- :params="params" -->
<myUpload <myUpload
v-model="show" v-model="show"
:headers="headers" :headers="headers"
@ -36,42 +29,25 @@
<li> <li>
<div style="height: 100%"> <div style="height: 100%">
<login-outlined /> 登录账号 <login-outlined /> 登录账号
<!-- <svg-icon icon-class="login" /> 登录账号 --> <div class="user-right">{{ userStore.userInfo?.username || '' }}</div>
<div class="user-right">{{ currentUser.username || '' }}</div>
</div> </div>
</li> </li>
<li> <li>
<smile-outlined /> 用户昵称 <smile-outlined /> 用户昵称
<!-- <svg-icon icon-class="user1" /> 用户昵称 --> <div class="user-right">{{ userStore.userInfo?.nickname }}</div>
<div class="user-right">{{ currentUser.nickname }}</div>
</li> </li>
<li> <li>
<user-outlined /> 用户角色 <user-outlined /> 用户角色
<div class="user-right">{{ userRole }}</div> <div class="user-right">{{ userRole }}</div>
<!-- <svg-icon icon-class="user" /> 用户角色 -->
<!-- <div v-for="item in user.roles" :key="item.id" class="user-right">
&nbsp;{{ item.name }}
</div> -->
</li> </li>
<!-- <li v-if="user.organizeName">
<svg-icon icon-class="dept" /> 所属小组
<div class="user-right">{{ user.organizeName }}</div>
</li> -->
<li> <li>
<phone-outlined /> 手机号码 <phone-outlined /> 手机号码
<!-- <svg-icon icon-class="phone" /> 手机号码 --> <div class="user-right">{{ userStore.userInfo?.phoneNumber }}</div>
<div class="user-right">{{ currentUser.phoneNumber }}</div>
</li> </li>
<!-- <li v-if="user.email">
<experiment-outlined /> 用户邮箱
<div class="user-right">{{ user.email }}</div>
</li> -->
<li> <li>
<safety-certificate-outlined /> 安全设置 <safety-certificate-outlined /> 安全设置
<!-- <svg-icon icon-class="anq" /> 安全设置 -->
<div class="user-right"> <div class="user-right">
<a @click="modifyPassword"></a> <a @click="modifyPassword"></a>
<!-- <a @click="$refs.email.dialog = true">修改邮箱</a> -->
</div> </div>
</li> </li>
</ul> </ul>
@ -92,12 +68,9 @@
:label-col="{ sm: { span: 24 }, md: { span: 3 } }" :label-col="{ sm: { span: 24 }, md: { span: 3 } }"
:wrapper-col="{ sm: { span: 24 }, md: { span: 20 } }" :wrapper-col="{ sm: { span: 24 }, md: { span: 20 } }"
> >
<!-- <a-form-item label="工号">
<a-input v-model="form.jobNumber" style="width: 35%" />
<span style="color: #C0C0C0;margin-left: 10px;">工号</span>
</a-form-item> -->
<a-form-item <a-form-item
label="昵称" label="昵称"
name="nickName"
:rules="[ :rules="[
{ required: true, message: '请输入用户昵称', trigger: 'blur' }, { required: true, message: '请输入用户昵称', trigger: 'blur' },
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' } { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
@ -108,6 +81,7 @@
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="手机号" label="手机号"
name="phone"
:rules="[{ required: true, trigger: 'blur', validator: validPhone }]" :rules="[{ required: true, trigger: 'blur', validator: validPhone }]"
> >
<a-input v-model:value="formModel.phone" style="width: 40%" /> <a-input v-model:value="formModel.phone" style="width: 40%" />
@ -119,10 +93,6 @@
<a-radio label="女" :value="2"></a-radio> <a-radio label="女" :value="2"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<!-- <a-form-item label="企微验证">
<a-input v-model="form.greetMessage" style="width: 35%;" />
<span style="color: #C0C0C0;margin-left: 10px;">用作企微好友添加验证模板</span>
</a-form-item> -->
<a-form-item :wrapper-col="{ offset: 3, span: 4 }"> <a-form-item :wrapper-col="{ offset: 3, span: 4 }">
<a-button :loading="saveLoading" size="mini" type="primary" @click="doSubmit" <a-button :loading="saveLoading" size="mini" type="primary" @click="doSubmit"
>保存配置</a-button >保存配置</a-button
@ -130,191 +100,34 @@
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-tab-pane> </a-tab-pane>
<!-- 线索规则 -->
<!-- <a-tab-pane v-if="user.isManager" key="2" tab="规则线索">
<div>
<div class="pan-item">
<label class="pan-label">线索回收</label>
<a-input
v-model="configureRule.recycleNumber"
type="Number"
style="width: 120px"
/>
<a-select
v-model="configureRule.recycleUnit"
placeholder="请选择"
class="ml-10"
style="width: 90px"
>
<a-option label="天" value="0" />
<a-option label="周" value="1" />
<a-option label="月" value="2" />
</a-select>
<span style="color: #c0c0c0; margin-left: 10px; font-size: 14px"
>线索指定时长内没有完结自动进入公海</span
>
</div>
<div class="pan-item">
<label class="pan-label">线索公示</label>
<a-input v-model="configureRule.idleNumber" type="Number" style="width: 120px" />
<a-select
v-model="configureRule.idleUnit"
placeholder="请选择"
class="ml-10"
style="width: 90px"
>
<a-option label="时" value="0" />
<a-option label="天" value="1" />
</a-select>
<span style="color: #c0c0c0; margin-left: 10px; font-size: 14px"
>线索进入公海后公示时长</span
>
</div>
<div class="pan-item">
<label class="pan-label" />
<a-button
:loading="saveLoading"
size="mini"
class=""
type="primary"
@click="configureRuleSubmit"
>保存配置</a-button
>
</div>
</div>
</a-tab-pane> -->
<!-- 操作日志 -->
<!-- <a-tab-pane v-if="user.addWeChatFlag" key="3" tab="企微模版">
<div class="u-flex">
<a-input
v-if="inputVisible"
ref="saveTagInput"
v-model="inputValue"
class="input-new-tag"
type="textarea"
:rows="2"
placeholder="请输入内容"
/>
<a-button
v-if="inputVisible"
class="filter-item ml-10"
size="mini"
type="primary"
@click.stop="toAdd"
>
保存
</a-button>
<a-button
v-if="inputVisible"
class="filter-item"
size="mini"
@click.stop="inputVisible = false"
>
取消
</a-button>
<a-button
v-else-if="!inputVisible"
class="filter-item"
size="mini"
type="primary"
icon="a-icon-plus"
@click.stop="showInput"
>
新增
</a-button>
</div> -->
<!-- <a-table
:data="templateArr"
:loading="templateLoading"
:header-cell-style="{ 'text-align': 'left' }"
style="width: 100%"
>
<a-table-column prop="greatMessage" label="消息内容" />
<a-table-column prop="status" label="是否默认">
<template #default="scope">
<span :style="{ color: scope.row.isDefault == 1 ? '#67c23a' : '' }">{{
scope.row.isDefault == 1 ? '当前默认' : '否'
}}</span>
</template>
</a-table-column>
<a-table-column prop="createTime" label="创建日期">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</a-table-column>
<a-table-column align="center">
<template #default="scope">
<a-button
slot="reference"
type="danger"
size="mini"
@click="toDelete(scope.row.id)"
>删除</a-button
>
<a-button
v-if="scope.row.isDefault != 1"
size="mini"
type="primary"
@click="toEdit(scope.row.id)"
>设置默认</a-button
>
</template>
</a-table-column>
</a-table> -->
<!-- </a-tab-pane> -->
<!--分页组件-->
<!-- <a-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</a-tab-pane> -->
</a-tabs> </a-tabs>
</a-card> </a-card>
</a-col> </a-col>
</a-row> </a-row>
<!-- <updateEmail ref="email" :email="user.email" /> -->
<updatePass ref="pass" />
<!-- 修改密码弹窗 --> <!-- 修改密码弹窗 -->
<updatepass-modal ref="gupdatepassModalRef" /> <updatepass-modal ref="updatepassModalRef" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
//
import 'babel-polyfill' import 'babel-polyfill'
import myUpload from 'vue-image-crop-upload' import myUpload from 'vue-image-crop-upload'
// import { mapGetters } from 'vuex'
import updatePass from './center/updatePass.vue'
// import { getToken } from '@/utils/auth'
// import store from '@/store'
// import Cookies from 'js-cookie'
// import { isvalidPhone } from '@/utils/validate'
// import crud from '@/mixins/crud'
// import { editUser } from '@/api/system/user'
import Avatar from '@/assets/images/avatar.png' import Avatar from '@/assets/images/avatar.png'
// import {
// wechatSendMessageList,
// wechatSendMessageAdd,
// changeIsDefault,
// wechatSendMessageDel,
// getpoolQuery,
// setPoolConfigure
// } from '@/api/index'
// //
import UpdatepassModal from '@/views/system/userCenter/center/updatePass.vue' import UpdatepassModal from '@/views/system/userCenter/center/updatePass.vue'
import { FormAction } from '@/hooks/form' import { FormAction } from '@/hooks/form'
// //
import { saveConfiguration, getUserInfo } from '@/api/personCenter' import { saveConfiguration, getUserInfo } from '@/api/personCenter'
// //
import { useUserStore } from '@/stores/user-store' import { useUserStore } from '@/stores/user-store'
import { loginPath } from '@/config'
import { logout } from '@/api/auth'
import { useMultiTabStore } from '@/stores/multitab-store'
import type { FormInstance } from 'ant-design-vue'
import { doRequest } from '@/utils/axios/request'
import { message } from 'ant-design-vue'
// import { fileAbsoluteUrl } from '@/utils/file-utils' // import { fileAbsoluteUrl } from '@/utils/file-utils'
// import { serverAddress } from '../../../../vite.config'
// import config from '@/../vite.config'
const envs = import.meta.env
const activeKey = ref('1') const activeKey = ref('1')
const user = ref({ const user = ref({
@ -322,22 +135,48 @@ const user = ref({
}) })
//myUpload //myUpload
const show = ref<boolean>(false) const show = ref<boolean>(false)
//urlip
const envs = import.meta.env
// //
const userStore = useUserStore() const userStore = useUserStore()
onMounted(() => {
const currentUser = computed(() => { formModel.phone = userStore.userInfo?.phoneNumber
const userInfo = userStore.userInfo formModel.gender = userStore.userInfo?.gender
console.log(userInfo, 'userInfo') getUserInfoData()
return {
nickname: userInfo?.nickname,
username: userInfo?.username,
phoneNumber: userInfo?.phoneNumber,
avatar: userInfo?.avatar ? userInfo?.avatar : '',
gender: userInfo?.gender,
userId: userInfo?.userId
}
}) })
//
const userRole = ref<string>('')
//
const getUserInfoData = () => {
doRequest(getUserInfo(toRaw(userStore.userInfo?.userId)), {
onSuccess: (res: any) => {
if (res.code === 200) {
if (userStore.userInfo) {
userStore.userInfo.nickname = res.data.nickname ? res.data.nickname : ''
userStore.userInfo.phoneNumber = res.data.phoneNumber ? res.data.phoneNumber : ''
userStore.userInfo.avatar = res.data.avatar ? res.data.avatar : ''
}
userRole.value = res.data.roleList[0].name
formModel.nickName = res.data.nickname
formModel.gender = res.data.gender
}
}
})
}
// const currentUser = computed(() => {
// const userInfo = userStore.userInfo
// console.log(userInfo, 'userInfo')
// return {
// nickname: userInfo?.nickname,
// username: userInfo?.username,
// phoneNumber: userInfo?.phoneNumber,
// avatar: userInfo?.avatar ? userInfo?.avatar : '',
// gender: userInfo?.gender,
// userId: userInfo?.userId
// }
// })
interface formModelItem { interface formModelItem {
nickName?: string nickName?: string
phone?: string phone?: string
@ -349,100 +188,49 @@ const formModel = reactive<formModelItem>({
phone: '', phone: '',
gender: undefined gender: undefined
}) })
const formRule = ref<any>({
nickName: [
{ required: true, message: '请输入用户昵称', trigger: 'blur' },
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
]
})
//
const userRole = ref<string>('')
// const serverAddress = ref<any>('')
onMounted(() => {
formModel.nickName = currentUser.value.nickname
formModel.phone = currentUser.value.phoneNumber
formModel.gender = currentUser.value.gender
// console.log(serverAddress, 'serverAddress')
getUserInfoData()
// baseUrl.value = import.meta.env.VITE_API_URL
// console.log(baseUrl.value, 'baseUrl')
})
const getUserInfoData = () => {
doRequest(getUserInfo(toRaw(currentUser.value.userId)), {
onSuccess: (res: any) => {
if (res.code === 200) {
console.log(res.data.roleList[0].name, 'res')
userRole.value = res.data.roleList[0].name
currentUser.value.avatar = res.data.avatar ? res.data.avatar : ''
// fileAbsoluteUrl(userInfo?.avatar)
console.log(currentUser.value.avatar, 'currentUser.value.avatar')
}
}
})
}
// //
const isvalidPhone = (phone: string) => { const isvalidPhone = (phone: string) => {
const reg = /^1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}$/ const reg = /^1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}$/
return reg.test(phone) return reg.test(phone)
} }
// //
const validPhone = (rule: any, value: any, callback: any) => { const validPhone = (rule: any, value: any) => {
if (!value) { if (!value) {
callback(new Error('请输入电话号码')) return Promise.reject('请输入电话号码')
} else if (!isvalidPhone(value)) { } else if (!isvalidPhone(value)) {
callback(new Error('请输入正确的11位手机号码')) return Promise.reject('请输入正确的11位手机号码')
} else { } else {
callback() return Promise.resolve()
} }
} }
//ref //ref
const gupdatepassModalRef = ref<InstanceType<typeof UpdatepassModal>>() const updatepassModalRef = ref<InstanceType<typeof UpdatepassModal>>()
// //
const modifyPassword = () => { const modifyPassword = () => {
gupdatepassModalRef.value?.open(FormAction.CREATE, currentUser.value.userId) updatepassModalRef.value?.open(FormAction.CREATE, userStore.userInfo?.userId)
} }
// //loading
const saveLoading = ref<boolean>(false) const saveLoading = ref<boolean>(false)
// //
const { accessToken } = useUserStore() const { accessToken } = useUserStore()
const headers = ref({ const headers = ref({
Authorization: 'Bearer ' + accessToken Authorization: 'Bearer ' + accessToken
// 'Access-Control-Allow-Origin': '*'
}) })
console.log(headers.value.Authorization, 'Authorization') const baseUrl = import.meta.env.VITE_API_URL
const updateAvatarApi = baseUrl + '/system/user/avatar'
const router = useRouter()
const multiTabStore = useMultiTabStore()
const toggleShow = () => { const toggleShow = () => {
show.value = !show.value show.value = !show.value
} }
const cropUploadSuccess = (jsonData: any, field: any) => { const cropUploadSuccess = (jsonData: any, field: any) => {
// store.dispatch('GetInfo').then(() => {}) // store.dispatch('GetInfo').then(() => {})
getUserInfoData() getUserInfoData()
// const userStore = useUserStore()
// const currentUser = computed(() => {
// const userInfo = userStore.userInfo
// console.log(userInfo, 'userInfo')
// return {
// nickname: userInfo?.nickname,
// username: userInfo?.username,
// phoneNumber: userInfo?.phoneNumber,
// avatar: userInfo?.avatar ? fileAbsoluteUrl(userInfo?.avatar) : '',
// gender: userInfo?.gender,
// userId: userInfo?.userId
// }
// })
} }
const baseUrl = import.meta.env.VITE_API_URL
const updateAvatarApi = baseUrl + '/system/user/avatar' //
console.log(updateAvatarApi, 'baseUrl')
const router = useRouter()
import { loginPath } from '@/config'
import { logout } from '@/api/auth'
import { useMultiTabStore } from '@/stores/multitab-store'
const multiTabStore = useMultiTabStore()
// //
const errorImg = (err: any) => { const errorImg = (err: any) => {
const response = JSON.parse(err.message) const response = JSON.parse(err.message)
const code = response.code const code = response.code
@ -470,10 +258,7 @@ const errorImg = (err: any) => {
} }
} }
const form = ref<FormInstance>() const form = ref<FormInstance>()
import type { FormInstance } from 'ant-design-vue'
import { doRequest } from '@/utils/axios/request'
import { message } from 'ant-design-vue'
import { env } from 'process'
const doSubmit = () => { const doSubmit = () => {
// if (this.$refs['form']) { // if (this.$refs['form']) {
// this.$refs['form'].validate(valid => { // this.$refs['form'].validate(valid => {
@ -491,223 +276,33 @@ const doSubmit = () => {
// } // }
// }) // })
// } // }
form.value form.value
?.validate() ?.validate()
.then(() => { .then(() => {
doRequest( doRequest(
saveConfiguration( saveConfiguration(
toRaw({ toRaw({
gender: currentUser.value.gender, gender: formModel.gender,
userId: currentUser.value.userId, userId: userStore.userInfo?.userId,
nickname: '管理员', nickname: formModel.nickName,
phone: currentUser.value.phoneNumber, phoneNumber: formModel.phone,
username: currentUser.value.username username: userStore.userInfo?.username
}) })
), ),
{ {
onSuccess: (res: any) => { onSuccess: (res: any) => {
// if (res.code === 200) { if (res.code === 200) {
message.success('编辑成功') getUserInfoData()
// } message.success('编辑成功')
}
} }
} }
) )
// if (formModel.customStoreEntities.length === 0) {
// message.info('')
// } else {
// formModel.enrollStatus = 0
// submitOperate()
// // handleSubmit()
// }
}) })
.catch(err => { .catch(err => {
console.log('校验失败err', err) console.log('校验失败err', err)
}) })
} }
// const params = ref({
// userId: currentUser.value.userId
// })
//tab
// const handleClick = (tab: any, event: any) => {
// if (tab.name === 'template') {
// totemplateArr()
// }
// if (tab.name === 'clueRule') {
// getpoolQuery()
// }
// }
// const totemplateArr = () => {
// this.templateLoading = true
// wechatSendMessageList().then(res => {
// this.templateLoading = false
// this.templateArr = res.data
// })
// }
// export default {
// name: 'Center',
// components: { updatePass, myUpload },
// // mixins: [crud],
// data() {
// //
// const validPhone = (rule, value, callback) => {
// if (!value) {
// callback(new Error(''))
// } else if (!isvalidPhone(value)) {
// callback(new Error('11'))
// } else {
// callback()
// }
// }
// return {
// show: false,
// Avatar: Avatar,
// c: 3,
// activeName: 'first',
// saveLoading: false,
// inputVisible: false, // input
// inputValue: '',
// templateLoading: false,
// baseApi: '',
// headers: {
// Authorization: 'Bearer ' //+ getToken()
// },
// form: {},
// configureRule: {
// recycleNumber: '',
// recycleUnit: '0',
// jobNumber: '',
// idleNumber: '',
// idleUnit: '0',
// id: ''
// }, // 线
// rules: {
// nickName: [
// { required: true, message: '', trigger: 'blur' },
// { min: 2, max: 20, message: ' 2 20 ', trigger: 'blur' }
// ],
// phone: [{ required: true, trigger: 'blur', validator: validPhone }]
// },
// templateArr: [],
// user: {
// username: ''
// }
// }
// },
// computed: {
// // ...mapGetters(['user', 'updateAvatarApi', 'baseImgUrl'])
// },
// created() {
// // this.form = {
// // id: this.user.id,
// // nickName: this.user.nickName,
// // gender: this.user.gender,
// // phone: this.user.phone,
// // jobNumber: this.user.jobNumber
// // }
// // this.baseApi = this.baseImgUrl
// // store.dispatch('GetInfo').then(() => {})
// },
// methods: {
// totemplateArr() {
// this.templateLoading = true
// wechatSendMessageList().then(res => {
// this.templateLoading = false
// this.templateArr = res.data
// })
// },
// showInput() {
// this.inputVisible = true
// this.$nextTick(() => {
// this.$refs.saveTagInput.focus()
// })
// },
// handleInputConfirm() {
// this.inputVisible = false
// this.inputValue = ''
// },
// toAdd() {
// wechatSendMessageAdd({
// greatMessage: this.inputValue
// }).then(res => {
// this.handleInputConfirm()
// this.totemplateArr()
// })
// },
// toEdit(id) {
// changeIsDefault({
// isDefault: 1,
// id: id
// }).then(res => {
// this.$notify({
// title: '',
// message: '',
// type: 'success'
// })
// this.totemplateArr()
// })
// },
// toDelete(id) {
// wechatSendMessageDel({
// id: id
// }).then(res => {
// this.$notify({
// title: '',
// message: '',
// type: 'success'
// })
// this.totemplateArr()
// })
// },
// handleClick(tab, event) {
// if (tab.name === 'template') {
// this.totemplateArr()
// }
// if (tab.name === 'clueRule') {
// this.getpoolQuery()
// }
// },
// beforeInit() {
// this.url = 'api/logs/user'
// return true
// },
// // 线
// getpoolQuery() {
// getpoolQuery({ companyId: this.user.companyId }).then(res => {
// if (res.data) {
// this.configureRule = res.data
// }
// })
// },
// configureRuleSubmit() {
// if (!this.configureRule.recycleNumber || Number(this.configureRule.recycleNumber) <= 0) {
// this.$message.warning('线')
// return false
// }
// if (!this.configureRule.idleNumber || Number(this.configureRule.idleNumber) < 0) {
// this.$message.warning('线')
// return false
// }
// this.configureRule.companyId = this.user.companyId
// this.saveLoading = true
// setPoolConfigure(this.configureRule)
// .then(res => {
// this.saveLoading = false
// this.$message.success('')
// this.getpoolQuery()
// })
// .catch(() => {
// this.saveLoading = false
// this.$message.error('')
// })
// }
// }
// }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

Loading…
Cancel
Save