Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jfpt-Vue
| | |
| | | </span> |
| | | </template> |
| | | |
| | | |
| | | <template slot-scope="{ row }" slot="devicestate"> |
| | | <el-tag>{{ |
| | | row.devicestate == "0" ? "撤防" : row.devicestate == "1" ? "布防" : "无" |
| | |
| | | |
| | | <script> |
| | | import {getList, remove, update, add, getclient, getDeptLazyTree, getAll, updates,getBaTree} from "@/api/client/client"; |
| | | // import {getDeptTree} from "@/api/system/dept"; |
| | | import {mapGetters} from "vuex"; |
| | | import axios from "axios"; |
| | | import Legend from '../../components/liu-legend/Legend' |
| | | import AvueMap from "avue-plugin-map"; |
| | | import website from '@/config/website'; |
| | | |
| | | export default { |
| | | components:{ |
| | |
| | | height: 'auto', |
| | | indexLabel: '序号', |
| | | calcHeight: 80, |
| | | labelWidth: '125', |
| | | dialogWidth: 960, |
| | | labelWidth: '105', |
| | | dialogWidth: 1040, |
| | | menuWidth: 150, |
| | | align:"center", |
| | | size: "mini", |
| | |
| | | }, |
| | | { |
| | | label: "使用方", |
| | | prop: "deptName", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "使用方", |
| | | prop: "deptId", |
| | | width: 200, |
| | | type: "tree", |
| | |
| | | multiple: true, |
| | | dicData: [], |
| | | checkStrictly:true, |
| | | hide:true, |
| | | props: { |
| | | label: "title" |
| | | }, |
| | |
| | | // type: "cascader", |
| | | // dicUrl: "/api/blade-system/dept/trees", |
| | | // multiple: true, |
| | | // checkStrictly:true, |
| | | // dicData: [], |
| | | // props: { |
| | | // label: "title" |
| | |
| | | prop: "province", |
| | | search: true, |
| | | searchSpan: 2, |
| | | labelWidth: '112', |
| | | labelWidth: '100', |
| | | searchLabelWidth: 45, |
| | | placeholder: "省份", |
| | | type: "select", |
| | |
| | | }, |
| | | cascaderItem: ["city", "district"], |
| | | dicUrl: "/api/blade-system/region/select", |
| | | span: 6, |
| | | span: 7, |
| | | className: "city1", |
| | | hide: true, |
| | | addDisplay: true, |
| | |
| | | value: "code" |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | span: 2, |
| | | labelWidth: "0", |
| | | className: "city2", |
| | | hide: true, |
| | |
| | | label: "地址", |
| | | prop: "street", |
| | | // type:"map", |
| | | span:10, |
| | | labelWidth: '142', |
| | | width:100, |
| | | span:11, |
| | | labelWidth: '160', |
| | | hide: true, |
| | | }, |
| | | { |
| | |
| | | searchSpan:0, |
| | | maxlength:0, |
| | | hide: true, |
| | | span: 2, |
| | | span: 1, |
| | | // display:false, |
| | | component: "AvueMap" |
| | | }, |
| | |
| | | hide: true, |
| | | prop: "jd", |
| | | searchSpan:2, |
| | | width:"100", |
| | | labelWidth: "110", |
| | | formatter: (row,value,label,column)=>{ |
| | | return value = value.substring(0,11); |
| | | }, |
| | |
| | | }, |
| | | { |
| | | label: "纬度", |
| | | labelWidth:50, |
| | | labelWidth: "45", |
| | | hide: true, |
| | | prop: "wd", |
| | | formatter: (row,value,label,column) => { |
| | |
| | | // form是表单或者表格绑定的数据集,v-model='form' |
| | | handler(val) { |
| | | if (val) { |
| | | console.log(val,111); |
| | | this.form.wd = val.latitude.toString().substring(0,10); |
| | | this.form.jd = val.longitude.toString().substring(0,11); |
| | | var that = this; |
| | | this.form.wd = val.latitude; |
| | | // this.form.wd = val.latitude.toString().substring(0,10); |
| | | this.form.jd = val.longitude; |
| | | // this.form.jd = val.longitude.toString().substring(0,11); |
| | | //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始 |
| | | var address = val.formattedAddress.toString(); |
| | | if(address.search("县") != -1){ |
| | |
| | | if(address.search("区") != -1){ |
| | | this.form.street = address.substring(address.indexOf("区")+1,address.length); |
| | | } |
| | | |
| | | // this.form.province = val.addressComponent.province; |
| | | // console.log( val.addressComponent.city,123456) |
| | | // this.form.city = val.addressComponent.city; |
| | | // this.form.district = val.addressComponent.district; |
| | | |
| | | that.form.province = val.addressComponent.province; |
| | | that.form.city = val.addressComponent.city; |
| | | that.form.district = val.addressComponent.district; |
| | | } |
| | | }, |
| | | immediate: true, |
| | |
| | | }); |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | //随意一个 |
| | | // 'form.deviceName'() { |
| | | // if (this.initFlag) { |
| | | // this.initData(); |
| | | // } |
| | | // } |
| | | |
| | | }, |
| | | computed: { |
| | |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | mounted(){ |
| | | // 租户模式默认加载管理组数据 |
| | | // var that = this; |
| | | //that.tenantId = website.tenantId; |
| | | }, |
| | | methods: { |
| | | generate(row) { |
| | | updates(row.expireTime, row.deviceNumber).then(() => { |
| | |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | |
| | | //初始化数据 |
| | | // initData() { |
| | | // //部门tree数据 |
| | | // getDeptTree().then(res => { |
| | | // const column = this.findObject(this.option.column, "deptId"); |
| | | // column.dicData = res.data.data; |
| | | // }); |
| | | // }, |
| | | |
| | | handleClick(row) { |
| | | this.form = row; |
| | | this.dialogTableVisible = true; |
| | | this.realjf = true; |
| | | |
| | | }, |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id; |
| | |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | debugger; |
| | | row.jd=row.map.latitude; |
| | | row.wd=row.map.longitude; |
| | | // row.jd=row.map.latitude; |
| | | // row.wd=row.map.longitude; |
| | | update(row).then(() => { |
| | | // this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | // this.initFlag = true; |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | |
| | | |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, values, this.treeDeptId).then(res => { |
| | | // debugger; |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | |