| | |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-drawer title="活动人员区域" :visible.sync="personBox" :append-to-body="true" size="50%"> |
| | | <securityManage /> |
| | | <el-drawer title="活动人员区域" :visible.sync="personBox" :append-to-body="true" size="50%" :destroy-on-close="true"> |
| | | <securityManage ref="securityManage" :securityId="securityId"/> |
| | | </el-drawer> |
| | | |
| | | <el-drawer title="活动车辆区域" :visible.sync="carBox" :append-to-body="true" size="50%"> |
| | | <securityManageCar /> |
| | | <el-drawer title="活动车辆区域" :visible.sync="carBox" :append-to-body="true" size="50%" :destroy-on-close="true"> |
| | | <securityManageCar ref="car" :securityId="securityId"/> |
| | | </el-drawer> |
| | | </basic-container> |
| | | </template> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | securityId:"", |
| | | carBox: false, |
| | | personBox: false, |
| | | form: {}, |
| | |
| | | }); |
| | | }, |
| | | //活动人员区域点击按钮事件 |
| | | handlePersonList() { |
| | | handlePersonList(row) { |
| | | this.personBox = true; |
| | | this.securityId = row.id |
| | | }, |
| | | //活动车辆区域点击按钮事件 |
| | | handleCarList() { |
| | | handleCarList(row) { |
| | | this.carBox = true; |
| | | this.securityId = row.id |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList" |
| | | :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" |
| | | @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.securityManage_delete" |
| | | @click="handleDelete">删 除 |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.securityManage_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{type,size,row,index}" slot="menu"> |
| | | <el-button icon="el-icon-view" :size="size" :type="type" @click="handleDetail(row)">地 图</el-button> |
| | | <el-button icon="el-icon-edit" v-if="permission.range_edit" :size="size" :type="type" @click="$refs.crud.rowEdit(row,index)">编 辑</el-button> |
| | | <el-button icon="el-icon-delete" v-if="permission.range_delete" :size="size" :type="type" @click="$refs.crud.rowDel(row,index)">删 除</el-button> |
| | | <el-button icon="el-icon-view" :size="size" :type="type" @click="handleDetail(row)">地 图</el-button> |
| | | <el-button icon="el-icon-edit" v-if="permission.range_edit" :size="size" :type="type" |
| | | @click="$refs.crud.rowEdit(row, index)">编 辑</el-button> |
| | | <el-button icon="el-icon-delete" v-if="permission.range_delete" :size="size" :type="type" |
| | | @click="$refs.crud.rowDel(row, index)">删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-drawer |
| | | title="地图详情" |
| | | :visible.sync="isDetail" |
| | | :append-to-body="true" |
| | | size="60%" |
| | | direction="rtl" |
| | | <el-drawer title="地图详情" :visible.sync="isDetail" :append-to-body="true" size="60%" direction="rtl" |
| | | :before-close="handleClose"> |
| | | <map-box v-if="isDetail" :is-detail="isDetail" :route-range="routeRange"></map-box> |
| | | </el-drawer> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getPage, getDetails, add, update, remove} from "@/api/securityManage/securityManage"; |
| | | import {getAll} from "@/api/security/security"; |
| | | import {mapGetters} from "vuex"; |
| | | import MapBox from "@/components/map/mapBox"; |
| | | import { getPage, getDetails, add, update, remove } from "@/api/securityManage/securityManage"; |
| | | import { getAll } from "@/api/security/security"; |
| | | import { mapGetters } from "vuex"; |
| | | import MapBox from "@/components/map/mapBox"; |
| | | |
| | | export default { |
| | | components: {MapBox}, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height:'auto', |
| | | menuWidth:250, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: false, |
| | | delBtn: false, |
| | | editBtn: false, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "活动", |
| | | prop:"securityId", |
| | | search: true, |
| | | type:"select", |
| | | dicData:[], |
| | | props:{ |
| | | label:"name", |
| | | value:"id" |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属活动", |
| | | trigger: "blur" |
| | | }], |
| | | searchSpan:6, |
| | | export default { |
| | | components: { MapBox }, |
| | | props: [ |
| | | 'securityId' |
| | | ], |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height: 'auto', |
| | | menuWidth: 250, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: false, |
| | | delBtn: false, |
| | | editBtn: false, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "活动", |
| | | prop: "securityId", |
| | | // search: true, |
| | | type: "select", |
| | | dicData: [], |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | }, |
| | | { |
| | | label: "警员", |
| | | prop: "policemanId", |
| | | type:"select", |
| | | dicUrl:"/api/policeman/policeman/all", |
| | | props:{ |
| | | label:"name", |
| | | value:"id" |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属活动", |
| | | trigger: "blur" |
| | | }], |
| | | searchSpan: 6, |
| | | }, |
| | | { |
| | | label: "警员", |
| | | prop: "policemanId", |
| | | type: "select", |
| | | dicUrl: "/api/policeman/policeman/all", |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | } |
| | | }, |
| | | { |
| | | label: "所属辖区", |
| | | prop: "deptId", |
| | | type: "tree", |
| | | disabled: true, |
| | | dicUrl: "api/blade-system/dept/lazy-list", |
| | | props: { |
| | | label: 'deptName', |
| | | value: 'id', |
| | | children: 'children' |
| | | }, |
| | | search: true, |
| | | searchSpan: 8, |
| | | }, |
| | | { |
| | | label: "类型", |
| | | prop: "type", |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "线", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "面", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "点", |
| | | value: 3 |
| | | } |
| | | }, |
| | | { |
| | | label: "所属辖区", |
| | | prop: "deptId", |
| | | type: "tree", |
| | | disabled:true, |
| | | dicUrl: "api/blade-system/dept/lazy-list", |
| | | props:{ |
| | | label:'deptName', |
| | | value:'id', |
| | | children:'children' |
| | | }, |
| | | search: true, |
| | | searchSpan:8, |
| | | }, |
| | | { |
| | | label: "类型", |
| | | prop: "type", |
| | | type:"select", |
| | | dicData:[ |
| | | { |
| | | label:"线", |
| | | value:1 |
| | | }, |
| | | { |
| | | label:"面", |
| | | value:2 |
| | | }, |
| | | { |
| | | label:"点", |
| | | value:3 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "范围", |
| | | prop: "position", |
| | | hide:true |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | isDetail:false, |
| | | routeRange:"", |
| | | securityList:[], |
| | | ] |
| | | }, |
| | | { |
| | | label: "范围", |
| | | prop: "position", |
| | | hide: true |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | isDetail: false, |
| | | routeRange: "", |
| | | securityList: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.securityManage_add, false), |
| | | viewBtn: this.vaildData(this.permission.securityManage_view, false), |
| | | delBtn: this.vaildData(this.permission.securityManage_delete, false), |
| | | editBtn: this.vaildData(this.permission.securityManage_edit, false) |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo","permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.securityManage_add, false), |
| | | viewBtn: this.vaildData(this.permission.securityManage_view, false), |
| | | delBtn: this.vaildData(this.permission.securityManage_delete, false), |
| | | editBtn: this.vaildData(this.permission.securityManage_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSecurityList() |
| | | }, |
| | | watch:{ |
| | | //根据活动回显机构 |
| | | 'form.securityId':{ |
| | | handler(newVal){ |
| | | this.securityList.forEach(e=>{ |
| | | if (e.id == newVal){ |
| | | this.form.deptId = e.deptId |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleDetail(row){ |
| | | this.routeRange = row.position |
| | | this.isDetail = true |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetails(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | |
| | | if (this.userInfo.role_name != "admin" && this.userInfo.role_name != "administrator"){ |
| | | params["jurisdiction"] = this.userInfo.dept_id; |
| | | } |
| | | |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | //获取所有活动集合 |
| | | getSecurityList(){ |
| | | getAll().then(res=>{ |
| | | if (res.data.code == 200){ |
| | | this.securityList = res.data.data |
| | | const securityIdColumn = this.findObject(this.option.column,"securityId") |
| | | securityIdColumn.dicData = this.securityList |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSecurityList() |
| | | }, |
| | | watch: { |
| | | //根据活动回显机构 |
| | | 'form.securityId': { |
| | | handler(newVal) { |
| | | this.securityList.forEach(e => { |
| | | if (e.id == newVal) { |
| | | this.form.deptId = e.deptId |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleDetail(row) { |
| | | this.routeRange = row.position |
| | | this.isDetail = true |
| | | }, |
| | | beforeOpen(done, type) { |
| | | const column = this.findObject(this.option.column, "securityId"); |
| | | column.addDisabled = true; |
| | | column.editDisabled = true; |
| | | if (["add"].includes(type)) { |
| | | this.form['securityId'] = this.securityId |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetails(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | |
| | | if (this.userInfo.role_name != "admin" && this.userInfo.role_name != "administrator") { |
| | | params["jurisdiction"] = this.userInfo.dept_id; |
| | | } |
| | | |
| | | params['securityId'] = this.securityId |
| | | |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | //获取所有活动集合 |
| | | getSecurityList() { |
| | | getAll().then(res => { |
| | | if (res.data.code == 200) { |
| | | this.securityList = res.data.data |
| | | const securityIdColumn = this.findObject(this.option.column, "securityId") |
| | | securityIdColumn.dicData = this.securityList |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList" |
| | | :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" |
| | | @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.securityManageCar_delete" |
| | | @click="handleDelete">删 除 |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.securityManageCar_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{type,size,row,index}" slot="menu"> |
| | | <el-button icon="el-icon-view" :size="size" :type="type" @click="handleDetail(row)">地 图</el-button> |
| | | <el-button icon="el-icon-edit" v-if="permission.range_edit" :size="size" :type="type" @click="$refs.crud.rowEdit(row,index)">编 辑</el-button> |
| | | <el-button icon="el-icon-delete" v-if="permission.range_delete" :size="size" :type="type" @click="$refs.crud.rowDel(row,index)">删 除</el-button> |
| | | <el-button icon="el-icon-view" :size="size" :type="type" @click="handleDetail(row)">地 图</el-button> |
| | | <el-button icon="el-icon-edit" v-if="permission.range_edit" :size="size" :type="type" |
| | | @click="$refs.crud.rowEdit(row, index)">编 辑</el-button> |
| | | <el-button icon="el-icon-delete" v-if="permission.range_delete" :size="size" :type="type" |
| | | @click="$refs.crud.rowDel(row, index)">删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-drawer |
| | | title="地图详情" |
| | | :visible.sync="isDetail" |
| | | :append-to-body="true" |
| | | size="60%" |
| | | direction="rtl" |
| | | <el-drawer title="地图详情" :visible.sync="isDetail" :append-to-body="true" size="60%" direction="rtl" |
| | | :before-close="handleClose"> |
| | | <map-box v-if="isDetail" :is-detail="isDetail" :route-range="routeRange"></map-box> |
| | | </el-drawer> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getPage, getDetail, add, update, remove} from "@/api/securityManageCar/securityManageCar"; |
| | | import {mapGetters} from "vuex"; |
| | | import MapBox from "@/components/map/mapBox"; |
| | | import {getAll} from "@/api/security/security"; |
| | | import { getPage, getDetail, add, update, remove } from "@/api/securityManageCar/securityManageCar"; |
| | | import { mapGetters } from "vuex"; |
| | | import MapBox from "@/components/map/mapBox"; |
| | | import { getAll } from "@/api/security/security"; |
| | | |
| | | export default { |
| | | components: {MapBox}, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height:'auto', |
| | | calcHeight: 30, |
| | | menuWidth:250, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: false, |
| | | delBtn: false, |
| | | editBtn: false, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "主键", |
| | | prop: "id", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | export default { |
| | | components: { MapBox }, |
| | | props: [ |
| | | 'securityId' |
| | | ], |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | menuWidth: 250, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: false, |
| | | delBtn: false, |
| | | editBtn: false, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "主键", |
| | | prop: "id", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "安保活动", |
| | | prop: "securityId", |
| | | type: "select", |
| | | // search: true, |
| | | dicData: [], |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | }, |
| | | { |
| | | label: "安保活动", |
| | | prop: "securityId", |
| | | type: "select", |
| | | search:true, |
| | | dicData:[], |
| | | props:{ |
| | | label:"name", |
| | | value:"id" |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属活动", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "警车", |
| | | prop: "carId", |
| | | type: "select", |
| | | dicUrl: "/api/policecar/policecar/all", |
| | | props: { |
| | | label: "serialNumber", |
| | | value: "id" |
| | | } |
| | | }, |
| | | { |
| | | label: "所属辖区", |
| | | prop: "deptId", |
| | | type: "tree", |
| | | dicUrl: "api/blade-system/dept/lazy-list", |
| | | props: { |
| | | label: 'deptName', |
| | | value: 'id', |
| | | children: 'children' |
| | | }, |
| | | search: true, |
| | | searchSpan: 8, |
| | | disabled: true, |
| | | }, |
| | | { |
| | | label: "位置或范围", |
| | | prop: "position", |
| | | type: "input", |
| | | hide: true |
| | | }, |
| | | { |
| | | label: "类型", |
| | | prop: "type", |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "线", |
| | | value: 1 |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属活动", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "警车", |
| | | prop: "carId", |
| | | type: "select", |
| | | dicUrl:"/api/policecar/policecar/all", |
| | | props:{ |
| | | label:"serialNumber", |
| | | value:"id" |
| | | { |
| | | label: "面", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "点", |
| | | value: 3 |
| | | } |
| | | }, |
| | | { |
| | | label: "所属辖区", |
| | | prop: "deptId", |
| | | type: "tree", |
| | | dicUrl: "api/blade-system/dept/lazy-list", |
| | | props:{ |
| | | label:'deptName', |
| | | value:'id', |
| | | children:'children' |
| | | }, |
| | | search: true, |
| | | searchSpan:8, |
| | | disabled:true, |
| | | }, |
| | | { |
| | | label: "位置或范围", |
| | | prop: "position", |
| | | type: "input", |
| | | hide:true |
| | | }, |
| | | { |
| | | label: "类型", |
| | | prop: "type", |
| | | type: "select", |
| | | dicData:[ |
| | | { |
| | | label:"线", |
| | | value:1 |
| | | }, |
| | | { |
| | | label:"面", |
| | | value:2 |
| | | }, |
| | | { |
| | | label:"点", |
| | | value:3 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "创建人", |
| | | prop: "createUser", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "创建部门", |
| | | prop: "createDept", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "修改人", |
| | | prop: "updateUser", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "修改时间", |
| | | prop: "updateTime", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "状态", |
| | | prop: "status", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "是否已删除", |
| | | prop: "isDeleted", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | isDetail:false, |
| | | routeRange:"", |
| | | securityList:[], |
| | | ] |
| | | }, |
| | | { |
| | | label: "创建人", |
| | | prop: "createUser", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "创建部门", |
| | | prop: "createDept", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "修改人", |
| | | prop: "updateUser", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "修改时间", |
| | | prop: "updateTime", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "状态", |
| | | prop: "status", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "是否已删除", |
| | | prop: "isDeleted", |
| | | type: "input", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | hide: true, |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | isDetail: false, |
| | | routeRange: "", |
| | | securityList: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.securityManageCar_add, false), |
| | | viewBtn: this.vaildData(this.permission.securityManageCar_view, false), |
| | | delBtn: this.vaildData(this.permission.securityManageCar_delete, false), |
| | | editBtn: this.vaildData(this.permission.securityManageCar_edit, false) |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.securityManageCar_add, false), |
| | | viewBtn: this.vaildData(this.permission.securityManageCar_view, false), |
| | | delBtn: this.vaildData(this.permission.securityManageCar_delete, false), |
| | | editBtn: this.vaildData(this.permission.securityManageCar_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSecurityList() |
| | | }, |
| | | watch:{ |
| | | //根据活动回显机构 |
| | | 'form.securityId':{ |
| | | handler(newVal){ |
| | | this.securityList.forEach(e=>{ |
| | | if (e.id == newVal){ |
| | | this.form.deptId = e.deptId |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleDetail(row){ |
| | | this.routeRange = row.position |
| | | this.isDetail = true |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | |
| | | if (this.userInfo.role_name != "admin" && this.userInfo.role_name != "administrator"){ |
| | | params["jurisdiction"] = this.userInfo.dept_id; |
| | | } |
| | | |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | //获取所有活动集合 |
| | | getSecurityList(){ |
| | | getAll().then(res=>{ |
| | | if (res.data.code == 200){ |
| | | this.securityList = res.data.data |
| | | const securityIdColumn = this.findObject(this.option.column,"securityId") |
| | | securityIdColumn.dicData = this.securityList |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSecurityList() |
| | | }, |
| | | watch: { |
| | | //根据活动回显机构 |
| | | 'form.securityId': { |
| | | handler(newVal) { |
| | | this.securityList.forEach(e => { |
| | | if (e.id == newVal) { |
| | | this.form.deptId = e.deptId |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleDetail(row) { |
| | | this.routeRange = row.position |
| | | this.isDetail = true |
| | | }, |
| | | beforeOpen(done, type) { |
| | | const column = this.findObject(this.option.column, "securityId"); |
| | | column.addDisabled = true; |
| | | column.editDisabled = true; |
| | | if (["add"].includes(type)) { |
| | | this.form['securityId'] = this.securityId |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | |
| | | if (this.userInfo.role_name != "admin" && this.userInfo.role_name != "administrator") { |
| | | params["jurisdiction"] = this.userInfo.dept_id; |
| | | } |
| | | |
| | | params['securityId'] = this.securityId |
| | | |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | //获取所有活动集合 |
| | | getSecurityList() { |
| | | getAll().then(res => { |
| | | if (res.data.code == 200) { |
| | | this.securityList = res.data.data |
| | | const securityIdColumn = this.findObject(this.option.column, "securityId") |
| | | securityIdColumn.dicData = this.securityList |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |