1、修复基础配置
2、修复业务模块 3、拆分页面代码
This commit is contained in:
@@ -201,7 +201,7 @@ export default {
|
||||
},
|
||||
onLoad() {
|
||||
this.loading = true;
|
||||
getList(this.page.currentPage, this.page.pageSize, this.query)
|
||||
return getList(this.page.currentPage, this.page.pageSize, this.query)
|
||||
.then(res => {
|
||||
const pageData = res.data.data || {};
|
||||
this.data = pageData.records || [];
|
||||
@@ -268,10 +268,10 @@ export default {
|
||||
this.mappingRows.map(item => ({ key: item.key, value: String(item.value || '').trim() }))
|
||||
),
|
||||
})
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
this.$message.success('操作成功');
|
||||
this.dialogVisible = false;
|
||||
this.onLoad();
|
||||
await this.onLoad();
|
||||
})
|
||||
.finally(() => {
|
||||
this.submitLoading = false;
|
||||
|
||||
@@ -555,9 +555,8 @@ export default {
|
||||
editDisplay: false,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '初始化录入', value: '初始化录入' },
|
||||
{ label: '批量导入', value: '批量导入' },
|
||||
{ label: '手动录入', value: '手动录入' },
|
||||
{ label: '手动输入', value: '手动录入' },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -150,7 +150,7 @@ export default {
|
||||
};
|
||||
const validateTelegraphCode = (rule, value, callback) => {
|
||||
if (!/^[A-Z]{3}$/.test(String(value || '').toUpperCase())) {
|
||||
callback(new Error('电报码格式不正确或已存在'));
|
||||
callback(new Error('电报略码格式不正确或已存在'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
@@ -246,12 +246,12 @@ export default {
|
||||
change: ({ value }) => this.handleTmisChange(value),
|
||||
},
|
||||
{
|
||||
label: '电报码',
|
||||
label: '电报略码',
|
||||
prop: 'telegraphCode',
|
||||
minWidth: 100,
|
||||
maxlength: 3,
|
||||
rules: [
|
||||
{ required: true, message: '电报码格式不正确或已存在', trigger: 'blur' },
|
||||
{ required: true, message: '电报略码格式不正确或已存在', trigger: 'blur' },
|
||||
{ validator: validateTelegraphCode, trigger: 'blur' },
|
||||
],
|
||||
change: ({ value }) => this.handleTelegraphChange(value),
|
||||
@@ -454,9 +454,8 @@ export default {
|
||||
editDisplay: false,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '初始化导入', value: '初始化导入' },
|
||||
{ label: '批量', value: '批量' },
|
||||
{ label: '手动', value: '手动' },
|
||||
{ label: '批量导入', value: '批量' },
|
||||
{ label: '手动导入', value: '手动' },
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -695,13 +694,13 @@ export default {
|
||||
return Promise.reject(new Error('该TMIS编码已存在'));
|
||||
}
|
||||
if (telegraphExists) {
|
||||
return Promise.reject(new Error('电报码格式不正确或已存在'));
|
||||
return Promise.reject(new Error('电报略码格式不正确或已存在'));
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
},
|
||||
handleSubmitError(error, loading) {
|
||||
const uniqueMessages = ['该TMIS编码已存在', '电报码格式不正确或已存在'];
|
||||
const uniqueMessages = ['该TMIS编码已存在', '电报略码格式不正确或已存在'];
|
||||
if (uniqueMessages.includes(error.message)) {
|
||||
this.$message.warning(error.message);
|
||||
}
|
||||
@@ -782,10 +781,18 @@ export default {
|
||||
});
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
const tmisCodeColumn = this.findColumn('tmisCode');
|
||||
if (tmisCodeColumn) {
|
||||
// Avue 会复用列配置,打开不同记录前必须先清除上一次编辑状态。
|
||||
tmisCodeColumn.disabled = false;
|
||||
}
|
||||
if (['edit', 'view'].includes(type)) {
|
||||
this.regionInitializing = true;
|
||||
getDetail(this.form.id).then(res => {
|
||||
const detail = this.normalizeRegionForm(res.data.data || {});
|
||||
if (tmisCodeColumn) {
|
||||
tmisCodeColumn.disabled = type === 'edit' && Number(detail.status) === 1;
|
||||
}
|
||||
this.loadCityOptions(detail.provinceCode)
|
||||
.then(() => {
|
||||
this.ensureCityOption(detail);
|
||||
@@ -851,7 +858,7 @@ export default {
|
||||
});
|
||||
},
|
||||
handleImport() {
|
||||
openImportDialog(this, '铁路车站主数据');
|
||||
openImportDialog(this, '铁路车站主数据', () => this.onLoad(this.page, this.query));
|
||||
},
|
||||
handleExport() {
|
||||
this.$confirm('是否导出铁路车站主数据?', '提示', {
|
||||
|
||||
+26
-23
@@ -4,7 +4,11 @@
|
||||
<div class="box">
|
||||
<el-scrollbar>
|
||||
<basic-container>
|
||||
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
|
||||
<avue-tree
|
||||
:option="treeOption"
|
||||
:data="treeData"
|
||||
@node-click="nodeClick"
|
||||
/>
|
||||
</basic-container>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@@ -27,20 +31,8 @@
|
||||
<el-option label="区县" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据来源">
|
||||
<el-select v-model="searchForm.dataSource" clearable placeholder="请选择" style="width: 200px;">
|
||||
<el-option label="手动录入" value="手动录入" />
|
||||
<el-option label="初始化导入" value="初始化导入" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
||||
<el-form-item label="启停状态">
|
||||
<el-select v-model="searchForm.status" clearable placeholder="请选择" style="width: 200px;">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="停用" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div style="display: flex; flex-direction: row; align-items: center; justify-content: flex-end;">
|
||||
<el-form-item class="region-page__search-actions">
|
||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
||||
<el-button @click="handleSearchReset">清空</el-button>
|
||||
@@ -180,8 +172,6 @@ export default {
|
||||
code: '',
|
||||
name: '',
|
||||
regionLevel: undefined,
|
||||
dataSource: '',
|
||||
status: undefined,
|
||||
},
|
||||
parentOptions: [],
|
||||
syncLoading: false,
|
||||
@@ -203,6 +193,7 @@ export default {
|
||||
},
|
||||
addBtn: false,
|
||||
menu: false,
|
||||
defaultExpandAll: false,
|
||||
size: 'default',
|
||||
props: {
|
||||
labelText: '标题',
|
||||
@@ -458,7 +449,13 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
hasSearchCriteria() {
|
||||
return Object.values(this.searchForm).some(
|
||||
value => value !== '' && value !== undefined && value !== null
|
||||
);
|
||||
},
|
||||
handleSearch() {
|
||||
this.treeOption.defaultExpandAll = this.hasSearchCriteria();
|
||||
this.initTree();
|
||||
this.regionForm = {};
|
||||
},
|
||||
@@ -467,8 +464,6 @@ export default {
|
||||
code: '',
|
||||
name: '',
|
||||
regionLevel: undefined,
|
||||
dataSource: '',
|
||||
status: undefined,
|
||||
};
|
||||
this.handleSearch();
|
||||
},
|
||||
@@ -507,6 +502,10 @@ export default {
|
||||
this.$message.warning('请先选择一项区划');
|
||||
return;
|
||||
}
|
||||
if (Number(this.regionForm.regionLevel) >= 3) {
|
||||
this.$message.warning('区县已是末级,不能新增下级');
|
||||
return;
|
||||
}
|
||||
const parentCode = this.regionForm.code;
|
||||
const parentName = this.regionForm.name;
|
||||
const parentGroupCode = this.regionForm.parentCode || this.topCode;
|
||||
@@ -517,8 +516,7 @@ export default {
|
||||
this.regionForm.subCode = '';
|
||||
this.regionForm.originalCode = '';
|
||||
this.regionForm.name = '';
|
||||
this.regionForm.regionLevel =
|
||||
this.regionForm.regionLevel === 5 ? 5 : this.regionForm.regionLevel + 1;
|
||||
this.regionForm.regionLevel = Number(this.regionForm.regionLevel) + 1;
|
||||
this.loadParentOptionsByGroup(parentGroupCode, parentCode, parentName);
|
||||
},
|
||||
setRegionColumnDisplay(prop, display) {
|
||||
@@ -637,9 +635,14 @@ export default {
|
||||
},
|
||||
handleImport() {
|
||||
this.syncImportAction();
|
||||
openImportDialog(this, '行政区划', () => {
|
||||
this.initTree();
|
||||
});
|
||||
openImportDialog(
|
||||
this,
|
||||
'行政区划',
|
||||
() => {
|
||||
this.initTree();
|
||||
},
|
||||
{ timeout: 180000 }
|
||||
);
|
||||
},
|
||||
syncImportAction() {
|
||||
const column = this.findColumn(this.excelOption.column, 'excelFile');
|
||||
|
||||
Reference in New Issue
Block a user