test #47
@ -43,8 +43,8 @@
|
||||
<base-table
|
||||
v-loading="attrListLoading"
|
||||
:table-props="section.props"
|
||||
:page="attrQuery.params.pageNo || 1"
|
||||
:limit="attrQuery.params.pageSize || 10"
|
||||
:page="attrQuery?.params.pageNo || 1"
|
||||
:limit="attrQuery?.params.pageSize || 10"
|
||||
:table-data="list"
|
||||
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr"
|
||||
@ -109,7 +109,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DialogForm from '@/components/DialogForm';
|
||||
// import DialogForm from '@/components/DialogForm';
|
||||
import DialogForm from './dialogForm';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
@ -138,9 +139,10 @@ const SmallTitle = {
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm },
|
||||
props: ['sections', 'mode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||
props: ['sections', 'defaultMode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
mode: '',
|
||||
visible: false,
|
||||
showForm: false,
|
||||
total: 0,
|
||||
@ -202,7 +204,12 @@ export default {
|
||||
},
|
||||
],
|
||||
],
|
||||
attrQuery: null, // 属性列表的请求
|
||||
attrQuery: {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
}, // 属性列表的请求
|
||||
infoQuery: null, // 基本信息的请求
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
@ -227,6 +234,7 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.mode = this.defaultMode || 'detail';
|
||||
for (const section of this.sections) {
|
||||
// 请求具体信息
|
||||
if ('url' in section) {
|
||||
|
177
src/views/base/equipmentGroup/components/dialogForm.vue
Normal file
177
src/views/base/equipmentGroup/components/dialogForm.vue
Normal 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>
|
@ -45,7 +45,7 @@
|
||||
<BasicDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
:mode="editMode"
|
||||
:default-mode="editMode"
|
||||
:data-id="form.id"
|
||||
:sections="[
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ export default {
|
||||
(item, index) => `
|
||||
<li style="list-style: none; display: flex; justify-content: space-between; align-items: center;">
|
||||
<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}
|
||||
</div>
|
||||
${item.value}
|
||||
@ -121,6 +121,7 @@ export default {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
animation: false,
|
||||
name: '合格数量',
|
||||
type: 'bar',
|
||||
barWidth: 20,
|
||||
@ -128,6 +129,7 @@ export default {
|
||||
data: opt.map((item) => item[1]),
|
||||
},
|
||||
{
|
||||
animation: false,
|
||||
name: '不合格数量',
|
||||
type: 'bar',
|
||||
barWidth: 20,
|
||||
|
@ -15,7 +15,8 @@
|
||||
</DetailGraph> -->
|
||||
<!-- <DetailGraph id="dg3" key="dg3" ref="dg3" />
|
||||
<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
|
||||
v-else
|
||||
:x-props="lineData.xProps"
|
||||
|
@ -6,7 +6,7 @@
|
||||
-->
|
||||
|
||||
<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
|
||||
class=""
|
||||
style="
|
||||
@ -43,6 +43,7 @@
|
||||
background: #fff;
|
||||
padding: 12px 16px 16px;
|
||||
border-radius: 8px;
|
||||
flex: 1;
|
||||
">
|
||||
<el-row style="display: flex; align-items: center">
|
||||
<div class="blue-title">产线检测详细</div>
|
||||
@ -64,12 +65,13 @@
|
||||
<transition mode="out-in" name="fade-down">
|
||||
<template v-if="mode == 'table'">
|
||||
<base-table
|
||||
v-if="mode == 'table'"
|
||||
v-if="mode == 'table' && list.length"
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun"></base-table>
|
||||
<div v-else class="no-data-bg"></div>
|
||||
</template>
|
||||
|
||||
<GraphPage
|
||||
|
Loading…
Reference in New Issue
Block a user