| | |
| | | label: '英文名称', |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | search: true, |
| | | formatter:function (d){ |
| | | return d.id || d.data.id |
| | | } |
| | | }, { |
| | | prop: 'name', |
| | | label: '中文名称', |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | search: true, |
| | | formatter:function (d){ |
| | | return d.name || d.data.name |
| | | } |
| | | }, { |
| | | prop: 'description', |
| | | label: '描述', |
| | | width: 250 |
| | | width: 250, |
| | | formatter:function (d){ |
| | | return d.description || d.data.description |
| | | } |
| | | }, { |
| | | prop: 'secretGradeText', |
| | | label: '密级', |
| | | width: 60, |
| | | hidden: (!this.controllerSecret) |
| | | hidden: (!this.controllerSecret), |
| | | formatter:function (d){ |
| | | return d.secretGradeText || d.data.secretGradeText |
| | | } |
| | | }]; |
| | | } else { |
| | | this.option.column = this.options.tableConfig.cols.map(item => { |
| | |
| | | let formatter=item.template || item.templet; |
| | | if(typeof formatter == "string" && formatter !=''){ |
| | | formatter=eval("(" + formatter + ")") |
| | | }else{ |
| | | formatter=function (d){ |
| | | if(d[item.field]!=undefined){ |
| | | return d[item.field] |
| | | }else if(d.data[item.field] !=undefined){ |
| | | return d.data[item.field] |
| | | }else { |
| | | return '' |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | this.data = res.data.data.records; |
| | | this.page.total=res.data.data.total; |
| | | } |
| | | this.data=this.data.map(item => { |
| | | item.data=item.data || {} |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }).catch(error=>{ |
| | |
| | | message: "请输入" + item.field, |
| | | trigger: "blur" |
| | | }]; |
| | | /*item.formatter=function(d,thisItem){ |
| | | var vciWebComboxStore = layui.vciWebComboxStore; |
| | | return vciWebComboxStore.getComboxText(thisItem.enumCode,d[thisItem.field]); |
| | | };*/ |
| | | item.formatter=function(d){ |
| | | return d.field || d.data.field |
| | | }; |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | let formatter=item.template || item.templet; |
| | | if(typeof formatter == "string" && formatter !=''){ |
| | | formatter=eval("(" + formatter + ")") |
| | | }else{ |
| | | formatter=function (d){ |
| | | if(d[item.field]!=undefined){ |
| | | return d[item.field] |
| | | }else if(d.data[item.field] !=undefined){ |
| | | return d.data[item.field] |
| | | }else { |
| | | return '' |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | this.data = res.data.data.records; |
| | | this.page.total=res.data.data.total; |
| | | } |
| | | this.data=this.data.map(item => { |
| | | item.data=item.data || {} |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }).catch(error=>{ |
| | |
| | | this.params=queryParams; |
| | | |
| | | }, |
| | | getTree(){ |
| | | getTree(this.params,this.treeUrl).then(res => { |
| | | this.treeData=res.data |
| | | getTree() { |
| | | getTree(this.params, this.treeUrl).then(res => { |
| | | res.data.map(item => { |
| | | if (!item.attribute) { |
| | | item.attribute = { |
| | | data: {} |
| | | } |
| | | } else { |
| | | item.attribute.data = item.attribute.data || {} |
| | | } |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |
| | | } |
| | | }) |
| | | this.treeData = res.data |
| | | }) |
| | | }, |
| | | treeLoad: function (treeNode, resolve) { |
| | | const parentOid = (treeNode.level === 0) ? 0 : treeNode.data.oid; |
| | |
| | | } |
| | | getLazyTree(this.params,this.treeUrl).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | if(!item.attribute){ |
| | | item.attribute={ |
| | | data:{} |
| | | } |
| | | }else{ |
| | | item.attribute.data=item.attribute.data || {} |
| | | } |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |