| | |
| | | </div> |
| | | <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'" |
| | | :value="attr.Value" :focus="focusField == `${index}-${iindex}`" @focus="ontap" |
| | | @click="onClick(index,iindex)" @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'" |
| | | <textarea :value="attr.Value" :focus="focusField == `${index}-${iindex}`" @focus="ontap" |
| | | @click="onClick(index,iindex)" @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'" |
| | | <textarea :value="attr.Value" :focus="focusField == `${index}-${iindex}`" @focus="ontap" |
| | | @click="onClick(index,iindex)" @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> |
| | | <!-- 扫码后事件返回 --> |
| | |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{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-index="index" :data-iindex="iindex" |
| | | class="attr_field" :value="attr.Value" :focus="focusField == `${index}-${iindex}`" |
| | | @focus="ontap" @blur="onevent" @click="onClick(index,iindex)" 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" |
| | | <textarea class="attr_field" :value="attr.Value" :focus="focusField == `${index}-${iindex}`" |
| | | @focus="ontap" @blur="onevent" @click="onClick(index,iindex)" |
| | | 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==true?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" |
| | | <textarea class="attr_field" :value="attr.Value" :focus="focusField ==`${index}-${iindex}`" |
| | | @focus="ontap" @blur="onevent" @click="onClick(index,iindex)" |
| | | 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==true?10:5) - (attr.ext_button==true?9:0) +'%'}" |
| | |
| | | <a class="class_attr_add_per" @tap="classAttr_AddPer(index,iindex)"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" :maxlength="-1"> |
| | | <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" |
| | | :maxlength="-1"> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | |
| | | <a href="#" class="class_attr_add_prj" @tap="classAttr_AddPrj(index,iindex)"><i |
| | | class="ace-icon fa fa-plus-circle"></i></a> |
| | | </div> |
| | | <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" :maxlength="-1"> |
| | | <input type="text" :value="attr.Value" :style="{'width':attr.Width}" disabled="true" |
| | | :maxlength="-1"> |
| | | </view> |
| | | <view v-if="classattr.control_style=='左右布局'"> |
| | | <p class="tx_title2" :style="{'width':classattr.title_p_wdith+'%'}">{{attr.DispName}}:</p> |
| | |
| | | return { |
| | | title: '新增', |
| | | param: {}, |
| | | focusField: "", |
| | | focusOldField: "", |
| | | classAttrList: [], |
| | | classGridStyle: [], |
| | | edit_inital_event: "", //弹窗初始化事件ID |
| | |
| | | delta: 1 //返回层数,2则上上页 |
| | | }); |
| | | }, |
| | | onClick(index, iindex) { |
| | | this.focusField = `${index}-${iindex}` |
| | | }, |
| | | |
| | | ontap(e) { //扫码功能 |
| | | var $ele = e; |
| | | //console.log(e.target) |
| | | this.focusOldField = `${e.target.dataset['index']}-${e.target.dataset['iindex']}` |
| | | getApp().onScan((result) => { |
| | | //console.log(result.decodedata); |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = |
| | | result.decodedata; |
| | | uni.hideKeyboard(); |
| | | this.onevent($ele, result.decodedata); |
| | | if (result.decodedata) { //第一个输入框不为空 |
| | | //初始化,下个输入框focus属性 |
| | | const attrs = this.$data.classAttrList[e.target.dataset['index']].Attr || [] |
| | | var findd = false |
| | | for (let i = e.target.dataset['iindex'] + 1; i < attrs.length; i++) { |
| | | const ele = attrs[i] |
| | | |
| | | if (ele.hidden != true) { |
| | | if (utils.classUtils.attrTypeIsString(ele.Type) || utils.classUtils |
| | | .attrTypeIsInt(ele.Type)) { |
| | | const field = `${e.target.dataset['index']}-${i}` |
| | | if (this |
| | | .focusOldField == |
| | | field) { |
| | | this.setData({ |
| | | focusField: "" |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | focusField: this |
| | | .focusOldField |
| | | }) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.setData({ |
| | | focusField: field |
| | | }) |
| | | }); |
| | | findd = true |
| | | break |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | if (findd) { |
| | | return |
| | | } |
| | | for (let i = e.target.dataset['index'] + 1; i < this.classAttrList.length; i++) { |
| | | const attrs2 = this.classAttrList[i].Attr || [] |
| | | for (let ii in attrs2) { |
| | | const ele = attrs2[ii] |
| | | if (ele.hidden != true) { |
| | | if (utils.classUtils.attrTypeIsString(ele.Type) || utils.classUtils |
| | | .attrTypeIsInt(ele.Type)) { |
| | | const field = `${i}-${ii}` |
| | | if (this |
| | | .focusOldField == |
| | | field) { |
| | | this.setData({ |
| | | focusField: "" |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | focusField: this |
| | | .focusOldField |
| | | }) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.setData({ |
| | | focusField: field |
| | | }) |
| | | }); |
| | | break |
| | | } |
| | | } |
| | | } |
| | | if (findd) { |
| | | break |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | onarrow(index, open) { |
| | |
| | | icon: "success", |
| | | duration: 3000 |
| | | }); |
| | | |
| | | // this.class_attr_init(); |
| | | //刷新 |
| | | uni.redirectTo({ |
| | | url: '../modal/classAttr?param=' + JSON.stringify(this.$data.param) + |
| | | "&titlename=" + this.$data.title |
| | | }); |
| | | //this.class_attr_init(); |
| | | |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | |
| | | ca.Value = '请选择'; |
| | | if (utils.classUtils.attrTypeIsBool(ca.Type)) |
| | | ca.Value = false; |
| | | if (ca.hidden != true) { |
| | | if (utils.classUtils.attrTypeIsString(ca.Type) || utils.classUtils |
| | | .attrTypeIsInt(ca.Type) || utils.classUtils.attrTypeIsFloat(ca.Type)) { |
| | | if (this.focusField == "") { |
| | | this.setData({ |
| | | focusField: `${newattrlist.length}-${attr.length}` |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | attr.push(ca); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (action_type == 'open_select_userdlg') { |
| | | } else if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({ |
| | | title: "错误2.2", |
| | | content: "open_select_userdlg这个action_type还未处理!", |