update 料位“

This commit is contained in:
lb 2023-03-03 10:06:29 +08:00
parent 5a1f8d894d
commit c5703b4b88
3 changed files with 41 additions and 25 deletions

View File

@ -11,7 +11,13 @@
<div class="storage-body" style="height: 120px; display: flex">
<div class="storage-box__bg" style="height: 100%; width: 48px; margin-right: 12px; border-radius: 4px; overflow: hidden">
<div class="storage-box__inner" style="position: absolute; bottom: 0; left: 0; height: 65%; width: 100%" :style="{ background: color }"></div>
<div
class="storage-box__inner"
style="position: absolute; bottom: 0; left: 0; height: 0; width: 100%; font-size: 1.125rem; text-align: center;"
:style="{ background: color, height: computedRatio + '%', color: computedRatio > 20 ? 'white' : '#ccc' }"
>
<span style="height: 100%; display: flex; flex-direction: column; justify-content: flex-end;">{{ computedRatio + '%' }}</span>
</div>
</div>
<div style="display: flex; flex-direction: column; min-width: 128px; justify-content: space-between">
@ -56,8 +62,12 @@ export default {
},
unitValue: {
type: String,
default: null
}
default: null,
},
ratio: {
type: Number,
default: 0.0,
},
},
data() {
return {
@ -66,9 +76,12 @@ export default {
},
computed: {
computedUnit() {
if (!this.unitValue) return '存量'
return this.unitList(this.unitValue)+' 存量'
if (!this.unitValue) return "存量";
return this.unitList(this.unitValue) + " 存量";
},
computedRatio() {
return this.ratio ? this.ratio.toFixed(2) * 100 : 0
}
},
created() {},
mounted() {},

View File

@ -31,6 +31,7 @@
:material="st.material ?? '默认物料'"
:total="2"
:unit-value="st.unitDictValue"
:ratio="st.ratio"
/>
</div>
</div>
@ -60,6 +61,7 @@
:material="st.material ?? '默认物料'"
:total="2"
:unit-value="st.unitDictValue"
:ratio="st.ratio"
/>
</div>
</div>
@ -89,6 +91,7 @@
:material="st.material ?? '默认物料'"
:total="2"
:unit-value="st.unitDictValue"
:ratio="st.ratio"
/>
</div>
</div>

View File

@ -69,7 +69,7 @@ export default function () {
const dialogConfigs = {
extraIds: { wsId: 4 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
menu: [{ name: "压制工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }],
menu: [{ name: "检测工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }],
form: {
rows: [
[