| | |
| | | } |
| | | }, |
| | | async Head_UIStyleGetInfo(class_id, style_id) { //获取自定义表单样式 |
| | | try { |
| | | 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) { |
| | | const ret = await this.getUIStyleInfo(dataInfo) |
| | | var styledef = ""; |
| | | if (ret.result.style_def) { |
| | | //mobox2的style_def是json字符串 |
| | |
| | | .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 => { |
| | | } 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) { //获取自定义表单样式 |
| | |
| | | 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] |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | console.log("Detail_UIstyleGetInfo", detailstyledef); |
| | | return detailstyledef |
| | |
| | | dataType: "json", |
| | | success: (_res) => { |
| | | // console.log(_res); |
| | | const ret = _res.data |
| | | 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 |
| | | "errMsg": ret.err_msg || ret.errMsg |
| | | }); |
| | | } |
| | | }, |
| | |
| | | } |
| | | }).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") |
| | | }); |
| | |
| | | }); |
| | | if (!pageData) |
| | | return |
| | | data.row.forEach(row => { |
| | | var styleStr = JSON.stringify(pageData.StyleDef); |
| | | |
| | | 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( |
| | |
| | | pageData.DefList.push(detailStyle); |
| | | |
| | | }); |
| | | } |
| | | }, |
| | | //加载已码盘内容 |
| | | viewAceionContent(data) { |
| | |
| | | }); |
| | | if (!pageData) |
| | | return |
| | | console.log("viewAceionContent", pageData) |
| | | pageData.ExtData = data.ext_data || {} |
| | | |
| | | if (JSON.stringify(data.content) == '{}') { |
| | | return; |
| | | } |
| | | data.content.forEach(cont => { |
| | | var styleStr = JSON.stringify(pageData.StyleDef); |
| | | console.log("viewAceionContent2", pageData) |
| | | var detailStyle = JSON.parse(styleStr); |
| | | if (detailStyle.form) { |
| | | data.content.forEach(cont => { |
| | | detailStyle = JSON.parse(styleStr); |
| | | detailStyle.SelBut_Checked = data.checkbox ?? true; |
| | | |
| | | detailStyle.form.objId = cont.id; |
| | | detailStyle.form.htmlobjId = cont.id ? cont.id.replace(/-/g, |
| | | '') |
| | |
| | | $this.activelist.push({ |
| | | active: false |
| | | }); |
| | | |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | onClickItem(e) { //选择页签 |
| | |
| | | pageParam.okLoading = false |
| | | }).catch(ex => { |
| | | pageParam.okLoading = false |
| | | var tip = typeof ex == "string" ? ex : ex.errMsg; |
| | | 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 { |