test #47

Merged
gtz217 merged 273 commits from test into master 2023-10-17 08:53:54 +08:00
Showing only changes of commit 0e6c01e578 - Show all commits

View File

@ -84,9 +84,28 @@ export default {
}, },
{ width: 128, prop: 'inQuantity', label: '投入数', align: 'center' }, { width: 128, prop: 'inQuantity', label: '投入数', align: 'center' },
{ width: 128, prop: 'outQuantity', label: '产出数', align: 'center' }, { width: 128, prop: 'outQuantity', label: '产出数', align: 'center' },
{ width: 128, prop: 'run', label: '是否运行', align: 'center' }, {
{ width: 128, prop: 'status', label: '状态', align: 'center' }, width: 128,
{ width: 128, prop: 'error', label: '是否故障', align: 'center' }, prop: 'run',
label: '是否运行',
align: 'center',
filter: (val) => (val != null ? (val ? '是' : '否') : '-'),
},
{
width: 128,
prop: 'status',
label: '状态',
align: 'center',
filter: (val) =>
val != null ? ['正常', '计划停机', '故障'][val] : '-',
},
{
width: 128,
prop: 'error',
label: '是否故障',
align: 'center',
filter: (val) => (val != null ? (val ? '是' : '否') : '-'),
},
{ {
prop: 'quantityRecordTime', prop: 'quantityRecordTime',
label: '生产量记录时间', label: '生产量记录时间',
@ -174,6 +193,7 @@ export default {
productionLineId: null, productionLineId: null,
equipmentId: null, equipmentId: null,
}, },
total: 0,
// //
form: {}, form: {},
// //
@ -210,6 +230,11 @@ export default {
/** 监听 search bar 的产线下拉框改变 */ /** 监听 search bar 的产线下拉框改变 */
async handleSearchBarItemChange({ param, value: id }) { async handleSearchBarItemChange({ param, value: id }) {
if (param == 'productionLineId') { if (param == 'productionLineId') {
if (id == '') {
//
this.searchBarFormConfig[1].selectOptions = [];
return;
}
const list = await this.getEquipmentList(id); const list = await this.getEquipmentList(id);
this.searchBarFormConfig[1].selectOptions = list.map((eq) => ({ this.searchBarFormConfig[1].selectOptions = list.map((eq) => ({
name: eq.name, name: eq.name,
@ -218,119 +243,40 @@ export default {
} }
}, },
/** 重写 basicPageMixin 里的 handleSearchBarBtnClick */
handleSearchBarBtnClick(btn) { handleSearchBarBtnClick(btn) {
// const { equipmentId, productionLineId } = btn;
this.queryParams.createTime = btn.createTime; if (equipmentId) this.queryParams.equipmentId = equipmentId;
this.handleQuery(); else this.queryParams.equipmentId = null;
}, if (productionLineId)
/** 查询列表 */ this.queryParams.productionLineId = productionLineId;
getList() { else this.queryParams.productionLineId = null;
this.loading = true;
//
// getEquipmentAlarmLogPage(this.queryParams).then((response) => {
// this.list = response.data.list;
// this.total = response.data.total;
// this.loading = false;
// });
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
alarmId: undefined,
alarmContent: undefined,
alarmValue: undefined,
alarmEquipmentId: undefined,
remark: undefined,
};
this.resetForm('form');
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */
resetQuery() { /** 查询列表 */
this.resetForm('queryForm'); async getList() {
this.handleQuery(); this.loading = true;
}, const { data } = await this.$axios({
/** 新增按钮操作 */ url: '/monitoring/equipment-monitor/realtime-page',
handleAdd() { method: 'get',
this.reset(); params: this.queryParams,
this.open = true;
this.title = '添加设备报警日志';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentAlarmLog(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改设备报警日志';
}); });
this.list = data.list;
this.total = data.total;
}, },
/** 提交按钮 */
submitForm() { handleEmitFun({ action, value }) {
this.$refs['form'].validate((valid) => { if (action == 'params-monitor') {
if (!valid) { const { equipmentId, equipmentName, equipmentCode } = value;
return; this.$router.push({
} name: 'equipmentFullParams',
// params: {
if (this.form.id != null) { equipmentId,
updateEquipmentAlarmLog(this.form).then((response) => { equipmentCode,
this.$modal.msgSuccess('修改成功'); equipmentName,
this.open = false; },
this.getList();
});
return;
}
//
createEquipmentAlarmLog(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
}); });
}); }
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除设备报警日志编号为"' + id + '"的数据项?')
.then(function () {
return deleteEquipmentAlarmLog(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm('是否确认导出所有设备报警日志数据项?')
.then(() => {
this.exportLoading = true;
return exportEquipmentAlarmLogExcel(params);
})
.then((response) => {
this.$download.excel(response, '设备报警日志.xls');
this.exportLoading = false;
})
.catch(() => {});
}, },
}, },
}; };