| | |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | |
| | | </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-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> |
| | |
| | | |
| | | <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"; |
| | | |
| | |
| | | selectionList: [], |
| | | option: { |
| | | height:'auto', |
| | | calcHeight: 30, |
| | | menuWidth:250, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | prop:"securityId", |
| | | search: true, |
| | | type:"select", |
| | | dicUrl:"/api/security/security/all", |
| | | dicData:[], |
| | | props:{ |
| | | label:"name", |
| | | value:"id" |
| | | } |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属活动", |
| | | trigger: "blur" |
| | | }], |
| | | searchSpan:6, |
| | | }, |
| | | { |
| | | label: "警员", |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: "所属机构", |
| | | label: "所属辖区", |
| | | prop: "deptId", |
| | | type: "tree", |
| | | disabled:true, |
| | | dicUrl: "api/blade-system/dept/lazy-list", |
| | | props:{ |
| | | label:'deptName', |
| | |
| | | children:'children' |
| | | }, |
| | | search: true, |
| | | searchSpan:4, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属机构", |
| | | trigger: "blur" |
| | | }] |
| | | searchSpan:8, |
| | | }, |
| | | { |
| | | label: "类型", |
| | |
| | | data: [], |
| | | isDetail:false, |
| | | routeRange:"", |
| | | securityList:[], |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | ...mapGetters(["userInfo","permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.securityManage_add, false), |
| | |
| | | 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: { |
| | |
| | | }, |
| | | 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.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 |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }; |