report-ui/dist/static/js/chunk-00f4.a176d883.js
2023-04-14 15:55:36 +08:00

1 line
12 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-00f4"],{"/rDb":function(e,t,a){},"1C1b":function(e,t,a){"use strict";var r=a("/rDb");a.n(r).a},CJ5O:function(e,t,a){"use strict";var r=a("14Xm"),i=a.n(r),o=a("D3Ub"),n=a.n(o),s=a("sm2R"),l={name:"GetDictionary",props:{dictKey:String,updataDict:String,value:String},data:function(){return{dictionary:"",dictionaryOptions:[]}},watch:{dictKey:{immediate:!0,handler:function(){this.getSystem()}},value:{handler:function(e){this.dictionary=e},deep:!0}},created:function(){this.getSystem()},mounted:function(){this.dictionary=this.value},methods:{getSystem:function(){var e=this;return n()(i.a.mark(function t(){var a,r,o;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(s.a)(e.dictKey);case 2:if(a=t.sent,r=a.code,o=a.data,"200"==r){t.next=7;break}return t.abrupt("return");case 7:e.dictionaryOptions=o;case 8:case"end":return t.stop()}},t,e)}))()},selectChange:function(e){this.$emit("input",e),this.$emit("change",e)}}},u=(a("1C1b"),a("KHd+")),c=Object(u.a)(l,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-select",{attrs:{placeholder:"请选择",clearable:"",size:"mini"},on:{change:e.selectChange},model:{value:e.dictionary,callback:function(t){e.dictionary=t},expression:"dictionary"}},e._l(e.dictionaryOptions,function(e){return a("el-option",{key:e.id,attrs:{label:e.text,value:e.id}})}),1)},[],!1,null,"9e2cd716",null);c.options.__file="index.vue";t.a=c.exports},Yfch:function(e,t,a){"use strict";function r(e,t,a){""==t||void 0==t||null==t?a():/^[_a-zA-Z0-9]+$/.test(t)?a():a(new Error("英文字母、数字或下划线"))}a.d(t,"a",function(){return r})},ZjmF:function(e,t,a){"use strict";a.r(t);var r=a("t3Un");function i(e){return Object(r.a)({url:"dataSource/pageList",method:"GET",params:e})}function o(e){return Object(r.a)({url:"dataSource",method:"post",data:e})}function n(e){return Object(r.a)({url:"dataSource/delete/batch",method:"post",data:e})}function s(e){return Object(r.a)({url:"dataSource",method:"put",data:e})}function l(e){return Object(r.a)({url:"dataSource/"+e.id,method:"get",params:{accessKey:e.accessKey}})}function u(e){return Object(r.a)({url:"/dataSource/testConnection",method:"post",data:e})}var c=a("gDS+"),d=a.n(c),p=a("14Xm"),m=a.n(p),f=a("D3Ub"),g=a.n(f),b=a("sm2R"),y=a("CJ5O"),h=a("Yfch"),v={name:"Support",components:{Dictionary:y.a},props:{visib:{required:!0,type:Boolean,default:!1},dataSource:{required:!1,type:Object,default:function(){return""}}},data:function(){return{dictionaryOptions:[],selectedList:[],clickType:"",formData:{},list:null,totalCount:0,totalPage:0,listLoading:!0,dialogFormVisible:!1,basicDialog:!1,params:{sourceName:"",sourceCode:"",sourceType:"",pageNumber:1,pageSize:10,order:"DESC",sort:"update_time"},dialogForm:{sourceName:"",sourceCode:"",sourceType:"",sourceDesc:"",sourceConfig:""},dataLink:[],rules:{sourceType:[{required:!0,message:"数据集名称必选",trigger:"change"}],sourceCode:[{required:!0,message:"数据集编码必填",trigger:"blur"},{validator:h.a,trigger:"blur"}],sourceName:[{required:!0,message:"数据源名称必选",trigger:"blur"}]},value:"",updataDisabled:!1,testReplyCode:null}},methods:{setDataSource:function(){var e=this;return g()(m.a.mark(function t(){var a,r,i,o,n;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.dialogForm={sourceName:"",sourceCode:"",sourceType:"",sourceDesc:"",sourceConfig:""},!e.dataSource.id){t.next=14;break}return t.next=4,l(e.dataSource);case 4:if(a=t.sent,r=a.code,i=a.data,"200"==r){t.next=9;break}return t.abrupt("return");case 9:e.dialogForm=i,o=e.dialogForm,n=[],e.dictionaryOptions.map(function(e){if(e.id==o.sourceType){n=JSON.parse(e.extend);for(var t=JSON.parse(o.sourceConfig),a=0;a<n.length;a++)n[a].value=t[n[a].label]}}),e.dataLink=n;case 14:case"end":return t.stop()}},t,e)}))()},getSystem:function(){var e=this;return g()(m.a.mark(function t(){var a,r,i;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(b.a)("SOURCE_TYPE");case 2:if(a=t.sent,r=a.code,i=a.data,"200"==r){t.next=7;break}return t.abrupt("return");case 7:e.dictionaryOptions=i,e.dialogForm.sourceType=e.dictionaryOptions[0].text,e.dataLink=JSON.parse(e.dictionaryOptions[0].extend),e.setDataSource();case 11:case"end":return t.stop()}},t,e)}))()},closeDialog:function(){this.$emit("handleClose")},UserConfirm:function(e){var t=this;return g()(m.a.mark(function a(){var r;return m.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:r={},t.dataLink.forEach(function(e){r[e.label]=e.value}),t.dialogForm.sourceConfig=d()(r),t.$refs[e].validate(function(){var e=g()(m.a.mark(function e(a,r){var i,n;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!a){e.next=24;break}if("200"==t.testReplyCode){e.next=4;break}return t.$message.error("测试结果为成功后方可保存!"),e.abrupt("return");case 4:if(void 0!=t.dialogForm.id){e.next=14;break}return e.next=7,o(t.dialogForm);case 7:if(i=e.sent,"200"==i.code){e.next=11;break}return e.abrupt("return");case 11:t.$emit("refreshList"),e.next=21;break;case 14:return e.next=16,s(t.dialogForm);case 16:if(n=e.sent,"200"==n.code){e.next=20;break}return e.abrupt("return");case 20:t.$emit("refreshList");case 21:t.closeDialog(),e.next=25;break;case 24:return e.abrupt("return");case 25:case"end":return e.stop()}},e,t)}));return function(t,a){return e.apply(this,arguments)}}());case 4:case"end":return a.stop()}},a,t)}))()},selectChange:function(e){this.dataLink=[];var t=this.dictionaryOptions.find(function(t){return t.id==e});this.dataLink=JSON.parse(t.extend)},test:function(){var e=this,t={};this.dataLink.forEach(function(e){t[e.label]=e.value}),this.dialogForm.sourceConfig=d()(t),u(this.dialogForm).then(function(t){"200"==t.code?(e.testReplyCode=t.code,e.$message({message:"测试成功!",type:"success"})):e.testReplyCode=null})}}},x=a("KHd+"),S=Object(x.a)(v,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:"项目基础配置",width:"50%","close-on-click-modal":!1,center:"",visible:e.visib,"before-close":e.closeDialog},on:{"update:visible":function(t){e.visib=t}}},[a("el-form",{ref:"userForm",attrs:{model:e.dialogForm,rules:e.rules,size:"small","label-width":"100px"}},[a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:24,sm:24,md:8,lg:8,xl:8}},[a("el-form-item",{attrs:{label:"数据源类型",prop:"sourceType"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},on:{change:e.selectChange},model:{value:e.dialogForm.sourceType,callback:function(t){e.$set(e.dialogForm,"sourceType","string"==typeof t?t.trim():t)},expression:"dialogForm.sourceType"}},e._l(e.dictionaryOptions,function(e){return a("el-option",{key:e.id,attrs:{label:e.text,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{xs:24,sm:24,md:8,lg:8,xl:8}},[a("el-form-item",{attrs:{label:"数据源编码",prop:"sourceCode"}},[a("el-input",{attrs:{disabled:e.updataDisabled,placeholder:"唯一标识"},model:{value:e.dialogForm.sourceCode,callback:function(t){e.$set(e.dialogForm,"sourceCode","string"==typeof t?t.trim():t)},expression:"dialogForm.sourceCode"}})],1)],1),e._v(" "),a("el-col",{attrs:{xs:24,sm:24,md:8,lg:8,xl:8}},[a("el-form-item",{attrs:{label:"数据源名称",prop:"sourceName"}},[a("el-input",{model:{value:e.dialogForm.sourceName,callback:function(t){e.$set(e.dialogForm,"sourceName","string"==typeof t?t.trim():t)},expression:"dialogForm.sourceName"}})],1)],1),e._v(" "),a("el-col",{attrs:{xs:24,sm:20,md:24,lg:24,xl:24}},[a("el-form-item",{attrs:{label:"数据源描述"}},[a("el-input",{attrs:{type:"textarea",autosize:{minRows:2,maxRows:4}},model:{value:e.dialogForm.sourceDesc,callback:function(t){e.$set(e.dialogForm,"sourceDesc","string"==typeof t?t.trim():t)},expression:"dialogForm.sourceDesc"}})],1)],1)],1),e._v(" "),a("el-row",{attrs:{gutter:10}},e._l(e.dataLink,function(t,r){return a("el-col",{key:r,attrs:{xs:24,sm:24,md:24,lg:24,xl:24}},[a("el-form-item",{attrs:{label:t.labelValue}},[a("el-input",{model:{value:t.value,callback:function(a){e.$set(t,"value","string"==typeof a?a.trim():a)},expression:"data.value"}})],1)],1)}),1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.closeDialog}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"warning"},on:{click:e.test}},[e._v("测试")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.UserConfirm("userForm")}}},[e._v("确定")])],1)],1)},[],!1,null,null,null);S.options.__file="EditDataSource.vue";var k={name:"ReportDataSource",components:{EditDataSource:S.exports},data:function(){var e=this;return{dialogVisibleSetDataSource:!1,dataSource:{},crudOption:{title:"数据源",labelWidth:"120px",tableButtons:[{label:"新增",type:"",permission:"datasourceManage:insert",icon:"el-icon-plus",plain:!0,click:function(){return e.operateDatasource("add")}},{label:"删除",type:"danger",permission:"datasourceManage:delete",icon:"el-icon-delete",plain:!1,click:function(){return e.$refs.listPage.handleDeleteBatch()}}],rowButtons:[{label:"编辑",permission:"datasourceManage:update",click:function(t){return e.operateDatasource("edit",t)}},{label:"删除",permission:"datasourceManage:delete",click:function(t){return e.$refs.listPage.handleDeleteBatch(t)}}],queryFormFields:[{inputType:"input",label:"数据源编码",field:"sourceCode"},{inputType:"input",label:"数据源名称",field:"sourceName"},{inputType:"anji-select",anjiSelectOption:{dictCode:"SOURCE_TYPE"},label:"数据源类型",field:"sourceType"}],buttons:{rowButtonsWidth:150,query:{api:i,permission:"datasourceManage:query",sort:"update_time",order:"DESC"},queryByPrimarykey:{api:l,permission:"datasourceManage:detail"},add:{api:o,permission:"datasourceManage:insert",isShow:!1},delete:{api:n,permission:"datasourceManage:delete"},edit:{api:s,permission:"datasourceManage:update",isShow:!1}},columns:[{label:"",field:"id",primaryKey:!0,tableHide:!0,editHide:!0},{label:"数据源编码",placeholder:"",field:"sourceCode",editField:"sourceCode",inputType:"input",rules:[{min:1,max:100,message:"不超过100个字符",trigger:"blur"}],disabled:!1},{label:"数据源名称",placeholder:"",field:"sourceName",editField:"sourceName",inputType:"input",rules:[{min:1,max:100,message:"不超过100个字符",trigger:"blur"}],disabled:!1},{label:"数据源描述",placeholder:"",field:"sourceDesc",editField:"sourceDesc",inputType:"input",rules:[{min:1,max:255,message:"不超过255个字符",trigger:"blur"}],disabled:!1},{label:"数据源类型",placeholder:"",field:"sourceType",fieldTableRowRenderer:function(t){return e.getDictLabelByCode("SOURCE_TYPE",t.sourceType)},editField:"sourceType",inputType:"input",rules:[{min:1,max:50,message:"不超过50个字符",trigger:"blur"}],disabled:!1},{label:"数据源连接配置json",placeholder:"",field:"sourceConfig",editField:"sourceConfig",tableHide:!0,inputType:"input",rules:[{min:1,max:2048,message:"不超过2048个字符",trigger:"blur"}],disabled:!1},{label:"状态",placeholder:"",field:"enableFlag",fieldTableRowRenderer:function(t){return e.getDictLabelByCode("ENABLE_FLAG",t.enableFlag)},colorStyle:{0:"table-danger",1:"table-success"},editField:"enableFlag",inputType:"input",rules:[],disabled:!1},{label:"删除标记",placeholder:"",field:"deleteFlag",editField:"deleteFlag",tableHide:!0,inputType:"input",rules:[],disabled:!1}]}}},methods:{operateDatasource:function(e,t){this.dialogVisibleSetDataSource=!0,this.dataSource=t||{},this.$refs.EditDataSource.getSystem()},refreshList:function(){this.$refs.listPage.handleQueryForm("query")}}},C=Object(x.a)(k,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("anji-crud",{ref:"listPage",attrs:{option:e.crudOption},scopedSlots:e._u([{key:"pageSection",fn:function(){return[a("EditDataSource",{ref:"EditDataSource",attrs:{dataSource:e.dataSource,visib:e.dialogVisibleSetDataSource},on:{handleClose:function(t){e.dialogVisibleSetDataSource=!1},refreshList:e.refreshList}})]},proxy:!0}])})},[],!1,null,null,null);C.options.__file="index.vue";t.default=C.exports}}]);