diff --git a/src/views/system/stationList.vue b/src/views/system/stationList.vue index 9be17a9..2053e38 100644 --- a/src/views/system/stationList.vue +++ b/src/views/system/stationList.vue @@ -85,6 +85,18 @@ @change="handleStatus" > + + + + + @@ -201,12 +213,14 @@ export default { } } return { + categoryOptions: [], queryParam: {}, rules: { stationId: [{ required: true, message: 'Please Enter Station Id' }], stationCode: [{ required: true, validator: validateStationCode }], countryCode: [{ required: true, validator: validateCountryCode }], status: [{ required: true, message: 'Please Select Status', trigger: 'change' }], + category: [{ required: true, message: 'Please Select Category', trigger: 'change' }], }, url: { list: '/gardsStations/findPage', @@ -226,6 +240,23 @@ export default { this.$set(this.model, 'status', 'Operating') }, methods: { + async getCategoryItem() { + try { + const res = await getAction('/sys/dict/getItems', { dictCode: 'Station Category' }) + console.log(res) + this.categoryOptions = res.map((item) => { + return { + label: item.text, + value: item.value, + } + }) + } catch (error) { + console.error(error) + } + }, + onCategoryChange(val) { + console.log(val) + }, handleStatus(val) { this.model.status = val }, @@ -252,15 +283,20 @@ export default { }, onAdd() { + this.getCategoryItem() this.isAdd = true // this.model = {} this.visible = true }, onEdit() { + this.getCategoryItem() if (this.selectedRowKeys && this.selectedRowKeys.length) { this.isAdd = false this.visible = true const find = this.dataSource.find((item) => item.stationId === this.selectedRowKeys[0]) + if (find) { + find.category = find.category.toString() + } this.model = cloneDeep(find) } else { this.$message.warn('Please Select An Item To Edit')