Browse Source

小瓶判断isUsed

feature/user-0111
zhangjiming 7 months ago
parent
commit
83c8d5d313
  1. 8
      src/pages/Index/Regular/Consumables.vue
  2. 14
      src/pages/Index/components/Consumables/BallGrid2.vue
  3. 6
      src/pages/Index/components/Consumables/MainComponent.vue

8
src/pages/Index/Regular/Consumables.vue

@ -87,6 +87,7 @@
gridWidth="240px" gridWidth="240px"
gridHeight="240px" gridHeight="240px"
:activeColor="item.color" :activeColor="item.color"
:inUse="item.isUsed"
/> />
</div> </div>
</div> </div>
@ -181,6 +182,7 @@ interface BufferLittle {
type?: string type?: string
projId?: number projId?: number
projName?: string projName?: string
isUsed?: boolean
} }
const bufferLittles = ref<BufferLittle[]>([ const bufferLittles = ref<BufferLittle[]>([
{ {
@ -221,7 +223,9 @@ const bufferLittles = ref<BufferLittle[]>([
}, },
]) ])
// //
const bufferBig = ref<BottleGroup[]>([])
const bufferBig = ref<BottleGroup[]>(
Array.from({ length: 6 }, () => ({}) as BottleGroup),
)
// //
const emergencyInfo = ref(emergencyStore.$state.emergencyInfo || {}) const emergencyInfo = ref(emergencyStore.$state.emergencyInfo || {})
// //
@ -444,7 +448,7 @@ const updateTipNum = async ({
tempTipNum.value[index] = tipNum tempTipNum.value[index] = tipNum
// //
if (sync) { if (sync) {
console.log(`🚀 ~ updateTipNum ~ order ${index + 1}, num ${tipNum}`, )
console.log(`🚀 ~ updateTipNum ~ order ${index + 1}, num ${tipNum}`)
isDragging.value = false isDragging.value = false
try { try {
await updateTipsNum({ group: `TipG${index + 1}`, num: tipNum }) await updateTipsNum({ group: `TipG${index + 1}`, num: tipNum })

14
src/pages/Index/components/Consumables/BallGrid2.vue

@ -8,6 +8,7 @@
:style="ballStyle(index)" :style="ballStyle(index)"
> >
<div class="inner-circle" :style="innerCircleStyle(index)"></div> <div class="inner-circle" :style="innerCircleStyle(index)"></div>
<img class="no-use-img" v-if="!inUse" src="@/assets/Index/stop.svg" alt="no-use" />
</div> </div>
</div> </div>
<!-- 拖动区 --> <!-- 拖动区 -->
@ -65,6 +66,10 @@ const props = defineProps({
type: String, type: String,
default: 'lightgray', // default: 'lightgray', //
}, },
inUse: {
type: Boolean,
default: true
},
canUpdate: { canUpdate: {
type: Boolean, type: Boolean,
default: false, default: false,
@ -123,7 +128,7 @@ const innerCircleStyle = (index) => {
return { return {
width: '80%', width: '80%',
height: '80%', height: '80%',
backgroundColor: isActive ? props.activeColor : props.innerColor,
backgroundColor: isActive && props.inUse ? props.activeColor : props.innerColor,
borderRadius: '50%', borderRadius: '50%',
transition: 'background-color 0.3s ease', transition: 'background-color 0.3s ease',
} }
@ -173,6 +178,13 @@ watch(
justify-content: center; justify-content: center;
align-items: center; align-items: center;
transition: background-color 0.3s ease; transition: background-color 0.3s ease;
position: relative;
.no-use-img {
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
}
} }
.inner-circle { .inner-circle {

6
src/pages/Index/components/Consumables/MainComponent.vue

@ -2,7 +2,7 @@
<div class="combined-container"> <div class="combined-container">
<!-- 小球组件 --> <!-- 小球组件 -->
<BallGrid2 :total="totalBalls" :activated="activatedBalls" :columns="columns" :width="gridWidth" :height="gridHeight" <BallGrid2 :total="totalBalls" :activated="activatedBalls" :columns="columns" :width="gridWidth" :height="gridHeight"
:activeColor="activeColor" />
:activeColor="activeColor" :inUse="inUse"/>
<!-- 项目信息组件 --> <!-- 项目信息组件 -->
<InfoBar :projectName="projectName" :currentCount="currentCount" :maxCount="maxCount" /> <InfoBar :projectName="projectName" :currentCount="currentCount" :maxCount="maxCount" />
@ -51,6 +51,10 @@ const props = defineProps({
type: String, type: String,
default: '#4caf50', // default: '#4caf50', //
}, },
inUse: {
type: Boolean,
default: true
},
}) })
</script> </script>

Loading…
Cancel
Save