| | |
| | | import Base64 from '../../components/js-base64/base64.js' |
| | | import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' |
| | | import utils from "@/js/utils.js" |
| | | import { |
| | | appGetInfo, |
| | | dictGetInfo, |
| | | dictItemGetInfo |
| | | } from "@/api/mobox.js" |
| | | import { |
| | | getUIStyleInfo, |
| | | runCustomEvent, |
| | | dataObjCreate |
| | | } from "@/api/data.js" |
| | | import { |
| | | classAttrList, |
| | | } from "@/api/index.js" |
| | | |
| | | |
| | | export default { |
| | | modules: { |
| | | Base64, |
| | |
| | | }); |
| | | }, |
| | | async loadData() { |
| | | try { |
| | | const param = this.param |
| | | var edit_dlg = { |
| | | Model: param.EditDlgMode, |
| | |
| | | group_name: '' |
| | | }; |
| | | var $this = this; |
| | | $this.$store.state.thisareaFuncID = param.clsid; |
| | | // console.log($this.$store.getters.getclassAttrList); |
| | | //获取 |
| | | if ($this.$store.getters.getclassAttrList) { |
| | | $this.$data.classAttrList = $this.$store.getters.getclassAttrList; |
| | | $this.classGridStyleInfo(); |
| | | } else { |
| | | $this.$store.dispatch('classAttrGetList', dataInfo) |
| | | .then((success) => { |
| | | if (success.err_code == 0) { |
| | | $this.$data.classAttrList = success.result; |
| | | success.result.forEach(async (group, index) => { |
| | | group.attr_list.forEach(async (attr, key) => { |
| | | const result = await classAttrList(dataInfo) || [] |
| | | for (let index in result) { |
| | | const group = result[index] |
| | | for (let key in group.attr_list) { |
| | | const attr = group.attr_list[key] |
| | | if (utils.classUtils.attrTypeIsDict(attr.type)) { |
| | | await $this.DictItemGetList(attr, key, |
| | | index); |
| | | attr.dictitem = await $this.DictItemGetList(attr); |
| | | } |
| | | }); |
| | | }); |
| | | setTimeout(function() { |
| | | $this.classGridStyleInfo(); |
| | | }, 500); |
| | | } else { |
| | | } |
| | | } |
| | | $this.$data.classAttrList = result; |
| | | await $this.classGridStyleInfo(); |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 1", |
| | | content: success.err_msg, |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | 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') |
| | | }); |
| | | }); |
| | | } |
| | | console.log(this.$data.param); |
| | | }, |
| | | async DictItemGetList(attr, key, index) { //Mobox3得到字典项列表 |
| | | async DictItemGetList(attr) { //Mobox3得到字典项列表 |
| | | try { |
| | | this.data = []; |
| | | var $this = this; |
| | | var dataInfo = { |
| | | dict_id: attr.dict_id, |
| | | dict_name: attr.dict_name |
| | | }; |
| | | // console.log(dataInfo); |
| | | this.$store.dispatch('DictItemGetList', dataInfo).then(async (success) => { |
| | | // console.log(success); |
| | | if (success.err_code == 0) { |
| | | $this.$data.classAttrList[index].attr_list[key].dictitem = success.result; |
| | | this.$store.commit("classAttrList", $this.$data.classAttrList); |
| | | const res = await dictItemGetInfo(dataInfo) |
| | | return res?.dict_item_list || [] |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 1.2", |
| | | content: success.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | } |
| | | }).catch(ex => { |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 1.3", |
| | |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | }); |
| | | return [] |
| | | } |
| | | }, |
| | | async classGridStyleInfo() { |
| | | |
| | | try { |
| | | var $this = this; |
| | | var gridstyleInfo = { |
| | | class_id: $this.$data.param.clsid, |
| | | ui_style_type: 2, |
| | | ui_style_name: $this.$data.param.Edit_dlg.Name |
| | | }; |
| | | $this.$store.state.thisEditName = $this.$data.param.Edit_dlg.Name |
| | | // console.log($this.$store.getters.getclassGridStyleInfo); |
| | | //获取 |
| | | if ($this.$store.getters.getclassGridStyleInfo) { |
| | | $this.$data.classGridStyle = $this.$store.getters.getclassGridStyleInfo; |
| | | $this.viewParam(); |
| | | } else { |
| | | // console.log(gridstyleInfo); |
| | | $this.$store.dispatch('UIStyleGetInfo', gridstyleInfo).then(async (success) => { |
| | | // console.log(success); |
| | | if (success.err_code == 0) { |
| | | var styledef = Base64.decode(success.result.style_def); |
| | | success.result.style_def = JSON.parse(styledef); |
| | | $this.$data.classGridStyle = success.result; |
| | | // console.log($this.$data.classGridStyle); |
| | | |
| | | const result = await getUIStyleInfo(dataInfo) |
| | | var styledef = Base64.decode(result.style_def); |
| | | result.style_def = JSON.parse(styledef); |
| | | $this.$data.classGridStyle = result |
| | | $this.viewParam(); |
| | | } else { |
| | | |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 1.4", |
| | | content: success.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | } |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 1.5", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | |
| | | }; |
| | | console.log(dataInfo); |
| | | // return |
| | | this.$store.dispatch('createDataObj', dataInfo).then(success => { |
| | | console.log(success); |
| | | DataObjCreate(dataInfo).then((result) => { |
| | | console.log(result); |
| | | uni.hideLoading(); |
| | | if (success.err_code == 0) { |
| | | var result = success.result; |
| | | // if(result.result_type == 0){} |
| | | if (success.result.action) { |
| | | var action = JSON.parse(success.result.action); |
| | | if (result.action) { |
| | | var action = JSON.parse(result.action); |
| | | console.log(action); |
| | | if (action.ret == '0') { |
| | | if (action.ret != 0) { |
| | |
| | | "&titlename=" + this.$data.title |
| | | }); |
| | | // this.cancel(); |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " ", |
| | | content: success.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | | uni.hideLoading(); |
| | |
| | | }; |
| | | console.log(dataInfo); |
| | | // return; |
| | | this.$store.dispatch('runCustomEvent', dataInfo).then(success => { |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | if (data.ret != 0) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data |
| | | .err_info : |
| | |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 2", |
| | | content: success.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | |
| | | }; |
| | | console.log(dataInfo); |
| | | // return; |
| | | this.$store.dispatch('runCustomEvent', dataInfo).then(success => { |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data |
| | | .err_info : |
| | |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 3", |
| | | content: success.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | |
| | | }; |
| | | console.log(dataInfo); |
| | | // return; |
| | | this.$store.dispatch('runCustomEvent', dataInfo).then(success => { |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data |
| | | .err_info : |
| | |
| | | |
| | | this.add(); |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 4", |
| | | content: success.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | |
| | | }; |
| | | console.log(dataInfo); |
| | | // return; |
| | | this.$store.dispatch('runCustomEvent', dataInfo).then(success => { |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data |
| | | .err_info : |
| | |
| | | }); |
| | | } |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: this.translateSys('error') + " 5", |
| | | content: success.err_msg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('cancel') |
| | | }); |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | |
| | | } |
| | | </script> |
| | | <style> |
| | | |
| | | .popup-content { |
| | | @include flex; |
| | | align-items: center; |
| | |
| | | /* height: 150px; */ |
| | | /* border: 1px solid red; */ |
| | | } |
| | | |
| | | .popup-height { |
| | | @include height; |
| | | /* width: 200px; */ |