| | |
| | | <template> |
| | | <div class="message-container"> |
| | | <div class="item" v-for="(item, index) in list" :key="index"> |
| | | <div class="title">{{ item.title }}({{ item.date }})</div> |
| | | <div class="content">{{ item.message }}</div> |
| | | <div id="title"> |
| | | <div id="bkuang" style="border-top: none"> |
| | | <!-- CSJä»å åæºç¶æé¢æ¿ --> |
| | | <div class="skuang"> |
| | | <div class="csjuname">æµè¯æ¶ä»å åæº</div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å å åæºç¶æ: |
| | | </div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_Status">{{ csjData.R_CSJ_Status || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å åæºæèªå¨ç¶æ:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_AutoStatus">{{ csjData.R_CSJ_AutoStatus || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ£å¨æ§è¡çä»»å¡å·:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_TaskNum">{{ csjData.R_CSJ_TaskNum || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å åæºå·¥ä½ç¶æ:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_WorkStatus">{{ csjData.R_CSJ_WorkStatus || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">ä½ä¸ç±»å:</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_WorkType">{{ csjData.R_CSJ_WorkType || '-' }}</div> |
| | | </div> |
| | | <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> |
| | | |
| | | <!-- CSJå
³èç«å°ï¼åºåº303+åºåº304ï¼ --> |
| | | <div class="skuang"> |
| | | <div class="csjuname">åºåº103ç«å°</div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_IsCanPut3">{{ csjData.R_CSJ_IsCanPut3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¯å¦å
许åè´§(读):</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_IsCanTake3">{{ csjData.R_CSJ_IsCanTake3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¾è´§è¯·æ±(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_PutRequest3">{{ csjData.W_CSJ_PutRequest3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_PutFinish3">{{ csjData.W_CSJ_PutFinish3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å货请æ±(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_TakeRequest3">{{ csjData.W_CSJ_TakeRequest3 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">åè´§å®æ(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_TakeFinish3">{{ csjData.W_CSJ_TakeFinish3 || '-' }}</div> |
| | | </div> |
| | | |
| | | <div class="csjuname">åºåº104ç«å°</div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_IsCanPut4">{{ csjData.R_CSJ_IsCanPut4 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¯å¦å
许åè´§(读):</div> |
| | | <div class="xcsji" :title="csjData.R_CSJ_IsCanTake4">{{ csjData.R_CSJ_IsCanTake4 || '-' }}</div> |
| | | </div> |
| | | |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¾è´§è¯·æ±(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_PutRequest4">{{ csjData.W_CSJ_PutRequest4 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_PutFinish4">{{ csjData.W_CSJ_PutFinish4 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">å货请æ±(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_TakeRequest4">{{ csjData.W_CSJ_TakeRequest4 || '-' }}</div> |
| | | </div> |
| | | <div class="csjankuang"> |
| | | <div class="xname">åè´§å®æ(å):</div> |
| | | <div class="xcsji" :title="csjData.W_CSJ_TakeFinish4">{{ csjData.W_CSJ_TakeFinish4 || '-' }}</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> |
| | | |
| | | <script> |
| | | import { ref, nextTick, watch, onUnmounted } from "vue"; |
| | | import { useStore } from "vuex"; |
| | | import { onMounted } from "vue"; |
| | | |
| | | export default { |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default: () => { |
| | | return []; |
| | | } |
| | | } |
| | | data() { |
| | | return { |
| | | xuan: 0 |
| | | }; |
| | | }, |
| | | created() { |
| | | if (!this.list.length) { |
| | | this.list.push({ |
| | | title: 'æ¶æ¯werweræµè¯æ é¢', |
| | | message: 'æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
容', |
| | | date: '2022-05-02 03:10' |
| | | setup() { |
| | | const store = useStore(); |
| | | const csjData = ref({}); |
| | | |
| | | const UPDATE_DELAY = 300; |
| | | let updateTimer = null; |
| | | |
| | | // CSJæ°æ®æ å°è§åï¼æ°å¢åå·å¤çï¼ |
| | | const csjStatusMap = { |
| | | R_CSJ_Status: { |
| | | 0: "æ£å¸¸", |
| | | 1: "æ
é", |
| | | 2: "æ¥å", |
| | | 3: "æªç¥" |
| | | }, |
| | | R_CSJ_AutoStatus: { |
| | | 0: "ç»´ä¿®", |
| | | 1: "æå¨", |
| | | 2: "åèªå¨", |
| | | 3: "èªå¨", |
| | | }, |
| | | R_CSJ_WorkStatus: { |
| | | 0: "å¾
æº", |
| | | 1: "åè´§ä¸", |
| | | 2: "åè´§å®æ", |
| | | 4: "æ¾è´§ä¸", |
| | | 5: "æ¾è´§å®æ", |
| | | 6: "ä»»å¡å®æ", |
| | | }, |
| | | R_CSJ_WorkType: { |
| | | 0: "æ ä½ä¸ä»»å¡(0)", |
| | | 1: "åæ¾è´§ä½ä¸(1)", |
| | | 2: "åªåè´§ä½ä¸(2)", |
| | | 3: "åªæ¾è´§ä½ä¸(3)", |
| | | 4: "ç§»å¨å°æå®ä½ç½®" |
| | | }, |
| | | R_CSJ_TrayType: { |
| | | "-1": "空箱(-1)", |
| | | 1: "å°æç(1)", |
| | | 2: "䏿ç(2)", |
| | | 3: "大æç(3)", |
| | | 4: "ç¹å¤§æç(4)", |
| | | }, |
| | | // æ°å¢ï¼åå·æ å°å¤ç |
| | | R_CSJ_Column: (val) => val !== undefined ? val : "æªç¥" |
| | | }; |
| | | |
| | | // CSJåæ®µåç» |
| | | const csjFieldGroups = { |
| | | permissionFields: { |
| | | keys: ["R_CSJ_IsCanPut1", "R_CSJ_IsCanTake1", "R_CSJ_IsCanPut2", "R_CSJ_IsCanTake2", |
| | | "R_CSJ_IsCanPut3", "R_CSJ_IsCanTake3", "R_CSJ_IsCanPut4", "R_CSJ_IsCanTake4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | requestFields: { |
| | | keys: ["W_CSJ_PutRequest1", "W_CSJ_TakeRequest1", "W_CSJ_PutRequest2", "W_CSJ_TakeRequest2", |
| | | "W_CSJ_PutRequest3", "W_CSJ_TakeRequest3", "W_CSJ_PutRequest4", "W_CSJ_TakeRequest4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | finishFields: { |
| | | keys: ["W_CSJ_PutFinish1", "W_CSJ_TakeFinish1", "W_CSJ_PutFinish2", "W_CSJ_TakeFinish2", |
| | | "W_CSJ_PutFinish3", "W_CSJ_TakeFinish3", "W_CSJ_PutFinish4", "W_CSJ_TakeFinish4"], |
| | | map: { true: "æ¯", false: "å¦" } |
| | | }, |
| | | palletTypeFields: { |
| | | keys: ["R_CSJ_TakePalletType1", "R_CSJ_TakePalletType2", "R_CSJ_TakePalletType3", "R_CSJ_TakePalletType4", |
| | | "W_CSJ_PutPalletType1", "W_CSJ_PutPalletType2", "W_CSJ_PutPalletType3", "W_CSJ_PutPalletType4"], |
| | | map: { "-1": "空箱(-1)", 1: "å°æç(1)", 2: "䏿ç(2)", 3: "大æç(3)", 4: "ç¹å¤§æç(4)" } |
| | | } |
| | | }; |
| | | |
| | | // å¤çCSJåå§æ°æ®ï¼å
å«åå·å¤çï¼ |
| | | const processCSJData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processedData = { ...rawData }; |
| | | |
| | | // å¤çæ ¸å¿ç¶æå段 |
| | | Object.keys(csjStatusMap).forEach(key => { |
| | | if (processedData.hasOwnProperty(key)) { |
| | | const mapper = csjStatusMap[key]; |
| | | processedData[key] = typeof mapper === 'function' |
| | | ? mapper(processedData[key]) |
| | | : (mapper[processedData[key]] || processedData[key]); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // å¤çåç»å段 |
| | | Object.values(csjFieldGroups).forEach(group => { |
| | | group.keys.forEach(key => { |
| | | if (processedData.hasOwnProperty(key)) { |
| | | processedData[key] = group.map[processedData[key]] || processedData[key]; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | return processedData; |
| | | }; |
| | | |
| | | // å»¶è¿æ´æ°CSJæ°æ® |
| | | const delayedUpdateCSJData = (newRawData) => { |
| | | if (updateTimer) { |
| | | clearTimeout(updateTimer); |
| | | } |
| | | |
| | | updateTimer = setTimeout(() => { |
| | | if (newRawData && newRawData.R_CSJ_Status !== undefined) { |
| | | csjData.value = processCSJData(newRawData); |
| | | |
| | | // æ´æ°æ ·å¼ |
| | | nextTick(() => { |
| | | const valueElements = document.getElementsByClassName("xcsji"); |
| | | for (let i = 0; i < valueElements.length; i++) { |
| | | if (valueElements[i].innerHTML === "æ¯") { |
| | | valueElements[i].style.color = "yellow"; |
| | | } else if (valueElements[i].innerHTML === "å¦") { |
| | | valueElements[i].style.color = "red"; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, UPDATE_DELAY); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | const initialData = store.state.homedata; |
| | | if (initialData && initialData.R_CSJ_Status !== undefined) { |
| | | csjData.value = processCSJData(initialData); |
| | | } |
| | | |
| | | const unwatch = watch( |
| | | () => store.state.homedata, |
| | | (newData) => { |
| | | if (newData && newData.R_CSJ_Status !== undefined) { |
| | | delayedUpdateCSJData(newData); |
| | | } |
| | | }, |
| | | { deep: true } |
| | | ); |
| | | |
| | | // ç»ä»¶å¸è½½æ¶æ¸
ç |
| | | onUnmounted(() => { |
| | | unwatch(); |
| | | if (updateTimer) { |
| | | clearTimeout(updateTimer); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | return { |
| | | csjData |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped lang="less"> |
| | | .message-container { |
| | | .title { |
| | | padding-bottom: 10px; |
| | | } |
| | | .item { |
| | | border-bottom: 1px solid #eee; |
| | | padding: 10px 20px; |
| | | } |
| | | .content { |
| | | color: #7e7e7e; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | <style scoped> |
| | | /* åææ ·å¼ä¿æä¸å */ |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-top: 7px; |
| | | } |
| | | </style> |
| | | .yan { |
| | | color: white; |
| | | float: left; |
| | | font-size: 25px; |
| | | } |
| | | .dakuang { |
| | | width: 250px; |
| | | height: 50px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 200px; |
| | | } |
| | | #xiugai { |
| | | width: 100px; |
| | | height: 30px; |
| | | float: left; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | border: 1px solid white; |
| | | color: white; |
| | | background: rgba(255, 255, 255, 0.5); |
| | | font-size: 25px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 450px; |
| | | } |
| | | #xiugai:hover { |
| | | background: #f60; |
| | | } |
| | | #shu1, |
| | | #shu2 { |
| | | width: 200px; |
| | | height: 30px; |
| | | float: left; |
| | | margin-top: 0px; |
| | | margin-right: 0px; |
| | | border-radius: 5px; |
| | | border: 1px solid white; |
| | | } |
| | | #guan { |
| | | width: 40px; |
| | | height: 40px; |
| | | float: left; |
| | | font-size: 1.1cqw; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-left: 560px; |
| | | color: white; |
| | | position: absolute; |
| | | } |
| | | #ti { |
| | | width: 600px; |
| | | height: 300px; |
| | | position: relative; |
| | | background: rgba(255, 255, 255, 1); |
| | | border-radius: 10px; |
| | | top: 230px; |
| | | left: 35%; |
| | | display: none; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 170%; |
| | | background-position: -220px 0px; |
| | | } |
| | | .csjuname { |
| | | width: 100%; |
| | | height: 5vh; |
| | | float: left; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-weight: 700; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xname { |
| | | width: 70%; |
| | | height: 80px; |
| | | float: left; |
| | | line-height: 7vh; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xcsji { |
| | | width: 30%; |
| | | height: 7vh; |
| | | float: left; |
| | | line-height: 50px; |
| | | font-size: 1.1cqw; |
| | | color: rgb(242, 242, 50); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .csjankuang { |
| | | width: 45%; |
| | | height: 3vh; |
| | | margin-top: 10px; |
| | | margin-left: 5%; |
| | | float: left; |
| | | } |
| | | #title { |
| | | float: left; |
| | | width: 95%; |
| | | height: 88vh; |
| | | margin-top: 40px; |
| | | margin-left: 3%; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100%; |
| | | container-type: inline-size; |
| | | } |
| | | #bkuang { |
| | | width: 100%; |
| | | height: 55vh; |
| | | float: left; |
| | | } |
| | | .skuang { |
| | | width: 31%; |
| | | height: 55vh; |
| | | float: left; |
| | | border-top: none; |
| | | border-left: none; |
| | | border-bottom: none; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | /* æ°å¢ï¼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> |