feat: 完善仓库建筑绑定、质检预警规则与大屏展示
这个提交包含在:
@@ -35,6 +35,16 @@
|
||||
.search-select .el-input--suffix .el-input__inner {
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
.quality-direction-toggle {
|
||||
display: inline-flex;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.quality-direction-toggle .el-button {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
</style>
|
||||
<div id="vue" v-cloak>
|
||||
<div class="screen-container">
|
||||
@@ -214,39 +224,63 @@
|
||||
<el-input type="number" placeholder="排序" style="width: 330px;" v-model="formData.sort"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测参数:" prop="content">
|
||||
<p>数值指标请选择“越大越好”或“越小越好”。绿色为达标、黄色为预警、红色为警告;等于阈值时归入较低一级,保存后对大屏生效。</p>
|
||||
<el-table :data="typeList[formData.type]['content']" border highlight-current-row>
|
||||
<el-table-column prop="num" width="60" label="序号" show-overflow-tooltip
|
||||
align="center"></el-table-column>
|
||||
<el-table-column prop="name" label="检测项目" show-overflow-tooltip
|
||||
align="center"></el-table-column>
|
||||
<el-table-column prop="unit" width="160" label="单位" show-overflow-tooltip
|
||||
<el-table-column prop="unit" width="110" label="单位" show-overflow-tooltip
|
||||
align="center">
|
||||
<template scope="scope">
|
||||
<el-input style="width: 130px;" placeholder="单位" size="small" maxlength="15" show-word-limit
|
||||
<el-input style="width: 85px;" placeholder="单位" size="small" maxlength="15" show-word-limit
|
||||
v-model="typeList[formData.type]['content'][scope.$index].unit"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" width="200" label="值" show-overflow-tooltip
|
||||
<el-table-column prop="val" width="130" label="值" show-overflow-tooltip
|
||||
align="center">
|
||||
<template scope="scope">
|
||||
<el-input style="width: 150px;" placeholder="请您输入值" size="small" maxlength="50" show-word-limit
|
||||
<el-input style="width: 110px;" placeholder="请您输入值" size="small" maxlength="50" show-word-limit
|
||||
v-model="typeList[formData.type]['content'][scope.$index].val"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warning" width="230" label="预警值" show-overflow-tooltip
|
||||
<el-table-column prop="warning" width="140" label="预警值" show-overflow-tooltip
|
||||
align="center">
|
||||
<template scope="scope">
|
||||
<el-input style="width: 170px;" placeholder="请您输入预警值" size="small" maxlength="50" show-word-limit
|
||||
<el-input style="width: 120px;" placeholder="请您输入预警值" size="small" maxlength="50" show-word-limit
|
||||
v-model="typeList[formData.type]['content'][scope.$index].warning"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="alert" width="230" label="警戒值" show-overflow-tooltip
|
||||
<el-table-column prop="alert" width="140" label="警告值" show-overflow-tooltip
|
||||
align="center">
|
||||
<template scope="scope">
|
||||
<el-input style="width: 170px;" placeholder="请您输入警戒值" size="small" maxlength="50" show-word-limit
|
||||
<el-input style="width: 120px;" placeholder="请您输入警告值" size="small" maxlength="50" show-word-limit
|
||||
v-model="typeList[formData.type]['content'][scope.$index].alert"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="270" fixed="right" label="指标偏好与颜色规则" align="left">
|
||||
<template scope="scope">
|
||||
<template v-if="isNumericRule(scope.row)">
|
||||
<el-button-group class="quality-direction-toggle" :aria-label="'选择' + scope.row.name + '的指标偏好'">
|
||||
<el-button size="mini" :type="ruleDirection(scope.row) === 'lower' ? 'success' : 'default'"
|
||||
:plain="ruleDirection(scope.row) !== 'lower'"
|
||||
:aria-pressed="ruleDirection(scope.row) === 'lower'"
|
||||
@click="setRuleDirection(scope.row, 'lower')">越大越好</el-button>
|
||||
<el-button size="mini" :type="ruleDirection(scope.row) === 'upper' ? 'success' : 'default'"
|
||||
:plain="ruleDirection(scope.row) !== 'upper'"
|
||||
:aria-pressed="ruleDirection(scope.row) === 'upper'"
|
||||
@click="setRuleDirection(scope.row, 'upper')">越小越好</el-button>
|
||||
</el-button-group>
|
||||
<div v-if="ruleError(scope.row)" style="color: #c0392b; margin-top: 6px;">{{ruleError(scope.row)}}</div>
|
||||
<div v-else style="font-size: 12px; line-height: 22px; margin-top: 6px;">
|
||||
<div style="color: #16844a;">绿 · {{ruleRanges(scope.row)[0]}}</div>
|
||||
<div style="color: #946200;">黄 · {{ruleRanges(scope.row)[1]}}</div>
|
||||
<div style="color: #c0392b;">红 · {{ruleRanges(scope.row)[2]}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<span v-else>文字指标,按检测结果判定</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="alert" width="100" label="图表" show-overflow-tooltip
|
||||
align="center">
|
||||
<template scope="scope">
|
||||
@@ -274,7 +308,7 @@
|
||||
width="98%"
|
||||
>
|
||||
<div class="form">
|
||||
<el-form ref="form" :model="formData" label-width="110px">
|
||||
<el-form ref="detailForm" :model="formData" label-width="110px">
|
||||
<el-form-item label="所属仓库:" prop="gid">
|
||||
<div>{{detail.granary.name}}</div>
|
||||
</el-form-item>
|
||||
@@ -308,9 +342,20 @@
|
||||
<el-table-column prop="warning" width="230" label="预警值" show-overflow-tooltip
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="alert" width="230" label="警戒值" show-overflow-tooltip
|
||||
<el-table-column prop="alert" width="230" label="警告值" show-overflow-tooltip
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column width="250" label="指标偏好与颜色规则" align="left">
|
||||
<template scope="scope">
|
||||
<template v-if="isNumericRule(scope.row)">
|
||||
<div>{{ruleDirection(scope.row) === 'lower' ? '● 越大越好' : '● 越小越好'}}</div>
|
||||
<div style="color: #16844a;">绿 · {{ruleRanges(scope.row)[0]}}</div>
|
||||
<div style="color: #946200;">黄 · {{ruleRanges(scope.row)[1]}}</div>
|
||||
<div style="color: #c0392b;">红 · {{ruleRanges(scope.row)[2]}}</div>
|
||||
</template>
|
||||
<span v-else>文字指标,按检测结果判定</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -326,4 +371,4 @@
|
||||
<script src="__CDN__/assets/element-ui-2.15.14/js/index.js"></script>
|
||||
<script src="__CDN__/assets/tool/libs/moment.js"></script>
|
||||
<script src="/assets/js/sweetalert.min.js"></script>
|
||||
<script src="__CDN__/assets/js/jquery-2.1.1.min.js"></script>
|
||||
<script src="__CDN__/assets/js/jquery-2.1.1.min.js"></script>
|
||||
|
||||
在新工单中引用
屏蔽一个用户