From d84283821bb08d81d887f20a7118caf25b8b2714 Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期二, 27 八月 2024 18:29:10 +0800 Subject: [PATCH] 判断接口返回值是否是字符串,然后解析 --- pages/modal/ms_classAttr.vue | 1530 +++++++++++++++++++++++++--------------------------------- 1 files changed, 659 insertions(+), 871 deletions(-) diff --git a/pages/modal/ms_classAttr.vue b/pages/modal/ms_classAttr.vue index 064f971..185e250 100644 --- a/pages/modal/ms_classAttr.vue +++ b/pages/modal/ms_classAttr.vue @@ -1,385 +1,3 @@ -<style> - .class_attr_title { - font-size: 44rpx; - padding-bottom: 22rpx; - position: relative; - } - - .class_attr_title .title_line { - border-bottom: 2rpx solid #aaa; - position: relative; - bottom: -50rpx; - width: calc(100% - 290rpx); - margin-left: 100px; - } - - .class_attr_title .title_icon { - border-radius: 50%; - width: 100rpx; - line-height: 64rpx; - display: inline-block; - vertical-align: middle; - padding-top: 10rpx; - padding-left: 20rpx; - text-align: center; - color: #fff; - } - - .class_attr_title i { - color: #2c6aa0 !important; - } - - .class_attr_title .title_icon i { - font-size: 80rpx; - } - - .class_attr_title .title { - padding-right: 22rpx; - display: inline-block; - background-color: #fff; - position: relative; - bottom: -8rpx; - } - - .class_attr_title .arrow { - position: absolute; - top: 6rpx; - right: 30rpx; - font-size: 60rpx; - } - - input::-webkit-input-placeholder { - font-size: 12rpx; - } - - textarea { - width: 98%; - border: 1px solid #d5d5d5; - padding: 10rpx 8rpx 12rpx; - background: #FFF; - border-radius: 0 !important; - font-size: 34rpx; - font-family: inherit; - box-shadow: none !important; - transition-duration: 0.1s; - color: #046db3; - margin-top: 4px; - } - - input { - border: 1px solid #d5d5d5; - width: 98%; - height: 52rpx; - background: #FFF; - border-radius: 0 !important; - color: #046db3; - padding: 10rpx 8rpx 12rpx; - font-size: 34rpx; - font-family: inherit; - box-shadow: none !important; - transition-duration: 0.1s; - margin-top: 4rpx; - } - - .select { - width: 20px; - position: absolute; - opacity: 0; - } - - .class_attr_body .form-group { - margin: 20rpx 30rpx; - /* margin-left: -12px; - margin-right: -12px; */ - } - - .subclass_attr_body .form-group { - margin: 20rpx 10rpx; - /* margin-left: -12px; - margin-right: -12px; */ - } - - .form-group>label[class*="col-"] { - margin-bottom: 8rpx; - font-size: 32rpx; - } - - .form-group label { - vertical-align: middle; - line-height: 60rpx; - } - - .no-padding-right { - padding-right: 0 !important; - } - - .col-xs-12 { - width: 100%; - } - - .tx_title { - font-size: 32rpx; - } - - .tx_title2 { - font-size: 32rpx; - text-align: right; - display: inline-block; - vertical-align: -2px; - } - - .text-right { - margin-right: 20rpx; - margin-top: -6rpx; - display: inline-block; - float: right; - font-size: 44rpx; - } - - .text-right2 { - margin: 0; - vertical-align: -4px; - margin-left: 9px; - float: none; - font-size: 44rpx; - display: inline-block; - } - - .section_iput { - border: 1px solid #d5d5d5; - width: 98%; - height: 62rpx; - background: #FFF; - border-radius: 0 !important; - color: #046db3; - padding: 10rpx 8rpx 10rpx; - font-size: 34rpx; - font-family: inherit; - box-shadow: none !important; - transition-duration: 0.1s; - } - - .date_iput { - border: 1px solid #d5d5d5; - /* width: 98%; */ - height: 62rpx; - background: #FFF; - border-radius: 0 !important; - color: #046db3; - padding: 10rpx 8rpx 4rpx; - font-size: 34rpx; - font-family: inherit; - box-shadow: none !important; - transition-duration: 0.1s; - } - - button.btn_add { - width: 49.5%; - margin-top: 50rpx; - padding: 20rpx; - line-height: 1.5; - background: #27A6E1; - border: none; - color: #fff; - font-size: 38rpx; - font-weight: bold; - float: right; - display: inline-block; - } - - button.btn_cancel { - width: 49.5%; - margin-top: 50rpx; - padding: 20rpx; - line-height: 1.5; - background: #27A6E1; - border: none; - color: #fff; - font-size: 38rpx; - font-weight: bold; - float: left; - display: inline-block; - } - - button.btn_sava { - width: 100%; - margin-top: 50rpx; - padding: 20rpx; - line-height: 1.5; - background: #27A6E1; - border: none; - color: #fff; - font-size: 38rpx; - font-weight: bold; - float: left; - display: inline-block; - } - - button.btn_trigger { - width: 100%; - margin-top: 20rpx; - padding: 20rpx; - line-height: 1.5; - background: #27A6E1; - border: none; - color: #fff; - font-size: 38rpx; - font-weight: bold; - float: left; - display: inline-block; - } - - .i_tishi { - color: red; - vertical-align: sub; - font-style: initial; - margin-left: 20rpx; - font-size: 17px; - } - - .attr_field { - display: inline-block; - vertical-align: middle; - margin-left: 8px; - /* width: 71%; */ - } - - .input_vallist { - max-height: 350rpx; - overflow-y: auto; - display: none; - } - - .input_vallist ul { - /* border: 1px solid red; */ - padding: 0 20rpx; - } - - .input_vallist ul li { - list-style: none; - padding: 20rpx; - border-bottom: 1px solid #ccc; - } - - .input_vallist ul li a { - float: right; - } - - .input_vallist ul li a i { - font-size: 45rpx; - } - - .panel_title { - font-size: 38rpx; - background-color: #27A6E1; - line-height: 80rpx; - color: #fff; - text-align: center; - font-weight: bold; - } - - .v-panel { - min-height: 788rpx; - } - - .v-panellist { - border: 4rpx solid #aaa; - border-radius: 10rpx; - margin: 10rpx 20rpx 0rpx 20rpx; - } - - .v-paneldel { - text-align: right; - } - - .panel_del { - font-size: 44rpx; - text-decoration: initial; - margin-top: 10rpx; - margin-right: 20rpx; - } - - .divX { - width: 20px; - height: 20px; - border-radius: 60%; - position: absolute; - top: -10px; - right: -10px; - z-index: 100; - } - - .view-popup { - position: relative; - } - - .popup-content { - @include flex; - align-items: center; - justify-content: center; - padding: 30rpx; - background-color: #fff; - /* height: 150px; */ - /* border: 1px solid red; */ - } - - .popup-cont { - overflow-y: auto; - /* border: 1px solid red; */ - } - - .popup-height { - @include height; - /* width: 200px; */ - } - - .popup-header { - font-size: 42rpx; - font-weight: bold; - margin: 20rpx 20rpx 0px 20rpx; - } - - .view_popup_CheckList { - margin-bottom: 20rpx; - } - - .popup-footer { - float: right; - position: absolute; - bottom: 0; - right: 20rpx; - } - - button.btn_popup_add { - width: 180rpx; - margin-top: 50rpx; - margin-right: 20rpx; - padding: 15rpx; - line-height: 1.5; - background: #27A6E1; - border: none; - color: #fff; - font-size: 38rpx; - font-weight: bold; - /* float: left; */ - display: inline-block; - } - - button.btn_popup_cancel { - width: 180rpx; - margin-top: 50rpx; - padding: 15rpx; - line-height: 1.5; - background: #27A6E1; - border: none; - color: #fff; - font-size: 38rpx; - font-weight: bold; - /* float: right; */ - display: inline-block; - } -</style> - <template> <view class="content"> <!-- 涓绘暟鎹�--> @@ -397,7 +15,7 @@ <div class="class_attr_body" :style="{'display':classattr.Open?'block':'none'}"> <div class="dv_field_div" v-for="(attr,iindex) in classattr.Attr"> <view class="form-group" - v-if="attr.Type=='瀛楃涓� || attr.Type=='鍙彉闀垮瓧绗︿覆' || attr.Type=='鏁存暟' || attr.Type=='娴偣鏁�" + v-if="attr.Type=='瀛楃涓� || attr.Type=='鍙彉闀垮瓧绗︿覆' || attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� ||attr.Type=='char' || attr.Type=='varchar' || attr.Type=='int' || attr.Type=='float'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -410,9 +28,11 @@ </div> <!-- <div style='width: 100px;position: relative;'> <image class="divX" src="../../images/msg_50_new.png"></image>--> - <input :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁�?'number':'text'" :value="attr.Value" - @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" :data-index="index" - :data-iindex="iindex" :style="{'width':attr.Width}" :disabled="attr.edit?false:true"> + <input + :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float'?'number':'text'" + :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" + :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" + :disabled="attr.edit?false:true"> <!-- =='flase'?true:false --> <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" :data-index="index" :data-iindex="iindex" style="height:60px;" @@ -429,9 +49,10 @@ </p> <!-- <div style='width: 100%;position: relative;'> <image class="divX" src="../../images/msg_50_new.png"></image> --> - <input :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁�?'number':'text'" class="attr_field" - :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" - :data-index="index" :data-iindex="iindex" + <input + :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float' ?'number':'text'" + class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" + v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - (attr.ext_button==true?9:0) +'%'}" :disabled="attr.edit?false:true"> <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" @@ -451,7 +72,8 @@ </div> </view> </view> - <view class="form-group" v-if="attr.Type=='甯冨皵鍊�" :style="{'display':attr.hidden == true?'none':''}"> + <view class="form-group" v-if="attr.Type=='甯冨皵鍊� || attr.Type=='bool'" + :style="{'display':attr.hidden == true?'none':''}"> <checkbox-group class="check_rememberPwd" @change="oncheck" :data-ischeck="attr.Value" :data-index="index" :data-iindex="iindex" :style="{'margin-left': classattr.control_style=='宸﹀彸甯冨眬'?classattr.title_p_wdith+2 +'%':'10rpx'}"> @@ -461,7 +83,8 @@ </label> </checkbox-group> </view> - <view class="form-group" v-if="attr.Type=='鏃ユ湡' || attr.Type=='鏃堕棿'" + <view class="form-group" + v-if="attr.Type=='鏃ユ湡' || attr.Type=='鏃堕棿' || attr.Type=='date' || attr.Type=='datetime'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -475,7 +98,8 @@ <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <picker mode="date" :value="attr.Value" @change="ondateTime" class="date_iput attr_field" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"> @@ -483,7 +107,8 @@ </picker> </view> </view> - <view class="form-group" v-if="attr.Type=='瀛楀吀' || attr.Type=='瀛楀吀-瀛楃涓� || attr.Type=='瀛楀吀-鏁存暟'" + <view class="form-group" + v-if="attr.Type=='瀛楀吀' || attr.Type=='瀛楀吀-瀛楃涓� || attr.Type=='瀛楀吀-鏁存暟' || attr.Type=='dict' || attr.Type=='dict-char' || attr.Type=='dict-int'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -502,7 +127,8 @@ <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <picker class="section_iput attr_field" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" v-if="attr.select==false" :data-index="index" :data-iindex="iindex" @@ -515,18 +141,19 @@ :style="{'display':'inline-block','margin-left':'8px','width':attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) +'%'}"></select-cy> </view> </view> - <view class="form-group" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)' || attr.Type=='寮曠敤瀵硅薄(澶氫釜)'" + <view class="form-group" + v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)' || attr.Type=='寮曠敤瀵硅薄(澶氫釜)' ||attr.Type=='obj-ref' || attr.Type=='obj-ref-multi'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"><i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</text> - <div class="text-right" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'"> + <div class="text-right" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'|| attr.Type=='obj-ref'"> <a @tap="classAttr_AddRef" :data-classid="attr.RelCls.split('|')[0]" :data-classname="attr.RelCls.split('|')[1]"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <div class="text-right" v-if="attr.Type=='寮曠敤瀵硅薄(澶氫釜)'"> + <div class="text-right" v-if="attr.Type=='寮曠敤瀵硅薄(澶氫釜)'|| attr.Type=='obj-ref-multi'"> <picker class="select" @change="classAttr_AddRef" :range="attr.RelClsList" range-key="name" :data-index="index" :data-iindex="iindex"> <label class="">{{ attr.Value }}</label> @@ -539,16 +166,17 @@ <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" disabled="true"> - <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'"> + <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'|| attr.Type=='obj-ref'"> <a @tap="classAttr_AddRef" :data-classid="attr.RelCls.split('|')[0]" :data-classname="attr.RelCls.split('|')[1]"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(澶氫釜)'"> + <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(澶氫釜)'|| attr.Type=='obj-ref-multi'"> <picker class="select" @change="classAttr_AddRef" :range="attr.RelClsList" range-key="name" :data-index="index" :data-iindex="iindex"> <label class="">{{ attr.Value }}</label> @@ -557,7 +185,7 @@ </div> </view> </view> - <view class="form-group" v-if="attr.Type=='寮曠敤浜哄憳'" + <view class="form-group" v-if="attr.Type=='寮曠敤浜哄憳' ||attr.Type=='user' " :style="{'display':attr.hidden == true?'none':''}"> <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -572,7 +200,8 @@ <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <input type="text" class="attr_field" :value="attr.Value" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true?10:5) - 9 +'%'}" disabled="true"> @@ -582,7 +211,7 @@ </div> </view> </view> - <view class="form-group" v-if="attr.Type=='寮曠敤椤圭洰'" + <view class="form-group" v-if="attr.Type=='寮曠敤椤圭洰' ||attr.Type=='project'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -597,7 +226,8 @@ <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <input type="text" class="attr_field" :value="attr.Value" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true ?10:5) - 9 +'%'}" disabled="true"> @@ -607,7 +237,8 @@ </div> </view> </view> - <view class="form-group" v-if="attr.Type=='缂栫爜'" :style="{'display':attr.hidden == true?'none':''}"> + <view class="form-group" v-if="attr.Type=='缂栫爜' || attr.Type=='code'" + :style="{'display':attr.hidden == true?'none':''}"> <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"><i @@ -618,14 +249,16 @@ <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"> - {{attr.DispName}}:</p> + {{attr.DispName}}: + </p> <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true ?10:5) +'%'}" :disabled="attr.edit?false:true"> <i class="i_tishi" v-if="attr.notempty==true || attr.NotEmpty=='1'">*</i> </view> </view> - <view class="form-group" v-if="attr.Type=='鐪佸競鍖�" :style="{'display':attr.hidden == true?'none':''}"> + <view class="form-group" v-if="attr.Type=='鐪佸競鍖� ||attr.Type=='region'" + :style="{'display':attr.hidden == true?'none':''}"> <view v-if="classattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"><i @@ -636,11 +269,13 @@ <view v-if="classattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':classattr.Font.Name?classattr.Font.Name:'initial','font-size':classattr.Font.Size?classattr.Font.Size:'initial','font-weight':classattr.Font.Bold?'bold':'initial','font-style':classattr.Font.Tilt?'italic':'initial','text-decoration':classattr.Font.Underline?'underline':'initial','background-color':classattr.Font.Bk_Color,'color':classattr.Font.Text_Color,'width':classattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <pickerAddress class="date_iput attr_field" @change="addresschange" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.notempty==true ?10:5) +'%'}"> - {{attr.Value}}</pickerAddress> + {{attr.Value}} + </pickerAddress> </view> </view> </div> @@ -685,7 +320,7 @@ <div class="subclass_attr_body" :style="{'display':subclassattr.Open?'block':'none'}"> <div class="dv_field_div" v-for="(attr,iindex) in subclassattr.Attr"> <view class="form-group" - v-if="attr.Type=='瀛楃涓� || attr.Type=='鍙彉闀垮瓧绗︿覆' || attr.Type=='鏁存暟' || attr.Type=='娴偣鏁�" + v-if="attr.Type=='瀛楃涓� || attr.Type=='鍙彉闀垮瓧绗︿覆' || attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� ||attr.Type=='char' || attr.Type=='varchar' || attr.Type=='int' || attr.Type=='float'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="subclassattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -696,7 +331,8 @@ <a @tap="classAttr_extButton(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <input :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁�?'number':'text'" + <input + :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float'?'number':'text'" :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width.split('%')[0] - 2.5 +'%'}" @@ -715,8 +351,10 @@ <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith +'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> - <input :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁�?'number':'text'" + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> + <input + :type="attr.Type=='鏁存暟' || attr.Type=='娴偣鏁� || attr.Type=='int' || attr.Type=='float'?'number':'text'" class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" @@ -738,7 +376,7 @@ </div> </view> </view> - <view class="form-group" v-if="attr.Type=='甯冨皵鍊�" + <view class="form-group" v-if="attr.Type=='甯冨皵鍊� ||attr.Type=='bool'" :style="{'display':attr.hidden == true?'none':''}"> <checkbox-group class="check_rememberPwd" @change="oncheck" :data-ischeck="attr.Value" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" @@ -750,7 +388,8 @@ </label> </checkbox-group> </view> - <view class="form-group" v-if="attr.Type=='鏃ユ湡' || attr.Type=='鏃堕棿'" + <view class="form-group" + v-if="attr.Type=='鏃ユ湡' || attr.Type=='鏃堕棿' || attr.Type=='date' || attr.Type=='datetime'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="subclassattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -765,7 +404,8 @@ <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <picker mode="date" :value="attr.Value" @change="ondateTime" class="date_iput attr_field" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" @@ -774,7 +414,8 @@ </picker> </view> </view> - <view class="form-group" v-if="attr.Type=='瀛楀吀' || attr.Type=='瀛楀吀-瀛楃涓� || attr.Type=='瀛楀吀-鏁存暟'" + <view class="form-group" + v-if="attr.Type=='瀛楀吀' || attr.Type=='瀛楀吀-瀛楃涓� || attr.Type=='瀛楀吀-鏁存暟' || attr.Type=='dict' || attr.Type=='dict-char' || attr.Type=='dict-int'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="subclassattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -796,7 +437,8 @@ <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <picker class="section_iput attr_field" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" v-if="attr.select==false" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" @@ -810,18 +452,19 @@ </view> </view> - <view class="form-group" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)' || attr.Type=='寮曠敤瀵硅薄(澶氫釜)'" + <view class="form-group" + v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)' || attr.Type=='寮曠敤瀵硅薄(澶氫釜)' ||attr.Type=='obj-ref' || attr.Type=='obj-ref-multi'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="subclassattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith+'%'}"><i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</text> - <div class="text-right" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'"> + <div class="text-right" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'||attr.Type=='obj-ref'"> <a @tap="classAttr_AddRef" :data-classid="attr.RelCls.split('|')[0]" :data-classname="attr.RelCls.split('|')[1]"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <div class="text-right" v-if="attr.Type=='寮曠敤瀵硅薄(澶氫釜)'"> + <div class="text-right" v-if="attr.Type=='寮曠敤瀵硅薄(澶氫釜)'|| attr.Type=='obj-ref-multi'"> <picker class="select" @change="classAttr_AddRef" :range="attr.RelClsList" range-key="name" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex"> @@ -835,17 +478,18 @@ <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <input type="text" class="attr_field" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - subclassattr.title_p_wdith - 16 +'%'}" disabled="true"> - <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'"> + <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(鍗曚釜)'||attr.Type=='obj-ref'"> <a @tap="classAttr_AddRef" :data-classid="attr.RelCls.split('|')[0]" :data-classname="attr.RelCls.split('|')[1]"><i class="ace-icon fa fa-plus-circle"></i></a> </div> - <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(澶氫釜)'"> + <div class="text-right2" v-if="attr.Type=='寮曠敤瀵硅薄(澶氫釜)'|| attr.Type=='obj-ref-multi'"> <picker class="select" @change="classAttr_AddRef" :range="attr.RelClsList" range-key="name" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex"> @@ -855,7 +499,7 @@ </div> </view> </view> - <view class="form-group" v-if="attr.Type=='寮曠敤浜哄憳'" + <view class="form-group" v-if="attr.Type=='寮曠敤浜哄憳' ||attr.Type=='user' " :style="{'display':attr.hidden == true?'none':''}"> <view v-if="subclassattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -871,7 +515,8 @@ <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <input type="text" class="attr_field" :value="attr.Value" :style="{'width': attr.Width.split('%')[0] - subclassattr.title_p_wdith - 16 +'%'}" disabled="true"> @@ -881,7 +526,7 @@ </div> </view> </view> - <view class="form-group" v-if="attr.Type=='寮曠敤椤圭洰'" + <view class="form-group" v-if="attr.Type=='寮曠敤椤圭洰' ||attr.Type=='project'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="subclassattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -897,7 +542,8 @@ <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <input type="text" class="attr_field" :value="attr.Value" :style="{'width': attr.Width.split('%')[0] - subclassattr.title_p_wdith - 16 +'%'}" disabled="true"> @@ -907,7 +553,7 @@ </div> </view> </view> - <view class="form-group" v-if="attr.Type=='缂栫爜'" + <view class="form-group" v-if="attr.Type=='缂栫爜' || attr.Type=='code'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="subclassattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -919,14 +565,15 @@ <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <input type="text" class="attr_field" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - subclassattr.title_p_wdith - 7 +'%'}" :disabled="attr.edit?false:true"> </view> </view> - <view class="form-group" v-if="attr.Type=='鐪佸競鍖�" + <view class="form-group" v-if="attr.Type=='鐪佸競鍖� ||attr.Type=='region'" :style="{'display':attr.hidden == true?'none':''}"> <view v-if="subclassattr.control_style=='涓婁笅甯冨眬'"> <text class="tx_title" @@ -934,16 +581,19 @@ class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</text> <pickerAddress class="date_iput" @change="addresschange" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"> - {{attr.Value}}</pickerAddress> + {{attr.Value}} + </pickerAddress> </view> <view v-if="subclassattr.control_style=='宸﹀彸甯冨眬'"> <p class="tx_title2" :style="{'font-family':subclassattr.Font.Name?subclassattr.Font.Name:'initial','font-size':subclassattr.Font.Size?subclassattr.Font.Size:'initial','font-weight':subclassattr.Font.Bold?'bold':'initial','font-style':subclassattr.Font.Tilt?'italic':'initial','text-decoration':subclassattr.Font.Underline?'underline':'initial','background-color':subclassattr.Font.Bk_Color,'color':subclassattr.Font.Text_Color,'width':subclassattr.title_p_wdith+'%'}"> - <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}:</p> + <i class="i_tishi" v-if="attr.notempty==true">*</i>{{attr.DispName}}: + </p> <pickerAddress class="date_iput attr_field" @change="addresschange" :data-iiindex="iiindex" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - subclassattr.title_p_wdith - 7 +'%'}"> - {{attr.Value}}</pickerAddress> + {{attr.Value}} + </pickerAddress> </view> </view> </div> @@ -962,10 +612,9 @@ v-if="param.Sub_Cls.Can_Add_Delete == true">{{title}}</button> <button type="default" @tap="sava" class="btn_sava" v-else-if="param.Sub_Cls.Can_Add_Delete == false">{{title}}</button> - - <button type="default" @tap="trigger" class="btn_trigger" - v-if="param.After_Trigger_Event">绾垎鎷�/button> - + + <button type="default" @tap="trigger" class="btn_trigger" v-if="param.After_Trigger_Event">绾垎鎷�/button> + <!-- 鏅�寮圭獥 top bottom center left right --> <view> @@ -996,6 +645,7 @@ <script> import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' + import utils from "@/js/utils.js" export default { components: { pickerAddress @@ -1020,6 +670,15 @@ check_list: {}, } }, + onNavigationBarButtonTap(e) { + //鍒锋柊 + uni.redirectTo({ + url: '../modal/ms_classAttr?param=' + JSON.stringify(this.param) + + "&titlename=" + this.title + }); + + }, + onLoad(options) { // console.log(options); uni.setNavigationBarTitle({ @@ -1170,7 +829,7 @@ }); } } - + var objects = []; var subPanelList = $this.$data.subPanelList; for (var s = 0; s < subPanelList.length; s++) { @@ -1180,19 +839,7 @@ for (var j = 0; j < attr.length; j++) { var ar = attr[j]; if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - sub_req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - sub_req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else if (ar.Type == '瀛楀吀' || ar.Type == '瀛楀吀-瀛楃涓� || ar.Type == '瀛楀吀-鏁存暟') { + if (utils.classUtils.attrTypeIsDict(ar.Type)) { if (ar.select == true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� var valStr = ""; for (var v in ar.Value) { @@ -1210,11 +857,8 @@ value: ar.Value }); } else - sub_req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); - + sub_req.push(this.formatAttr(ar)) + if (ar.notempty == true && !ar.Value) { // if(ar.NotEmpty=='1'){ uni.hideLoading(); @@ -1251,7 +895,7 @@ cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, objects: objects } - + }; var req = []; // var subPanelList = $this.$data.subPanelList; @@ -1310,7 +954,12 @@ var $this = this; var After_Select_Event = $this.$data.param.Scan_Code.After_Select_Event; if (!After_Select_Event) { - uni.showModal({title: "鎻愮ず",content: "閫夋嫨鍚庝簨浠朵负绌猴紒",showCancel: false,confirmText: "鍙栨秷"}); + uni.showModal({ + title: "鎻愮ず", + content: "閫夋嫨鍚庝簨浠朵负绌猴紒", + showCancel: false, + confirmText: "鍙栨秷" + }); return; } var items = $this.$data.check_list.items; @@ -1328,7 +977,12 @@ } } if (data.length == 0) { - uni.showModal({title: "鎻愮ず",content: "鏈�鎷╂暟鎹紒",showCancel: false,confirmText: "鍙栨秷"}); + uni.showModal({ + title: "鎻愮ず", + content: "鏈�鎷╂暟鎹紒", + showCancel: false, + confirmText: "鍙栨秷" + }); return; } var mast_attr = []; @@ -1338,20 +992,18 @@ for (var j = 0; j < attr.length; j++) { var ar = attr[j]; if (ar.Value == '璇烽�鎷�) { - uni.showModal({title: "鎻愮ず",content: ar.DispName + "鏈�鎷╂暟鎹紒",showCancel: false,confirmText: "鍙栨秷"}); + uni.showModal({ + title: "鎻愮ず", + content: ar.DispName + "鏈�鎷╂暟鎹紒", + showCancel: false, + confirmText: "鍙栨秷" + }); return; } - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - mast_attr.push({attr: ar.Name,value: ar.ValID ? ar.ValID : ''}); - else if (ar.Type == '甯冨皵鍊�) - mast_attr.push({attr: ar.Name,value: ar.Value ? '1' : '0'}); - else - mast_attr.push({attr: ar.Name,value: ar.Value ? ar.Value : ''}); + mast_attr.push(this.formatAttr(ar)) } } - + $this.$data.scanCodeVal = name; var info = { eventid: After_Select_Event.ID, @@ -1362,7 +1014,10 @@ userlogin: '', clsid: 'MBOX', objid: "", - attr: [{attr: 'mast_input_3037',value: name}], + attr: [{ + attr: 'mast_input_3037', + value: name + }], global_attr: mast_attr, inputParamter: data } @@ -1442,11 +1097,15 @@ //console.log(gridstyleInfo); $this.$store.dispatch('classGridStyleInfo', gridstyleInfo).then(success => { // console.log(success); + if (success.code == '00000') { + success.data.StyleDef = JSON.parse(success.data.StyleDef); $this.$data.classGridStyle = success.data; $this.class_attr_init(); + + } else { uni.showModal({ title: "閿欒1.2", @@ -1472,13 +1131,17 @@ $this.subClass_attr_init(); } else { //console.log(gridstyleInfo); + $this.$store.dispatch('subClassGridStyleInfo', gridstyleInfo).then(success => { // console.log(success); if (success.code == '00000') { + success.data.StyleDef = JSON.parse(success.data.StyleDef); $this.$data.subClassGridStyle = success.data; $this.subClass_attr_init(); + + } else { uni.showModal({ title: "閿欒1.2", @@ -1524,23 +1187,8 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) + } } var info = { @@ -1553,7 +1201,7 @@ clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, objid: "", attr: req, - mast_attr: [], + mast_attr: req, inputParamter: [{ attr: 'mast_input_3037', value: result.decodedata @@ -1585,23 +1233,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } var info = { @@ -1648,23 +1280,7 @@ var attr = classattrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - mast_req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - mast_req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - mast_req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + mast_req.push(this.formatAttr(ar)) } } var req = []; @@ -1674,23 +1290,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } var info = { @@ -1736,23 +1336,7 @@ var attr = classattrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - mast_req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - mast_req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - mast_req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + mast_req.push(this.formatAttr(ar)) } } var req = []; @@ -1762,23 +1346,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } var info = { @@ -1823,7 +1391,7 @@ return; } this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = e.target - .value; + .value; }, onchange(e) { @@ -1834,9 +1402,9 @@ console.log(data_attr); if (value.Name != data_attr.Value) { this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = value - .Name; + .Name; console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] - .Value); + .Value); var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] .action; if (eventid) { @@ -1847,23 +1415,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - val: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - val: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - val: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } var info = { @@ -1923,28 +1475,13 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') + if (utils.classUtils.attrTypeIsDict(ar.Type)) req.push({ attr: ar.Name, - val: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - val: ar.Value ? '1' : '0' - }); - else if (ar.Type == '瀛楀吀' || ar.Type == '瀛楀吀-瀛楃涓� || ar.Type == '瀛楀吀-鏁存暟') - req.push({ - attr: ar.Name, - val: itemvalue.Name + value: itemvalue.Name }); else - req.push({ - attr: ar.Name, - val: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } var info = { @@ -1987,23 +1524,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - val: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - val: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - val: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } var info = { @@ -2069,28 +1590,13 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') + if (utils.classUtils.attrTypeIsDict(ar.Type)) req.push({ attr: ar.Name, - val: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - val: ar.Value ? '1' : '0' - }); - else if (ar.Type == '瀛楀吀' || ar.Type == '瀛楀吀-瀛楃涓� || ar.Type == '瀛楀吀-鏁存暟') - req.push({ - attr: ar.Name, - val: itemvalue.Name + value: itemvalue.Name }); else - req.push({ - attr: ar.Name, - val: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } var info = { @@ -2134,23 +1640,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } var info = { @@ -2163,7 +1653,7 @@ clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, objid: "", attr: req, - mast_attr: [], + mast_attr: req, inputParamter: [{ attr: 'mast_input_3037', value: e.target.value @@ -2197,23 +1687,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - val: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - val: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - val: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) } } @@ -2370,15 +1844,15 @@ delta: 1 }); //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 }, - trigger() { + trigger() { if (this.$data.param.Before_Trigger_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁瑙﹀彂鍓嶈剼鏈� this.scan_TriggerDataObjRunCustomEvent(this.$data.param.Before_Trigger_Event.ID); else if (this.$data.param.After_Trigger_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁瑙﹀彂鍚庤剼鏈� this.scan_TriggerDataObjRunCustomEvent(this.$data.param.After_Trigger_Event.ID); elsess - uni.navigateBack({ - delta: 1 - }); //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 + uni.navigateBack({ + delta: 1 + }); //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 }, add() { uni.showLoading({ @@ -2392,19 +1866,7 @@ for (var j = 0; j < attr.length; j++) { var ar = attr[j]; if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - name: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - name: ar.Name, - value: ar.Value ? '1' : '0' - }); - else if (ar.Type == '瀛楀吀' || ar.Type == '瀛楀吀-瀛楃涓� || ar.Type == '瀛楀吀-鏁存暟') { + if (utils.classUtils.attrTypeIsDict(ar.Type)) { if (ar.select == true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� var valStr = ""; for (var v in ar.Value) { @@ -2421,11 +1883,13 @@ name: ar.Name, value: ar.Value }); - } else + } else { + const node = this.formatAttr(ar) req.push({ - name: ar.Name, - value: ar.Value ? ar.Value : '' + name: node.attr, + value: node.value }); + } if (ar.notempty == true && !ar.Value) { // if(ar.NotEmpty=='1'){ @@ -2482,11 +1946,11 @@ // "{"ret":0, "result_type":0, "result":"鍒涘缓鎴愬姛123123123","info":""}" } //鍒锋柊 - uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify(this.$data.param) + - "&titlename=" + this.$data.title - }); - // this.class_attr_init(); + // uni.redirectTo({ + // url: '../modal/ms_classAttr?param=' + JSON.stringify(this.$data.param) + + // "&titlename=" + this.$data.title + // }); + // // this.class_attr_init(); } else { uni.showModal({ title: "閿欒", @@ -2507,7 +1971,7 @@ }); }, class_attr_init() { - var attrlist = this.$data.classGridStyle.StyleDef.show_style + const attrlist = this.$data.classGridStyle.StyleDef?.show_style || [] var newattrlist = []; if (this.$data.classAttrList.length > 0) { for (var i = 0; i < attrlist.length; i++) { @@ -2522,6 +1986,7 @@ for (var l = 0; l < clsattr.Attr.length; l++) { var ca = clsattr.Attr[l]; if (attrs[j].attr == ca.Name) { + ca.action = attrs[j].action; ca.edit = attrs[j].edit; ca.notempty = attrs[j].notempty; @@ -2533,6 +1998,7 @@ ca.hidden = attrs[j].hidden; ca.select = attrs[j].select == undefined ? false : attrs[j].select; ca.Value = ""; + if (ca.dictitem) { if (ca.select == true) ca.Value = []; //ca.dictitem[0].CN_S_NAME; @@ -2547,7 +2013,8 @@ ca.Value = ca.dictitem[d].CN_S_NAME; } } - if (ca.Type == '鏃ユ湡' || ca.Type == '鏃堕棿') { + + if (utils.classUtils.attrTypeIsDateTime(ca.Type)) { var nowDate = new Date(); var date = { year: nowDate.getFullYear(), @@ -2557,7 +2024,7 @@ ca.Value = date.year + '-' + (date.month >= 10 ? date.month : '0' + date .month) + '-' + (date.day >= 10 ? date.day : '0' + date.day); } - if (ca.Type == '寮曠敤瀵硅薄(澶氫釜)') { + if (utils.classUtils.attrTypeIsObjRefMulti(ca.Type)) { var relClsList = []; var attr_rescls = ca.RelCls.split(','); for (var ii in attr_rescls) { @@ -2570,15 +2037,18 @@ ca.RelClsList = relClsList; ca.Value = '璇�; } - if (ca.Type == '鐪佸競鍖�) + + if (utils.classUtils.attrTypeIsRegion(ca.Type)) ca.Value = '璇烽�鎷�; - if (ca.Type == '甯冨皵鍊�) + if (utils.classUtils.attrTypeIsBool(ca.Type)) ca.Value = false; attr.push(ca); + } } } + newattrlist.push({ BkColor: clsattr.BkColor, HasAce: clsattr.HasAce, @@ -2597,30 +2067,24 @@ .classGridStyle.StyleDef.Text_Color : '#000000' }) } + } } if (newattrlist.length > 0) { this.$data.classAttrList = newattrlist; } var req = []; - if (this.$data.classGridStyle.StyleDef) { - if (this.$data.classGridStyle.StyleDef.show_style.length > 0) { - var attrlist = this.$data.classGridStyle.StyleDef.show_style - // $el.find('.attr_field').prop('readonly', true); - // $el.find('.attr_field').prop('disabled', true); - for (var i = 0; i < attrlist.length; i++) { - var attr = attrlist[i].attrs - for (var j = 0; j < attr.length; j++) { - var ar = attr[j]; - req.push({ - attr: ar.attr, - value: ar.value ? ar.value : '' - }); - } - } + + for (var i = 0; i < attrlist.length; i++) { + var attr = attrlist[i].attrs + for (var j = 0; j < attr.length; j++) { + var ar = attr[j]; + req.push({ + attr: ar.attr, + value: ar.value ? ar.value : '' + }); } } - var eventlist = this.$data.classGridStyle.StyleDef.event; if (eventlist) { if (eventlist.length > 0) { @@ -2705,7 +2169,7 @@ ca.Value = ca.dictitem[d].CN_S_NAME; } } - if (ca.Type == '鏃ユ湡' || ca.Type == '鏃堕棿') { + if (utils.classUtils.attrTypeIsDateTime(ca.Type)) { var nowDate = new Date(); var date = { year: nowDate.getFullYear(), @@ -2715,7 +2179,7 @@ ca.Value = date.year + '-' + (date.month >= 10 ? date.month : '0' + date .month) + '-' + (date.day >= 10 ? date.day : '0' + date.day); } - if (ca.Type == '寮曠敤瀵硅薄(澶氫釜)') { + if (utils.classUtils.attrTypeIsObjRefMulti(ca.Type)) { var relClsList = []; var attr_rescls = ca.RelCls.split(','); for (var ii in attr_rescls) { @@ -2728,9 +2192,9 @@ ca.RelClsList = relClsList; ca.Value = '璇�; } - if (ca.Type == '鐪佸競鍖�) + if (utils.classUtils.attrTypeIsRegion(ca.Type)) ca.Value = '璇烽�鎷�; - if (ca.Type == '甯冨皵鍊�) + if (utils.classUtils.attrTypeIsBool(ca.Type)) ca.Value = false; attr.push(ca); @@ -2878,8 +2342,7 @@ for (var l = 0; l < this.$data.classAttrList[a].Attr.length; l++) { var ca = this.$data.classAttrList[a].Attr[l]; if (val[i].attr == ca.Name) { - if (ca.Type == '瀛楀吀' || ca.Type == '瀛楀吀-瀛楃涓� || ca.Type == - '瀛楀吀-鏁存暟') { + if (utils.classUtils.attrTypeIsDict(ca.Type)) { var dictItemList = []; for (var d in val[i].choice_list) { var val = val[i].choice_list[d]; @@ -3006,8 +2469,7 @@ var attr = $this.$data.classAttrList[c].Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { - if (attr[j].Type == '瀛楀吀' || attr[j].Type == '瀛楀吀-瀛楃涓� || - attr[j].Type == '瀛楀吀-鏁存暟') { + if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { var dictItemList = []; for (var d in result[i].choice_list) { var val = result[i].choice_list[d]; @@ -3120,24 +2582,9 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; + if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - value: ar.Value - }); + req.push(this.formatAttr(ar)) } } @@ -3238,23 +2685,7 @@ var attr = attrlist[i].Attr; for (var j = 0; j < attr.length; j++) { var ar = attr[j]; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else - req.push({ - attr: ar.Name, - value: ar.Value - }); + req.push(this.formatAttr(ar)) } } if (this.$data.refdatastore.length > 0) { @@ -3510,8 +2941,7 @@ .length; l++) { var ca = this.$data.subClassAttrList[a].Attr[l]; if (val[i].attr == ca.Name) { - if (ca.Type == '瀛楀吀' || ca.Type == '瀛楀吀-瀛楃涓� || ca.Type == - '瀛楀吀-鏁存暟') { + if (utils.classUtils.attrTypeIsDict(ca.Type)) { var dictItemList = []; for (var d in val[i].choice_list) { var val = val[i].choice_list[d]; @@ -3581,7 +3011,7 @@ scan_DataObjRunCustomEvent(info, data_attr) { var $this = this; var enviroment = {}; - if(info.enviroment){ + if (info.enviroment) { enviroment = info.enviroment; } else { enviroment = { @@ -3592,14 +3022,14 @@ edit_dlg: { type: 'small', //灏忕獥鍙� class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d - }, - master: { - cls_id: 'MBOX',//self.options.ExtParam.Sub_Cls.ID, // button=bottom鏃�master鐨刢ls_id - attr: info.mast_attr //涓绘暟鎹被灞炴� - //objs_id: '' // button=bottom鏃�master鐨刼bj_id - } + }, + master: { + cls_id: 'MBOX', //self.options.ExtParam.Sub_Cls.ID, // button=bottom鏃�master鐨刢ls_id + attr: info.mast_attr //涓绘暟鎹被灞炴� + //objs_id: '' // button=bottom鏃�master鐨刼bj_id + } }; - + } var global_attr = this.$data.global_attr; if (info.global_attr) { @@ -3638,11 +3068,10 @@ for (var c = 0; c < $this.$data.subPanelList[s].subClassAttrList .length; c++) { var attr = $this.$data.subPanelList[s].subClassAttrList[c] - .Attr; + .Attr; for (var j = 0; j < attr.length; j++) { if (attr[j].Name == result[i].attr) { - if (attr[j].Type == '瀛楀吀' || attr[j].Type == '瀛楀吀-瀛楃涓� || - attr[j].Type == '瀛楀吀-鏁存暟') { + if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { var dictItemList = []; for (var d in result[i].choice_list) { var val = result[i].choice_list[d]; @@ -3806,15 +3235,28 @@ } } } else { - uni.showModal({title: "閿欒7",content: success.msg,showCancel: false,confirmText: "鍙栨秷"}); + uni.showModal({ + title: "閿欒7", + content: success.msg, + showCancel: false, + confirmText: "鍙栨秷" + }); } }).catch(ex => { // console.log(ex); - uni.showModal({title: "閿欒7.1",content: ex.errMsg,showCancel: false,confirmText: "鍙栨秷"}); + uni.showModal({ + title: "閿欒7.1", + content: ex.errMsg, + showCancel: false, + confirmText: "鍙栨秷" + }); }); }, scan_OKDataObjRunCustomEvent(eventID) { - uni.showLoading({title: "鍔犺浇涓�..",mask: true}); + uni.showLoading({ + title: "鍔犺浇涓�..", + mask: true + }); var $this = this; var req = []; var attrlist = $this.$data.classAttrList; @@ -3823,19 +3265,8 @@ for (var j = 0; j < attr.length; j++) { var ar = attr[j]; if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else if (ar.Type == '瀛楀吀' || ar.Type == '瀛楀吀-瀛楃涓� || ar.Type == '瀛楀吀-鏁存暟') { + + if (utils.classUtils.attrTypeIsDict(ar.Type)) { if (ar.select == true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� var valStr = ""; for (var v in ar.Value) { @@ -3853,10 +3284,7 @@ value: ar.Value }); } else - req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) if (ar.notempty == true && !ar.Value) { // if(ar.NotEmpty=='1'){ @@ -3881,19 +3309,8 @@ for (var j = 0; j < attr.length; j++) { var ar = attr[j]; if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - sub_req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - sub_req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else if (ar.Type == '瀛楀吀' || ar.Type == '瀛楀吀-瀛楃涓� || ar.Type == '瀛楀吀-鏁存暟') { + + if (utils.classUtils.attrTypeIsDict(ar.Type)) { if (ar.select == true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� var valStr = ""; for (var v in ar.Value) { @@ -3911,11 +3328,7 @@ value: ar.Value }); } else - sub_req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); - + sub_req.push(this.formatAttr(ar)) if (ar.notempty == true && !ar.Value) { // if(ar.NotEmpty=='1'){ uni.hideLoading(); @@ -3972,13 +3385,13 @@ var result = data.result; if (eventID != $this.$data.param.After_OK_Event.ID) $this.scan_OKDataObjRunCustomEvent($this.$data.param.After_OK_Event.ID); - else { - //鍒锋柊 - uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + - "&titlename=" + $this.$data.title - }); - } + // else { + // //鍒锋柊 + // uni.redirectTo({ + // url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + + // "&titlename=" + $this.$data.title + // }); + // } } else { uni.showModal({ title: "閿欒8", @@ -3999,7 +3412,10 @@ }); }, scan_TriggerDataObjRunCustomEvent(eventID) { - uni.showLoading({title: "鍔犺浇涓�..",mask: true}); + uni.showLoading({ + title: "鍔犺浇涓�..", + mask: true + }); var $this = this; var req = []; var attrlist = $this.$data.classAttrList; @@ -4008,19 +3424,7 @@ for (var j = 0; j < attr.length; j++) { var ar = attr[j]; if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else if (ar.Type == '瀛楀吀' || ar.Type == '瀛楀吀-瀛楃涓� || ar.Type == '瀛楀吀-鏁存暟') { + if (utils.classUtils.attrTypeIsDict(ar.Type)) { if (ar.select == true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� var valStr = ""; for (var v in ar.Value) { @@ -4038,10 +3442,7 @@ value: ar.Value }); } else - req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + req.push(this.formatAttr(ar)) if (ar.notempty == true && !ar.Value) { // if(ar.NotEmpty=='1'){ @@ -4066,19 +3467,7 @@ for (var j = 0; j < attr.length; j++) { var ar = attr[j]; if (ar.Value == '璇烽�鎷� || ar.Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = ''; - if (ar.Type == '寮曠敤瀵硅薄(澶氫釜)') - if (ar.Value == '璇�) ar.Value = ''; - if (ar.Type == '寮曠敤浜哄憳' || ar.Type == '寮曠敤椤圭洰') - sub_req.push({ - attr: ar.Name, - value: ar.ValID ? ar.ValID : '' - }); - else if (ar.Type == '甯冨皵鍊�) - sub_req.push({ - attr: ar.Name, - value: ar.Value ? '1' : '0' - }); - else if (ar.Type == '瀛楀吀' || ar.Type == '瀛楀吀-瀛楃涓� || ar.Type == '瀛楀吀-鏁存暟') { + if (utils.classUtils.attrTypeIsDict(ar.Type)) { if (ar.select == true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� var valStr = ""; for (var v in ar.Value) { @@ -4096,10 +3485,7 @@ value: ar.Value }); } else - sub_req.push({ - attr: ar.Name, - value: ar.Value ? ar.Value : '' - }); + sub_req.push(this.formatAttr(ar)) if (ar.notempty == true && !ar.Value) { // if(ar.NotEmpty=='1'){ @@ -4157,13 +3543,13 @@ var result = data.result; if (eventID != $this.$data.param.After_Trigger_Event.ID) $this.scan_TriggerDataObjRunCustomEvent($this.$data.param.After_Trigger_Event.ID); - else { - //鍒锋柊 - uni.redirectTo({ - url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + - "&titlename=" + $this.$data.title - }); - } + // else { + // //鍒锋柊 + // uni.redirectTo({ + // url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + + // "&titlename=" + $this.$data.title + // }); + // } } else { uni.showModal({ title: "閿欒8", @@ -4183,8 +3569,410 @@ }); }); }, + formatAttr(attr) { + if (utils.classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='寮曠敤瀵硅薄(澶氫釜)') + if (attr.Value == '璇�) ar.Value = ''; + if (utils.classUtils.attrTypeIsUser(attr.Type) || utils.classUtils.attrTypeIsProject(attr + .Type)) //if(ar.Type=='寮曠敤浜哄憳' || ar.Type=='寮曠敤椤圭洰') + return { + attr: attr.Name, + value: attr.ValID ? attr.ValID : '' + }; + else if (utils.classUtils.attrTypeIsBool(attr.Type)) //if(ar.Type=='甯冨皵鍊�) + return { + attr: attr.Name, + value: attr.Value ? '1' : '0' + }; + else + return { + attr: attr.Name, + value: attr.Value ? attr.Value : '' + }; + }, } } -</script> \ No newline at end of file +</script> + +<style> + .class_attr_title { + font-size: 44rpx; + padding-bottom: 22rpx; + position: relative; + } + + .class_attr_title .title_line { + border-bottom: 2rpx solid #aaa; + position: relative; + bottom: -50rpx; + width: calc(100% - 290rpx); + margin-left: 100px; + } + + .class_attr_title .title_icon { + border-radius: 50%; + width: 100rpx; + line-height: 64rpx; + display: inline-block; + vertical-align: middle; + padding-top: 10rpx; + padding-left: 20rpx; + text-align: center; + color: #fff; + } + + .class_attr_title i { + color: #2c6aa0 !important; + } + + .class_attr_title .title_icon i { + font-size: 80rpx; + } + + .class_attr_title .title { + padding-right: 22rpx; + display: inline-block; + background-color: #fff; + position: relative; + bottom: -8rpx; + } + + .class_attr_title .arrow { + position: absolute; + top: 6rpx; + right: 30rpx; + font-size: 60rpx; + } + + input::-webkit-input-placeholder { + font-size: 12rpx; + } + + textarea { + width: 98%; + border: 1px solid #d5d5d5; + padding: 10rpx 8rpx 12rpx; + background: #FFF; + border-radius: 0 !important; + font-size: 34rpx; + font-family: inherit; + box-shadow: none !important; + transition-duration: 0.1s; + color: #046db3; + margin-top: 4px; + } + + input { + border: 1px solid #d5d5d5; + width: 98%; + height: 52rpx; + background: #FFF; + border-radius: 0 !important; + color: #046db3; + padding: 10rpx 8rpx 12rpx; + font-size: 34rpx; + font-family: inherit; + box-shadow: none !important; + transition-duration: 0.1s; + margin-top: 4rpx; + } + + .select { + width: 20px; + position: absolute; + opacity: 0; + } + + .class_attr_body .form-group { + margin: 20rpx 30rpx; + /* margin-left: -12px; + margin-right: -12px; */ + } + + .subclass_attr_body .form-group { + margin: 20rpx 10rpx; + /* margin-left: -12px; + margin-right: -12px; */ + } + + .form-group>label[class*="col-"] { + margin-bottom: 8rpx; + font-size: 32rpx; + } + + .form-group label { + vertical-align: middle; + line-height: 60rpx; + } + + .no-padding-right { + padding-right: 0 !important; + } + + .col-xs-12 { + width: 100%; + } + + .tx_title { + font-size: 32rpx; + } + + .tx_title2 { + font-size: 32rpx; + text-align: right; + display: inline-block; + vertical-align: -2px; + } + + .text-right { + margin-right: 20rpx; + margin-top: -6rpx; + display: inline-block; + float: right; + font-size: 44rpx; + } + + .text-right2 { + margin: 0; + vertical-align: -4px; + margin-left: 9px; + float: none; + font-size: 44rpx; + display: inline-block; + } + + .section_iput { + border: 1px solid #d5d5d5; + width: 98%; + height: 62rpx; + background: #FFF; + border-radius: 0 !important; + color: #046db3; + padding: 10rpx 8rpx 10rpx; + font-size: 34rpx; + font-family: inherit; + box-shadow: none !important; + transition-duration: 0.1s; + } + + .date_iput { + border: 1px solid #d5d5d5; + /* width: 98%; */ + height: 62rpx; + background: #FFF; + border-radius: 0 !important; + color: #046db3; + padding: 10rpx 8rpx 4rpx; + font-size: 34rpx; + font-family: inherit; + box-shadow: none !important; + transition-duration: 0.1s; + } + + button.btn_add { + width: 49.5%; + margin-top: 50rpx; + padding: 20rpx; + line-height: 1.5; + background: #27A6E1; + border: none; + color: #fff; + font-size: 38rpx; + font-weight: bold; + float: right; + display: inline-block; + } + + button.btn_cancel { + width: 49.5%; + margin-top: 50rpx; + padding: 20rpx; + line-height: 1.5; + background: #27A6E1; + border: none; + color: #fff; + font-size: 38rpx; + font-weight: bold; + float: left; + display: inline-block; + } + + button.btn_sava { + width: 100%; + margin-top: 50rpx; + padding: 20rpx; + line-height: 1.5; + background: #27A6E1; + border: none; + color: #fff; + font-size: 38rpx; + font-weight: bold; + float: left; + display: inline-block; + } + + button.btn_trigger { + width: 100%; + margin-top: 20rpx; + padding: 20rpx; + line-height: 1.5; + background: #27A6E1; + border: none; + color: #fff; + font-size: 38rpx; + font-weight: bold; + float: left; + display: inline-block; + } + + .i_tishi { + color: red; + vertical-align: sub; + font-style: initial; + margin-left: 20rpx; + font-size: 17px; + } + + .attr_field { + display: inline-block; + vertical-align: middle; + margin-left: 8px; + /* width: 71%; */ + } + + .input_vallist { + max-height: 350rpx; + overflow-y: auto; + display: none; + } + + .input_vallist ul { + /* border: 1px solid red; */ + padding: 0 20rpx; + } + + .input_vallist ul li { + list-style: none; + padding: 20rpx; + border-bottom: 1px solid #ccc; + } + + .input_vallist ul li a { + float: right; + } + + .input_vallist ul li a i { + font-size: 45rpx; + } + + .panel_title { + font-size: 38rpx; + background-color: #27A6E1; + line-height: 80rpx; + color: #fff; + text-align: center; + font-weight: bold; + } + + .v-panel { + min-height: 788rpx; + } + + .v-panellist { + border: 4rpx solid #aaa; + border-radius: 10rpx; + margin: 10rpx 20rpx 0rpx 20rpx; + } + + .v-paneldel { + text-align: right; + } + + .panel_del { + font-size: 44rpx; + text-decoration: initial; + margin-top: 10rpx; + margin-right: 20rpx; + } + + .divX { + width: 20px; + height: 20px; + border-radius: 60%; + position: absolute; + top: -10px; + right: -10px; + z-index: 100; + } + + .view-popup { + position: relative; + } + + .popup-content { + @include flex; + align-items: center; + justify-content: center; + padding: 30rpx; + background-color: #fff; + /* height: 150px; */ + /* border: 1px solid red; */ + } + + .popup-cont { + overflow-y: auto; + /* border: 1px solid red; */ + } + + .popup-height { + @include height; + /* width: 200px; */ + } + + .popup-header { + font-size: 42rpx; + font-weight: bold; + margin: 20rpx 20rpx 0px 20rpx; + } + + .view_popup_CheckList { + margin-bottom: 20rpx; + } + + .popup-footer { + float: right; + position: absolute; + bottom: 0; + right: 20rpx; + } + + button.btn_popup_add { + width: 180rpx; + margin-top: 50rpx; + margin-right: 20rpx; + padding: 15rpx; + line-height: 1.5; + background: #27A6E1; + border: none; + color: #fff; + font-size: 38rpx; + font-weight: bold; + /* float: left; */ + display: inline-block; + } + + button.btn_popup_cancel { + width: 180rpx; + margin-top: 50rpx; + padding: 15rpx; + line-height: 1.5; + background: #27A6E1; + border: none; + color: #fff; + font-size: 38rpx; + font-weight: bold; + /* float: right; */ + display: inline-block; + } +</style> \ No newline at end of file -- Gitblit v1.9.1