From df481aebfb7a19eea5d6c02f93c6f5776b0fdc19 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 23 五月 2025 18:30:41 +0800
Subject: [PATCH] 界面大模式

---
 components/oi-form/index.vue |   46 ++++++++++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/components/oi-form/index.vue b/components/oi-form/index.vue
index fd8bbc0..3d23cc7 100644
--- a/components/oi-form/index.vue
+++ b/components/oi-form/index.vue
@@ -1,27 +1,32 @@
 <template>
-	<uni-forms class="oi-form" ref="baseForm" label-align="right">
-		<template v-for="(item,index) in form.items">
-			<OIFormLayout v-if="item.name == 'Layout'" v-show="!item.isHidden" :focusId="focusId" :viewMode="viewMode"
-				:hiddenIds="hiddenIds" :data="item" @change="onChange" @focus="onFocus" @click="onClick"
-				@click-prefix="onClickPrefix" @click-suffix="onClickSuffix">
-			</OIFormLayout>
+	<uni-forms class="oi-form"  ref="baseForm" :label-align="largeMode?'left':'right'" :label-position="largeMode?'top':'left'" >
+		<view v-for="(item,index) in form.items" :key="index">
+			<!-- 鏍呮牸甯冨眬 -->
+			<uni-row v-if="item.name == 'Layout'" v-show="!item.isHidden" :gutter="item.setting.gutter">
+				<uni-col
+					:span="item.setting.spanList && item.setting.spanList[key]? item.setting.spanList[key] : 24 / item.setting.col"
+					v-for="(col,key) in item.setting.colList" :key="key">
+					<OIFormItem v-if="col != null" :focusId="focusId" :viewMode="viewMode" :data="col"
+						:hiddenIds="hiddenIds" @on-change="onChange" @on-focus="onFocus" @on-click="onClick"
+						@on-click-prefix="onClickPrefix" @on-click-suffix="onClickSuffix"></OIFormItem>
+					<uni-forms-item v-else label=""></uni-forms-item>
+				</uni-col>
+			</uni-row>
 			<OIFormItem v-else :hiddenIds="hiddenIds" :focusId="focusId" :viewMode="viewMode" :data="item"
-				@change="onChange" @focus="onFocus" @click="onClick" @click-prefix="onClickPrefix"
-				@click-suffix="onClickSuffix">
+				@on-change="onChange" @on-focus="onFocus" @on-click="onClick" @on-click-prefix="onClickPrefix"
+				@on-click-suffix="onClickSuffix">
 			</OIFormItem>
-		</template>
+		</view>
 
 	</uni-forms>
 </template>
 
 <script>
 	import OIFormItem from './list/index.vue'
-	import OIFormLayout from './list/layout/index.vue'
 	export default {
 		name: "OIForm",
 		components: {
 			OIFormItem,
-			OIFormLayout
 		},
 		props: {
 			form: {
@@ -43,7 +48,7 @@
 		},
 		data() {
 			return {
-
+				largeMode: getApp().globalData?.largeMode || false,
 			}
 		},
 		methods: {
@@ -73,27 +78,28 @@
 			onChange(item) {
 				var attr = item.fieldId;
 				this.form.model[attr] = item.value;
-				this.$emit("change", item)
+				this.$emit("on-change", item)
 			},
 			onClick(item) {
-				this.$emit("click", item)
+				this.$emit("on-click", item)
 			},
 			onFocus(item) {
-				this.$emit("focus", item)
+				this.$emit("on-focus", item)
 			},
 			onClickPrefix(item) {
-				this.$emit("click-prefix", item)
+				this.$emit("on-click-prefix", item)
 			},
 			onClickSuffix(item) {
-				this.$emit("click-suffix", item)
+				this.$emit("on-click-suffix", item)
 			},
-		}
+		},
 	};
 </script>
 
 <style lang="less">
 	.oi-form {
-		
-
+	
 	}
+	
+	
 </style>
\ No newline at end of file

--
Gitblit v1.9.1