| | |
| | | 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; |
| | | } |
| | | </style> |
| | | |
| | | <template> |
| | | <view class="content"> |
| | | <view class="v-area" v-for="(classattr,index) in classAttrList"> |
| | | <div class="class_attr_title"> |
| | | <div class="class_attr_title" style="display: none;"> |
| | | <div class="title_line"></div> |
| | | <div class="title_icon" :style="{'background-color':classattr.BkColor}"> |
| | | <i class="ace-icon fa" :class="classattr.ImgFontStyle"></i> |
| | |
| | | <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=='浮点数'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <text class="tx_title" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> <!-- attr.NotEmpty=='1' --> |
| | | <div class="text-right" v-if="attr.ext_button==true"> |
| | | <a @tap="classAttr_extButton(index,iindex)" ><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :value="attr.Value" @focus="ontap" @blur="onevent" v-if="attr.Height=='1'" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :readonly="attr.edit=='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;" :style="{'width':attr.Width}" :readonly="attr.edit=='Flase'?true:false"></textarea> |
| | | <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" :data-index="index":data-iindex="iindex" style="height:90px;" :style="{'width':attr.Width}" :readonly="attr.edit=='Flase'?true:false"></textarea> |
| | | <input type="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;" :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea> |
| | | <textarea :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" :data-index="index":data-iindex="iindex" style="height:90px;" :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></textarea> |
| | | <!-- 扫码后事件返回 --> |
| | | <div class="input_vallist" > |
| | | <ul v-for="(inputval,vindex) in inputValList"> |
| | | <li><span>{{inputval.Name}}</span><a href="javascript:;" @tap="inputValListIsDel(vindex)"><i class="ace-icon fa fa-times"></i></a></li> |
| | | </ul> |
| | | </div> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <input type="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=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :readonly="attr.edit=='Flase'?true:false" > |
| | | <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" :data-index="index":data-iindex="iindex" style="height:60px;" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :readonly="attr.edit=='Flase'?true:false"></textarea> |
| | | <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" :data-index="index":data-iindex="iindex" style="height:90px;" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :readonly="attr.edit=='Flase'?true:false"></textarea> |
| | | <input type="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=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :disabled="attr.edit?false:true" > |
| | | <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='2'" :data-index="index":data-iindex="iindex" style="height:60px;" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :disabled="attr.edit?false:true"></textarea> |
| | | <textarea class="attr_field" :value="attr.Value" @focus="ontap" @blur="onevent" v-else-if="attr.Height=='3'" :data-index="index":data-iindex="iindex" style="height:90px;" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) - (attr.ext_button==true?9:0) +'%'}" :disabled="attr.edit?false:true"></textarea> |
| | | <div class="text-right2" v-if="attr.ext_button==true"> |
| | | <a @tap="classAttr_extButton(index,iindex)" ><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='布尔值'" :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'}"> |
| | | <label> |
| | | <checkbox :value="attr.Value" :checked="attr.Value"/> |
| | | <text>{{attr.DispName}}<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <text>{{attr.DispName}}<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='日期' || attr.Type=='时间'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <text class="tx_title" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | <picker mode="date" :value="attr.Value" @change="ondateTime" class="date_iput" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"> |
| | | <view class="picker">{{attr.Value}}</view> |
| | | </picker> |
| | |
| | | <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=='1'?10:5) +'%'}"> |
| | | <view class="picker">{{attr.Value}}</view> |
| | | </picker> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='字典' || attr.Type=='字典-字符串'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <picker class="section_iput" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | <picker class="section_iput" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" v-if="attr.select==false" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :disabled="attr.edit?false:true"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <select-cy :value="attr.Value" :name="attr.Name" :options="attr.dictitem" showClearIcon="true" @change="onchange2" v-else-if="attr.select==true" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :disabled="attr.edit?false:true"></select-cy> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | | <picker class="section_iput attr_field" @change="onchange" :range="attr.dictitem" range-key="CN_S_NAME" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) +'%'}"> |
| | | <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" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) +'%'}"> |
| | | <label class="">{{ attr.Value }}</label> |
| | | </picker> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | <select-cy :value="attr.Value" :name="attr.Name" :options="attr.dictitem" showClearIcon="true" @change="onchange2" v-else-if="attr.select==true" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}"></select-cy> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='引用对象(单个)' || attr.Type=='引用对象(多个)'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | <div class="text-right" v-if="attr.Type=='引用对象(单个)'"> |
| | | <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> |
| | |
| | | </picker> |
| | | <a class="class_attr_add_ref"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='引用人员'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | <div class="text-right"> |
| | | <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | |
| | | <div class="text-right2"> |
| | | <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='引用项目'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | <div class="text-right"> |
| | | <a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | |
| | | <div class="text-right2"> |
| | | <a class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='编码'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :readonly="attr.edit=='Flase'?true:false" > |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :disabled="attr.edit?false:true" > |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{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=='1'?10:5) +'%'}" :readonly="attr.edit=='Flase'?true:false" > |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | <input type="text" class="attr_field" :data-index="index" :data-iindex="iindex" :style="{'width': attr.Width.split('%')[0] - classattr.title_p_wdith - (attr.NotEmpty=='1'?10:5) +'%'}" :disabled="attr.edit?false:true" > |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | <view class="form-group" v-if="attr.Type=='省市区'" :style="{'display':attr.hidden == 'True'?'none':''}"> |
| | | <view v-if="classattr.control_style=='上下布局'"> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i></text> |
| | | <text class="tx_title">{{attr.DispName}}:<i class="i_tishi" v-if="attr.notempty==true">*</i></text> |
| | | <pickerAddress class="date_iput" @change="addresschange" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" >{{attr.Value}}</pickerAddress> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{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=='1'?10:5) +'%'}">{{attr.Value}}</pickerAddress> |
| | | <i class="i_tishi" v-if="attr.NotEmpty=='1'">*</i> |
| | | <i class="i_tishi" v-if="attr.notempty==true">*</i> |
| | | </view> |
| | | </view> |
| | | </div> |
| | |
| | | edit_compose_cls_id:"", |
| | | global_attr:[], |
| | | refdatastore: [], //引用数据存储区// {attr:'G_PRJ_' + bindattr + '_ID', value:info.id} |
| | | |
| | | inputValList:[{Name:"test"},{Name:"test2"},{Name:"test3"},{Name:"test4"},{Name:"test5"},{Name:"test6"},{Name:"test7"}], |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | // console.log(options); |
| | | this.$data.title = options.titlename; //设置按钮文字 |
| | | uni.setNavigationBarTitle({ title: options.titlename}); //设置顶部标题 |
| | | var param = JSON.parse(options.param); |
| | | this.$data.title = param.Add_BtnName?param.Add_BtnName:options.titlename; //设置按钮文字 |
| | | // console.log(param); |
| | | if(!param.EditDlgMode){ |
| | | uni.showModal({title:"提示",content:"该功能点未配置编辑窗口,请重新配置!",showCancel:false,confirmText:"取消"}); |
| | |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误1.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=e.target.value; |
| | | }, |
| | | onchange(e) { |
| | | // console.log(e.target); |
| | | console.log(e.target); |
| | | var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].dictitem[e.target.value]; |
| | | var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']]; |
| | | // console.log(data_attr); |
| | | 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; |
| | | console.log(this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value); |
| | | var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | onchange2(item,value,delvalue) { |
| | | // console.log(item); |
| | | // console.log(value); |
| | | // console.log(delvalue); |
| | | if(item.length==0){ //为空时,清空属性value |
| | | var index ,iindex,dindex=0; |
| | | for(var i in this.$data.classAttrList){ |
| | | for(var j in this.$data.classAttrList[i].Attr){ |
| | | for(var d in this.$data.classAttrList[i].Attr[j].dictitem){ |
| | | if(delvalue[0].Name == this.$data.classAttrList[i].Attr[j].dictitem[d].Name){ |
| | | this.$data.classAttrList[i].Attr[j].Value=""; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | for(var v in item){ |
| | | var index ,iindex,dindex=0; |
| | | for(var i in this.$data.classAttrList){ |
| | | for(var j in this.$data.classAttrList[i].Attr){ |
| | | for(var d in this.$data.classAttrList[i].Attr[j].dictitem){ |
| | | if(item[v].Name == this.$data.classAttrList[i].Attr[j].dictitem[d].Name){ |
| | | index=i;iindex=j;dindex=d; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var itemvalue = item[v]; |
| | | var data_attr = this.$data.classAttrList[index].Attr[iindex]; |
| | | |
| | | console.log(data_attr); |
| | | if (itemvalue.Name != data_attr.Value) { |
| | | this.$data.classAttrList[index].Attr[iindex].Value=value; |
| | | console.log(this.$data.classAttrList[index].Attr[iindex].Value); |
| | | var eventid = this.$data.classAttrList[index].Attr[iindex].action; |
| | | if (eventid) { |
| | | // self.event_no_sub = 1; |
| | | var req=[]; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | 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 if(ar.Type=='字典' || ar.Type=='字典-字符串') |
| | | req.push({ attr: ar.Name, val: itemvalue.Name}); |
| | | else |
| | | req.push({ attr: ar.Name, val: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.clsid, |
| | | objid: "", |
| | | attr: req, |
| | | } |
| | | this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }, |
| | | onevent(e){ |
| | |
| | | } |
| | | } |
| | | |
| | | }, |
| | | inputValListIsDel(index){ |
| | | // console.log(index); |
| | | this.$data.inputValList.splice(index, 1); //删除tabPagejson的内容 |
| | | // console.log(this.$data.inputValList); |
| | | }, |
| | | addresschange(e) { |
| | | // console.log(e.target); |
| | |
| | | this.add(); |
| | | }, |
| | | add(){ |
| | | uni.showLoading({ |
| | | title:"加载中..." |
| | | }); |
| | | var req=[]; |
| | | var attrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.NotEmpty=='1'){ |
| | | uni.showModal({title:"提示",content:'字段:'+ar.Name+',值不能为空!',showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | if(ar.Value=='请选择') ar.Value=''; |
| | | 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=='字典-字符串'){ |
| | | if(ar.select==true){ //判断下拉是否多选 |
| | | var valStr =""; |
| | | for(var v in ar.Value){ |
| | | if(valStr) |
| | | valStr+=";"; |
| | | valStr+=ar.Value[v]; |
| | | } |
| | | req.push({ name: ar.Name, value: valStr}); |
| | | }else |
| | | req.push({ name: ar.Name, value: ar.Value}); |
| | | } |
| | | else |
| | | req.push({ name: ar.Name, value: ar.Value ?ar.Value :''}); |
| | | |
| | | if ((ar.NotEmpty == '1' || ar.notempty == true) && !ar.Value) { |
| | | // if(ar.notEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({title:"提示",content:ar.DispName+'不能为空!',showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var enviroment = { |
| | |
| | | compose: JSON.stringify([]), refdatastore: JSON.stringify([]), extinfo: JSON.stringify(enviroment), |
| | | not_trigger_sys_event: '' |
| | | }; |
| | | |
| | | // return |
| | | console.log(dataInfo); |
| | | this.$store.dispatch('addclassattr',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | uni.hideLoading(); |
| | | if (success.code=='00000') { |
| | | this.class_attr_init(); |
| | | var action = JSON.parse(success.data.Action); |
| | | if(action.ret=='0'){ |
| | | if(action.result_type=='0'){ |
| | | uni.showToast({title:action.result,icon:"success",duration:3000}); |
| | | } |
| | | // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}" |
| | | } |
| | | //刷新 |
| | | uni.redirectTo({ |
| | | url:'../modal/classAttr?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title |
| | | }); |
| | | // this.class_attr_init(); |
| | | }else{ |
| | | uni.showModal({title:"错误5",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | uni.showModal({title:"错误",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误5.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({title:"提示",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | }, |
| | | class_attr_init(){ |
| | |
| | | ca.before_click_button = attrs[j].before_click_button; |
| | | ca.button_callback = attrs[j].button_callback; |
| | | ca.hidden = attrs[j].hidden; |
| | | attr.push(ca); |
| | | ca.select = attrs[j].select==undefined?false:attrs[j].select; |
| | | ca.Value =""; |
| | | if(ca.dictitem){ |
| | | // var dictitem=ca.dictitem; |
| | | // var dictitemlist=[]; |
| | | // for (var d = 0; d < dictitem.length; d++) { |
| | | // dictitemlist.push(dictitem[d].CN_S_NAME); |
| | | // } |
| | | // ca.dictitemlist = dictitemlist; |
| | | ca.Value = ca.dictitem[0].CN_S_NAME; |
| | | var dictitemlist=[]; |
| | | for (var d = 0; d < ca.dictitem.length; d++) { |
| | | ca.dictitem[d].label=ca.dictitem[d].CN_S_NAME; |
| | | ca.dictitem[d].value=ca.dictitem[d].CN_S_NAME; |
| | | } |
| | | if(ca.select == true) |
| | | ca.Value = [];//ca.dictitem[0].CN_S_NAME; |
| | | else |
| | | ca.Value = '请选择';//ca.dictitem[0].CN_S_NAME; |
| | | } |
| | | if(ca.Type=='日期' || ca.Type=='时间'){ |
| | | var nowDate = new Date(); |
| | |
| | | ca.Value = '请选择'; |
| | | if(ca.Type=='布尔值') |
| | | ca.Value = false; |
| | | |
| | | attr.push(ca); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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) { |
| | | ca.value = val[i].value; |
| | | if(ca.Type=='字典' || ca.Type=='字典-字符串'){ |
| | | var dictItemList=[]; |
| | | for(var d in val[i].choice_list){ |
| | | var val =val[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | |
| | | } |
| | | ca.dictitem = dictItemList; |
| | | // attr[j].dictitem = val[i].choice_list; |
| | | }else{ |
| | | // ca.value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // if ($el_attr.data('type') == 'bool') { |
| | | // $el_attr.prop('checked', val[i].value == 'Y' || val[i].value == 'y' || val[i].value == '1') |
| | | // } |
| | | // else { |
| | | // if (val[i].choice_list) { |
| | | // $el_attr.empty(); |
| | | // val[i].choice_list.forEach(function (list) { |
| | | // $el_attr.append('<option value="' + list + '">' + list + '</option>'); |
| | | // }) |
| | | // } |
| | | // $el_attr.val(val[i].value); |
| | | // } |
| | | // $el_attr.data('val', val[i].value); |
| | | |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function (s) { |
| | |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | if(attr[j].Type=='字典' || attr[j].Type=='字典-字符串'){ |
| | | attr[j].dictitem = result[i].choice_list; |
| | | var dictItemList=[]; |
| | | for(var d in result[i].choice_list){ |
| | | var val =result[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | } |
| | | attr[j].dictitem = dictItemList; |
| | | // attr[j].dictitem = result[i].choice_list; |
| | | } |
| | | } |
| | | } |
| | |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Value=='请选择') ar.Value=''; |
| | | if(ar.Value=='请选择' || ar.Value=='——请选择——') ar.Value=''; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Value=='请选择') ar.Value=''; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误5.2",content: '调用 before_click_button 脚本返回空,event_id' + eventid,showCancel:false,confirmText:"取消"}); |
| | | uni.showModal({title:"提示5.2",content: '调用 before_click_button 脚本返回空,event_id' + eventid,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误5",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | | // console.log(ex); |
| | | uni.showModal({title:"错误5.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | uni.showModal({title:"提示5.1",content:ex.errMsg,showCancel:false,confirmText:"取消"}); |
| | | }); |
| | | }, |
| | | |