| | |
| | | <div class="skuang"> |
| | | <div class="csjuname">æµè¯æ¶ä»å åæº</div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å åæºç¶æ:</div> |
| | | <div class="xname">å å åæºç¶æ: |
| | | </div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_Status">{{ csjData.R_CSJ_Status || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | |
| | | <div class="csjankuang"> |
| | | <div class="xname">æçç±»å:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_TrayType">{{ csjData.R_CSJ_TrayType || '-' }}</div> |
| | | </div> |
| | | <!-- æ°å¢ï¼å½åæå¨åæ¾ç¤º --> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å½åæå¨å:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_Column">{{ csjData.R_CSJ_Column || 'æªç¥' }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- æ°å¢ï¼å åæºå½ååæåæ¾ç¤º --> |
| | | <div id="csj-nowcolumn" :class="{ 'abnormal-column': csjData.R_CSJ_Status !== 'æ£å¸¸' }"> |
| | | <div>æµè¯æ¶å åæºå½åæå¨å: |
| | | <span :title="csjData.R_CSJ_Column">{{ csjData.R_CSJ_Column || 'æªç¥' }}</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- æ°å¢ï¼åæ¹æ ¼å±ç¤ºåºå --> |
| | | <div class="csj-column-container" :class="{ 'pp-status-abnormal': csjData.R_CSJ_Status !== 'æ£å¸¸' }"> |
| | | <!-- 䏿¹1-24å --> |
| | | <div class="column-grid-container"> |
| | | <div |
| | | v-for="num in 20" |
| | | :key="num" |
| | | class="column-grid-item" |
| | | :class="{ 'active': num == csjData.R_CSJ_Column }" |
| | | :title="`åå·: ${num}`" |
| | | > |
| | | {{ num }} |
| | | </div> |
| | | </div> |
| | | <!-- 䏿¹25-47å (23个) --> |
| | | <div class="column-grid-container"> |
| | | <div |
| | | v-for="i in 23" |
| | | :key="'csj-lower-' + i" |
| | | class="column-grid-item" |
| | | :class="{ 'active': (20 + i) == csjData.R_CSJ_Column }" |
| | | :title="`åå·: ${20 + i}`" |
| | | > |
| | | {{ 20 + i }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | setup() { |
| | | const store = useStore(); |
| | | // ä»
åå¨CSJæ°æ®ï¼ä¸å
¶ä»æ°æ®é离 |
| | | const csjData = ref({}); |
| | | |
| | | // å»¶è¿æ´æ°é
ç½®ï¼è§£å³éªçé®é¢ |
| | | const UPDATE_DELAY = 300; // å»¶è¿300msæ´æ°UI |
| | | let updateTimer = null; // 宿¶å¨å®ä¾ |
| | | const UPDATE_DELAY = 300; |
| | | let updateTimer = null; |
| | | |
| | | // CSJæ°æ®æ å°è§å |
| | | // CSJæ°æ®æ å°è§åï¼æ°å¢åå·å¤çï¼ |
| | | const csjStatusMap = { |
| | | R_CSJ_Status: { |
| | | 1: "æ£å¸¸", |
| | | 2: "æ
é", |
| | | 3: "æ¥å", |
| | | 0: "æ£å¸¸", |
| | | 1: "æ
é", |
| | | 2: "æ¥å", |
| | | 3: "æªç¥" |
| | | }, |
| | | R_CSJ_AutoStatus: { |
| | | 0: "ç»´ä¿®", |
| | |
| | | 2: "䏿ç(2)", |
| | | 3: "大æç(3)", |
| | | 4: "ç¹å¤§æç(4)", |
| | | } |
| | | }, |
| | | // æ°å¢ï¼åå·æ å°å¤ç |
| | | R_CSJ_Column: (val) => val !== undefined ? val : "æªç¥" |
| | | }; |
| | | |
| | | // CSJåæ®µåç» |
| | |
| | | } |
| | | }; |
| | | |
| | | // å¤çCSJåå§æ°æ® |
| | | // å¤çCSJåå§æ°æ®ï¼å
å«åå·å¤çï¼ |
| | | const processCSJData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processedData = { ...rawData }; |
| | |
| | | // å¤çæ ¸å¿ç¶æå段 |
| | | Object.keys(csjStatusMap).forEach(key => { |
| | | if (processedData.hasOwnProperty(key)) { |
| | | processedData[key] = csjStatusMap[key][processedData[key]] || processedData[key]; |
| | | const mapper = csjStatusMap[key]; |
| | | processedData[key] = typeof mapper === 'function' |
| | | ? mapper(processedData[key]) |
| | | : (mapper[processedData[key]] || processedData[key]); |
| | | } |
| | | }); |
| | | |
| | |
| | | return processedData; |
| | | }; |
| | | |
| | | // å»¶è¿æ´æ°CSJæ°æ®ï¼é¿å
é«é¢å·æ° |
| | | // å»¶è¿æ´æ°CSJæ°æ® |
| | | const delayedUpdateCSJData = (newRawData) => { |
| | | if (updateTimer) { |
| | | clearTimeout(updateTimer); |
| | | } |
| | | |
| | | updateTimer = setTimeout(() => { |
| | | // åªå¤çå
å«CSJç¹å¾åæ®µçæ°æ® |
| | | if (newRawData && newRawData.R_CSJ_Status !== undefined) { |
| | | csjData.value = processCSJData(newRawData); |
| | | |
| | |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // åå§å è½½æ°æ® |
| | | const initialData = store.state.homedata; |
| | | if (initialData && initialData.R_CSJ_Status !== undefined) { |
| | | csjData.value = processCSJData(initialData); |
| | | } |
| | | |
| | | // ç嬿°æ®ååï¼åªå¤çCSJæ°æ® |
| | | const unwatch = watch( |
| | | () => store.state.homedata, |
| | | (newData) => { |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* åææ ·å¼ä¿æä¸å */ |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |
| | | |
| | | /* æ°å¢ï¼CSJå åæºå½ååæ ·å¼ */ |
| | | #csj-nowcolumn { |
| | | width: 100%; |
| | | height: 70px; |
| | | float: left; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | font-size: 1.5cqw; |
| | | font-weight: bold; |
| | | color: #00ff4c; |
| | | } |
| | | |
| | | /* å¼å¸¸ç¶ææååè² */ |
| | | #csj-nowcolumn.abnormal-column { |
| | | color: red !important; |
| | | } |
| | | #csj-nowcolumn.abnormal-column span { |
| | | color: red !important; |
| | | } |
| | | |
| | | /* å容卿 ·å¼ */ |
| | | .csj-column-container { |
| | | width: 95%; |
| | | margin: 0 auto; |
| | | position: relative; |
| | | clear: both; |
| | | padding-top: 15px; |
| | | } |
| | | |
| | | /* æ¹æ ¼å®¹å¨æ ·å¼ */ |
| | | .column-grid-container { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-wrap: nowrap; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | gap: 2px; |
| | | position: relative; |
| | | z-index: 2; |
| | | margin-bottom: 10px; |
| | | padding: 0 2px; |
| | | } |
| | | |
| | | /* æ¹æ ¼æ ·å¼ */ |
| | | .column-grid-item { |
| | | flex: 1; |
| | | min-width: 24px; |
| | | max-width: 60px; |
| | | height: 30px; |
| | | border: 1px solid #fff; |
| | | border-radius: 8px 8px 0 0; |
| | | color: white; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | font-size: clamp(8px, 1vw, 14px); |
| | | box-sizing: border-box; |
| | | transition: background-color 0.3s ease; |
| | | } |
| | | |
| | | /* å½ååé«äº® */ |
| | | .column-grid-item.active { |
| | | background-color: green; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | /* å¼å¸¸ç¶æä¸å½åå红è²é«äº® */ |
| | | .pp-status-abnormal .column-grid-item.active { |
| | | background-color: red !important; |
| | | } |
| | | </style> |