3 Commits

Author SHA1 Message Date
Liang0621 a228391ecc chore(config): 添加开发和生产环境配置文件及相关忽略规则
- 新增 .env.development 文件,配置开发环境变量
- 新增 .env.production 文件,配置生产环境变量及压缩选项
- 添加 .gitignore 文件,忽略常见临时文件和本地配置
- 新增 .npmrc 文件,配置私有npm仓库及认证信息
- 新增 .prettierrc.json,配置代码格式化规则
- 添加 403 错误页面背景图 svg 文件至 public/img/bg/目录
2026-07-20 15:36:45 +08:00
Liang0621 6b1863a9e6 chore(config): 添加开发和生产环境配置文件及相关忽略规则
- 新增 .env.development 文件,配置开发环境变量
- 新增 .env.production 文件,配置生产环境变量及压缩选项
- 添加 .gitignore 文件,忽略常见临时文件和本地配置
- 新增 .npmrc 文件,配置私有npm仓库及认证信息
- 新增 .prettierrc.json,配置代码格式化规则
- 添加 403 错误页面背景图 svg 文件至 public/img/bg/目录
2026-07-20 15:32:23 +08:00
Liang0621 0a2e0f1784 chore(config): 添加开发和生产环境配置文件及相关忽略规则
- 新增 .env.development 文件,配置开发环境变量
- 新增 .env.production 文件,配置生产环境变量及压缩选项
- 添加 .gitignore 文件,忽略常见临时文件和本地配置
- 新增 .npmrc 文件,配置私有npm仓库及认证信息
- 新增 .prettierrc.json,配置代码格式化规则
- 添加 403 错误页面背景图 svg 文件至 public/img/bg/目录
2026-07-20 15:08:51 +08:00
2 changed files with 67 additions and 19 deletions
+9 -2
View File
@@ -86,7 +86,10 @@ export const createOption = ({ validateLongitude, validateLatitude }) => ({
type: 'number', type: 'number',
precision: 6, precision: 6,
minWidth: 120, minWidth: 120,
rules: [{ validator: validateLongitude, trigger: 'blur' }], rules: [
{ required: true, message: '请输入经度', trigger: 'blur' },
{ validator: validateLongitude, trigger: 'blur' },
],
}, },
{ {
label: '纬度', label: '纬度',
@@ -94,13 +97,17 @@ export const createOption = ({ validateLongitude, validateLatitude }) => ({
type: 'number', type: 'number',
precision: 6, precision: 6,
minWidth: 120, minWidth: 120,
rules: [{ validator: validateLatitude, trigger: 'blur' }], rules: [
{ required: true, message: '请输入纬度', trigger: 'blur' },
{ validator: validateLatitude, trigger: 'blur' },
],
}, },
{ {
label: '行政区划', label: '行政区划',
prop: 'regionName', prop: 'regionName',
search: true, search: true,
minWidth: 150, minWidth: 150,
rules: [{ required: true, message: '请输入行政区划', trigger: 'blur' }],
}, },
{ {
label: '组织', label: '组织',
+58 -17
View File
@@ -306,37 +306,59 @@ export default {
}, },
handleSourceChange(value) { handleSourceChange(value) {
const source = this.sourceOptions.find(item => item.sourceId === value); const source = this.sourceOptions.find(item => item.sourceId === value);
if (!source) return; if (!source) {
this.form.addressName = this.form.addressName || source.addressName; this.resetTypeRelatedFields();
return;
}
this.form.addressName = source.addressName;
this.form.siteCode = source.siteCode; this.form.siteCode = source.siteCode;
this.form.siteCodeDisplay = source.siteCode; this.form.siteCodeDisplay = source.siteCode;
this.form.detailAddress = source.detailAddress; this.form.detailAddress = source.detailAddress;
this.form.regionName = source.regionName; this.form.regionName = source.regionName;
this.form.regionCode = source.regionCode;
this.form.longitude = source.longitude; this.form.longitude = source.longitude;
this.form.latitude = source.latitude; this.form.latitude = source.latitude;
}, },
handleAddressTypeChange(value, reset = true) { handleAddressTypeChange(value, reset = true) {
const sourceColumn = this.findColumn(this.option.column, 'sourceId'); const sourceColumn = this.findColumn(this.option.column, 'sourceId');
sourceColumn.rules = value === '常规地址' ? [] : [{ required: true, message: '请选择来源主数据', trigger: 'change' }]; if (sourceColumn) {
sourceColumn.rules =
value === '常规地址' ? [] : [{ required: true, message: '请选择来源主数据', trigger: 'change' }];
}
const sourceDisabled = value === '常规地址'; const sourceDisabled = value === '常规地址';
this.findColumn(this.option.column, 'longitude').disabled = !sourceDisabled; const longitudeColumn = this.findColumn(this.option.column, 'longitude');
this.findColumn(this.option.column, 'latitude').disabled = !sourceDisabled; const latitudeColumn = this.findColumn(this.option.column, 'latitude');
if (longitudeColumn) longitudeColumn.disabled = !sourceDisabled;
if (latitudeColumn) latitudeColumn.disabled = !sourceDisabled;
if (value === '常规地址') { if (value === '常规地址') {
if (reset) { if (reset) {
this.form.sourceId = undefined; this.resetTypeRelatedFields();
this.form.siteCode = '/';
this.form.siteCodeDisplay = '/';
this.sourceOptions = [];
} }
this.form.siteCode = '/';
this.form.siteCodeDisplay = '/';
this.sourceOptions = [];
return; return;
} }
if (reset) { if (reset) {
this.form.sourceId = undefined; this.resetTypeRelatedFields();
this.form.siteCode = '';
this.form.siteCodeDisplay = '';
} }
this.loadSourceOptions(); this.loadSourceOptions();
}, },
resetTypeRelatedFields() {
this.form.addressName = '';
this.form.sourceId = undefined;
this.form.siteCode = '';
this.form.siteCodeDisplay = '';
this.form.detailAddress = '';
this.form.regionName = '';
this.form.regionCode = '';
this.form.longitude = undefined;
this.form.latitude = undefined;
this.mapBox = false;
this.mapKeyword = '';
this.mapStatus = '可搜索地址或点击地图选点';
this.mapSelected = {};
},
normalizeRow(row) { normalizeRow(row) {
const submitRow = { const submitRow = {
...row, ...row,
@@ -344,6 +366,7 @@ export default {
addressType: String(row.addressType || '').trim(), addressType: String(row.addressType || '').trim(),
detailAddress: String(row.detailAddress || '').trim(), detailAddress: String(row.detailAddress || '').trim(),
regionName: String(row.regionName || '').trim(), regionName: String(row.regionName || '').trim(),
regionCode: String(row.regionCode || '').trim(),
contactName: String(row.contactName || '').trim(), contactName: String(row.contactName || '').trim(),
contactPhone: String(row.contactPhone || '').trim(), contactPhone: String(row.contactPhone || '').trim(),
remark: String(row.remark || '').trim(), remark: String(row.remark || '').trim(),
@@ -359,6 +382,10 @@ export default {
this.$message.warning('请选择类型'); this.$message.warning('请选择类型');
return false; return false;
} }
if (row.addressType !== '常规地址' && !row.sourceId) {
this.$message.warning('请选择来源主数据');
return false;
}
if (!row.addressName) { if (!row.addressName) {
this.$message.warning('请输入地址名称'); this.$message.warning('请输入地址名称');
return false; return false;
@@ -367,8 +394,16 @@ export default {
this.$message.warning('请输入详细地址'); this.$message.warning('请输入详细地址');
return false; return false;
} }
if (row.addressType !== '常规地址' && !row.sourceId) { if (!row.regionName) {
this.$message.warning('请选择来源主数据'); this.$message.warning('请输入行政区划');
return false;
}
if (row.longitude === undefined || row.longitude === null || row.longitude === '') {
this.$message.warning('请输入经度');
return false;
}
if (row.latitude === undefined || row.latitude === null || row.latitude === '') {
this.$message.warning('请输入纬度');
return false; return false;
} }
if (row.remark && row.remark.length > 200) { if (row.remark && row.remark.length > 200) {
@@ -479,9 +514,8 @@ export default {
const addressTypeColumn = this.findColumn(this.option.column, 'addressType'); const addressTypeColumn = this.findColumn(this.option.column, 'addressType');
addressTypeColumn.change = ({ value }) => this.handleAddressTypeChange(value); addressTypeColumn.change = ({ value }) => this.handleAddressTypeChange(value);
if (type === 'add') { if (type === 'add') {
this.form.addressType = this.form.addressType || '常规地址'; this.resetTypeRelatedFields();
this.form.siteCode = '/'; this.form.addressType = '常规地址';
this.form.siteCodeDisplay = '/';
this.handleAddressTypeChange(this.form.addressType); this.handleAddressTypeChange(this.form.addressType);
done(); done();
return; return;
@@ -498,10 +532,13 @@ export default {
siteCode: this.form.siteCode, siteCode: this.form.siteCode,
detailAddress: this.form.detailAddress, detailAddress: this.form.detailAddress,
regionName: this.form.regionName, regionName: this.form.regionName,
regionCode: this.form.regionCode,
longitude: this.form.longitude, longitude: this.form.longitude,
latitude: this.form.latitude, latitude: this.form.latitude,
}, },
]; ];
} else {
this.sourceOptions = [];
} }
done(); done();
}); });
@@ -583,6 +620,7 @@ export default {
lat: this.form.latitude, lat: this.form.latitude,
address: this.form.detailAddress, address: this.form.detailAddress,
regionName: this.form.regionName, regionName: this.form.regionName,
regionCode: this.form.regionCode,
}); });
this.mapStatus = this.mapSelected.longitude ? '已加载当前经纬度,可重新选点' : '可搜索地址或点击地图选点'; this.mapStatus = this.mapSelected.longitude ? '已加载当前经纬度,可重新选点' : '可搜索地址或点击地图选点';
this.mapBox = true; this.mapBox = true;
@@ -813,3 +851,6 @@ export default {
} }
} }
</style> </style>