| | |
| | | |
| | | <script> |
| | | import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' |
| | | import classUtils from "@/js/utils.js" |
| | | import utils from "@/js/utils.js" |
| | | export default { |
| | | components: { |
| | | pickerAddress |
| | |
| | | //console.log(gridstyleInfo); |
| | | $this.$store.dispatch('classGridStyleInfo', gridstyleInfo).then(success => { |
| | | // console.log(success); |
| | | |
| | | if (success.code == '00000') { |
| | | |
| | | success.data.StyleDef = JSON.parse(success.data.StyleDef); |
| | | $this.$data.classGridStyle = success.data; |
| | | // console.log($this.$data.classGridStyle); |
| | | |
| | | $this.class_attr_init(); |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: "错误1.2", |
| | |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (classUtils.attrTypeIsDict(ar.Type)) |
| | | if (utils.classUtils.attrTypeIsDict(ar.Type)) |
| | | req.push({ |
| | | attr: ar.Name, |
| | | value: itemvalue.Name |
| | |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择' || ar.Value == '——请选择——') ar.Value = ''; |
| | | if (classUtils.attrTypeIsDict(ar.Type)) { |
| | | if (utils.classUtils.attrTypeIsDict(ar.Type)) { |
| | | if (ar.select == true) { //判断下拉是否多选 |
| | | var valStr = ""; |
| | | for (var v in ar.Value) { |
| | |
| | | name: ar.Name, |
| | | value: ar.Value |
| | | }); |
| | | } else |
| | | { |
| | | } else { |
| | | const node = this.formatAttr(ar) |
| | | req.push({ |
| | | name: node.attr, |
| | |
| | | }); |
| | | }, |
| | | class_attr_init() { |
| | | var attrlist = this.$data.classGridStyle.StyleDef.show_style |
| | | const attrlist = this.$data.classGridStyle.StyleDef?.show_style || [] |
| | | var newattrlist = []; |
| | | if (this.$data.classAttrList.length > 0) { |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | |
| | | ca.Value = ca.dictitem[d].CN_S_NAME; |
| | | } |
| | | } |
| | | if(classUtils.attrTypeIsDate(ca.Type)) { |
| | | if (utils.classUtils.attrTypeIsDateTime(ca.Type)) { |
| | | var nowDate = new Date(); |
| | | var date = { |
| | | year: nowDate.getFullYear(), |
| | |
| | | ca.Value = date.year + '-' + (date.month >= 10 ? date.month : '0' + date |
| | | .month) + '-' + (date.day >= 10 ? date.day : '0' + date.day); |
| | | } |
| | | if(classUtils.attrTypeIsObjRefMulti(ca.Type)) { |
| | | if (utils.classUtils.attrTypeIsObjRefMulti(ca.Type)) { |
| | | var relClsList = []; |
| | | var attr_rescls = ca.RelCls.split(','); |
| | | for (var ii in attr_rescls) { |
| | |
| | | ca.RelClsList = relClsList; |
| | | ca.Value = '请'; |
| | | } |
| | | if(classUtils.attrTypeIsRegion(ca.Type)) |
| | | if (utils.classUtils.attrTypeIsRegion(ca.Type)) |
| | | ca.Value = '请选择'; |
| | | if(classUtils.attrTypeIsBool(ca.Type)) |
| | | if (utils.classUtils.attrTypeIsBool(ca.Type)) |
| | | ca.Value = false; |
| | | |
| | | attr.push(ca); |
| | |
| | | this.$data.classAttrList = newattrlist; |
| | | } |
| | | var req = []; |
| | | if (this.$data.classGridStyle.StyleDef) { |
| | | if (this.$data.classGridStyle.StyleDef.show_style.length > 0) { |
| | | var attrlist = this.$data.classGridStyle.StyleDef.show_style |
| | | // $el.find('.attr_field').prop('readonly', true); |
| | | // $el.find('.attr_field').prop('disabled', true); |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].attrs |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | req.push({ |
| | | attr: ar.attr, |
| | | val: ar.value ? ar.value : '' |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].attrs |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | req.push({ |
| | | attr: ar.attr, |
| | | val: ar.value ? ar.value : '' |
| | | }); |
| | | } |
| | | } |
| | | |
| | | var eventlist = this.$data.classGridStyle.StyleDef.event; |
| | | |
| | | if (eventlist) { |
| | | if (eventlist.length > 0) { |
| | | for (var i = 0; i < eventlist.length; i++) { |
| | |
| | | } |
| | | this.ini_DataObjRunCustomEvent(info); |
| | | } |
| | | |
| | | console.log(this.$data.classGridStyle); |
| | | console.log(this.$data.classAttrList); |
| | | |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: "提示", |
| | |
| | | for (var l = 0; l < this.$data.classAttrList[a].Attr.length; l++) { |
| | | var ca = this.$data.classAttrList[a].Attr[l]; |
| | | if (value[i].attr == ca.Name) { |
| | | if (classUtils.attrTypeIsDict(ca.Type)) { |
| | | if (utils.classUtils.attrTypeIsDict(ca.Type)) { |
| | | var dictItemList = []; |
| | | for (var d in value[i].choice_list) { |
| | | var list_val = value[i].choice_list[d]; |
| | |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if (attr[j].Name == result[i].attr) { |
| | | if (classUtils.attrTypeIsDict(attr[j].Type)) { |
| | | if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { |
| | | var dictItemList = []; |
| | | for (var d in result[i].choice_list) { |
| | | var val = result[i].choice_list[d]; |
| | |
| | | }); |
| | | }, |
| | | formatAttr(attr) { |
| | | if (classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='引用对象(多个)') |
| | | if (utils.classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='引用对象(多个)') |
| | | if (attr.Value == '请') ar.Value = ''; |
| | | if (classUtils.attrTypeIsUser(attr.Type) || classUtils.attrTypeIsProject(attr |
| | | if (utils.classUtils.attrTypeIsUser(attr.Type) || utils.classUtils.attrTypeIsProject(attr |
| | | .Type)) //if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | return { |
| | | attr: attr.Name, |
| | | value: attr.ValID ? attr.ValID : '' |
| | | }; |
| | | else if (classUtils.attrTypeIsBool(attr.Type)) //if(ar.Type=='布尔值') |
| | | else if (utils.classUtils.attrTypeIsBool(attr.Type)) //if(ar.Type=='布尔值') |
| | | return { |
| | | attr: attr.Name, |
| | | value: attr.Value ? '1' : '0' |