应急防御

master
lion 7 months ago
parent f275889e80
commit e3c58afdd5

@ -104,7 +104,10 @@
}, },
methods: { methods: {
setTeamId(id,name){
this.form.team_id = id
this.form.suozaiduiwu = name
},
async getDetail() { async getDetail() {
const res = await show({ const res = await show({
id: this.id, id: this.id,

@ -1,6 +1,10 @@
<template> <template>
<div> <div>
<div class="map" id="map" :style="{'height':mapHeight+'px'}"> <div class="map" id="map" :style="{'height':mapHeight+'px'}">
<div class="teamsTab">
<span>防汛队伍{{this.makerObj.teams.length}}</span>
<span>在册人员{{totalPerson}}</span>
</div>
<div class="tabs"> <div class="tabs">
<div :class="!addCur?'tabcur':''" @click="changeMask(1)"></div> <div :class="!addCur?'tabcur':''" @click="changeMask(1)"></div>
@ -79,6 +83,7 @@
export default { export default {
data() { data() {
return { return {
totalPerson: 0,
zoom: 10, zoom: 10,
center: [120.585294, 31.299758], center: [120.585294, 31.299758],
mapHeight: 0, mapHeight: 0,
@ -284,13 +289,16 @@
if (res.data.length < 1) { if (res.data.length < 1) {
return return
} }
let _total = 0
res.data.map(item => { res.data.map(item => {
_total += parseInt(item.renshu)
this.makerObj.teams.push({ this.makerObj.teams.push({
type: 'teams', type: 'teams',
name: item.mingcheng, name: item.mingcheng,
...item ...item
}) })
}) })
this.totalPerson = _total
this.setMapMarker("teams", this.makerObj.teams) this.setMapMarker("teams", this.makerObj.teams)
this.loadingFull.close(); this.loadingFull.close();
}) })
@ -406,6 +414,26 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.teamsTab {
position: absolute;
z-index: 99;
top: 20px;
left: 20px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background: #fff;
padding: 20px 40px;
border-radius: 40px;
font-size: 18px;
&>span{
margin:0px 20px;
}
}
.tabs { .tabs {
position: absolute; position: absolute;
z-index: 99; z-index: 99;
@ -426,6 +454,7 @@
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
.tabs>div:first-child { .tabs>div:first-child {
border-radius: 20px 0 0 20px; border-radius: 20px 0 0 20px;

@ -1,34 +1,54 @@
<template> <template>
<div> <div>
<xy-dialog ref="dialog" :width='60' :is-show.sync="isShow" type="normal" title="花名册" <xy-dialog ref="dialog" :width='60' :is-show.sync="isShow" type="normal" title="花名册">
>
<template v-slot:normalContent> <template v-slot:normalContent>
<xy-table :list="bookList" :isPage="false" <Button type="primary" style="margin-left: 10px;margin-bottom:10px" @click="$refs['addBook'].type='add',
:table-item="table"> $refs['addBook'].setlistTeam(listTeam),
$refs['addBook'].setTeamId(id,name),
$refs['addBook'].isShow=true">新增人员</Button>
<xy-table :list="bookList" :isPage="false" :table-item="table">
<template v-slot:btns> <template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<div> <div>
<Button type="primary" size="small" @click="$refs['addBook'].type='editor',
$refs['addBook'].id=scope.row.id,
$refs['addBook'].setlistTeam(listTeam),
$refs['addBook'].setTeamId(id,name),
$refs['addBook'].isShow=true">编辑</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div> </div>
</template> </template>
</el-table-column>
</template>
</xy-table> </xy-table>
</template> </template>
</xy-dialog> </xy-dialog>
<addBook ref="addBook" @refresh="getBooks"></addBook>
</div> </div>
</template> </template>
<script> <script>
import addBook from "@/views/books/components/addBook.vue"
import { import {
index index,
destroy
} from "@/api/system/baseForm.js" } from "@/api/system/baseForm.js"
export default { export default {
components: {
addBook
},
data() { data() {
return { return {
isShow: false, isShow: false,
id: '', id: '',
name:'',
tableName: 'books', tableName: 'books',
bookList: [], bookList: [],
listTeam:[],
table: [{ table: [{
label: '序号', label: '序号',
type: 'index', type: 'index',
@ -59,6 +79,7 @@
} }
}, },
created() { created() {
this.getTeamList()
}, },
methods: { methods: {
async getBooks() { async getBooks() {
@ -74,6 +95,28 @@
}) })
this.bookList = res.data this.bookList = res.data
}, },
async getTeamList() {
const res = await index({
page: 1,
page_size: 999,
table_name: 'teams'
})
this.listTeam = res.data
},
delRow(id) {
if (id) {
destroy({
id: id,
table_name: 'books',
}).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getBooks()
})
}
},
}, },
watch: { watch: {
isShow(newVal) { isShow(newVal) {
@ -81,6 +124,7 @@
this.getBooks() this.getBooks()
} else { } else {
this.bookList = [] this.bookList = []
this.name = ''
this.$refs['dialog'].reset() this.$refs['dialog'].reset()
} }
}, },

@ -29,6 +29,7 @@
</Poptip> </Poptip>
<Button type="primary" style="margin-left: 10px;" size="small" @click=" <Button type="primary" style="margin-left: 10px;" size="small" @click="
$refs['showTeam'].id=scope.row.id, $refs['showTeam'].id=scope.row.id,
$refs['showTeam'].name = scope.row.mingcheng,
$refs['showTeam'].isShow=true">花名册</Button> $refs['showTeam'].isShow=true">花名册</Button>
</div> </div>
</template> </template>

Loading…
Cancel
Save