| | |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/blade-desk/notice/remove', |
| | | url: '/api/blade-jfpts/alarm/alarm/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | |
| | | |
| | | export const add = (row) => { |
| | | return request({ |
| | | url: '/api/blade-desk/notice/submit', |
| | | url: '/api/blade-jfpts/alarm/alarm/submit', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/blade-desk/notice/submit', |
| | | url: '/api/blade-jfpts/alarm/alarm/submit', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentId = (node.level === 0) ? 0 : node.data.id; |
| | | getzcxlTree(parentId).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }); |
| | | |
| | | }, |
| | | addBtn: false, |
| | | menu: false, |
| | |
| | | option: { |
| | | height: 'auto', |
| | | indexLabel:'序号', |
| | | calcHeight: 30, |
| | | calcHeight: 80, |
| | | labelWidth:'100', |
| | | dialogWidth: 950, |
| | | tip: false, |
| | |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="category"> |
| | | <el-tag>{{row.categoryName}}</el-tag> |
| | | |
| | | <template slot="menuRight"> |
| | | <el-button size="small" |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | @click="getBZdata">本周 |
| | | </el-button> |
| | | <el-button size="small" |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | @click="getBYdata">本月 |
| | | </el-button> |
| | | <el-button size="small" |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | @click="getQBdata">全部 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{row}" slot="jtype"> |
| | | <el-tag>{{row.jtype=='0'?'否':row.jtype=='1'?'是':'无'}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | dateTime:[], |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | |
| | | selectionList: [], |
| | | option: { |
| | | height: 'auto', |
| | | indexLabel:'序号', |
| | | indexLabel: '序号', |
| | | calcHeight: 30, |
| | | labelWidth:'100', |
| | | labelWidth: '100', |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 4, |
| | | searchSpan:4, |
| | | searchMenuSpan: 3, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | label: "警情类型", |
| | | prop: "waringType", |
| | | search: true, |
| | | searchSpan: 3, |
| | | }, |
| | | { |
| | | label: "报警时间", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | prop: "alarmTime", |
| | | }, |
| | | { |
| | | label: "报警时间", |
| | | prop: "releaseTimeRange", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | searchRange: true, |
| | | searchSpan: 5, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入时间", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "报警内容", |
| | | prop: "rname", |
| | | },{ |
| | | }, { |
| | | label: "报警人", |
| | | prop: "alarmPeople", |
| | | },{ |
| | | }, { |
| | | label: "联系电话", |
| | | prop: "phoneNumber", |
| | | },{ |
| | | }, { |
| | | label: "接警人", |
| | | prop: "galarmPeople", |
| | | },{ |
| | | }, { |
| | | label: "接警时间", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | prop: "jjTime", |
| | | },{ |
| | | label: "行政区", |
| | | prop: "addvnm", |
| | | search: true, |
| | | },{ |
| | | }, { |
| | | label: "事发地址", |
| | | prop: "place", |
| | | },{ |
| | | }, { |
| | | label: "设备编号", |
| | | prop: "deviceNumber", |
| | | },{ |
| | | }, { |
| | | label: "是否生成警单", |
| | | prop: "yorn", |
| | | } |
| | | search: true, |
| | | searchSpan: 3, |
| | | slot: true, |
| | | searchLabelWidth: 100, |
| | | searchPlaceholder: "请选择", |
| | | prop: "jtype", |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "否", |
| | | value: '0' |
| | | }, |
| | | { |
| | | label: "是", |
| | | value: '1' |
| | | } |
| | | ], |
| | | }, { |
| | | label: '省份', |
| | | prop: 'province', |
| | | search: true, |
| | | searchSpan: 3, |
| | | searchLabelWidth: 50, |
| | | type: 'select', |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | }, |
| | | cascaderItem: ['city', 'district'], |
| | | dicUrl: '/api/blade-system/region/select', |
| | | span: 4, |
| | | labelWidth:'44', |
| | | className:'cityClass' |
| | | }, |
| | | { |
| | | label: '地市', |
| | | prop: 'city', |
| | | type: 'select', |
| | | searchLabelWidth: 50, |
| | | searchSpan: 3, |
| | | search: true, |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | }, |
| | | dicFlag: false, |
| | | dicUrl: '/api/blade-system/region/select?code={{key}}', |
| | | span:4, |
| | | labelWidth:'44', |
| | | className:'cityClass' |
| | | }, |
| | | { |
| | | label: '区县', |
| | | searchSpan: 3, |
| | | searchLabelWidth: 50, |
| | | search: true, |
| | | prop: 'district', |
| | | type: 'select', |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | }, |
| | | dicFlag: false, |
| | | dicUrl: '/api/blade-system/region/select?code={{key}}', |
| | | span: 4, |
| | | labelWidth:'44', |
| | | className:'cityClass' |
| | | }, |
| | | |
| | | ] |
| | | }, |
| | |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | created() { |
| | | this.dateTime = this.getDate(); |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | |
| | | }); |
| | | done(); |
| | | }, error => { |
| | |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | debugger |
| | | row.coordinate = ""; |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...params, |
| | | releaseTime_datege: releaseTimeRange[0], |
| | | releaseTime_datelt: releaseTimeRange[1], |
| | | beginTime: releaseTimeRange[0], |
| | | endTime: releaseTimeRange[1], |
| | | ...this.query |
| | | }; |
| | | values.releaseTimeRange = null; |
| | |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | getDate(){ |
| | | // 当前时间 |
| | | var timestamp = Date.parse(new Date()); |
| | | var serverDate = new Date(timestamp); |
| | | |
| | | // 本周周一的时间 |
| | | var mondayTime = timestamp - ((serverDate.getDay() - 1) * 24 * 60 * 60 * 1000) |
| | | var mondayData = new Date(mondayTime); |
| | | //年 |
| | | var mondayY = mondayData.getFullYear(); |
| | | //月 |
| | | var mondayM = (mondayData.getMonth() + 1 < 10 ? '0' + (mondayData.getMonth() + 1) : mondayData.getMonth() + 1); |
| | | //日 |
| | | var mondayD = mondayData.getDate() < 10 ? '0' + mondayData.getDate() : mondayData.getDate(); |
| | | // 当前时间 |
| | | var currentData = new Date(timestamp); |
| | | //年 |
| | | var currentY = currentData.getFullYear(); |
| | | //月 |
| | | var currentM = (currentData.getMonth() + 1 < 10 ? '0' + (currentData.getMonth() + 1) : currentData.getMonth() + 1); |
| | | //日 |
| | | var currentD = currentData.getDate() < 10 ? '0' + currentData.getDate() : currentData.getDate(); |
| | | //时 |
| | | var currenH = currentData.getHours() < 10 ? '0' + currentData.getHours() : currentData.getHours(); |
| | | //分 |
| | | var currenM = currentData.getMinutes() < 10 ? '0' + currentData.getMinutes() : currentData.getMinutes(); |
| | | |
| | | return { |
| | | week: { |
| | | beginTime: mondayY + '-' + mondayM + '-' + mondayD + ' 00:00:00', |
| | | endTime: currentY + '-' + currentM + '-' + currentD + ' ' + currenH + ':' + currenM + ':00', |
| | | }, |
| | | month: { |
| | | beginTime: mondayY + '-' + mondayM + '-01 00:00:00', |
| | | endTime: currentY + '-' + currentM + '-' + currentD + ' ' + currenH + ':' + currenM + ':00', |
| | | } |
| | | } |
| | | |
| | | }, |
| | | getBZdata() { |
| | | var params = { |
| | | beginTime: this.dateTime.week.beginTime, |
| | | endTime: this.dateTime.week.endTime |
| | | }; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | getBYdata() { |
| | | var params = { |
| | | beginTime: this.dateTime.month.beginTime, |
| | | endTime: this.dateTime.month.endTime |
| | | }; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | getQBdata() { |
| | | var params = {}; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .cityClass{ |
| | | padding-left: 0px !important; |
| | | } |
| | | |
| | | </style> |