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

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

parent 919d5834
......@@ -2,36 +2,36 @@
import html2Canvas from 'html2canvas'
import JsPDF from 'jspdf'
export default{
install (Vue, options) {
Vue.prototype.getPdf = function () {
var title = this.htmlTitle
html2Canvas(document.querySelector('.many_charts'), {
allowTaint: true
}).then(function (canvas) {
let contentWidth = canvas.width
let contentHeight = canvas.height
let pageHeight = contentWidth / 592.28 * 841.89
let leftHeight = contentHeight
let position = 0
let imgWidth = 595.28
let imgHeight = 592.28 / contentWidth * contentHeight
let pageData = canvas.toDataURL('image/jpeg', 1.0)
let PDF = new JsPDF('', 'pt', 'a4')
if (leftHeight < pageHeight) {
PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight)
} else {
while (leftHeight > 0) {
PDF.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
leftHeight -= pageHeight
position -= 841.89
if (leftHeight > 0) {
PDF.addPage()
install (Vue, options) {
Vue.prototype.getPdf = function () {
var title = this.htmlTitle
html2Canvas(document.querySelector('.many_charts'), {
allowTaint: true
}).then(function (canvas) {
let contentWidth = canvas.width
let contentHeight = canvas.height
let pageHeight = contentWidth / 592.28 * 841.89
let leftHeight = contentHeight
let position = 0
let imgWidth = 595.28
let imgHeight = 592.28 / contentWidth * contentHeight
let pageData = canvas.toDataURL('image/jpeg', 1.0)
let PDF = new JsPDF('', 'pt', 'a4')
if (leftHeight < pageHeight) {
PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight)
} else {
while (leftHeight > 0) {
PDF.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
leftHeight -= pageHeight
position -= 841.89
if (leftHeight > 0) {
PDF.addPage()
}
}
}
PDF.save(title + '.pdf')
}
}
)
}
PDF.save(title + '.pdf')
}
)
}
}
}
\ No newline at end of file
}
......@@ -24,7 +24,7 @@ export default {
path: 'deviceStatus',
component: () => import('@/views/DeviceRunning/DeviceStatus/list'),
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 {
path: 'index',
component: () => import('@/views/DutyStation/list'),
name: 'DutyStationIndex',
meta: { title: 'DutyStationIndex', icon: 'dutyStationSearch', noCache: false }
meta: { title: 'DutyStationIndex', icon: 'dutyStationSearch', noCache: false, mark: '/dutyStation/index' }
}
]
}
......@@ -13,7 +13,7 @@
</div>
<div class="tool-pack clear-float pl-15 pr-15">
<Search
searchCode="PASS_INFO"
searchCode="REAL_TIME_STATUS"
@search="doSearchClick"
@reset="doResetClick">
</Search>
......@@ -49,10 +49,10 @@
height: 0,
data: [],
fieldList: [
{ label: '车间', value: 'vin' },
{ label: '设备名称', value: 'stationName' },
{ label: '设备编码', value: 'stationNo' },
{ label: '设备状态', value: 'passTime' }
{ label: '车间', value: 'equipWorkshop' },
{ label: '设备名称', value: 'equipName' },
{ label: '设备编码', value: 'equipCode' },
{ label: '设备状态', value: 'equipState' }
],
paginationToggle: true,
paginationConfig: {
......@@ -65,19 +65,72 @@
},
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 () {
setTimeout(() => {
this.tableConfig.height = document.querySelector('.page-pack').offsetHeight - 178;
// 设备实时状态查询
this.getDeviceStatusRunningTime();
}, 0);
}
}
......
......@@ -21,13 +21,15 @@
<el-button
@click="doOpenAutoMakeUpClick"
type="primary"
size="small">
size="small"
v-if="Authority.checkedAuthority('/dutyStation/index/openAutoMakeUp')">
开启自动补扫
</el-button>
<el-button
@click="doStopAutoMakeUpClick"
type="primary"
size="small">
size="small"
v-if="Authority.checkedAuthority('/dutyStation/index/stopAutoMakeUp')">
关闭自动补扫
</el-button>
</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