| | |
| | | |
| | | <template slot-scope="{ row }" slot="devicestate"> |
| | | <el-tag>{{ |
| | | row.devicestate == "0" ? "撤防" : row.devicestate == "1" ? "布防" : "无" |
| | | row.devicestate == "0" ? "撤防" : row.devicestate == "1" ? "布防" : "无" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | |
| | | |
| | | <template slot-scope="{ row }" slot="dxzt"> |
| | | <el-tag>{{ |
| | | row.dxzt == "0" ? "掉线" : row.dxzt == "1" ? "在线" : "无" |
| | | row.dxzt == "0" ? "掉线" : row.dxzt == "1" ? "在线" : "无" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | |
| | | |
| | | <el-drawer |
| | | title="电子地图" |
| | |
| | | </basic-container> |
| | | </el-col> |
| | | <el-dialog title="缴费提醒" :visible.sync="dialogTableVisible" top="280px" custom-class="payWin" append-to-body="true"> |
| | | <el-table :data="gridData"> |
| | | <el-table-column property="xb" label="序号" width="50"></el-table-column> |
| | | <el-table-column property="deviceName" label="设备名称" width="150"></el-table-column> |
| | | <el-table-column property="deviceNumber" label="设备编号" width="150"></el-table-column> |
| | | <el-table-column property="street" label="所属单位" width="200"></el-table-column> |
| | | <el-table-column property="expireTime" label="到期时间"></el-table-column> |
| | | <el-table-column property="pay" label="缴费信息"></el-table-column> |
| | | |
| | | |
| | | <el-dialog |
| | | class="real-jf-dialog" |
| | | title="缴费" |
| | | :visible.sync="realjf" |
| | | append-to-body="true" |
| | | :modal="false" |
| | | > |
| | | <el-form |
| | | :model="form" |
| | | label-position="right" |
| | | size="mini" |
| | | label-width="100px" |
| | | > |
| | | <el-col span="12"> |
| | | <el-form-item label="到期时间"> |
| | | <el-date-picker |
| | | v-model="form.expireTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="选择日期时间" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :offset="4"> |
| | | <el-form-item> |
| | | <el-button type="primary" @click.stop="generate(form)" |
| | | >缴费 |
| | | </el-button |
| | | > |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | </el-dialog> |
| | | |
| | | |
| | | <el-table |
| | | :data="gridData" |
| | | border |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | fixed |
| | | prop="xb" |
| | | label="序号" |
| | | width="50"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="deviceName" |
| | | label="设备名称" |
| | | width="150"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="deviceNumber" |
| | | label="设备编码" |
| | | width="150"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="street" |
| | | label="所属单位" |
| | | width="160"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="expireTime" |
| | | label="到期时间" |
| | | width="160" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="pay" |
| | | label="缴费信息" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | fixed="right" |
| | | label="操作" |
| | | width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="handleClick(scope.row)">一键缴费</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, remove, update, add, getclient, getDeptLazyTree, getAll} from "@/api/client/client"; |
| | | import {mapGetters} from "vuex"; |
| | | import {getList, remove, update, add, getclient, getDeptLazyTree, getAll,updates} from "@/api/client/client"; |
| | | import {mapGetters} from "vuex"; |
| | | import axios from "axios"; |
| | | |
| | | export default { |
| | | created() { |
| | | this.payWin(); |
| | | }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | showMap: false, |
| | | initFlag: true, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | export default { |
| | | created() { |
| | | this.payWin(); |
| | | }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | showMap: false, |
| | | initFlag: true, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | dialogTableVisible: false, |
| | | realjf: false, |
| | | gridData: null, |
| | | selectionList: [], |
| | | treeDeptId: '', |
| | | treeData: [], |
| | | treeOption: { |
| | | nodeKey: 'id', |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentId = (node.level === 0) ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }); |
| | | }, |
| | | dialogTableVisible: false, |
| | | gridData: null, |
| | | selectionList: [], |
| | | treeDeptId: '', |
| | | treeData: [], |
| | | treeOption: { |
| | | nodeKey: 'id', |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentId = (node.level === 0) ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }); |
| | | addBtn: false, |
| | | menu: false, |
| | | size: 'small', |
| | | props: { |
| | | labelText: '标题', |
| | | label: 'title', |
| | | value: 'value', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | indexLabel: '序号', |
| | | calcHeight: 80, |
| | | labelWidth: '100', |
| | | dialogWidth: 950, |
| | | menuWidth: 250, |
| | | size: "mini", |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 4, |
| | | searchSpan: 4, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "设备名称", |
| | | width: 200, |
| | | prop: "deviceName", |
| | | searchPlaceholder: "设备名称/编号", |
| | | search: true, |
| | | }, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: 'small', |
| | | props: { |
| | | labelText: '标题', |
| | | label: 'title', |
| | | value: 'value', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | indexLabel: '序号', |
| | | calcHeight: 80, |
| | | labelWidth: '100', |
| | | dialogWidth: 950, |
| | | menuWidth: 250, |
| | | size: "mini", |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 4, |
| | | searchSpan: 4, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "设备名称", |
| | | width: 200, |
| | | prop: "deviceName", |
| | | searchPlaceholder: "设备名称/编号", |
| | | search: true, |
| | | { |
| | | label: "上级菜单", |
| | | prop: "pid", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-jfpts/catalogs/catalogs/tree", |
| | | hide: true, |
| | | props: { |
| | | label: "title" |
| | | }, |
| | | { |
| | | label: "上级菜单", |
| | | prop: "pid", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-jfpts/catalogs/catalogs/tree", |
| | | hide: true, |
| | | props: { |
| | | label: "title" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请选择上级菜单", |
| | | trigger: "click" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "到期时间", |
| | | prop: "releaseTimeRange", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | searchRange: true, |
| | | searchSpan: 6, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入时间", |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | } |
| | | , |
| | | { |
| | | label: "设备编号", |
| | | prop: "deviceNumber", |
| | | width: 130, |
| | | editDisabled: true, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请输入设备编号", |
| | | trigger: "click" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "序列号", |
| | | prop: "serialNumber", |
| | | hide: true, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | }, |
| | | { |
| | | label: "通道号", |
| | | prop: "channelNumber", |
| | | hide: true, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | }, { |
| | | label: "布撤防状态", |
| | | prop: "devicestate", |
| | | type: "select", |
| | | slot: true, |
| | | width: 100, |
| | | rules: [{ |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请选择上级菜单", |
| | | trigger: "click" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "到期时间", |
| | | prop: "releaseTimeRange", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | searchRange: true, |
| | | searchSpan: 6, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择布撤防状态", |
| | | message: "请输入时间", |
| | | trigger: "blur" |
| | | }], |
| | | dicData: [ |
| | | { |
| | | label: "撤防", |
| | | value: "0" |
| | | }, |
| | | { |
| | | label: "布防", |
| | | value: "1" |
| | | } |
| | | ] |
| | | }, { |
| | | label: "设备状态", |
| | | prop: "dxzt", |
| | | slot: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | }, |
| | | { |
| | | label: "设备类型", |
| | | prop: "deviceType", |
| | | width: 160, |
| | | search: true, |
| | | searchSpan: 3, |
| | | searchLabelWidth: 80, |
| | | searchPlaceholder: "请选择", |
| | | type: "select", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictValue" |
| | | } |
| | | ] |
| | | } |
| | | , |
| | | { |
| | | label: "设备编号", |
| | | prop: "deviceNumber", |
| | | width: 130, |
| | | editDisabled: true, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请输入设备编号", |
| | | trigger: "click" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "序列号", |
| | | prop: "serialNumber", |
| | | hide: true, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | }, |
| | | { |
| | | label: "通道号", |
| | | prop: "channelNumber", |
| | | hide: true, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | }, { |
| | | label: "布撤防状态", |
| | | prop: "devicestate", |
| | | type: "select", |
| | | slot: true, |
| | | width: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择布撤防状态", |
| | | trigger: "blur" |
| | | }], |
| | | dicData: [ |
| | | { |
| | | label: "撤防", |
| | | value: "0" |
| | | }, |
| | | dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1357568691367661569", |
| | | { |
| | | label: "布防", |
| | | value: "1" |
| | | } |
| | | ] |
| | | }, { |
| | | label: "设备状态", |
| | | prop: "dxzt", |
| | | slot: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | }, |
| | | { |
| | | label: "设备类型", |
| | | prop: "deviceType", |
| | | width: 160, |
| | | search: true, |
| | | searchSpan: 3, |
| | | searchLabelWidth: 80, |
| | | searchPlaceholder: "请选择", |
| | | type: "select", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictValue" |
| | | }, |
| | | { |
| | | label: "省份", |
| | | prop: "province", |
| | | search: true, |
| | | searchSpan: 3, |
| | | searchLabelWidth: 45, |
| | | placeholder: "省份", |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | cascaderItem: ["city", "district"], |
| | | dicUrl: "/api/blade-system/region/select", |
| | | span: 6, |
| | | className: "cityClass1" |
| | | dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1357568691367661569", |
| | | }, |
| | | { |
| | | label: "省份", |
| | | prop: "province", |
| | | search: true, |
| | | searchSpan: 3, |
| | | searchLabelWidth: 45, |
| | | placeholder: "省份", |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | { |
| | | label: "地市", |
| | | prop: "city", |
| | | type: "select", |
| | | searchPlaceholder: "地市", |
| | | placeholder: "地市", |
| | | searchLabelWidth: 1, |
| | | searchSpan: 2, |
| | | search: true, |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass2" |
| | | cascaderItem: ["city", "district"], |
| | | dicUrl: "/api/blade-system/region/select", |
| | | span: 6, |
| | | className: "cityClass1" |
| | | }, |
| | | { |
| | | label: "地市", |
| | | prop: "city", |
| | | type: "select", |
| | | searchPlaceholder: "地市", |
| | | placeholder: "地市", |
| | | searchLabelWidth: 1, |
| | | searchSpan: 2, |
| | | search: true, |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | { |
| | | label: "区县", |
| | | searchSpan: 2, |
| | | searchLabelWidth: 1, |
| | | searchPlaceholder: "区县", |
| | | placeholder: "区县", |
| | | search: true, |
| | | prop: "district", |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass3" |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass2" |
| | | }, |
| | | { |
| | | label: "区县", |
| | | searchSpan: 2, |
| | | searchLabelWidth: 1, |
| | | searchPlaceholder: "区县", |
| | | placeholder: "区县", |
| | | search: true, |
| | | prop: "district", |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | { |
| | | label: "权属", |
| | | prop: "ownership", |
| | | width: 150 |
| | | }, { |
| | | label: "街道", |
| | | prop: "street", |
| | | width: 200 |
| | | }, { |
| | | label: "到期时间", |
| | | prop: "expireTime", |
| | | type: "datetime", |
| | | slot: true, |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 150 |
| | | },{ |
| | | label: "缴费信息", |
| | | prop: "pay", |
| | | }, { |
| | | label: "安装时间", |
| | | prop: "stime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 130 |
| | | }, { |
| | | label: "最后上传时间", |
| | | prop: "heartbeat", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 130 |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass3" |
| | | }, |
| | | { |
| | | label: "权属", |
| | | prop: "ownership", |
| | | width: 150 |
| | | }, { |
| | | label: "街道", |
| | | prop: "street", |
| | | width: 200 |
| | | }, { |
| | | label: "到期时间", |
| | | prop: "expireTime", |
| | | type: "datetime", |
| | | slot: true, |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 150 |
| | | }, { |
| | | label: "缴费信息", |
| | | prop: "pay", |
| | | }, { |
| | | label: "安装时间", |
| | | prop: "stime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 130 |
| | | }, { |
| | | label: "最后上传时间", |
| | | prop: "heartbeat", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 130 |
| | | }, |
| | | |
| | | ] |
| | | }, |
| | | data: [] |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.clientManagement_add, false), |
| | | viewBtn: this.vaildData(this.permission.clientManagement_view, false), |
| | | delBtn: this.vaildData(this.permission.clientManagement_delete, false), |
| | | editBtn: this.vaildData(this.permission.clientManagement_edit, false) |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.clientManagement_add, false), |
| | | viewBtn: this.vaildData(this.permission.clientManagement_view, false), |
| | | delBtn: this.vaildData(this.permission.clientManagement_delete, false), |
| | | editBtn: this.vaildData(this.permission.clientManagement_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | methods: { |
| | | generate(row) { |
| | | updates(row.expireTime,row.deviceNumber).then(() => { |
| | | this.dialogTableVisible = false; |
| | | this.realjf = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "缴费成功!" |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }, error => { |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | methods: { |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id; |
| | | this.page.currentPage = 1; |
| | | handleClick(row) { |
| | | this.form=row; |
| | | this.dialogTableVisible = true; |
| | | this.realjf = true; |
| | | |
| | | }, |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | }, |
| | | searchReset() { |
| | | this.treeDeptId = null; |
| | | 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(); |
| | | }, |
| | | 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: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | searchReset() { |
| | | this.treeDeptId = null; |
| | | 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(); |
| | | }, |
| | | 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(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getclient(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const {releaseTimeRange} = this.query; |
| | | let values = { |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getclient(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const {releaseTimeRange} = this.query; |
| | | let values = { |
| | | ...params, |
| | | }; |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...params, |
| | | beginTime: releaseTimeRange[0], |
| | | endTime: releaseTimeRange[1], |
| | | ...this.query |
| | | }; |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...params, |
| | | beginTime: releaseTimeRange[0], |
| | | endTime: releaseTimeRange[1], |
| | | ...this.query |
| | | }; |
| | | values.releaseTimeRange = null; |
| | | } else { |
| | | values = { |
| | | ...params, |
| | | ...this.query |
| | | }; |
| | | } |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, values, this.treeDeptId).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | values.releaseTimeRange = null; |
| | | } else { |
| | | values = { |
| | | ...params, |
| | | ...this.query |
| | | }; |
| | | } |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, values, this.treeDeptId).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | |
| | | var Dqdate = new Date().getTime(); |
| | | var Dqdate = new Date().getTime(); |
| | | |
| | | for (var i = 0; i < data.records.length; i++) { |
| | | var date = new Date(data.records[i].heartbeat).getTime(); |
| | | if ((Dqdate - date) >= (60 * 60 * 24 * 1000)) { |
| | | data.records[i].dxzt = 0; |
| | | } else if (data.records[i].heartbeat == "") { |
| | | data.records[i].dxzt = 0; |
| | | } else { |
| | | data.records[i].dxzt = 1; |
| | | } |
| | | } |
| | | |
| | | data.records.sort((a, b) => { |
| | | return a.dxzt - b.dxzt; |
| | | }); |
| | | |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, rowStyle({row, column, rowIndex}) { |
| | | if (row.heartbeat != null && row.heartbeat != "") { |
| | | var date = new Date(row.heartbeat).getTime(); |
| | | var Dqdate = new Date().getTime(); |
| | | for (var i = 0; i < data.records.length; i++) { |
| | | var date = new Date(data.records[i].heartbeat).getTime(); |
| | | if ((Dqdate - date) >= (60 * 60 * 24 * 1000)) { |
| | | return { |
| | | color: "#fe1515" |
| | | }; |
| | | data.records[i].dxzt = 0; |
| | | } else if (data.records[i].heartbeat == "") { |
| | | data.records[i].dxzt = 0; |
| | | } else { |
| | | data.records[i].dxzt = 1; |
| | | } |
| | | } |
| | | |
| | | } else if (row.heartbeat == "") { |
| | | data.records.sort((a, b) => { |
| | | return a.dxzt - b.dxzt; |
| | | }); |
| | | |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, rowStyle({row, column, rowIndex}) { |
| | | if (row.heartbeat != null && row.heartbeat != "") { |
| | | var date = new Date(row.heartbeat).getTime(); |
| | | var Dqdate = new Date().getTime(); |
| | | if ((Dqdate - date) >= (60 * 60 * 24 * 1000)) { |
| | | return { |
| | | color: "#fe1515" |
| | | }; |
| | | } |
| | | }, |
| | | payWin() { |
| | | var that = this; |
| | | getAll().then(res => { |
| | | var data = res.data.data; |
| | | var lists = []; |
| | | var xb = 0; |
| | | for (var i = 0; i < data.length; i++) { |
| | | if (data[i].type == "1") { |
| | | xb++; |
| | | data[i].xb = xb; |
| | | lists.push(data[i]); |
| | | } |
| | | } |
| | | if (lists.length > 0) { |
| | | that.gridData = lists; |
| | | that.dialogTableVisible = true; |
| | | } |
| | | }); |
| | | |
| | | }, handleStart(row) { |
| | | var arr = []; |
| | | this.$store.state.tags.tagList.forEach(item => { |
| | | if (item.label != "视频") { |
| | | arr.push(item); |
| | | } else if (row.heartbeat == "") { |
| | | return { |
| | | color: "#fe1515" |
| | | }; |
| | | } |
| | | }, |
| | | handleManage(row) { |
| | | this.form; |
| | | this.dialogTableVisible = true; |
| | | }, |
| | | payWin() { |
| | | var that = this; |
| | | getAll().then(res => { |
| | | var data = res.data.data; |
| | | var lists = []; |
| | | var xb = 0; |
| | | for (var i = 0; i < data.length; i++) { |
| | | if (data[i].type == "1") { |
| | | xb++; |
| | | data[i].xb = xb; |
| | | lists.push(data[i]); |
| | | } |
| | | }); |
| | | this.$store.state.tags.tagList = arr; |
| | | this.$router.push({ |
| | | path: `/real/video/`, query: row |
| | | }); |
| | | }, handleMap(row) { |
| | | this.showMap = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.mapDiv.onload = () => { |
| | | window.frames[0].init("equipment", {x: row.jd, y: row.wd}); |
| | | }; |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | } |
| | | if (lists.length > 0) { |
| | | that.gridData = lists; |
| | | that.dialogTableVisible = true; |
| | | } |
| | | }); |
| | | |
| | | }, handleStart(row) { |
| | | var arr = []; |
| | | this.$store.state.tags.tagList.forEach(item => { |
| | | if (item.label != "视频") { |
| | | arr.push(item); |
| | | } |
| | | }); |
| | | this.$store.state.tags.tagList = arr; |
| | | this.$router.push({ |
| | | path: `/real/video/`, query: row |
| | | }); |
| | | }, handleMap(row) { |
| | | this.showMap = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.mapDiv.onload = () => { |
| | | window.frames[0].init("equipment", {x: row.jd, y: row.wd}); |
| | | }; |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .payWin { |
| | | overflow-y: auto; |
| | | height: 350px; |
| | | } |
| | | .payWin { |
| | | overflow-y: auto; |
| | | height: 350px; |
| | | } |
| | | |
| | | .payWin .el-dialog__body { |
| | | padding-top: 0px !important; |
| | | } |
| | | .payWin .el-dialog__body { |
| | | padding-top: 0px !important; |
| | | } |
| | | |
| | | .real-jf-dialog { |
| | | position: absolute !important; |
| | | top: 0 !important; |
| | | left: auto !important; |
| | | right: 0px !important; |
| | | bottom: 0 !important; |
| | | margin: auto !important; |
| | | height: 100% !important; |
| | | width: 800px !important; |
| | | } |
| | | |
| | | .real-jf-dialog .el-dialog { |
| | | position: absolute !important; |
| | | top: 140px !important; |
| | | left: 245px !important; |
| | | right: 0px !important; |
| | | bottom: 0 !important; |
| | | margin: auto !important; |
| | | margin-top: 15vh !important; |
| | | height: 170px; |
| | | } |
| | | |
| | | .real-jf-dialog .el-dialog .el-dialog__body { |
| | | height: calc(100% - 54px); |
| | | box-sizing: border-box; |
| | | } |
| | | </style> |