Compare commits

...

2 Commits

Author SHA1 Message Date
lb
ab09a2b08c update zentao bugs 2023-11-22 17:04:22 +08:00
lb
cd55b4c860 update 2023-11-22 14:41:53 +08:00
6 changed files with 169 additions and 93 deletions

View File

@ -347,6 +347,8 @@ export default {
console.log('setting code: ', response.data);
//
this.form[opt.prop] = response.data;
// dataFormcodebug
this.$emit('update', this.form)
}
});
}

View File

@ -61,7 +61,7 @@
rows: drawerBaseInfoRows,
},
{
name: '属性列表',
name: '采集参数',
key: 'attrs',
props: drawerListProps,
url: '/base/equipment-plc-param/page',
@ -75,18 +75,26 @@
pageSize: 10,
},
tableBtn: [
this.$auth.hasPermi('equipment:collection-config-param:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('equipment:collection-config-param:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
{
type: 'edit',
btnName: '修改',
},
{
type: 'delete',
btnName: '删除',
},
// this.$auth.hasPermi('equipment:collection-config-param:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:collection-config-param:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v),
allowAdd: true,
},
@ -106,7 +114,6 @@ import {
getEquipmentPlcConnectPage,
exportEquipmentPlcConnectExcel,
} from '@/api/base/equipmentPlcConnect';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
// import './http';
import BasicDrawer from './components/BasicDrawer.vue';
@ -182,13 +189,15 @@ export default {
placeholder: '请选择设备',
param: 'equipmentId',
selectOptions: [],
filterable: true
},
{
type: 'select',
label: '编码',
placeholder: '请选择编码',
label: '关联表编码',
placeholder: '请选择关联表编码',
param: 'plcId',
selectOptions: [],
filterable: true
},
{
type: 'button',
@ -224,7 +233,9 @@ export default {
prop: 'plcId',
labelKey: `plcTableName`,
url: '/base/equipment-plc/listAll',
rules: [{ required: true, message: '关联表名不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
@ -236,7 +247,9 @@ export default {
label: '设备',
prop: 'equipmentId',
url: '/base/core-equipment/page?pageNo=1&pageSize=99',
rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
@ -262,7 +275,9 @@ export default {
input: true,
label: '设备名',
prop: 'equipmentName',
rules: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '设备名不能为空', trigger: 'blur' },
],
// bind: {
// disabled: this.editMode == 'detail', // some condition, like detail mode...
// }
@ -296,7 +311,8 @@ export default {
label: '生产参数类型',
filter: (val) =>
val != null
? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val]
// ? ['', '', '', '', '', ''][val]
? ['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
: '-',
},
{

View File

@ -59,7 +59,6 @@ import {
getEquipmentPlcPage,
exportEquipmentPlcExcel,
} from '@/api/base/equipmentPlc';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
const switchBtn = {
@ -352,7 +351,7 @@ export default {
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除实时数据采集配置编号为"' + id + '"的数据项?')
.confirm('是否确认删除该配置?')
.then(function () {
return deleteEquipmentPlc(id);
})

View File

@ -194,13 +194,17 @@ export default {
input: true,
label: '参数列名',
prop: 'plcParamName',
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
},
{
input: true,
label: '参数名称',
prop: 'name',
rules: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
],
},
],
[
@ -230,19 +234,35 @@ export default {
{ label: '工艺参数', value: 2 },
{ label: '报警参数', value: 3 },
],
rules: [{ required: true, message: '设备参数类型不能为空', trigger: 'blur' }],
rules: [
{
required: true,
message: '设备参数类型不能为空',
trigger: 'blur',
},
],
},
{
select: true,
label: '生产参数类型',
prop: 'production_param_type',
options: [
{ label: '进片数量', value: 1 },
{ label: '出片数量', value: 2 },
{ label: '破损数量', value: 3 },
// { label: '', value: 1 },
// { label: '', value: 2 },
// { label: '', value: 3 },
// { label: '', value: 4 },
{ label: '进口计数', value: 1 },
{ label: '出口计数', value: 2 },
{ label: '损耗计数', value: 3 },
{ label: '无类型', value: 4 },
],
rules: [{ required: true, message: '生产参数类型不能为空', trigger: 'blur' }],
rules: [
{
required: true,
message: '生产参数类型不能为空',
trigger: 'blur',
},
],
},
],
[
@ -305,6 +325,7 @@ export default {
infoQuery: null, //
attrFormSubmitting: false,
attrListLoading: false,
shouldRefreshPageView: false,
};
},
computed: {
@ -323,10 +344,12 @@ export default {
});
},
tableBtn() {
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
return this.sections[1].tableBtn;
// return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
},
},
mounted() {
this.shouldRefreshPageView = false;
this.mode = this.defaultMode || 'detail';
for (const section of this.sections) {
//
@ -403,6 +426,9 @@ export default {
},
handleCancel() {
if (this.shouldRefreshPageView) {
this.$emit('refreshDataList');
}
this.visible = false;
},
@ -426,7 +452,7 @@ export default {
remark: '',
alarmContent: '',
};
this.attrTitle = '添加设备绑定信息';
this.attrTitle = '添加参数绑定信息';
this.attrFormVisible = true;
},
@ -439,14 +465,14 @@ export default {
});
if (res.code == 0) {
this.attrForm = res.data;
this.attrTitle = '编辑设备绑定信息';
this.attrTitle = '编辑参数绑定信息';
this.attrFormVisible = true;
}
},
//
handleDeleteAttr(attrId) {
this.$confirm('确定删除该分组报警?', '提示', {
this.$confirm('确定删除该参数?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
@ -458,6 +484,7 @@ export default {
params: { id: attrId },
});
if (res.code == 0) {
this.shouldRefreshPageView = true;
this.$message({
message: '删除成功',
type: 'success',
@ -472,35 +499,37 @@ export default {
},
//
async submitAttrForm() {
this.$refs['attrForm'].validate((valid) => {
submitAttrForm() {
this.$refs['attrForm'].validate(async (valid) => {
if (!valid) {
return;
}
});
const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true;
const res = await this.$axios({
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
method: isEdit ? 'put' : 'post',
data: {
...this.attrForm,
connectId: this.infoData.id,
},
});
if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true;
const res = await this.$axios({
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
method: isEdit ? 'put' : 'post',
data: {
...this.attrForm,
connectId: this.infoData.id,
},
});
}
this.attrFormSubmitting = false;
if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
this.shouldRefreshPageView = true;
},
});
}
this.attrFormSubmitting = false;
});
},
closeAttrForm() {
@ -509,7 +538,7 @@ export default {
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(`确定删除该报警?`, '提示', {
this.$confirm(`确定删除该参数?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',

View File

@ -482,7 +482,7 @@ export default {
async submitForm() {
const { code, data } = await this.$axios({
url: '/analysis/equipment-analysis/quantity',
url: '/monitoring/equipment-monitor/quantity-series',
method: 'get',
params: this.queryParams,
});

View File

@ -6,19 +6,29 @@
-->
<template>
<div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
<el-row class="" style="
<div
class="status-timegraph-container"
style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
<el-row
class=""
style="
margin-bottom: 12px;
background: #fff;
padding: 16px 16px 0;
border-radius: 8px;
">
<div class="blue-title">生产节拍时序图</div>
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" :remove-blue="true"
@select-changed="handleSearchBarSelectChange" @headBtnClick="handleSearchBarBtnClick" />
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
:remove-blue="true"
@select-changed="handleSearchBarSelectChange"
@headBtnClick="handleSearchBarBtnClick" />
</el-row>
<el-row class="" style="
<el-row
class=""
style="
height: 1px;
flex: 1;
margin-bottom: 12px;
@ -47,17 +57,36 @@
</div>
</el-col>
</el-row>
<div class="main-area" style="flex: 1; display: flex; flex-direction: column">
<div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div>
<div
class="main-area"
style="flex: 1; display: flex; flex-direction: column">
<div
class="graphs"
v-show="graphList.length"
id="status-chart"
style="height: 1px; flex: 1"></div>
<h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
</div>
</el-row>
<!-- 对话框(添加 / 修改) -->
<base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false"
<base-dialog
dialogTitle="添加设备"
:dialogVisible="open"
width="500px"
@close="open = false"
@cancel="open = false"
@confirm="submitForm">
<el-select v-if="open" style="width: 100%" v-model="queryParams.equipmentId" placeholder="请选择一个设备">
<el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option>
<el-select
v-if="open"
style="width: 100%"
v-model="queryParams.equipmentId"
placeholder="请选择一个设备">
<el-option
v-for="eq in eqList"
:key="eq.id"
:value="eq.id"
:label="eq.name"></el-option>
</el-select>
</base-dialog>
</div>
@ -129,7 +158,7 @@ export default {
open: false,
eqList: [],
startTime: null,
gantt: null
gantt: null,
// demo: [
// [
// {
@ -159,7 +188,7 @@ export default {
this.initEquipment();
// this.getList();
},
mounted() { },
mounted() {},
watch: {
graphList: {
handler(val) {
@ -171,7 +200,6 @@ export default {
return;
}
this.gantt.update(val);
});
}
return;
@ -215,7 +243,9 @@ export default {
params: this.queryParams,
});
if (code == 0) {
this.existingEquipments = Object.values(data).map((eq) => eq[0].equipmentId);
this.existingEquipments = Object.values(data).map(
(eq) => eq[0].equipmentId
);
this.graphList = this.objectToArray(data);
}
},
@ -302,26 +332,26 @@ export default {
return;
}
this.startTime = new Date(payload.recordTime)
this.startTime = new Date(payload.recordTime);
this.queryParams.lineId = payload.lineId || null;
this.queryParams.sectionId = payload.sectionId || null;
this.queryParams.equipmentId = payload.equipmentId || null;
this.queryParams.recordTime = payload.recordTime
? [
payload.recordTime,
new Date(
new Date(payload.recordTime).getTime() + 24 * 3600 * 1000
)
.toLocaleDateString()
.split('/')
.map((value, index) => {
if (index == 1 || index == 2) {
return value.padStart(2, '0');
}
return value;
})
.join('-') + ' 00:00:00',
]
payload.recordTime,
new Date(
new Date(payload.recordTime).getTime() + 24 * 3600 * 1000
)
.toLocaleDateString()
.split('/')
.map((value, index) => {
if (index == 1 || index == 2) {
return value.padStart(2, '0');
}
return value;
})
.join('-') + ' 00:00:00',
]
: null;
this.getList();
break;
@ -337,7 +367,7 @@ export default {
return;
}
const { code, data } = await this.$axios({
url: '/analysis/equipment-analysis/status',
url: '/monitoring/equipment-monitor/status-series',
method: 'get',
params: this.queryParams,
});
@ -444,7 +474,7 @@ export default {
}
.running {
background-color: #288AFF;
background-color: #288aff;
// background-color: #84f04e;
}
@ -455,7 +485,7 @@ export default {
.fault {
// background-color: #ea5b5b;
background-color: #FC9C91;
background-color: #fc9c91;
}
.full {
@ -469,7 +499,7 @@ export default {
}
.stop {
background-color: #FFDC94;
background-color: #ffdc94;
}
.legend-row {
@ -478,7 +508,7 @@ export default {
display: flex;
justify-content: flex-end;
>.legend:not(:last-child) {
> .legend:not(:last-child) {
margin-right: 12px;
}
@ -521,7 +551,7 @@ export default {
background: #ccc;
}
.echarts__status-chart>div {
.echarts__status-chart > div {
height: 100% !important;
width: 100% !important;
}