同步国家卫健委风险地区数据
This commit is contained in:
@@ -1,41 +1,45 @@
|
||||
<template>
|
||||
<ai-list class="notice">
|
||||
<template slot="title">
|
||||
<ai-title title="风险区域配置" isShowBottomBorder></ai-title>
|
||||
<ai-title title="风险区域配置" isShowBottomBorder>
|
||||
<template #rightBtn>
|
||||
<el-button type="primary" @click="handleSyncData">同步卫健委数据</el-button>
|
||||
</template>
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<ai-select
|
||||
v-model="search.level"
|
||||
clearable
|
||||
placeholder="请选择风险等级"
|
||||
:selectList="dict.getDict('epidemicDangerousAreaLevel')"
|
||||
@change="search.current = 1, getList()">
|
||||
v-model="search.level"
|
||||
clearable
|
||||
placeholder="请选择风险等级"
|
||||
:selectList="dict.getDict('epidemicDangerousAreaLevel')"
|
||||
@change="search.current = 1, getList()">
|
||||
</ai-select>
|
||||
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input
|
||||
v-model="search.province"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="省级名称/市级名称/区级名称"
|
||||
clearable
|
||||
@clear="search.current = 1, search.province = '', getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
v-model="search.province"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="省级名称/市级名称/区级名称"
|
||||
clearable
|
||||
@clear="search.current = 1, search.province = '', getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
@@ -50,92 +54,102 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: 'List',
|
||||
import {mapState} from 'vuex'
|
||||
import {getRiskArea} from "../riskareaCrawler";
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
moduleName: String
|
||||
},
|
||||
export default {
|
||||
name: 'List',
|
||||
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
level: '',
|
||||
province: ''
|
||||
},
|
||||
currIndex: -1,
|
||||
areaList: [],
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{ prop: 'province', label: '省级', align: 'left', width: '200px' },
|
||||
{ prop: 'city', label: '市级', align: 'center' },
|
||||
{ prop: 'district', label: '区级', align: 'center' },
|
||||
{ prop: 'town', label: '镇级', align: 'center' },
|
||||
{ prop: 'village', label: '村级', align: 'center' },
|
||||
{ prop: 'level', label: '等级', align: 'center', formart: v => this.dict.getLabel('epidemicDangerousAreaLevel', v) },
|
||||
{ prop: 'createTime', label: '设置时间', align: 'center' },
|
||||
{ prop: 'createUserName', label: '添加人', align: 'center' },
|
||||
{ slot: 'options', label: '操作', align: 'center' }
|
||||
],
|
||||
areaName: '',
|
||||
unitName: '',
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
moduleName: String
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
level: '',
|
||||
province: ''
|
||||
},
|
||||
currIndex: -1,
|
||||
areaList: [],
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{prop: 'province', label: '省级', align: 'left', width: '200px'},
|
||||
{prop: 'city', label: '市级', align: 'center'},
|
||||
{prop: 'district', label: '区级', align: 'center'},
|
||||
{prop: 'town', label: '镇级', align: 'center'},
|
||||
{prop: 'village', label: '村级', align: 'center'},
|
||||
{prop: 'level', label: '等级', align: 'center', formart: v => this.dict.getLabel('epidemicDangerousAreaLevel', v)},
|
||||
{prop: 'createTime', label: '设置时间', align: 'center'},
|
||||
{prop: 'createUserName', label: '添加人', align: 'center'},
|
||||
{slot: 'options', label: '操作', align: 'center'}
|
||||
],
|
||||
areaName: '',
|
||||
unitName: '',
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.dict.load('epidemicDangerousAreaLevel').then(() => {
|
||||
this.getList()
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
|
||||
created() {
|
||||
this.dict.load('epidemicDangerousAreaLevel').then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appepidemicpreventionriskarea/list`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appepidemicdangerousarea/list`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
remove(id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appepidemicpreventionriskarea/delete?ids=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appepidemicdangerousarea/delete?ids=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
toAdd(id) {
|
||||
this.$emit('change', {
|
||||
type: 'Add',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
toAdd(id) {
|
||||
this.$emit('change', {
|
||||
type: 'Add',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSyncData() {
|
||||
getRiskArea(this.instance).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.getList()
|
||||
this.$message.success("同步完毕!")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.notice {
|
||||
}
|
||||
.notice {
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user