Merge branch 'master-dev' into feature-Beta-dev-renpy

This commit is contained in:
orgin 2024-03-06 17:10:34 +08:00
commit d57ab15b53
3 changed files with 116 additions and 62 deletions

View File

@ -105,14 +105,12 @@ export default {
}) })
}, },
handleInput(e = '') { handleInput(e = '') {
console.log('qweq', e)
let val let val
if (Object.keys(e).includes('target')) { if (Object.keys(e).includes('target')) {
val = e.target.value val = e.target.value
} else { } else {
val = e val = e
} }
console.log(val)
this.$emit('change', val ? val : undefined) this.$emit('change', val ? val : undefined)
//LOWCOD-2146 SQL //LOWCOD-2146 SQL
this.$emit('input', val ? val : undefined) this.$emit('input', val ? val : undefined)

View File

@ -1,6 +1,7 @@
<template> <template>
<div style="height: 100%"> <div style="height: 100%">
<SearchBar type="alarmAnalysis" @search="handleSearch"></SearchBar> <SearchBar type="alarmAnalysis" @search="handleSearch"></SearchBar>
<div style="width: 100%; height: calc(100% - 50px)">
<a-spin :spinning="spinning"> <a-spin :spinning="spinning">
<div class="chart-layout" id="analysisChartBar"></div> <div class="chart-layout" id="analysisChartBar"></div>
<div class="chart-box"> <div class="chart-box">
@ -15,6 +16,7 @@
</div> </div>
</a-spin> </a-spin>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -107,9 +109,11 @@ export default {
.then((res) => { .then((res) => {
this.spinning = false this.spinning = false
if (res.success) { if (res.success) {
if (res.result.pieTotal > 0) {
this.pieData = res.result.pieData this.pieData = res.result.pieData
this.pieTotal = res.result.pieTotal this.pieTotal = res.result.pieTotal
this.drawRightChart() this.drawRightChart()
}
} else { } else {
this.$message.warning('This operation fails. Contact your system administrator') this.$message.warning('This operation fails. Contact your system administrator')
} }
@ -314,12 +318,18 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
::v-deep.ant-spin-nested-loading {
height: 100%;
.ant-spin-container {
height: 100%;
}
}
.chart-layout { .chart-layout {
height: 400px; height: 400px;
margin-left: 20px; margin-left: 20px;
} }
.chart-box { .chart-box {
height: calc(100% - 450px); height: calc(100% - 400px);
margin-left: 20px; margin-left: 20px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -79,7 +79,23 @@
<a-textarea v-model="model.description" :rows="3"></a-textarea> <a-textarea v-model="model.description" :rows="3"></a-textarea>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="Status" prop="status"> <a-form-model-item label="Status" prop="status">
<j-dict-select-tag v-model="model.status" dictCode="STATION_STATUS"></j-dict-select-tag> <j-dict-select-tag
v-model="model.status"
dictCode="STATION_STATUS"
@change="handleStatus"
></j-dict-select-tag>
</a-form-model-item>
<a-form-model-item label="Category" prop="category">
<a-select
v-model="model.category"
:options="categoryOptions"
show-arrow
allowClear
placeholder="select..."
@change="onCategoryChange"
>
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
</a-select>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</custom-modal> </custom-modal>
@ -99,76 +115,76 @@ const columns = [
align: 'left', align: 'left',
width: 100, width: 100,
scopedSlots: { scopedSlots: {
customRender: 'index' customRender: 'index',
}, },
customHeaderCell: () => { customHeaderCell: () => {
return { return {
style: { style: {
'padding-left': '60px !important' 'padding-left': '60px !important',
} },
} }
}, },
customCell: () => { customCell: () => {
return { return {
style: { style: {
'padding-left': '60px !important' 'padding-left': '60px !important',
} },
}
} }
}, },
},
{ {
title: 'STATION ID', title: 'STATION ID',
align: 'left', align: 'left',
dataIndex: 'stationId', dataIndex: 'stationId',
width: 100 width: 100,
}, },
{ {
title: 'STATION CODE', title: 'STATION CODE',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'stationCode' dataIndex: 'stationCode',
}, },
{ {
title: 'COUNTRY CODE', title: 'COUNTRY CODE',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'countryCode' dataIndex: 'countryCode',
}, },
{ {
title: 'TYPE', title: 'TYPE',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'type' dataIndex: 'type',
}, },
{ {
title: 'LON', title: 'LON',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'lon' dataIndex: 'lon',
}, },
{ {
title: 'LAT', title: 'LAT',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'lat' dataIndex: 'lat',
}, },
{ {
title: 'ELEVATION', title: 'ELEVATION',
width: 100, width: 100,
dataIndex: 'elevation' dataIndex: 'elevation',
}, },
{ {
title: 'DESCRIPTION', title: 'DESCRIPTION',
width: 100, width: 100,
dataIndex: 'description', dataIndex: 'description',
ellipsis: true ellipsis: true,
}, },
{ {
title: 'STATUS', title: 'STATUS',
align: 'left', align: 'left',
width: 100, width: 100,
dataIndex: 'status' dataIndex: 'status',
} },
] ]
export default { export default {
@ -188,41 +204,66 @@ export default {
} }
const validateCountryCode = (_, value, callback) => { const validateCountryCode = (_, value, callback) => {
if(!value) { if (!value) {
callback(new Error('Please Enter Country Code')) 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')) callback(new Error('Country Code Limit 2 Char'))
} else { } else {
callback() callback()
} }
} }
return { return {
categoryOptions: [],
queryParam: {}, queryParam: {},
rules: { rules: {
stationId: [{ required: true, message: 'Please Enter Station Id' }], stationId: [{ required: true, message: 'Please Enter Station Id' }],
stationCode: [{ required: true, validator: validateStationCode }], stationCode: [{ required: true, validator: validateStationCode }],
countryCode: [{ required: true, validator: validateCountryCode }] countryCode: [{ required: true, validator: validateCountryCode }],
status: [{ required: true, message: 'Please Select Status', trigger: 'change' }],
category: [{ required: true, message: 'Please Select Category', trigger: 'change' }],
}, },
url: { url: {
list: '/gardsStations/findPage', list: '/gardsStations/findPage',
delete: '/gardsStations/deleteById', delete: '/gardsStations/deleteById',
add: '/gardsStations/create', add: '/gardsStations/create',
edit: '/gardsStations/update' edit: '/gardsStations/update',
}, },
countryCodeList: [], countryCodeList: [],
typeList: [] typeList: [],
} }
}, },
created() { created() {
this.getTypeList() this.getTypeList()
this.getCountryCodeList() this.getCountryCodeList()
}, },
mounted() {
this.$set(this.model, 'status', 'Operating')
},
methods: { 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
},
async getTypeList() { async getTypeList() {
try { try {
const res = await getAction('/gardsStations/findType') 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) { } catch (error) {
console.error(error) console.error(error)
} }
@ -231,7 +272,7 @@ export default {
async getCountryCodeList() { async getCountryCodeList() {
try { try {
const res = await getAction('/gardsStations/findCountryCode') 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) { } catch (error) {
console.error(error) console.error(error)
} }
@ -242,15 +283,20 @@ export default {
}, },
onAdd() { onAdd() {
this.getCategoryItem()
this.isAdd = true this.isAdd = true
this.model = {} // this.model = {}
this.visible = true this.visible = true
}, },
onEdit() { onEdit() {
this.getCategoryItem()
if (this.selectedRowKeys && this.selectedRowKeys.length) { if (this.selectedRowKeys && this.selectedRowKeys.length) {
this.isAdd = false this.isAdd = false
this.visible = true 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])
if (find) {
find.category = find.category.toString()
}
this.model = cloneDeep(find) this.model = cloneDeep(find)
} else { } else {
this.$message.warn('Please Select An Item To Edit') this.$message.warn('Please Select An Item To Edit')
@ -264,12 +310,12 @@ export default {
cancelText: 'Cancel', cancelText: 'Cancel',
onOk: () => { onOk: () => {
this.handleDelete(this.selectedRowKeys[0], 'stationId') this.handleDelete(this.selectedRowKeys[0], 'stationId')
} },
}) })
} else { } else {
this.$message.warn('Please Select An Item To Delete') this.$message.warn('Please Select An Item To Delete')
} }
} },
}, },
computed: { computed: {
formItems() { formItems() {
@ -284,12 +330,12 @@ export default {
showSearch: true, showSearch: true,
filterOption: this.filterOption, filterOption: this.filterOption,
style: { style: {
width: '261px' width: '261px',
} },
}, },
style: { style: {
width: 'auto' width: 'auto',
} },
}, },
{ {
label: 'Type', label: 'Type',
@ -301,12 +347,12 @@ export default {
showSearch: true, showSearch: true,
filterOption: this.filterOption, filterOption: this.filterOption,
style: { style: {
width: '261px' width: '261px',
} },
}, },
style: { style: {
width: 'auto' width: 'auto',
} },
}, },
{ {
label: 'Status', label: 'Status',
@ -318,16 +364,16 @@ export default {
return document.body return document.body
}, },
style: { style: {
width: '261px' width: '261px',
} },
}, },
style: { style: {
width: 'auto' width: 'auto',
} },
} },
] ]
} },
} },
} }
</script> </script>