| | |
| | | <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> |
| | | </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> |
| | |
| | | <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==true">*</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}"> |
| | | <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> |
| | | <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=='编码'" :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==true">*</i></text> |
| | | <input type="text" :data-index="index" :data-iindex="iindex" :style="{'width':attr.Width}" :readonly="attr.edit=='Flase'?true:false" > |
| | | <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" > |
| | | <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> |
| | |
| | | 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){ |
| | |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if ((ar.NotEmpty == '1' || ar.notempty == true) && !ar.Value) { |
| | | // if(ar.notEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | uni.showModal({title:"提示",content:ar.DispName+'不能为空!',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); |
| | |
| | | var action = JSON.parse(success.data.Action); |
| | | if(action.ret=='0'){ |
| | | if(action.result_type=='0'){ |
| | | uni.showModal({title:"提示",content:action.result,showCancel:false,confirmText:"取消"}); |
| | | uni.showToast({title:action.result,icon:"success",duration:3000}); |
| | | } |
| | | // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}" |
| | | } |
| | | this.class_attr_init(); |
| | | //刷新 |
| | | uni.redirectTo({ |
| | | url:'../modal/classAttr?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title |
| | | }); |
| | | // this.class_attr_init(); |
| | | }else{ |
| | | uni.hideLoading(); |
| | | uni.showModal({title:"错误",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | |
| | | ca.before_click_button = attrs[j].before_click_button; |
| | | ca.button_callback = attrs[j].button_callback; |
| | | ca.hidden = attrs[j].hidden; |
| | | 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(); |
| | |
| | | if(ca.Type=='省市区') |
| | | ca.Value = '请选择'; |
| | | if(ca.Type=='布尔值') |
| | | ca.Value = false |
| | | ca.Value = false; |
| | | |
| | | attr.push(ca); |
| | | } |
| | |
| | | if (val[i].attr == ca.Name) { |
| | | if(ca.Type=='字典' || ca.Type=='字典-字符串'){ |
| | | 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}); |
| | | 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 = result[i].choice_list; |
| | | // attr[j].dictitem = val[i].choice_list; |
| | | }else{ |
| | | ca.value = val[i].value; |
| | | // ca.value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | |
| | | 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}); |
| | | 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=='引用项目') |