From 3ab330b8aefb3cd781c9b8730b4ab7ac65e7e9d7 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 07 三月 2025 09:14:08 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizePrint.vue |   80 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizePrint.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizePrint.vue
new file mode 100644
index 0000000..e6fd0ff
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizePrint.vue
@@ -0,0 +1,80 @@
+<script setup>
+ import {ref} from "vue";
+
+ const layout=ref([
+   {"x":0,"y":0,"w":50,"h":50,"i":"0"},
+   /*{"x":2,"y":0,"w":2,"h":4,"i":"1"},
+   {"x":4,"y":0,"w":2,"h":5,"i":"2"},
+   {"x":6,"y":0,"w":2,"h":3,"i":"3"},
+   {"x":8,"y":0,"w":2,"h":3,"i":"4"},
+   {"x":10,"y":0,"w":2,"h":3,"i":"5"},
+   {"x":0,"y":5,"w":2,"h":5,"i":"6"},
+   {"x":2,"y":5,"w":2,"h":5,"i":"7"},
+   {"x":4,"y":5,"w":2,"h":5,"i":"8"},
+   {"x":6,"y":3,"w":2,"h":4,"i":"9"},
+   {"x":8,"y":4,"w":2,"h":4,"i":"10"},
+   {"x":10,"y":4,"w":2,"h":4,"i":"11"},
+   {"x":0,"y":10,"w":2,"h":5,"i":"12"},
+   {"x":2,"y":10,"w":2,"h":5,"i":"13"},
+   {"x":4,"y":8,"w":2,"h":4,"i":"14"},
+   {"x":6,"y":8,"w":2,"h":4,"i":"15"},
+   {"x":8,"y":10,"w":2,"h":5,"i":"16"},
+   {"x":10,"y":4,"w":2,"h":2,"i":"17"},
+   {"x":0,"y":9,"w":2,"h":3,"i":"18"},
+   {"x":2,"y":6,"w":2,"h":2,"i":"19"}*/
+ ])
+
+ const layoutUpdated = (newLayout) => {
+   //checkLayoutBounds(newLayout)
+ }
+ const checkLayoutBounds = (layout1) => {
+   layout1.forEach(item => {
+     // 妫�鏌ヨ竟鐣岋紝渚嬪纭繚x鍜寉涓嶅皬浜�0锛屽苟涓攚鍜宧涓嶈秴鍑烘渶澶у�肩瓑銆�
+     if (item.x < 0) item.x = 0;
+     if (item.y < 0) item.y = 0;
+     if (item.w > 12) item.w = 12; // 鍋囪鏈�澶у垪鏁颁负12
+     if (item.h > 10) item.h = 10; // 鍋囪鏈�澶ц涓�10锛堟牴鎹渶瑕佽皟鏁达級
+   });
+   layout.value = layout1; // 搴旂敤杈圭晫妫�鏌ュ悗鐨勫竷灞�
+   console.log(layout1)
+ }
+ const moveEvent = (i, newX, newY) => {
+   console.log(`绉诲姩鍏冪礌 ${i} 鍒� (${newX}, ${newY})`)
+ }
+
+</script>
+
+<template>
+  <grid-layout
+      style="border:1px solid black;height: 244px;width: 366px;overflow: hidden;grid-template-columns: 1px"
+      :layout.sync="layout"
+      :col-num="366"
+      :row-height="1"
+      :is-draggable="true"
+      :is-resizable="false"
+      :is-mirrored="false"
+      :vertical-compact="true"
+      :margin="[0, 0]"
+      :use-css-transforms="true"
+      :autoSize="false"
+      @layout-updated="layoutUpdated"
+  >
+
+    <grid-item v-for="item in layout"
+               :x="item.x"
+               :y="item.y"
+               :w="item.w"
+               :h="item.h"
+               :i="item.i"
+               :key="item.i"
+               @move="moveEvent"
+               style="background-color: white"
+    >
+      {{item.i}}
+    </grid-item>
+  </grid-layout>
+</template>
+
+<style scoped>
+
+</style>
\ No newline at end of file

--
Gitblit v1.8.0