diff --git a/src/components/dict/JDictSelectTag.vue b/src/components/dict/JDictSelectTag.vue
index 5918142..1826980 100644
--- a/src/components/dict/JDictSelectTag.vue
+++ b/src/components/dict/JDictSelectTag.vue
@@ -105,14 +105,12 @@ export default {
})
},
handleInput(e = '') {
- console.log('qweq', e)
let val
if (Object.keys(e).includes('target')) {
val = e.target.value
} else {
val = e
}
- console.log(val)
this.$emit('change', val ? val : undefined)
//LOWCOD-2146 【菜单】数据规则,选择自定义SQL 规则值无法输入空格
this.$emit('input', val ? val : undefined)
diff --git a/src/views/system/stationList.vue b/src/views/system/stationList.vue
index 55e4d1b..9be17a9 100644
--- a/src/views/system/stationList.vue
+++ b/src/views/system/stationList.vue
@@ -79,7 +79,11 @@
-
+
@@ -99,76 +103,76 @@ const columns = [
align: 'left',
width: 100,
scopedSlots: {
- customRender: 'index'
+ customRender: 'index',
},
customHeaderCell: () => {
return {
style: {
- 'padding-left': '60px !important'
- }
+ 'padding-left': '60px !important',
+ },
}
},
customCell: () => {
return {
style: {
- 'padding-left': '60px !important'
- }
+ 'padding-left': '60px !important',
+ },
}
- }
+ },
},
{
title: 'STATION ID',
align: 'left',
dataIndex: 'stationId',
- width: 100
+ width: 100,
},
{
title: 'STATION CODE',
align: 'left',
width: 100,
- dataIndex: 'stationCode'
+ dataIndex: 'stationCode',
},
{
title: 'COUNTRY CODE',
align: 'left',
width: 100,
- dataIndex: 'countryCode'
+ dataIndex: 'countryCode',
},
{
title: 'TYPE',
align: 'left',
width: 100,
- dataIndex: 'type'
+ dataIndex: 'type',
},
{
title: 'LON',
align: 'left',
width: 100,
- dataIndex: 'lon'
+ dataIndex: 'lon',
},
{
title: 'LAT',
align: 'left',
width: 100,
- dataIndex: 'lat'
+ dataIndex: 'lat',
},
{
title: 'ELEVATION',
width: 100,
- dataIndex: 'elevation'
+ dataIndex: 'elevation',
},
{
title: 'DESCRIPTION',
width: 100,
dataIndex: 'description',
- ellipsis: true
+ ellipsis: true,
},
{
title: 'STATUS',
align: 'left',
width: 100,
- dataIndex: 'status'
- }
+ dataIndex: 'status',
+ },
]
export default {
@@ -188,10 +192,9 @@ export default {
}
const validateCountryCode = (_, value, callback) => {
- if(!value) {
+ if (!value) {
callback(new Error('Please Enter Country Code'))
- }
- else if (value.length > 2) {
+ } else if (value.length > 2) {
callback(new Error('Country Code Limit 2 Char'))
} else {
callback()
@@ -202,27 +205,34 @@ export default {
rules: {
stationId: [{ required: true, message: 'Please Enter Station Id' }],
stationCode: [{ required: true, validator: validateStationCode }],
- countryCode: [{ required: true, validator: validateCountryCode }]
+ countryCode: [{ required: true, validator: validateCountryCode }],
+ status: [{ required: true, message: 'Please Select Status', trigger: 'change' }],
},
url: {
list: '/gardsStations/findPage',
delete: '/gardsStations/deleteById',
add: '/gardsStations/create',
- edit: '/gardsStations/update'
+ edit: '/gardsStations/update',
},
countryCodeList: [],
- typeList: []
+ typeList: [],
}
},
created() {
this.getTypeList()
this.getCountryCodeList()
},
+ mounted() {
+ this.$set(this.model, 'status', 'Operating')
+ },
methods: {
+ handleStatus(val) {
+ this.model.status = val
+ },
async getTypeList() {
try {
const res = await getAction('/gardsStations/findType')
- this.typeList = res.filter(item => item).map(item => ({ label: item, value: item }))
+ this.typeList = res.filter((item) => item).map((item) => ({ label: item, value: item }))
} catch (error) {
console.error(error)
}
@@ -231,7 +241,7 @@ export default {
async getCountryCodeList() {
try {
const res = await getAction('/gardsStations/findCountryCode')
- this.countryCodeList = res.filter(item => item).map(item => ({ label: item, value: item }))
+ this.countryCodeList = res.filter((item) => item).map((item) => ({ label: item, value: item }))
} catch (error) {
console.error(error)
}
@@ -243,14 +253,14 @@ export default {
onAdd() {
this.isAdd = true
- this.model = {}
+ // this.model = {}
this.visible = true
},
onEdit() {
if (this.selectedRowKeys && this.selectedRowKeys.length) {
this.isAdd = false
this.visible = true
- const find = this.dataSource.find(item => item.stationId === this.selectedRowKeys[0])
+ const find = this.dataSource.find((item) => item.stationId === this.selectedRowKeys[0])
this.model = cloneDeep(find)
} else {
this.$message.warn('Please Select An Item To Edit')
@@ -264,12 +274,12 @@ export default {
cancelText: 'Cancel',
onOk: () => {
this.handleDelete(this.selectedRowKeys[0], 'stationId')
- }
+ },
})
} else {
this.$message.warn('Please Select An Item To Delete')
}
- }
+ },
},
computed: {
formItems() {
@@ -284,12 +294,12 @@ export default {
showSearch: true,
filterOption: this.filterOption,
style: {
- width: '261px'
- }
+ width: '261px',
+ },
},
style: {
- width: 'auto'
- }
+ width: 'auto',
+ },
},
{
label: 'Type',
@@ -301,12 +311,12 @@ export default {
showSearch: true,
filterOption: this.filterOption,
style: {
- width: '261px'
- }
+ width: '261px',
+ },
},
style: {
- width: 'auto'
- }
+ width: 'auto',
+ },
},
{
label: 'Status',
@@ -318,16 +328,16 @@ export default {
return document.body
},
style: {
- width: '261px'
- }
+ width: '261px',
+ },
},
style: {
- width: 'auto'
- }
- }
+ width: 'auto',
+ },
+ },
]
- }
- }
+ },
+ },
}