| | |
| | | }); //设置顶部标题 |
| | | this.$data.title = options.titlename; |
| | | this.$data.param = JSON.parse(options.param); |
| | | this.initial( options.paramValue); |
| | | |
| | | |
| | | this.styledef = {}; |
| | | this.head_styledef = { |
| | | form: { |
| | | items: [] |
| | | } |
| | | }; |
| | | this.detail1_styledef = {}; |
| | | this.detail1StyleDefList = []; |
| | | this.detail2_styledef = {}; |
| | | this.detail2StyleDefList = []; |
| | | this.ListHtml_Panel = ""; |
| | | this.ListPageHtml_Show = { |
| | | name: "", |
| | | event: { |
| | | id: "", |
| | | name: "" |
| | | } |
| | | }; |
| | | this.items = []; |
| | | this.active_id = ''; |
| | | this.activelist = []; |
| | | |
| | | if (this.param.ListPage.ListItem_UIDef?.ui_type == "HTML页面") { |
| | | // HTML页面 |
| | | //获取数据类的HTML页面 |
| | | await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id, options |
| | | .paramValue); |
| | | } else { |
| | | await this.Detail1_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id); |
| | | |
| | | await this.initial(options.paramValue); |
| | | } |
| | | // this.isFilter=true; |
| | | // if(this.param.ShowFilter) |
| | | // this.isFilter=false; |
| | |
| | | let that = this; |
| | | let keys = []; |
| | | let val, data; |
| | | |
| | | |
| | | Object.keys(obj).forEach(function(key) { |
| | | keys = key.split("."); |
| | | val = obj[key]; |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | |
| | | //初始化 |
| | | async initial(paramValue) { |
| | | this.styledef = {}; |
| | | this.head_styledef = { |
| | | form: { |
| | | items: [] |
| | | } |
| | | }; |
| | | this.detail1_styledef = {}; |
| | | this.detail1StyleDefList = []; |
| | | this.detail2_styledef = {}; |
| | | this.detail2StyleDefList = []; |
| | | this.items = []; |
| | | this.active_id = ''; |
| | | this.activelist = []; |
| | | this.ListHtml_Panel = ""; |
| | | this.ListPageHtml_Show = { |
| | | name: "", |
| | | event: { |
| | | id: "", |
| | | name: "" |
| | | } |
| | | }; |
| | | |
| | | this.isFilter = true; |
| | | if (this.param.ShowFilter) |
| | | this.isFilter = false; |
| | |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | if (this.param.ListPage.ListItem_UIDef?.ui_type == "HTML页面") { |
| | | // HTML页面 |
| | | //获取数据类的HTML页面 |
| | | await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id); |
| | | } else { |
| | | await this.Detail1_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id); |
| | | } |
| | | this.orderby = this.param.Order ? this.param.Order : 'T_CREATE Desc'; |
| | | if (this.param.Query_Event) { |
| | |
| | | }); |
| | | |
| | | }, |
| | | async Html_UIstyleGetInfo(class_id, style_id) { //获取自定义表单样式 |
| | | async Html_UIstyleGetInfo(class_id, style_id, paramValue) { //获取自定义表单样式 |
| | | var $this = this; |
| | | var dataInfo = { |
| | | class_id: class_id, |
| | |
| | | if (!ret.result.style_def.includes('"')) styledef = Base64.decode(ret.result |
| | | .style_def); |
| | | } |
| | | // console.log(styledef); |
| | | $this.ListPageHtml_Show = ret.result.style_def ? JSON.parse(styledef) : {}; |
| | | // console.log($this.ListPageHtml_Show); |
| | | |
| | | $this.initial(paramValue); |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "10", |
| | |
| | | dict_id: dict.id, |
| | | dict_name: dict.name |
| | | }; |
| | | // console.log(dataInfo); |
| | | this.$store.dispatch('DictGetInfo', dataInfo).then(async (success) => { |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | if (type == 'mast') { |
| | | var list = []; |
| | | var itemName = ''; |
| | | success.result.dict_item_list.forEach((item) => { |
| | | if (item.is_default == '1') |
| | | itemName = item.name; |
| | | list.push({ |
| | | text: item.value, |
| | | value: item.name, |
| | | }); |
| | | try { |
| | | const success = await this.getDictInfo(dataInfo) |
| | | if (type == 'mast') { |
| | | var list = []; |
| | | var itemName = ''; |
| | | success.result.dict_item_list.forEach((item) => { |
| | | if (item.is_default == '1') |
| | | itemName = item.name; |
| | | list.push({ |
| | | text: item.value, |
| | | value: item.name, |
| | | }); |
| | | //有默认值,显示默认值 |
| | | if (itemName) { |
| | | $this.head_styledef.form.items[index].value = itemName; |
| | | var attr = $this.head_styledef.form.items[index].fieldId; |
| | | $this.head_styledef.form.model[attr] = itemName; |
| | | } |
| | | $this.head_styledef.form.items[index].dict = list; |
| | | var head_styledef = JSON.parse(JSON.stringify($this.head_styledef)); |
| | | $this.head_styledef = []; |
| | | $this.head_styledef = head_styledef; |
| | | } else { |
| | | // $this.$data.subClassAttrList[index].attr_list[key].dictitem=success.result; |
| | | // this.$store.commit("subClassAttrList", $this.$data.subClassAttrList); |
| | | } |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "3.1", |
| | | content: success.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | //有默认值,显示默认值 |
| | | if (itemName) { |
| | | $this.head_styledef.form.items[index].value = itemName; |
| | | var attr = $this.head_styledef.form.items[index].fieldId; |
| | | $this.head_styledef.form.model[attr] = itemName; |
| | | } |
| | | $this.head_styledef.form.items[index].dict = list; |
| | | var head_styledef = JSON.parse(JSON.stringify($this.head_styledef)); |
| | | $this.head_styledef = []; |
| | | $this.head_styledef = head_styledef; |
| | | } else { |
| | | // $this.$data.subClassAttrList[index].attr_list[key].dictitem=success.result; |
| | | // this.$store.commit("subClassAttrList", $this.$data.subClassAttrList); |
| | | } |
| | | }).catch(ex => { |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "3", |
| | |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | getDictInfo(info) { //Mobox3得到得到字典信息字典项列表 |
| | | const loginInfo = this.$store.getters.loginid |
| | | const mobxoSApi = this.$store.getters.getMobxoSApi |
| | | return new Promise((resolve, reject) => { |
| | | uni.request({ |
| | | url: mobxoSApi + 'api/dict/GetInfo2?sessionid=' + loginInfo.result.session_id, |
| | | data: info, |
| | | method: 'POST', |
| | | dataType: "json", |
| | | success: (_res) => { |
| | | // console.log(_res); |
| | | const ret = _res.data |
| | | if (ret.err_code == 0) { |
| | | resolve(ret); |
| | | } else { |
| | | reject({ |
| | | "errMsg": ret.err_msg |
| | | }); |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | // console.log(err); |
| | | reject(err); |
| | | } |
| | | }) |
| | | |
| | | }) |
| | | |
| | | }, |
| | | |
| | | // 执行查询事件 |
| | |
| | | if (ret.result) { |
| | | $this.page_count = ret.result.page_count; |
| | | if (ret.result.page_count > 1) $this.query_id = ret.result.query_id; |
| | | // console.log($this.ListPageHtml_Show.event); |
| | | if ($this.ListPageHtml_Show.event.id) { |
| | | ret.result.obj_list.forEach((obj) => { |
| | | var info = { |
| | |
| | | if (btn.FunCode == "Add" || btn.FunCode == "Modify") { |
| | | if (btn.Edit_dlg.Model == "small") { |
| | | this.showAddSmallDialog(btn, style, enviroment); |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translateSys("unrealized"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | } |
| | | } else if (btn.FunCode == "Delete") { |
| | | this.DeleteObj(btn, style, enviroment); |
| | |
| | | if ((success.result || []).length > 0) { |
| | | const app = success.result[0] |
| | | var param = ""; |
| | | var appName = app.name || app.list_name |
| | | var appName = app.list_name || app.name |
| | | .Name; |
| | | var paramStr = app.param |
| | | if (paramStr) { |
| | |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | }); |
| | | } |
| | | else{ |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys("error"), |
| | | content: this.translate("cannot_related_function"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys("cancel") |
| | | }); |
| | | |
| | | |
| | | } |
| | | }, |
| | | //执行后处理事件 |