| | |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | |
| | | <!-- å³ä¾§å¾çä¾§è¾¹æ - å¢å z-indexå±çº§ --> |
| | | <div class="image-sidebar" :class="{ 'sidebar-open': isSidebarOpen }"> |
| | | <div class="sidebar-toggle" @click="toggleSidebar"> |
| | | <span>{{ isSidebarOpen ? ">" : "<" }}</span> |
| | | </div> |
| | | <div class="sidebar-content"> |
| | | <div class="image-container"> |
| | | <img :src="logoUrl" alt="åèå¾ç" class="reference-image" /> |
| | | <div class="image-description">é
æ¹å¸å±åèå¾</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import extend from "@/extension/basicinfo/formula.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | import { ref, defineComponent, computed } from "vue"; |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | const isSidebarOpen = ref(false); |
| | | |
| | | // å¾çè·¯å¾ |
| | | const logoUrl = computed(() => { |
| | | try { |
| | | return require("@/assets/test.png"); |
| | | } catch (e) { |
| | | console.log("使ç¨ç¸å¯¹è·¯å¾å è½½å¾ç"); |
| | | return "/assets/test.png"; |
| | | } |
| | | }); |
| | | |
| | | const toggleSidebar = () => { |
| | | isSidebarOpen.value = !isSidebarOpen.value; |
| | | }; |
| | | |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | |
| | | sortName: "createDate", |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨ååæ®µ - å®å
¨å¹é
å端Dt_Formulaå®ä½ç±» |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | productCode: "", |
| | | productName: "", |
| | | productLength: 0, |
| | | productWidth: 0, |
| | | productHeight: 0, |
| | | screwDownsetDistance: 0, |
| | | screwTorqueOutput: 0, |
| | | dintAutoScrewOn: 0, |
| | | xDirectionDistance1: 0, |
| | | yDirectionHeight1: 0, |
| | | xDirectionDistance2: 0, |
| | | yDirectionHeight2: 0, |
| | | xDirectionDistance3: 0, |
| | | yDirectionHeight3: 0, |
| | | productLength: "", |
| | | productWidth: "", |
| | | productHeight: "", |
| | | pressNoTighten: "", |
| | | pressNoCheckBottomPlate: "", |
| | | screwDownsetDistance: "", // å端注é为ï¼ä¿ååå |
| | | screwTorqueOutput: "", // å端注é为ï¼ä¸å¿é«åº¦ |
| | | dintAutoScrewOn: "", |
| | | pressFastenTorque: "", |
| | | p0P1Width: "", |
| | | p0P2Width: "", |
| | | p0P3Width: "", |
| | | pressPressureDiff: "", |
| | | pressTorqueDiff: "", |
| | | detectHeightDiff: "", |
| | | screwPositionDiff: "", |
| | | // ç§»é¤äºcenterHeightåæ®µï¼åç«¯æ æ¤å段ï¼åå端é
ç½®é误æ å°ï¼ |
| | | }); |
| | | |
| | | // ç¼è¾è¡¨åé
ç½® - ä¿®æ£åæ®µä¸æåç§°åæ³¨éï¼å¹é
å端å®ä½ |
| | | // éç¹ï¼ä¸ºæ ¸å¿å段补å
å¿
å¡«é
ç½®ï¼require: trueï¼ |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "æåç¼å·", |
| | | required: true, |
| | | field: "productCode", |
| | | type: "input", |
| | | type: "string", |
| | | width: 200, |
| | | require: true, |
| | | }, |
| | | { |
| | | title: "æååç§°", |
| | | field: "productName", |
| | | type: "input", |
| | | type: "string", |
| | | width: 200, |
| | | require: true, |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "主é®ID", |
| | | field: "id", |
| | | type: "input", |
| | | title: "æ§ç´§ç¨åºå·", |
| | | field: "dintAutoScrewOn", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 180, |
| | | placeholder: "请è¾å
¥æ´æ°", |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "产åé¿åº¦", // ä¿®æ£å端注é |
| | | field: "productLength", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 100, |
| | | hidden: true, |
| | | readonly: true, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "产å宽度", // ä¿®æ£å端注é |
| | | field: "productWidth", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 100, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "产åé«åº¦", // ä¿®æ£å端注é |
| | | field: "productHeight", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 100, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "䏿§ç´§", |
| | | field: "pressNoTighten", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | defaultValue: "0", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | required: true, // æ°å¢ï¼å¼å
³ç±»å段å¿
å¡« |
| | | }, |
| | | { |
| | | title: "䏿µåºæ¿", |
| | | field: "pressNoCheckBottomPlate", |
| | | type: "select", |
| | | width: 120, |
| | | align: "center", |
| | | defaultValue: "0", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | required: true, // æ°å¢ï¼å¼å
³ç±»å段å¿
å¡« |
| | | }, |
| | | { |
| | | title: "ä¿ååå", |
| | | field: "screwDownsetDistance", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å·¥èºåæ°å¿
å¡« |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "ä¸å¿é«åº¦", // ä¿®æ£åæ®µä¸æåç§°ï¼å端注éï¼ |
| | | field: "screwTorqueOutput", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å·¥èºåæ°å¿
å¡« |
| | | }, |
| | | { |
| | | title: "ç´§åºæç©", // è¡¥å
宿´å段åç§° |
| | | field: "pressFastenTorque", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°ï¼é»è®¤0.00", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å·¥èºåæ°å¿
å¡« |
| | | }, |
| | | { |
| | | title: "P0P1宽度", |
| | | field: "p0P1Width", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å°ºå¯¸åæ°å¿
å¡« |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "P0P2宽度", |
| | | field: "p0P2Width", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å°ºå¯¸åæ°å¿
å¡« |
| | | }, |
| | | { |
| | | title: "P0P3宽度", |
| | | field: "p0P3Width", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å°ºå¯¸åæ°å¿
å¡« |
| | | }, |
| | | { |
| | | title: "ååå·®å¼", |
| | | field: "pressPressureDiff", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å·®å¼åæ°å¿
å¡« |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æåå·®å¼", |
| | | field: "pressTorqueDiff", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å·®å¼åæ°å¿
å¡« |
| | | }, |
| | | { |
| | | title: "é«åº¦å·®å¼", |
| | | field: "detectHeightDiff", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å·®å¼åæ°å¿
å¡« |
| | | }, |
| | | { |
| | | title: "èºçº¹å·®å¼", |
| | | field: "screwPositionDiff", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, // æ°å¢ï¼å·®å¼åæ°å¿
å¡« |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "å«çé«åº¦", |
| | | field: "gasketHeight", |
| | | type: "string", |
| | | inputType: "number", |
| | | width: 120, |
| | | placeholder: "ä¿ç2ä½å°æ°", |
| | | attrs: { step: 0.01, min: 0 }, |
| | | required: true, |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | // æç´¢è¡¨ååæ®µ |
| | | const searchFormFields = ref({ |
| | | productCode: "", |
| | | productName: "", |
| | |
| | | createDate: "", |
| | | }); |
| | | |
| | | // æç´¢è¡¨åé
ç½® |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æåç¼å·", field: "productCode", type: "like" }, |
| | | { title: "æååç§°", field: "productName", type: "like" }, |
| | | { title: "æåç¼å·", field: "productCode", type: "like", width: 200 }, |
| | | { title: "æååç§°", field: "productName", type: "like", width: 200 }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | { title: "å建人", field: "creater", type: "like", width: 200 }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime", width: 380 }, |
| | | ], |
| | | ]); |
| | | |
| | | // è¡¨æ ¼åé
ç½® - ä¿®æ£åæ®µä¸æåç§°åæ³¨éï¼å¹é
å端å®ä½ |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "åºå·", |
| | | title: "id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | width: 80, |
| | | // hidden: true, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "productCode", |
| | | title: "æåç¼å·", |
| | | type: "string", |
| | | link: true, |
| | | width: 200, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productName", |
| | | title: "æååç§°", |
| | | type: "string", |
| | | width: 200, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productLength", |
| | | title: "产åé¿åº¦", // ä¿®æ£å端注é |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "productWidth", |
| | | title: "产å宽度", // ä¿®æ£å端注é |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "productHeight", |
| | | title: "产åé«åº¦", // ä¿®æ£å端注é |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "pressNoTighten", |
| | | title: "䏿§ç´§", |
| | | type: "select", |
| | | width: 100, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "pressNoCheckBottomPlate", |
| | | title: "䏿µåºæ¿", |
| | | type: "select", |
| | | width: 110, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | | { key: "0", value: "å¦" }, |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: "screwDownsetDistance", |
| | | title: "ä¿ååå", // ä¿®æ£åæ®µä¸æåç§° |
| | | type: "decimal", |
| | | width: 110, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "screwTorqueOutput", |
| | | title: "ä¸å¿é«åº¦", // ä¿®æ£åæ®µä¸æåç§° |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "pressFastenTorque", |
| | | title: "ç´§åºæç©", // è¡¥å
宿´å段åç§° |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "dintAutoScrewOn", |
| | | title: "æ§ç´§ç¨åºå·", |
| | | type: "int", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "p0P1Width", |
| | | title: "P0P1宽度", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "p0P2Width", |
| | | title: "P0P2宽度", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "p0P3Width", |
| | | title: "P0P3宽度", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "pressPressureDiff", |
| | | title: "ååå·®å¼", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "pressTorqueDiff", |
| | | title: "æç©å·®å¼", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "detectHeightDiff", |
| | | title: "é«åº¦å·®å¼", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "screwPositionDiff", |
| | | title: "èºçº¹å·®å¼", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "gasketHeight", |
| | | title: "å«çé«åº¦", |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 150, |
| | | align: "left", |
| | | width: 160, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | |
| | | // é
æ¹æç»é
ç½® - åæ ·ç»æç»å段添å å¿
å¡« |
| | | const detail = ref({ |
| | | cnName: "é¶ä»¶è¯¦ç»ä¿¡æ¯", |
| | | table: "componentDetail", |
| | | cnName: "é
æ¹ä¿¡æ¯è¯¦æ
", |
| | | table: "FormulaDetail", |
| | | columns: [ |
| | | { |
| | | field: "formulaId", |
| | | title: "ID", |
| | | title: "é
æ¹ID", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | require: true, |
| | | align: "left", |
| | | readonly: true, |
| | | required: true, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "componentCode", |
| | | title: "é¶ä»¶ç¼å·", |
| | | type: "string", |
| | | edit: { type: "input" }, |
| | | width: 120, |
| | | require: true, |
| | | required: true, // æç»æ ¸å¿å段å¿
å¡« |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "componentName", |
| | | title: "é¶ä»¶åç§°", |
| | | type: "string", |
| | | edit: { type: "input" }, |
| | | width: 150, |
| | | require: true, |
| | | required: true, // æç»æ ¸å¿å段å¿
å¡« |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "supplierCode", |
| | | title: "便¹ä»£ç ", |
| | | type: "string", |
| | | edit: { type: "input" }, |
| | | width: 150, |
| | | required: true, // æç»æ ¸å¿å段å¿
å¡« |
| | | align: "left", |
| | | }, |
| | | { |
| | | title: "æ¯å¦æ«ç ", |
| | | field: "isScanned", |
| | | type: "select", |
| | | width: 100, |
| | | align: "center", |
| | | bind: { |
| | | key: "value", |
| | | data: [ |
| | |
| | | { key: "1", value: "æ¯" }, |
| | | ], |
| | | }, |
| | | required: true, // æç»å¼å
³å段å¿
å¡« |
| | | }, |
| | | ], |
| | | sortName: "createDate", |
| | |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | isSidebarOpen, |
| | | logoUrl, |
| | | toggleSidebar, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* ä¾§è¾¹æ æ ·å¼ - å¢å z-indexå±çº§ */ |
| | | .image-sidebar { |
| | | position: fixed; |
| | | top: 0; |
| | | right: -600px; |
| | | width: 600px; |
| | | height: 100vh; |
| | | background: #fff; |
| | | box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1); |
| | | transition: right 0.3s ease; |
| | | z-index: 9999; |
| | | display: flex; |
| | | } |
| | | |
| | | .sidebar-open { |
| | | right: 0; |
| | | } |
| | | |
| | | .sidebar-toggle { |
| | | position: absolute; |
| | | left: -40px; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 40px; |
| | | height: 80px; |
| | | background: #409eff; |
| | | color: white; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | border-radius: 8px 0 0 8px; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | transition: all 0.3s ease; |
| | | box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1); |
| | | z-index: 10000; /* 忢æé®çz-indexæ´é« */ |
| | | } |
| | | |
| | | .sidebar-toggle:hover { |
| | | background: #66b1ff; |
| | | } |
| | | |
| | | .sidebar-toggle span { |
| | | transition: transform 0.3s ease; |
| | | } |
| | | |
| | | .sidebar-open .sidebar-toggle span { |
| | | transform: rotate(180deg); |
| | | } |
| | | |
| | | .sidebar-content { |
| | | flex: 1; |
| | | padding: 20px; |
| | | overflow-y: auto; |
| | | z-index: 9999; /* å
容åºåä¹è®¾ç½®é«z-index */ |
| | | } |
| | | |
| | | .image-container { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | height: 100%; |
| | | } |
| | | |
| | | .reference-image { |
| | | max-width: 100%; |
| | | max-height: 60vh; |
| | | object-fit: contain; |
| | | border: 1px solid #ddd; |
| | | border-radius: 8px; |
| | | padding: 10px; |
| | | background: #f8f9fa; |
| | | } |
| | | |
| | | .image-description { |
| | | margin-top: 15px; |
| | | padding: 10px; |
| | | background: #409eff; |
| | | color: white; |
| | | border-radius: 4px; |
| | | font-size: 14px; |
| | | text-align: center; |
| | | } |
| | | |
| | | /* ååºå¼è®¾è®¡ */ |
| | | @media (max-width: 768px) { |
| | | .image-sidebar { |
| | | width: 250px; |
| | | right: -250px; |
| | | } |
| | | |
| | | .sidebar-toggle { |
| | | left: -30px; |
| | | width: 30px; |
| | | height: 60px; |
| | | } |
| | | } |
| | | </style> |