| | |
| | | <view class="view-bottom" v-if="pageData.OK_Button==true"> |
| | | <button type="default" @tap="cancel" |
| | | class="btn_cancel">{{translateSys('cancel')}}</button> |
| | | <button type="primary" @tap="ok(pageData)" |
| | | class="btn_add">{{translateSys('ok')}}</button> |
| | | <button type="primary" @tap="ok(pageData)" class="btn_add" |
| | | :class="pageData.okLoading?'btn_disabled':''" |
| | | :disabled="pageData.okLoading? true:false">{{translateSys('ok')}}</button> |
| | | </view> |
| | | </view> |
| | | </swiper-item> |
| | |
| | | //加载Tab页签 |
| | | const pageList = this.param.Sub_Page || [] |
| | | for (let i in pageList) { |
| | | page.DefList = []; |
| | | |
| | | const page = pageList[i] |
| | | page.DefList = []; |
| | | page.StyleDef = await this.Detail_UIstyleGetInfo( |
| | | this.ClsID, |
| | | page.UI_Style.ID |
| | |
| | | } |
| | | }, |
| | | async Head_UIStyleGetInfo(class_id, style_id) { //获取自定义表单样式 |
| | | var $this = this; |
| | | var dataInfo = { |
| | | class_id: class_id, |
| | | ui_style_id: style_id, |
| | | }; |
| | | this.$store.dispatch('UIStyleGetInfo', dataInfo).then(async (ret) => { |
| | | // console.log(ret); |
| | | if (ret.err_code == 0) { |
| | | var styledef = ""; |
| | | if (ret.result.style_def) { |
| | | //mobox2的style_def是json字符串 |
| | | styledef = ret.result.style_def.replace(/\\/g, ""); |
| | | //mobox3的style_def是base64字符串 |
| | | if (!ret.result.style_def.includes('"')) styledef = Base64.decode( |
| | | ret.result |
| | | .style_def); |
| | | } |
| | | const styledefHead = styledef ? JSON.parse(styledef) : {}; |
| | | |
| | | try { |
| | | var $this = this; |
| | | var dataInfo = { |
| | | class_id: class_id, |
| | | ui_style_id: style_id, |
| | | }; |
| | | const ret = await this.getUIStyleInfo(dataInfo) |
| | | var styledef = ""; |
| | | if (ret.result.style_def) { |
| | | //mobox2的style_def是json字符串 |
| | | styledef = ret.result.style_def.replace(/\\/g, ""); |
| | | //mobox3的style_def是base64字符串 |
| | | if (!ret.result.style_def.includes('"')) styledef = Base64.decode( |
| | | ret.result |
| | | .style_def); |
| | | } |
| | | const styledefHead = styledef ? JSON.parse(styledef) : {}; |
| | | if (styledefHead?.form?.items) { |
| | | for (let i in styledefHead.form.items) { |
| | | const ele = styledefHead.form.items[i] |
| | | if (ele.name != "Layout") { |
| | |
| | | } |
| | | } |
| | | } |
| | | this.setData({ |
| | | head_styledef: styledefHead |
| | | }) |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "1", |
| | | content: ret.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | |
| | | } |
| | | }).catch(ex => { |
| | | this.setData({ |
| | | head_styledef: styledefHead |
| | | }) |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "1.1", |
| | | title: this.translateSys("error") + "1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | }); |
| | | return {} |
| | | } |
| | | // this.$store.dispatch('UIStyleGetInfo', dataInfo).then(async (ret) => { |
| | | // // console.log(ret); |
| | | // if (ret.err_code == 0) { |
| | | // var styledef = ""; |
| | | // if (ret.result.style_def) { |
| | | // //mobox2的style_def是json字符串 |
| | | // styledef = ret.result.style_def.replace(/\\/g, ""); |
| | | // //mobox3的style_def是base64字符串 |
| | | // if (!ret.result.style_def.includes('"')) styledef = Base64.decode( |
| | | // ret.result |
| | | // .style_def); |
| | | // } |
| | | // const styledefHead = styledef ? JSON.parse(styledef) : {}; |
| | | |
| | | // for (let i in styledefHead.form.items) { |
| | | // const ele = styledefHead.form.items[i] |
| | | // if (ele.name != "Layout") { |
| | | // if (ele?.useDict) { |
| | | // //判断useDict是否使用字典 |
| | | // await this.DictGetInfo(ele.bind.dict, |
| | | // styledefHead.form.model, |
| | | // ele); |
| | | // } |
| | | // if ($this.focusFieldId == "") { |
| | | // if (ele.name == 'Input' || ele.name == |
| | | // 'InputNumber') { |
| | | // $this.setData({ |
| | | // focusFieldId: ele.fieldId |
| | | // }) |
| | | // } |
| | | // } |
| | | // } else { |
| | | // for (let j in ele.setting.colList) { |
| | | // const col = ele.setting.colList[j] |
| | | // if (col?.useDict) { |
| | | // //判断useDict是否使用字典 |
| | | // await this.DictGetInfo(col.bind |
| | | // .dict, |
| | | // styledefHead.form |
| | | // .model, col); |
| | | // } |
| | | // if ($this.focusFieldId == "") { |
| | | // if (col.name == 'Input' || col |
| | | // .name == |
| | | // 'InputNumber') { |
| | | // $this.setData({ |
| | | // focusFieldId: col |
| | | // .fieldId |
| | | // }) |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // this.setData({ |
| | | // head_styledef: styledefHead |
| | | // }) |
| | | // } else { |
| | | // uni.showModal({ |
| | | // title: this.translateSys("error") + "1", |
| | | // content: ret.err_msg, |
| | | // showCancel: false, |
| | | // confirmText: this.translateSys("cancel") |
| | | // }); |
| | | // } |
| | | // }).catch(ex => { |
| | | // // console.log(ex); |
| | | // uni.showModal({ |
| | | // title: this.translateSys("error") + "1.1", |
| | | // content: ex.errMsg, |
| | | // showCancel: false, |
| | | // confirmText: this.translateSys("cancel") |
| | | // }); |
| | | // }); |
| | | |
| | | }, |
| | | async Detail_UIstyleGetInfo(class_id, style_id) { //获取自定义表单样式 |
| | | var $this = this; |
| | | var dataInfo = { |
| | | class_id: class_id, |
| | | ui_style_id: style_id, |
| | | }; |
| | | this.$store.dispatch('UIStyleGetInfo', dataInfo).then(async (ret) => { |
| | | // console.log(ret); |
| | | if (ret.err_code == 0) { |
| | | var styledef = ""; |
| | | if (ret.result.style_def) { |
| | | //mobox2的style_def是json字符串 |
| | | styledef = ret.result.style_def.replace(/\\/g, ""); |
| | | //mobox3的style_def是base64字符串 |
| | | if (!ret.result.style_def.includes('"')) styledef = Base64 |
| | | .decode(ret.result |
| | | .style_def); |
| | | } |
| | | try { |
| | | var $this = this; |
| | | var dataInfo = { |
| | | class_id: class_id, |
| | | ui_style_id: style_id, |
| | | }; |
| | | const ret = await this.getUIStyleInfo(dataInfo) |
| | | var styledef = ""; |
| | | if (ret.result.style_def) { |
| | | //mobox2的style_def是json字符串 |
| | | styledef = ret.result.style_def.replace(/\\/g, ""); |
| | | //mobox3的style_def是base64字符串 |
| | | if (!ret.result.style_def.includes('"')) styledef = Base64 |
| | | .decode(ret.result |
| | | .style_def); |
| | | } |
| | | |
| | | const detailstyledef = ret.result.style_def ? JSON.parse( |
| | | styledef) : {}; |
| | | detailstyledef.SelBut_Checked = true; |
| | | for (let index in styledefHead.form.items) { |
| | | const ele = styledefHead.form.items[index] |
| | | const detailstyledef = ret.result.style_def ? JSON.parse( |
| | | styledef) : {}; |
| | | detailstyledef.SelBut_Checked = true; |
| | | if (detailstyledef?.form?.items) { |
| | | for (let index in detailstyledef.form.items) { |
| | | const ele = detailstyledef.form.items[index] |
| | | |
| | | if (ele.name != "Layout") { |
| | | if (ele.useDict == true) { //判断useDict是否使用字典 |
| | |
| | | } |
| | | } |
| | | } |
| | | console.log("Detail_UIstyleGetInfo", detailstyledef); |
| | | return detailstyledef |
| | | } else { |
| | | return {} |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "2", |
| | | content: ret.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | |
| | | } |
| | | }).catch(ex => { |
| | | console.log("Detail_UIstyleGetInfo", detailstyledef); |
| | | return detailstyledef |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "2.1", |
| | | title: this.translateSys("error") + "2", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | return {} |
| | | }); |
| | | } |
| | | // this.$store.dispatch('UIStyleGetInfo', dataInfo).then(async (ret) => { |
| | | // // console.log(ret); |
| | | // if (ret.err_code == 0) { |
| | | // var styledef = ""; |
| | | // if (ret.result.style_def) { |
| | | // //mobox2的style_def是json字符串 |
| | | // styledef = ret.result.style_def.replace(/\\/g, ""); |
| | | // //mobox3的style_def是base64字符串 |
| | | // if (!ret.result.style_def.includes('"')) styledef = Base64 |
| | | // .decode(ret.result |
| | | // .style_def); |
| | | // } |
| | | |
| | | // const detailstyledef = ret.result.style_def ? JSON.parse( |
| | | // styledef) : {}; |
| | | // detailstyledef.SelBut_Checked = true; |
| | | // for (let index in detailstyledef.form.items) { |
| | | // const ele = detailstyledef.form.items[index] |
| | | |
| | | // if (ele.name != "Layout") { |
| | | // if (ele.useDict == true) { //判断useDict是否使用字典 |
| | | // await this.DictGetInfo(ele.bind.dict, |
| | | // detailstyledef.form |
| | | // .model, ele); |
| | | // } |
| | | // } else { |
| | | // for (let j in ele.setting.colList) { |
| | | // const col = ele.setting.colList[j] |
| | | // if (col?.useDict == true) { |
| | | // await this.DictGetInfo(col |
| | | // .bind.dict, |
| | | // detailstyledef.form |
| | | // .model, col); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // console.log("Detail_UIstyleGetInfo", detailstyledef); |
| | | // return detailstyledef |
| | | // } else { |
| | | // return {} |
| | | // uni.showModal({ |
| | | // title: this.translateSys("error") + "2", |
| | | // content: ret.err_msg, |
| | | // showCancel: false, |
| | | // confirmText: this.translateSys("cancel") |
| | | // }); |
| | | // } |
| | | // }).catch(ex => { |
| | | // // console.log(ex); |
| | | // uni.showModal({ |
| | | // title: this.translateSys("error") + "2.1", |
| | | // content: ex.errMsg, |
| | | // showCancel: false, |
| | | // confirmText: this.translateSys("cancel") |
| | | // }); |
| | | // return {} |
| | | // }); |
| | | |
| | | }, |
| | | |
| | |
| | | } |
| | | |
| | | }, |
| | | getDictInfo(info) { //Mobox3得到得到字典信息字典项列表 |
| | | getDictInfo(info) { //Mobox3得到字典信息字典项列表 |
| | | const loginInfo = this.$store.getters.loginid |
| | | const mobxoSApi = this.$store.getters.getMobxoSApi |
| | | return new Promise((resolve, reject) => { |
| | |
| | | }) |
| | | |
| | | }, |
| | | getUIStyleInfo(info) { //Mobox3数据类界面样式 |
| | | const loginInfo = this.$store.getters.loginid |
| | | const dataSApi = this.$store.getters.getDataSApi |
| | | return new Promise((resolve, reject) => { |
| | | uni.request({ |
| | | url: dataSApi + 'api/class/uistyle/GetInfo?sessionid=' + loginInfo.result |
| | | .session_id, |
| | | data: info, |
| | | method: 'POST', |
| | | dataType: "json", |
| | | success: (_res) => { |
| | | // console.log(_res); |
| | | var ret = _res.data |
| | | if (typeof ret == 'string') { |
| | | try { |
| | | try { |
| | | try { |
| | | ret = JSON.parse(ret.replace(/\\"/g, '"')); |
| | | } catch (ex) { |
| | | ret = JSON.parse(ret.replace(/\\/g, '\\\\')) |
| | | } |
| | | } catch (ex) { |
| | | ret = JSON.parse(ret.replace(/\\"/g, "'").replace(/[\r\n]/g, |
| | | '<br>').replace(/[\t]/g, ' ')); |
| | | } |
| | | } catch (ex) { |
| | | console.log(ret) |
| | | return reject('将getUIStyleInfo【json string】转换为【json object】失败') |
| | | } |
| | | } |
| | | if (ret.err_code == 0) { |
| | | resolve(ret); |
| | | } else { |
| | | reject({ |
| | | "errMsg": ret.err_msg || ret.errMsg |
| | | }); |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | // console.log(err); |
| | | reject(err); |
| | | } |
| | | }) |
| | | |
| | | }) |
| | | |
| | | }, |
| | | |
| | | onClick(item) { |
| | | this.focusFieldId = item.fieldId |
| | |
| | | console.log(result.decodedata); |
| | | item.value = result.decodedata; |
| | | var $this = this; |
| | | if (item.oldvalue != item.value&& item.value.trim() != "") { |
| | | if (item.oldvalue != item.value && item.value.trim() != "") { |
| | | item.oldvalue = item.value; |
| | | var attr = item.fieldId; |
| | | this.head_styledef.form.model[attr] = item.value; |
| | |
| | | |
| | | onEnterChange(item) { //回车,点击按钮,取消节点事件 |
| | | console.log(item); |
| | | if (item.oldvalue != item.value&& item.value.trim() != "") { |
| | | if (item.oldvalue != item.value && item.value.trim() != "") { |
| | | item.oldvalue = item.value; |
| | | var attr = item.fieldId; |
| | | this.head_styledef.form.model[attr] = item.value; |
| | |
| | | }, |
| | | getDetailAttrList(pageData) { |
| | | const detailAttrList = []; |
| | | pageData.DefList.forEach(style => { |
| | | var detail_attr = {}; |
| | | style.form.items.forEach(item => { |
| | | if (item.name == "Layout") { //判断是否是栅栏格式 |
| | | item.setting.colList.forEach(cols => { |
| | | if (cols != null) detail_attr[cols |
| | | .fieldId] = cols.value; |
| | | }); |
| | | } else |
| | | detail_attr[item.fieldId] = item.value; |
| | | }); |
| | | |
| | | detail_attr['id'] = style.form.objId; |
| | | if (pageData.Select_Button == true) { //判断选择按钮是否为true |
| | | if (style.SelBut_Checked == true) |
| | | detailAttrList.push(detail_attr); |
| | | } else |
| | | detailAttrList.push(detail_attr); |
| | | }); |
| | | // console.log(detailAttrList); |
| | | //获取正在码盘里没有显示的字段 |
| | | pageData.DefList.forEach(style => { |
| | | style.form.attrs.forEach(attr => { |
| | | for (var key in detailAttrList) { |
| | | if (style.form.objId == detailAttrList[key][ |
| | | 'id' |
| | | ]) { |
| | | var keys = Object.keys(detailAttrList[key]); |
| | | var isflag = true; |
| | | keys.forEach((ele) => { |
| | | if (ele == attr.attr) isflag = |
| | | false; |
| | | if (pageData.DefList) { |
| | | pageData.DefList.forEach(style => { |
| | | var detail_attr = {}; |
| | | style.form.items.forEach(item => { |
| | | if (item.name == "Layout") { //判断是否是栅栏格式 |
| | | item.setting.colList.forEach(cols => { |
| | | if (cols != null) detail_attr[cols |
| | | .fieldId] = cols.value; |
| | | }); |
| | | if (isflag) { |
| | | detailAttrList[attr.attr] = attr.value; |
| | | } else |
| | | detail_attr[item.fieldId] = item.value; |
| | | }); |
| | | |
| | | detail_attr['id'] = style.form.objId; |
| | | if (pageData.Select_Button == true) { //判断选择按钮是否为true |
| | | if (style.SelBut_Checked == true) |
| | | detailAttrList.push(detail_attr); |
| | | } else |
| | | detailAttrList.push(detail_attr); |
| | | }); |
| | | // console.log(detailAttrList); |
| | | //获取正在码盘里没有显示的字段 |
| | | pageData.DefList.forEach(style => { |
| | | style.form.attrs.forEach(attr => { |
| | | for (var key in detailAttrList) { |
| | | if (style.form.objId == detailAttrList[key][ |
| | | 'id' |
| | | ]) { |
| | | var keys = Object.keys(detailAttrList[key]); |
| | | var isflag = true; |
| | | keys.forEach((ele) => { |
| | | if (ele == attr.attr) isflag = |
| | | false; |
| | | }); |
| | | if (isflag) { |
| | | detailAttrList[attr.attr] = attr.value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | const jsonlist = []; |
| | | detailAttrList.forEach(attr => { |
| | | jsonlist.push({ |
| | |
| | | var $this = this; |
| | | const jsonList = [] |
| | | this.pageDetail.forEach((page) => { |
| | | |
| | | jsonList.push({ |
| | | page_name: page.Name, |
| | | item_list: $this.getDetailAttrList(page |
| | |
| | | .Select_Button), |
| | | ext_data: page.ExtData || {} |
| | | }) |
| | | |
| | | }) |
| | | const data_json = Base64.encode( |
| | | JSON.stringify(jsonList) |
| | |
| | | input_param: input_param, |
| | | }; |
| | | this.$store.dispatch('runCustomEvent', dataInfo).then(ret => { |
| | | // console.log(ret); |
| | | console.log(ret); |
| | | if (ret.err_code == 0) { |
| | | var result = ret.result; |
| | | if (result.ret != 0) { |
| | |
| | | |
| | | if (result.result_type == 0 && result.action) { |
| | | result.action.forEach(item => { |
| | | |
| | | if (item.action_type == |
| | | "insert_subtable_page_row" |
| | | ) { //码盘中 |
| | |
| | | .page_name + |
| | | this |
| | | .translateSys( |
| | | "sys.quotation_mark_right" |
| | | "quotation_mark_right" |
| | | ) + |
| | | this |
| | | .translate( |
| | |
| | | } |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "4.1", |
| | | content: ex.errMsg, |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | |
| | | return; |
| | | } |
| | | const pageData = this.pageDetail.find((page) => { |
| | | return value.page_name == page.Name; |
| | | return data.page_name == page.Name; |
| | | }); |
| | | if (!pageData) |
| | | return |
| | | data.row.forEach(row => { |
| | | var styleStr = JSON.stringify(pageData.StyleDef); |
| | | var styleStr = JSON.stringify(pageData.StyleDef); |
| | | |
| | | var detailStyle = JSON.parse(styleStr); |
| | | detailStyle.form.objId = row.id; |
| | | detailStyle.form.htmlobjId = row.id ? row.id.replace(/-/g, '') |
| | | .replace( |
| | | '{', '').replace('}', |
| | | '') : 'null'; |
| | | detailStyle.form.attrs = row.attrs; |
| | | row.attrs.forEach(attr => { |
| | | detailStyle.form.items.forEach(ele => { |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr.attr) ele |
| | | .value = |
| | | attr.value; |
| | | } else if (ele.name == 'Layout') { |
| | | ele.setting.colList.forEach( |
| | | col => { |
| | | if (col) { |
| | | if (col.fieldId == |
| | | attr |
| | | .attr) col |
| | | .value = attr |
| | | .value; |
| | | } |
| | | }); |
| | | } |
| | | var detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | data.row.forEach(row => { |
| | | detailStyle = JSON.parse(styleStr); |
| | | detailStyle.form.objId = row.id; |
| | | detailStyle.form.htmlobjId = row.id ? row.id.replace(/-/g, '') |
| | | .replace( |
| | | '{', '').replace('}', |
| | | '') : 'null'; |
| | | detailStyle.form.attrs = row.attrs; |
| | | row.attrs.forEach(attr => { |
| | | detailStyle.form.items.forEach(ele => { |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr.attr) ele |
| | | .value = |
| | | attr.value; |
| | | } else if (ele.name == 'Layout') { |
| | | ele.setting.colList.forEach( |
| | | col => { |
| | | if (col) { |
| | | if (col.fieldId == |
| | | attr |
| | | .attr) col |
| | | .value = attr |
| | | .value; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | pageData.DefList.push(detailStyle); |
| | | |
| | | }); |
| | | |
| | | pageData.DefList.push(detailStyle); |
| | | |
| | | }); |
| | | } |
| | | }, |
| | | //加载已码盘内容 |
| | | viewAceionContent(data) { |
| | | var $this = this; |
| | | const pageData = $this.pageDetail.find((page) => { |
| | | return value.page_name == page.Name; |
| | | return data.page_name == page.Name; |
| | | }); |
| | | if (!pageData) |
| | | return |
| | | |
| | | pageData.ExtData = data.ext_data || {} |
| | | |
| | | if (JSON.stringify(data.content) == '{}') { |
| | | return; |
| | | } |
| | | data.content.forEach(cont => { |
| | | var styleStr = JSON.stringify(pageData.StyleDef); |
| | | var styleStr = JSON.stringify(pageData.StyleDef); |
| | | var detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | data.content.forEach(cont => { |
| | | detailStyle = JSON.parse(styleStr); |
| | | detailStyle.SelBut_Checked = data.checkbox ?? true; |
| | | |
| | | var detailStyle = JSON.parse(styleStr); |
| | | detailStyle.SelBut_Checked = data.checkbox ?? true; |
| | | detailStyle.form.objId = cont.id; |
| | | detailStyle.form.htmlobjId = cont.id ? cont.id.replace(/-/g, |
| | | '') |
| | | .replace('{', '').replace('}', |
| | | '') : 'null'; |
| | | detailStyle.form.attrs = cont.attrs; |
| | | cont.attrs.forEach(attr => { |
| | | detailStyle.form.items.forEach(ele => { |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr.attr) ele |
| | | .value = |
| | | attr.value; |
| | | } else if (ele.name == 'Layout') { |
| | | ele.setting.colList.forEach( |
| | | col => { |
| | | if (col) { |
| | | if (col.fieldId == |
| | | attr |
| | | .attr) col |
| | | .value = attr |
| | | .value; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | //如果 clear = false 则不需要清除,根据id判断是否存在,不存在插入到页面,如果存在用新的属性覆盖 |
| | | if (data.clear == false) { |
| | | var isflag = true; |
| | | pageData.DefList.forEach((style, index) => { |
| | | if (style.form.objId == detailStyle.form |
| | | .objId) { |
| | | cont.attrs.forEach(attr => { |
| | | style.form.items.forEach( |
| | | ele => { |
| | | if (ele.name != |
| | | 'Layout') { |
| | | if (ele |
| | | .fieldId == |
| | | attr.attr) |
| | | ele |
| | | .value = |
| | | attr.value; |
| | | } else if (ele |
| | | .name == |
| | | 'Layout') { |
| | | ele.setting |
| | | .colList |
| | | .forEach( |
| | | col => { |
| | | if ( |
| | | col |
| | | ) { |
| | | if (col |
| | | .fieldId == |
| | | attr |
| | | .attr |
| | | ) |
| | | col |
| | | .value = |
| | | attr |
| | | .value; |
| | | } |
| | | }); |
| | | detailStyle.form.objId = cont.id; |
| | | detailStyle.form.htmlobjId = cont.id ? cont.id.replace(/-/g, |
| | | '') |
| | | .replace('{', '').replace('}', |
| | | '') : 'null'; |
| | | detailStyle.form.attrs = cont.attrs; |
| | | cont.attrs.forEach(attr => { |
| | | detailStyle.form.items.forEach(ele => { |
| | | if (ele.name != 'Layout') { |
| | | if (ele.fieldId == attr.attr) ele |
| | | .value = |
| | | attr.value; |
| | | } else if (ele.name == 'Layout') { |
| | | ele.setting.colList.forEach( |
| | | col => { |
| | | if (col) { |
| | | if (col.fieldId == |
| | | attr |
| | | .attr) col |
| | | .value = attr |
| | | .value; |
| | | } |
| | | }); |
| | | }); |
| | | isflag = false; |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | if (isflag) pageData.DefList.push(detailStyle); //待分拣 |
| | | } else { |
| | | pageData.DefList.push(detailStyle); //待分拣 |
| | | } |
| | | $this.activelist.push({ |
| | | active: false |
| | | //如果 clear = false 则不需要清除,根据id判断是否存在,不存在插入到页面,如果存在用新的属性覆盖 |
| | | if (data.clear == false) { |
| | | var isflag = true; |
| | | pageData.DefList.forEach((style, index) => { |
| | | if (style.form.objId == detailStyle.form |
| | | .objId) { |
| | | cont.attrs.forEach(attr => { |
| | | style.form.items.forEach( |
| | | ele => { |
| | | if (ele.name != |
| | | 'Layout') { |
| | | if (ele |
| | | .fieldId == |
| | | attr.attr) |
| | | ele |
| | | .value = |
| | | attr.value; |
| | | } else if (ele |
| | | .name == |
| | | 'Layout') { |
| | | ele.setting |
| | | .colList |
| | | .forEach( |
| | | col => { |
| | | if ( |
| | | col |
| | | ) { |
| | | if (col |
| | | .fieldId == |
| | | attr |
| | | .attr |
| | | ) |
| | | col |
| | | .value = |
| | | attr |
| | | .value; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | isflag = false; |
| | | } |
| | | }); |
| | | if (isflag) pageData.DefList.push(detailStyle); //待分拣 |
| | | } else { |
| | | pageData.DefList.push(detailStyle); //待分拣 |
| | | } |
| | | $this.activelist.push({ |
| | | active: false |
| | | }); |
| | | }); |
| | | |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | onClickItem(e) { //选择页签 |
| | |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate( |
| | | "page.tip_no_data_first") + |
| | | "tip_no_data_first") + |
| | | this.translateSys( |
| | | "quotation_mark_left") + pageData.Name + this |
| | | .translateSys( |
| | | "sys.quotation_mark_right") + |
| | | "quotation_mark_right") + |
| | | this.translate( |
| | | "page.tip_no_data_last"), |
| | | "tip_no_data_last"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | return false; |
| | | } |
| | | //获取表头属性 |
| | | pageData.okLoading = true |
| | | var head_attr = {}; |
| | | this.$data.head_styledef.form.items.forEach(item => { |
| | | if (item.name == "Layout") { //判断是否是栅栏格式 |
| | |
| | | }); |
| | | }); |
| | | if (jsonlist.length == 0) { |
| | | pageData.okLoading = false |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate("tip_no_select_data"), |
| | |
| | | "cancel") |
| | | }); |
| | | } |
| | | pageParam.okLoading = false |
| | | }).catch(ex => { |
| | | var tip = typeof ex == "string" ? ex : ex.errMsg; |
| | | pageParam.okLoading = false |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "8.1", |
| | | content: this.translate( |
| | |
| | | .v-head-style { |
| | | width: 98%; |
| | | |
| | | .uni-form-item { |
| | | margin-bottom: 15rpx; |
| | | .uni-forms-item { |
| | | margin-bottom: 11rpx; |
| | | } |
| | | |
| | | .input-wrapper { |
| | |
| | | .uni-input { |
| | | flex: 1; |
| | | padding: 12rpx 8rpx; |
| | | color: #2d8cf0; |
| | | // height: 40rpx; |
| | | // line-height: 40rpx; |
| | | } |
| | |
| | | position: relative; |
| | | border: 0 solid #000; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .uni-input { |
| | | /* border: none; */ |
| | | } |
| | | |
| | | .uni-icon { |
| | |
| | | font-size: 38rpx; |
| | | font-weight: bold; |
| | | float: right; |
| | | color: #fff; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .btn_disabled { |
| | | background-color: #ddd; |
| | | color: #888; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |