Commit 4ffa49a3 authored by 李志鸣's avatar 李志鸣

feat(设备状态): 功能联调(100%) 添加权限 eslint错误修复

parent 919d5834
...@@ -2,36 +2,36 @@ ...@@ -2,36 +2,36 @@
import html2Canvas from 'html2canvas' import html2Canvas from 'html2canvas'
import JsPDF from 'jspdf' import JsPDF from 'jspdf'
export default{ export default{
install (Vue, options) { install (Vue, options) {
Vue.prototype.getPdf = function () { Vue.prototype.getPdf = function () {
var title = this.htmlTitle var title = this.htmlTitle
html2Canvas(document.querySelector('.many_charts'), { html2Canvas(document.querySelector('.many_charts'), {
allowTaint: true allowTaint: true
}).then(function (canvas) { }).then(function (canvas) {
let contentWidth = canvas.width let contentWidth = canvas.width
let contentHeight = canvas.height let contentHeight = canvas.height
let pageHeight = contentWidth / 592.28 * 841.89 let pageHeight = contentWidth / 592.28 * 841.89
let leftHeight = contentHeight let leftHeight = contentHeight
let position = 0 let position = 0
let imgWidth = 595.28 let imgWidth = 595.28
let imgHeight = 592.28 / contentWidth * contentHeight let imgHeight = 592.28 / contentWidth * contentHeight
let pageData = canvas.toDataURL('image/jpeg', 1.0) let pageData = canvas.toDataURL('image/jpeg', 1.0)
let PDF = new JsPDF('', 'pt', 'a4') let PDF = new JsPDF('', 'pt', 'a4')
if (leftHeight < pageHeight) { if (leftHeight < pageHeight) {
PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight) PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight)
} else { } else {
while (leftHeight > 0) { while (leftHeight > 0) {
PDF.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight) PDF.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
leftHeight -= pageHeight leftHeight -= pageHeight
position -= 841.89 position -= 841.89
if (leftHeight > 0) { if (leftHeight > 0) {
PDF.addPage() PDF.addPage()
}
}
}
PDF.save(title + '.pdf')
} }
} )
} }
PDF.save(title + '.pdf')
}
)
} }
} }
}
\ No newline at end of file
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
path: 'deviceStatus', path: 'deviceStatus',
component: () => import('@/views/DeviceRunning/DeviceStatus/list'), component: () => import('@/views/DeviceRunning/DeviceStatus/list'),
name: 'DeviceStatus', name: 'DeviceStatus',
meta: { title: 'DeviceStatus', icon: 'repairApplication', noCache: false } meta: { title: 'DeviceStatus', icon: 'repairApplication', noCache: false, mark: '/deviceRunning/deviceStatus/list' }
} }
] ]
} }
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
path: 'index', path: 'index',
component: () => import('@/views/DutyStation/list'), component: () => import('@/views/DutyStation/list'),
name: 'DutyStationIndex', name: 'DutyStationIndex',
meta: { title: 'DutyStationIndex', icon: 'dutyStationSearch', noCache: false } meta: { title: 'DutyStationIndex', icon: 'dutyStationSearch', noCache: false, mark: '/dutyStation/index' }
} }
] ]
} }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
<div class="tool-pack clear-float pl-15 pr-15"> <div class="tool-pack clear-float pl-15 pr-15">
<Search <Search
searchCode="PASS_INFO" searchCode="REAL_TIME_STATUS"
@search="doSearchClick" @search="doSearchClick"
@reset="doResetClick"> @reset="doResetClick">
</Search> </Search>
...@@ -49,10 +49,10 @@ ...@@ -49,10 +49,10 @@
height: 0, height: 0,
data: [], data: [],
fieldList: [ fieldList: [
{ label: '车间', value: 'vin' }, { label: '车间', value: 'equipWorkshop' },
{ label: '设备名称', value: 'stationName' }, { label: '设备名称', value: 'equipName' },
{ label: '设备编码', value: 'stationNo' }, { label: '设备编码', value: 'equipCode' },
{ label: '设备状态', value: 'passTime' } { label: '设备状态', value: 'equipState' }
], ],
paginationToggle: true, paginationToggle: true,
paginationConfig: { paginationConfig: {
...@@ -65,19 +65,72 @@ ...@@ -65,19 +65,72 @@
}, },
methods: { methods: {
// 点击刷新按钮 // 点击刷新按钮
doRefreshClick () {}, async doRefreshClick () {
try {
let params = {
searchCode: this.searchList.searchCode || 'REAL_TIME_STATUS',
filters: this.searchList.filters || [],
pageSize: this.tableConfig.paginationConfig.pageSize,
pageNum: this.tableConfig.paginationConfig.currentPage
};
let response = await this.$service('POST', '/api/basicinfo/equipStatusRealTime', params);
this.tableConfig.data = _.cloneDeep(response.list);
this.tableConfig.paginationConfig.total = _.cloneDeep(response.total);
this.$message.success('刷新成功');
} catch (error) {
throw error;
}
},
// 点击搜索按钮 // 点击搜索按钮
doSearchClick (searchValue) {}, doSearchClick (searchValue) {
this.searchList = searchValue;
this.tableConfig.paginationConfig.currentPage = 1;
// 设备实时状态查询
this.getDeviceStatusRunningTime();
},
// 点击重置按钮 // 点击重置按钮
doResetClick (searchValue) {}, doResetClick (searchValue) {
this.searchList = { ...searchValue, filters: [] };
this.tableConfig.paginationConfig.currentPage = 1;
this.tableConfig.paginationConfig.pageSize = 20;
// 设备实时状态查询
this.getDeviceStatusRunningTime();
},
// 触发表格数量改变事件 // 触发表格数量改变事件
onPageSizeChange (pageSize) {}, onPageSizeChange (pageSize) {
this.tableConfig.paginationConfig.currentPage = 1;
this.tableConfig.paginationConfig.pageSize = pageSize;
// 设备实时状态查询
this.getDeviceStatusRunningTime();
},
// 触发表格分页改变事件 // 触发表格分页改变事件
onCurrentPageChange (currentPage) {} onCurrentPageChange (currentPage) {
this.tableConfig.paginationConfig.currentPage = currentPage;
// 设备实时状态查询
this.getDeviceStatusRunningTime();
},
// 设备实时状态查询
async getDeviceStatusRunningTime () {
try {
let params = {
searchCode: this.searchList.searchCode || 'REAL_TIME_STATUS',
filters: this.searchList.filters || [],
pageSize: this.tableConfig.paginationConfig.pageSize,
pageNum: this.tableConfig.paginationConfig.currentPage
};
let response = await this.$service('POST', '/api/basicinfo/equipStatusRealTime', params);
this.tableConfig.data = _.cloneDeep(response.list);
this.tableConfig.paginationConfig.total = _.cloneDeep(response.total);
} catch (error) {
throw error;
}
}
}, },
mounted () { mounted () {
setTimeout(() => { setTimeout(() => {
this.tableConfig.height = document.querySelector('.page-pack').offsetHeight - 178; this.tableConfig.height = document.querySelector('.page-pack').offsetHeight - 178;
// 设备实时状态查询
this.getDeviceStatusRunningTime();
}, 0); }, 0);
} }
} }
......
...@@ -21,13 +21,15 @@ ...@@ -21,13 +21,15 @@
<el-button <el-button
@click="doOpenAutoMakeUpClick" @click="doOpenAutoMakeUpClick"
type="primary" type="primary"
size="small"> size="small"
v-if="Authority.checkedAuthority('/dutyStation/index/openAutoMakeUp')">
开启自动补扫 开启自动补扫
</el-button> </el-button>
<el-button <el-button
@click="doStopAutoMakeUpClick" @click="doStopAutoMakeUpClick"
type="primary" type="primary"
size="small"> size="small"
v-if="Authority.checkedAuthority('/dutyStation/index/stopAutoMakeUp')">
关闭自动补扫 关闭自动补扫
</el-button> </el-button>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment