From c094d4a32180130de0c26c75a5abc414128a5ec1 Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期四, 20 三月 2025 18:31:33 +0800 Subject: [PATCH] test --- pages/modal/3037_2.vue | 171 +++++++++++++++++++++++++------------------------------- 1 files changed, 76 insertions(+), 95 deletions(-) diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue index 1aff5ff..c7cdeae 100644 --- a/pages/modal/3037_2.vue +++ b/pages/modal/3037_2.vue @@ -1,8 +1,9 @@ <template> <view class="uni-page-modal-3017-2"> <!-- 琛ㄥご鏍峰紡 --> - <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" @focus="ontap" @change="onEnterChange" - @click-prefix="classAttr_extButton" @click-suffix="classAttr_extButton"></OIForm> + <OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" @on-focus="ontap" + @on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton"> + </OIForm> <!-- 浠庢暟鎹�--> <view class="v-panel"> <div class="panel_title">{{param.Sub_Cls.Title}}</div> @@ -32,8 +33,38 @@ <!-- 浠庢暟鎹樉绀鸿鎯呭尯 --> <view class="v-panellist" v-for="(subpanel,iiindex) in subPanelList" @tap="onPanelClick(iiindex)" :class="activelist[iiindex].active==true?'bk-active':''"> - <OIForm class="v-area dv-panel" :form="subpanel.subClassAttr.form" viewMode></OIForm> + <uni-forms class="v-area dv-panel" label-align="right"> + <view v-for="(item,index) in subpanel.subClassAttr.form.items" :key="index"> + <!-- 鏍呮牸甯冨眬 --> + <uni-row v-if="item.name == 'Layout'" :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"> + <uni-forms-item v-if="col != null" + :label="col.labelWidth === 0 ? '' : col.label? col.label+'锛�:''" + :label-width="col.labelWidth || col.labelWidth === 0 ? col.labelWidth : 100+'px'"> + <view v-if="col.disabled">{{col.value}}</view> + <input class="uni-input" v-else-if="col.name=='Input' || col.name=='InputNumber'" + :type="col.name=='InputNumber'?'number':'text'" v-model="col.value" + :placeholder="col.placeholder" :maxlength="-1" /> + <view v-else>{{col.value}}</view> + </uni-forms-item> + <uni-forms-item v-else label=""></uni-forms-item> + </uni-col> + </uni-row> + <uni-forms-item v-else :label="item.labelWidth === 0 ? '' : item.label? item.label+'锛�:''" + :label-width="item.labelWidth || item.labelWidth === 0 ? item.labelWidth : 100+'px'" + :style="{ textAlign: item.setting.align }"> + <view v-if="item.disabled">{{item.value}}</view> + <input v-else-if="item.name=='Input' || item.name=='InputNumber' " class="uni-input" + :type="item.name=='InputNumber'?'number':'text'" v-model="item.value" + :disabled="item.disabled" :placeholder="item.placeholder" :maxlength="-1" /> + <view v-else>{{item.value}}</view> + + </uni-forms-item> + </view> + </uni-forms> <view class="v-paneldel" v-if="param.Sub_Cls.Can_Add_Delete == true"> <a href="javascript:;" class="panel_del" @tap="panel_del(iiindex)"><i class="ace-icon fu-delete"></i></a> @@ -497,20 +528,6 @@ } } }); - } - } - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; - } } } } @@ -1073,15 +1090,20 @@ //console.log(e.target) getApp().onScan((result) => { console.log(result.decodedata); + item.value = result.decodedata + let newVal = item.value + if (typeof item.value == "string") { + newVal = item.value.trim() + } var isflag = true; for (var i in this.$data.subPanelList) { - if (this.$data.subPanelList[i].scanCodeVal == result.decodedata) + if (this.$data.subPanelList[i].scanCodeVal == newVal) isflag = false; } //瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁 if (isflag) { uni.hideKeyboard(); - this.$data.scanCodeVal = result.decodedata; + this.$data.scanCodeVal = newVal; var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; if (eventid) { //涓绘暟鎹被灞炴� @@ -1559,20 +1581,7 @@ } } - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; - } - } - } + } } else if (action.action_type == 'set_dlg_attr_show') { var result = action.value; @@ -1816,20 +1825,7 @@ } } } - var length = 0; - if (!$this.$data.refdatastore.filter(function(s) { - return result[i].attr == s.attr - }).length) { - length = 1; - $this.$data.refdatastore.push(result[i]); - } - if (length == 0) { - for (var j = 0; j < $this.$data.refdatastore.length; j++) { - if ($this.$data.refdatastore[j].attr == result[i].attr) { - $this.$data.refdatastore[j].value = result[i].value; - } - } - } + } } else if (action.action_type == 'set_global_attr') { $this.$actiontr = action.value || []; @@ -2253,61 +2249,46 @@ /* padding: 10rpx 20rpx 4rpx 0px; */ border-radius: 12rpx; /* margin-bottom: 20rpx; */ - text-align: right; + + .uni-forms-item { + padding-bottom: 5rpx; + margin-bottom: 0; + + .uni-forms-item__label { + height: 20px !important; + padding: 0 10rpx 0 0 !important; + } + + .uni-input { + width: calc(100% - 12rpx); + padding: 5rpx; + border: 1px solid #d5d5d5; + color: #2d8cf0; + height: 20px; + background: #FFF; + line-height: 20px; + border-radius: 6px !important; + font-size: 14px; + font-family: inherit; + box-shadow: none !important; + transition-duration: 0.1s; + vertical-align: middle; + } + + .uni-input:hover { + border: 1px solid rgb(41, 121, 255); + } + } + + + } .dv-panel:first-child { padding-top: 10rpx; } - .dv-panel-input { - width: 100%; - display: inline-block; - text-align: left; - } - .dv-panel .txt_title { - font-size: 34rpx; - text-align: right; - display: inline-block; - vertical-align: 12px; - } - - .dv-panel input { - /* vertical-align: middle; */ - display: inline-block; - border: 1px solid #d5d5d5; - width: 68%; - height: 52rpx; - line-height: 34rpx; - background: #FFF; - border-radius: 7px !important; - color: #2d8cf0; - padding: 6rpx 8rpx 8rpx; - font-size: 32rpx; - font-family: inherit; - box-shadow: none !important; - transition-duration: 0.1s; - margin-top: 0rpx; - } - - .dv-panel input::-webkit-input-placeholder { - font-size: 10rpx; - } - - .input-disabled { - background-color: #f3f3f3 !important; - } - - .dv-panel .form-item-span { - vertical-align: top; - color: #2d8cf0; - white-space: normal; - word-break: break-all; - display: inline-block; - width: calc(100% - 100px); - /* border: 1rpx solid red; */ - } #dv_select { display: inline-block; -- Gitblit v1.9.1