update 设备分组

This commit is contained in:
lb 2023-10-09 17:01:19 +08:00
parent 907db90e93
commit 769830c448
6 changed files with 200 additions and 10 deletions

View File

@ -43,8 +43,8 @@
<base-table <base-table
v-loading="attrListLoading" v-loading="attrListLoading"
:table-props="section.props" :table-props="section.props"
:page="attrQuery.params.pageNo || 1" :page="attrQuery?.params.pageNo || 1"
:limit="attrQuery.params.pageSize || 10" :limit="attrQuery?.params.pageSize || 10"
:table-data="list" :table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'" :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" @emitButtonClick="handleAddAttr"
@ -109,7 +109,8 @@
</template> </template>
<script> <script>
import DialogForm from '@/components/DialogForm'; // import DialogForm from '@/components/DialogForm';
import DialogForm from './dialogForm';
const SmallTitle = { const SmallTitle = {
name: 'SmallTitle', name: 'SmallTitle',
@ -138,9 +139,10 @@ const SmallTitle = {
export default { export default {
components: { SmallTitle, DialogForm }, components: { SmallTitle, DialogForm },
props: ['sections', 'mode', 'dataId'], // dataId id props: ['sections', 'defaultMode', 'dataId'], // dataId id
data() { data() {
return { return {
mode: '',
visible: false, visible: false,
showForm: false, showForm: false,
total: 0, total: 0,
@ -202,7 +204,12 @@ export default {
}, },
], ],
], ],
attrQuery: null, // attrQuery: {
params: {
pageNo: 1,
pageSize: 10
}
}, //
infoQuery: null, // infoQuery: null, //
attrFormSubmitting: false, attrFormSubmitting: false,
attrListLoading: false, attrListLoading: false,
@ -227,6 +234,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.mode = this.defaultMode || 'detail';
for (const section of this.sections) { for (const section of this.sections) {
// //
if ('url' in section) { if ('url' in section) {

View File

@ -0,0 +1,177 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-09-11 15:55:13
description: DialogForm for equipmentBindSection only
-->
<template>
<el-form
ref="form"
:model="dataForm"
label-width="100px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="报警编码"
prop="code"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-input
v-model="dataForm.code"
@change="$emit('update', dataForm)"
placeholder="请输入工段排序" />
</el-form-item>
<!--
<el-form-item
label="报警编码"
prop="code"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="dataForm.code"
placeholder="请选择产线"
@change="handleProductlineChange">
<el-option
v-for="opt in productionLineList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item
label="报警类型"
prop="type"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="dataForm.type"
placeholder="请选择报警类型"
@change="$emit('update', dataForm)">
<el-option
v-for="opt in [
{ label: '布尔型', value: 2 },
{ label: '字符型', value: 1 },
]"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="报警级别"
prop="grade"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="dataForm.grade"
placeholder="请选择报警级别"
@change="$emit('update', dataForm)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
v-if="+dataForm.type == 1"
label="设备报警编码"
prop="alarmCode">
<el-input
v-model="dataForm.alarmCode"
@change="$emit('update', dataForm)"
placeholder="请输入设备报警编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="参数列名"
prop="plcParamName"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-input
v-model="dataForm.plcParamName"
placeholder="请输入参数列名"
@change="$emit('update', dataForm)"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="报警内容"
prop="alarmContent"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-input
v-model="dataForm.alarmContent"
placeholder="请输入报警内容"
@change="$emit('update', dataForm)"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
export default {
name: 'DialogForm',
model: {
prop: 'dataForm',
event: 'update',
},
emits: ['update'],
components: {},
props: {
dataForm: {
type: Object,
default: () => ({}),
},
},
data() {
return {
formLoading: true,
};
},
mounted() {
this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
this.formLoading = false;
this.$emit('update', {
...this.dataForm,
code,
});
});
},
methods: {
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
async handleProductlineChange(id) {
await this.getWorksectionList(id);
this.dataForm.workshopSectionId = null;
this.$emit('update', this.dataForm);
},
async getCode(url) {
const response = await this.$axios(url);
return response.data;
},
},
};
</script>
<style scoped lang="scss">
.el-date-editor,
.el-select {
width: 100%;
}
</style>

View File

@ -45,7 +45,7 @@
<BasicDrawer <BasicDrawer
v-if="editVisible" v-if="editVisible"
ref="drawer" ref="drawer"
:mode="editMode" :default-mode="editMode"
:data-id="form.id" :data-id="form.id"
:sections="[ :sections="[
{ {

View File

@ -66,7 +66,7 @@ export default {
(item, index) => ` (item, index) => `
<li style="list-style: none; display: flex; justify-content: space-between; align-items: center;"> <li style="list-style: none; display: flex; justify-content: space-between; align-items: center;">
<div> <div>
<span style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: ${item.color}; margin-right: 5px;"></span> <span style="display: inline-block; width: 10px; height: 10px; border-radius: 2px; background-color: ${item.color}; margin-right: 5px;"></span>
${item.seriesName} ${item.seriesName}
</div> </div>
${item.value} ${item.value}
@ -121,6 +121,7 @@ export default {
}, },
series: [ series: [
{ {
animation: false,
name: '合格数量', name: '合格数量',
type: 'bar', type: 'bar',
barWidth: 20, barWidth: 20,
@ -128,6 +129,7 @@ export default {
data: opt.map((item) => item[1]), data: opt.map((item) => item[1]),
}, },
{ {
animation: false,
name: '不合格数量', name: '不合格数量',
type: 'bar', type: 'bar',
barWidth: 20, barWidth: 20,

View File

@ -15,7 +15,8 @@
</DetailGraph> --> </DetailGraph> -->
<!-- <DetailGraph id="dg3" key="dg3" ref="dg3" /> <!-- <DetailGraph id="dg3" key="dg3" ref="dg3" />
<DetailGraph id="dg4" key="dg4" ref="dg4" /> --> <DetailGraph id="dg4" key="dg4" ref="dg4" /> -->
<div v-if="!series || series.length == 0" style="color: #777; font-size: 16px; letter-spacing: 1px; text-align: center; padding-top: 56px; text-decoration: underline;">暂无数据</div> <!-- <div v-if="!series || series.length == 0" style="color: #777; font-size: 16px; letter-spacing: 1px; text-align: center; padding-top: 56px; text-decoration: underline;">暂无数据</div> -->
<div v-if="!series || series.length == 0" class="no-data-bg" />
<LineGraph <LineGraph
v-else v-else
:x-props="lineData.xProps" :x-props="lineData.xProps"

View File

@ -6,7 +6,7 @@
--> -->
<template> <template>
<div class="quality-container" style="background: #f2f4f9; flex: 1"> <div class="quality-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column;">
<el-row <el-row
class="" class=""
style=" style="
@ -43,6 +43,7 @@
background: #fff; background: #fff;
padding: 12px 16px 16px; padding: 12px 16px 16px;
border-radius: 8px; border-radius: 8px;
flex: 1;
"> ">
<el-row style="display: flex; align-items: center"> <el-row style="display: flex; align-items: center">
<div class="blue-title">产线检测详细</div> <div class="blue-title">产线检测详细</div>
@ -64,12 +65,13 @@
<transition mode="out-in" name="fade-down"> <transition mode="out-in" name="fade-down">
<template v-if="mode == 'table'"> <template v-if="mode == 'table'">
<base-table <base-table
v-if="mode == 'table'" v-if="mode == 'table' && list.length"
:table-props="tableProps" :table-props="tableProps"
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
@emitFun="handleEmitFun"></base-table> @emitFun="handleEmitFun"></base-table>
<div v-else class="no-data-bg"></div>
</template> </template>
<GraphPage <GraphPage