| | |
| | | <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> |
| | |
| | | }, |
| | | 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.$store.dispatch('addclassattr',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.code=='00000') { |
| | | uni.showModal({title:"提示",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | | this.class_attr_init(); |
| | | }else{ |
| | | uni.showModal({title:"错误5",content:success.msg,showCancel:false,confirmText:"取消"}); |
| | |
| | | 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.Value =""; |
| | | if(ca.dictitem){ |
| | | // var dictitem=ca.dictitem; |
| | | // var dictitemlist=[]; |
| | |
| | | if(ca.Type=='省市区') |
| | | ca.Value = '请选择'; |
| | | if(ca.Type=='布尔值') |
| | | ca.Value = false; |
| | | ca.Value = false |
| | | |
| | | attr.push(ca); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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}); |
| | | } |
| | | attr[j].dictitem = dictItemList; |
| | | // attr[j].dictitem = result[i].choice_list; |
| | | } |
| | | } |
| | | } |