lg_frontend/pages/cleanTravel/trend.vue

142 lines
3.4 KiB
Vue
Raw Normal View History

2024-06-26 16:52:06 +00:00
<template>
2024-08-06 14:30:41 +00:00
<new-bg>
<flex-col>
<system-title show-back custom-title="清洁运输+趋势" />
<ModuleContent padding="0px 20px 20px">
2024-06-26 16:52:06 +00:00
<a-row :gutter="16">
2024-08-06 14:30:41 +00:00
<a-col :span="6">
2024-06-26 16:52:06 +00:00
</a-col>
2024-08-06 14:30:41 +00:00
<a-col :span="18">
<CustomTable
hide-action
hide-search
hide-button
:columns="columns"
:api-conf="apiConf"
:form-items="formItems"
>
<template slot="search-button" slot-scope="{ search }">
<a-button type="primary" @click="exportList(search)">查询</a-button>
<a-button type="primary" @click="exportList(search)" style="margin-left: 10px;">导出</a-button>
<Split height="10"></Split>
</template>
</CustomTable>
2024-06-26 16:52:06 +00:00
</a-col>
</a-row>
2024-08-06 14:30:41 +00:00
</ModuleContent>
</flex-col>
</new-bg>
2024-06-26 16:52:06 +00:00
</template>
<script>
import Curd from "../../components/smallCommon/Curd.vue";
import moment from 'moment'
2024-08-06 14:30:41 +00:00
import SystemTitle from "../../components/smallCommon/SystemTitle.vue";
import NewBg from "../../components/NewBg.vue";
import FlexCol from "../../components/FlexCol.vue";
import ModuleContent from "../../components/ModuleContent.vue";
import CustomTable from "../../components/smallCommon/CustomTable.vue";
import Split from "../../components/smallCommon/Split.vue";
2024-06-26 16:52:06 +00:00
export default {
name: "user",
components: {
2024-08-06 14:30:41 +00:00
Split,
CustomTable,
ModuleContent, FlexCol, NewBg, SystemTitle,
2024-06-26 16:52:06 +00:00
Curd
},
data () {
return {
yunshuzongliang: 0,
isEdit: false,
roles: [],
columns: [
{
dataIndex: 'outTime',
key: 'outTime',
title: '日期'
},
{
dataIndex: 'carNum',
key: 'carNum',
title: '车牌号'
},
{
dataIndex: 'carModel',
key: 'carModel',
title: '车型'
},
{
dataIndex: 'newCar',
key: 'newCar',
title: '新能源',
customRender (text) {
if (text) return '是'
return '否'
}
},
{
dataIndex: 'emissions',
key: 'emissions',
title: '燃油车'
},
{
dataIndex: 'createDateTime',
key: 'createDateTime',
title: '出厂日期'
}
],
apiConf: {
listApi: { api: '/api/Transport/list', method: 'get' },
}
}
},
computed: {
formItems () {
return [
2024-08-06 14:30:41 +00:00
{
type: 'dateRange',
key: 'time',
label: '日期',
isSearch: true,
hide: true,
placeholder: ['请选择开始日期', '请选择结束日期'],
rules: [
{ required: true, message: '请选择时间范围' }
],
fields: ['startTime', 'endTime']
},
2024-06-26 16:52:06 +00:00
]
}
},
created() {
this.getyunshuzongliang()
},
methods: {
getyunshuzongliang () {
/*this.$get('/api/Transport/count').then(({ data }) => {
this.yunshuzongliang = data
})*/
},
editHandler (isEdit) {
this.isEdit = isEdit
},
exportList ({ time }) {
const [ start, end ] = time
const fmt = 'YYYY-MM-DD'
window.open(`http://101.43.201.20:5000/api/Ledger/export?start=${moment(start).format(fmt)}&end=${moment(end).format(fmt)}`, '_blank')
}
}
}
</script>
<style scoped lang="less">
</style>