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 = '') {
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)

View File

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

View File

@ -79,7 +79,23 @@
<a-textarea v-model="model.description" :rows="3"></a-textarea>
</a-form-model-item>
<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>
</custom-modal>
@ -99,76 +115,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,41 +204,66 @@ 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()
}
}
return {
categoryOptions: [],
queryParam: {},
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' }],
category: [{ required: true, message: 'Please Select Category', 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: {
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() {
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 +272,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)
}
@ -242,15 +283,20 @@ export default {
},
onAdd() {
this.getCategoryItem()
this.isAdd = true
this.model = {}
// 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])
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')
@ -264,12 +310,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 +330,12 @@ export default {
showSearch: true,
filterOption: this.filterOption,
style: {
width: '261px'
}
width: '261px',
},
},
style: {
width: 'auto'
}
width: 'auto',
},
},
{
label: 'Type',
@ -301,12 +347,12 @@ export default {
showSearch: true,
filterOption: this.filterOption,
style: {
width: '261px'
}
width: '261px',
},
},
style: {
width: 'auto'
}
width: 'auto',
},
},
{
label: 'Status',
@ -318,16 +364,16 @@ export default {
return document.body
},
style: {
width: '261px'
}
width: '261px',
},
},
style: {
width: 'auto'
}
}
width: 'auto',
},
},
]
}
}
},
},
}
</script>