parent
d99e3639d6
commit
3870d1f53d
@ -0,0 +1,50 @@
|
||||
import request from '@/utils/request'
|
||||
function customParamsSerializer(params) {
|
||||
let result = ''
|
||||
for (const key in params) {
|
||||
if (params.hasOwnProperty(key)) {
|
||||
if (Array.isArray(params[key])) {
|
||||
params[key].forEach((item, index) => {
|
||||
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`
|
||||
})
|
||||
} else {
|
||||
result += `${key}=${params[key]}&`
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.slice(0, -1)
|
||||
}
|
||||
export function index(params, isLoading = false) {
|
||||
return request({
|
||||
method: 'get',
|
||||
url: '/api/admin/team-articles/index',
|
||||
params,
|
||||
paramsSerializer: customParamsSerializer,
|
||||
isLoading
|
||||
})
|
||||
}
|
||||
|
||||
export function show(params, isLoading = true) {
|
||||
return request({
|
||||
method: 'get',
|
||||
url: '/api/admin/team-articles/show',
|
||||
params,
|
||||
isLoading
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
method: 'post',
|
||||
url: '/api/admin/team-articles/save',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function destroy(params) {
|
||||
return request({
|
||||
method: 'get',
|
||||
url: '/api/admin/team-articles/destroy',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
Before Width: | Height: | Size: 771 KiB After Width: | Height: | Size: 766 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<slot>
|
||||
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
|
||||
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="名称搜索" />
|
||||
<Button type="primary" @click="getList">查询</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
style="margin-left: 10px;"
|
||||
@click="$refs['addTeamUpdate'].type='add',
|
||||
$refs['addTeamUpdate'].isShow=true"
|
||||
>添加</Button>
|
||||
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
|
||||
@click="$refs['imports'].show()">导入</Button> -->
|
||||
</div>
|
||||
</slot>
|
||||
</lx-header>
|
||||
</div>
|
||||
|
||||
<xy-table
|
||||
:list="list"
|
||||
:total="total"
|
||||
:table-item="table"
|
||||
@pageSizeChange="pageSizeChange"
|
||||
@pageIndexChange="pageChange"
|
||||
>
|
||||
<template v-slot:btns>
|
||||
<el-table-column fixed="right" label="操作" width="260" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<Button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="$refs['addTeamUpdate'].type='editor',
|
||||
$refs['addTeamUpdate'].id=scope.row.id,
|
||||
$refs['addTeamUpdate'].isShow=true"
|
||||
>编辑</Button>
|
||||
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
|
||||
<Button type="error" style="margin-left: 10px;" size="small" ghost>删除</Button>
|
||||
</Poptip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
||||
</xy-table>
|
||||
<addTeamUpdate ref="addTeamUpdate" @refresh="getList" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
index,
|
||||
destroy
|
||||
} from '@/api/teamUpdate.js'
|
||||
import addTeamUpdate from './components/addTeamUpdate.vue'
|
||||
export default {
|
||||
components: {
|
||||
addTeamUpdate,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
select: {
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
keyword: '',
|
||||
},
|
||||
total: 0,
|
||||
list: [],
|
||||
table: [{
|
||||
label: '序号',
|
||||
type: 'index',
|
||||
fixed: 'left',
|
||||
width: 80
|
||||
}, {
|
||||
label: '开始日期',
|
||||
prop: 'start_date',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
}, {
|
||||
label: '结束日期',
|
||||
prop: 'end_date',
|
||||
align: 'center',
|
||||
width: 120
|
||||
}, {
|
||||
label: '出动队伍',
|
||||
prop: 'team_ids',
|
||||
align: 'left',
|
||||
customFn:(row)=>{
|
||||
if(row.team && row.team.length>0){
|
||||
return row.team.map(item=>{
|
||||
return(<div>{item.mingcheng}</div>)
|
||||
})
|
||||
}
|
||||
}
|
||||
}, {
|
||||
label: '出动人次',
|
||||
prop: 'total',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
}, {
|
||||
label: '目的地',
|
||||
prop: 'destination',
|
||||
width: 240,
|
||||
align: 'left',
|
||||
}]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
const res = await index({
|
||||
...this.select,
|
||||
// filter: [{
|
||||
// key: 'mingcheng',
|
||||
// op: 'like',
|
||||
// value: this.select.keyword
|
||||
// }]
|
||||
})
|
||||
this.list = res.data
|
||||
this.total = res.total
|
||||
},
|
||||
pageChange(e) {
|
||||
this.select.page = e
|
||||
this.getList()
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e
|
||||
this.getList()
|
||||
},
|
||||
delRow(id) {
|
||||
if (id) {
|
||||
destroy({
|
||||
id: id,
|
||||
table_name: this.select.table_name
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
})
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Loading…
Reference in new issue