✨ MK公开页、预结算体验优化、地图选址与认证密码规则完善
This commit is contained in:
@@ -94,6 +94,17 @@
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #detailAddress-form>
|
||||
<el-input
|
||||
v-model="form.detailAddress"
|
||||
class="detail-address-input"
|
||||
readonly
|
||||
maxlength="255"
|
||||
show-word-limit
|
||||
placeholder="点击选择地图地址"
|
||||
@click="openAddressMapPicker"
|
||||
/>
|
||||
</template>
|
||||
<template #longitude-form>
|
||||
<el-input
|
||||
v-model="form.longitude"
|
||||
@@ -121,6 +132,13 @@
|
||||
</template>
|
||||
</avue-form>
|
||||
</el-dialog>
|
||||
<address-map-picker
|
||||
v-model="addressMapPickerVisible"
|
||||
:address="form.detailAddress"
|
||||
:longitude="form.longitude"
|
||||
:latitude="form.latitude"
|
||||
@confirm="handleAddressMapConfirm"
|
||||
/>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -134,12 +152,16 @@ import { openImportDialog } from '@/utils/import-excel';
|
||||
import { formatUpdateUserName } from '@/utils/audit';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
|
||||
import AddressMapPicker from '@/components/address-map-picker/main.vue';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
|
||||
const DEFAULT_COUNTRY_CODE = '+86';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
AddressMapPicker,
|
||||
},
|
||||
data() {
|
||||
const validateTmisCode = (rule, value, callback) => {
|
||||
if (!/^\d{5}$/.test(value || '')) {
|
||||
@@ -185,6 +207,7 @@ export default {
|
||||
loading: true,
|
||||
data: [],
|
||||
excelBox: false,
|
||||
addressMapPickerVisible: false,
|
||||
excelForm: {},
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
@@ -340,15 +363,14 @@ export default {
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
type: 'textarea',
|
||||
minRows: 2,
|
||||
formslot: true,
|
||||
span: 24,
|
||||
minWidth: 220,
|
||||
overHidden: false,
|
||||
maxlength: 255,
|
||||
showWordLimit: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入详细地址', trigger: 'blur' },
|
||||
{ required: true, message: '请选择详细地址', trigger: 'change' },
|
||||
{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
@@ -652,6 +674,29 @@ export default {
|
||||
handleCoordinateInput(prop, value) {
|
||||
this.form[prop] = normalizeCoordinateInput(value);
|
||||
},
|
||||
openAddressMapPicker() {
|
||||
this.addressMapPickerVisible = true;
|
||||
},
|
||||
handleAddressMapConfirm(payload) {
|
||||
const selection = typeof payload === 'string' ? { address: payload } : payload || {};
|
||||
if (selection.address) {
|
||||
this.form.detailAddress = selection.address;
|
||||
}
|
||||
if (
|
||||
selection.longitude !== undefined &&
|
||||
selection.longitude !== null &&
|
||||
selection.longitude !== ''
|
||||
) {
|
||||
this.form.longitude = Number(selection.longitude).toFixed(6);
|
||||
}
|
||||
if (
|
||||
selection.latitude !== undefined &&
|
||||
selection.latitude !== null &&
|
||||
selection.latitude !== ''
|
||||
) {
|
||||
this.form.latitude = Number(selection.latitude).toFixed(6);
|
||||
}
|
||||
},
|
||||
normalizeRow(row) {
|
||||
row.code = row.tmisCode ? `TL${row.tmisCode}` : row.code;
|
||||
row.regionCode = String(row.regionCode || '').trim();
|
||||
@@ -910,9 +955,16 @@ export default {
|
||||
:deep(.el-table td .cell) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.detail-address-input {
|
||||
cursor: pointer;
|
||||
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-input__inner) {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user