1 line
151 KiB
JavaScript
1 line
151 KiB
JavaScript
(function(e){function t(t){for(var o,i,s=t[0],l=t[1],c=t[2],d=0,h=[];d<s.length;d++)i=s[d],Object.prototype.hasOwnProperty.call(n,i)&&n[i]&&h.push(n[i][0]),n[i]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(e[o]=l[o]);u&&u(t);while(h.length)h.shift()();return r.push.apply(r,c||[]),a()}function a(){for(var e,t=0;t<r.length;t++){for(var a=r[t],o=!0,s=1;s<a.length;s++){var l=a[s];0!==n[l]&&(o=!1)}o&&(r.splice(t--,1),e=i(i.s=a[0]))}return e}var o={},n={index:0},r=[];function i(t){if(o[t])return o[t].exports;var a=o[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=o,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(a,o,function(t){return e[t]}.bind(null,o));return a},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var c=0;c<s.length;c++)t(s[c]);var u=l;r.push([0,"chunk-vendors"]),a()})({0:function(e,t,a){e.exports=a("56d7")},"034f":function(e,t,a){"use strict";var o=a("85ec"),n=a.n(o);n.a},"0d0e":function(e,t,a){"use strict";var o=a("fb92"),n=a.n(o);n.a},"0ea6":function(e,t,a){},"1cc7":function(e,t,a){"use strict";var o=a("d1f1"),n=a.n(o);n.a},"21eb":function(e,t,a){},"29bf":function(e,t,a){},"40c0":function(e,t,a){},"44c2":function(e,t,a){},"499b":function(e,t,a){"use strict";var o=a("29bf"),n=a.n(o);n.a},"56d7":function(e,t,a){"use strict";a.r(t);a("e260"),a("e6cf"),a("cca6"),a("a79d");var o=a("a026"),n=a("5c96"),r=a.n(n),i=(a("0fae"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"app"}},[e.fullscreen?[a("router-view")]:a("el-container",[a("el-aside",{staticStyle:{background:"#fafafa"},style:{width:e.rightAsideWidth+"px"}},[a("div",{staticStyle:{padding:"10px",height:"100%","box-sizing":"border-box"}},[a("div",{staticStyle:{"margin-bottom":"10px"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{size:"small",filterable:"",placeholder:"请先选择分组"},on:{change:e.sourceGroupChangeEvents},model:{value:e.choiceDatasourceGroup,callback:function(t){e.choiceDatasourceGroup=t},expression:"choiceDatasourceGroup"}},[a("el-option",{attrs:{value:"",label:"全部分组"}}),e._l(e.datasourceGroupList,(function(e){return a("el-option",{key:e,attrs:{value:e}})}))],2),a("el-select",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{size:"small",filterable:"",placeholder:"请先选择数据源"},on:{change:e.datasourceChangeEvents},model:{value:e.choiceDatasourceId,callback:function(t){e.choiceDatasourceId=t},expression:"choiceDatasourceId"}},e._l(e.datasourceOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-menu",{staticClass:"el-menu-vertical",staticStyle:{height:"auto"},attrs:{router:!0}},[a("el-menu-item",{attrs:{index:"/data/datasourceManage"}},[a("i",{staticClass:"el-icon-coin"}),e._v("数据源管理")]),a("el-menu-item",{attrs:{index:"/data/executor"}},[a("i",{staticClass:"el-icon-video-play"}),e._v("SQL执行器")]),a("el-submenu",{attrs:{index:"1"}},[a("template",{slot:"title"},[a("i",{staticClass:"el-icon-s-platform"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v("管理工具")])]),a("el-menu-item",{attrs:{index:"/data/export"}},[a("i",{staticClass:"el-icon-finished"}),e._v("数据库表导出")]),a("el-menu-item",{attrs:{index:"/data/transferData"}},[a("i",{staticClass:"el-icon-document-copy"}),e._v("数据互导工具")])],2)],1),a("el-tree",{directives:[{name:"loading",rawName:"v-loading",value:e.databaseListLoading,expression:"databaseListLoading"}],ref:"databaseTree",staticClass:"database-list-tree",attrs:{props:e.defaultProps,data:e.databaseList,"highlight-current":"","empty-text":"","default-expanded-keys":e.databaseExpandedKeys,"node-key":"id","element-loading-text":"数据库信息加载中"},on:{"node-click":e.handleNodeClick,"node-expand":e.handleNodeExpand},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.node,n=t.data;return a("div",{},[n.needLoad?a("span",[a("i",{staticClass:"el-icon-loading"})]):a("span",[e._v(" "+e._s(o.label)+" "),n.comment?a("el-tooltip",{attrs:{effect:"dark",content:n.comment,placement:"top-start","open-delay":600}},[a("span",{staticStyle:{color:"#aaa"}},[e._v("-"+e._s(n.comment))])]):e._e(),1==n.type?a("el-dropdown",{on:{command:e.databaseActionDropdown}},[a("i",{staticClass:"el-icon-more",on:{click:function(e){e.stopPropagation()}}}),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{icon:"el-icon-coin",command:{command:"procedure",node:o}}},[e._v("函数管理")]),a("el-dropdown-item",{attrs:{icon:"el-icon-refresh",command:{command:"refresh",node:o}}},[e._v("刷新")]),a("el-dropdown-item",{attrs:{icon:"el-icon-download",command:{command:"download",node:o}}},[e._v("数据导出")])],1)],1):e._e()],1)])}}])})],1)]),a("div",{ref:"rightResize",staticClass:"right-resize"},[a("i",{ref:"rightResizeBar"},[e._v("...")])]),a("el-container",[a("el-header",[a("span",{staticClass:"header-right-user-name"},[e._v(e._s(e.userSelfInfo.userName))]),a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.userSettingDropdown}},[a("i",{staticClass:"el-icon-setting",staticStyle:{"margin-right":"15px","font-size":"16px",cursor:"pointer",color:"#fff"}}),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"console"}},[e._v("控制台")]),a("el-dropdown-item",{attrs:{command:"aboutDoc",divided:""}},[e._v("关于")]),a("el-dropdown-item",{attrs:{command:"myInfo"}},[e._v("我的资料")]),a("el-dropdown-item",{attrs:{command:"userSignOut"}},[e._v("退出登录")])],1)],1)],1),a("el-main",{staticStyle:{padding:"0"}},[a("router-view",{on:{initLoadDataList:e.initLoadDataList,loadDatasourceList:e.loadDatasourceList}})],1)],1)],1),a("about-dialog",{ref:"aboutDialog"})],2)}),s=[],l=(a("4de4"),a("7db0"),a("4160"),a("a630"),a("b0c0"),a("d3b7"),a("e25e"),a("6062"),a("3ca3"),a("159b"),a("ddb0"),a("4328")),c=a.n(l),u=a("bc3a"),d=a.n(u),h=d.a.create({baseURL:"./",timeout:6e4,headers:{"Content-type":"application/x-www-form-urlencoded"},withCredentials:!0}),p={"/zyplayer-doc-db/executor/execute":!0,"/zyplayer-doc-db/datasource/test":!0};h.interceptors.request.use((function(e){return e.needValidateResult=!0,p[e.url]&&(e.needValidateResult=!1),e}),(function(e){return console.log(e),Promise.reject(e)})),h.interceptors.response.use((function(e){if(e.message)Ba.$message.error("请求错误:"+e.message);else{if(!e.config.needValidateResult||200==e.data.errCode)return e.data;if(400==e.data.errCode){Ba.$message.error("请先登录");var t=encodeURIComponent(window.location.href);window.location="./#/user/login?redirect="+t}else 402==e.data.errCode?Ba.$router.push("/common/noAuth"):200!==e.data.errCode&&Ba.$message.error(e.data.errMsg||"未知错误")}return Promise.reject("请求错误")}),(function(e){return console.log("err"+e),Ba.$message.info("请求错误:"+e.message),Promise.reject(e)}));var m=h,f={userLogin:function(e){return m({url:"/login",method:"post",data:c.a.stringify(e)})},userLogout:function(){return m({url:"/logout",method:"post",data:c.a.stringify({})})},getSelfUserInfo:function(){return m({url:"/user/info/selfInfo",method:"post",data:c.a.stringify({})})},getUserBaseInfo:function(e){return m({url:"/zyplayer-doc-wiki/common/user/base",method:"post",data:c.a.stringify(e)})}},b={queryTestDatasource:function(e){return m({url:"/zyplayer-doc-db/datasource/test",method:"post",data:c.a.stringify(e)})},queryTableDdl:function(e){return m({url:"/zyplayer-doc-db/doc-db/getTableDdl",method:"post",data:c.a.stringify(e)})},getSourceBaseInfo:function(e){return m({url:"/zyplayer-doc-db/doc-db/getSourceBaseInfo",method:"post",data:c.a.stringify(e)})},datasourceList:function(e){return m({url:"/zyplayer-doc-db/doc-db/getDataSourceList",method:"post",data:c.a.stringify(e)})},databaseList:function(e){return m({url:"/zyplayer-doc-db/doc-db/getDatabaseList",method:"post",data:c.a.stringify(e)})},tableList:function(e){return m({url:"/zyplayer-doc-db/doc-db/getTableList",method:"post",data:c.a.stringify(e)})},tableColumnList:function(e){return m({url:"/zyplayer-doc-db/doc-db/getTableColumnList",method:"post",data:c.a.stringify(e)})},tableStatus:function(e){return m({url:"/zyplayer-doc-db/doc-db/getTableStatus",method:"post",data:c.a.stringify(e)})},tableAndColumnBySearch:function(e){return m({url:"/zyplayer-doc-db/doc-db/getTableAndColumnBySearch",method:"post",data:c.a.stringify(e)})},updateTableDesc:function(e){return m({url:"/zyplayer-doc-db/doc-db/updateTableDesc",method:"post",data:c.a.stringify(e)})},updateTableColumnDesc:function(e){return m({url:"/zyplayer-doc-db/doc-db/updateTableColumnDesc",method:"post",data:c.a.stringify(e)})},manageDatasourceList:function(e){return m({url:"/zyplayer-doc-db/datasource/list",method:"post",data:c.a.stringify(e)})},manageDatasourceGroupList:function(e){return m({url:"/zyplayer-doc-db/datasource/groups",method:"post",data:c.a.stringify(e)})},manageUpdateDatasource:function(e){return m({url:"/zyplayer-doc-db/datasource/update",method:"post",data:c.a.stringify(e)})},queryExecuteSql:function(e){return m({url:"/zyplayer-doc-db/executor/execute",method:"post",data:c.a.stringify(e)})},executeSqlCancel:function(e){return m({url:"/zyplayer-doc-db/executor/cancel",method:"post",data:c.a.stringify(e)})},updateFavorite:function(e){return m({url:"/zyplayer-doc-db/executor/favorite/add",method:"post",data:c.a.stringify(e)})},favoriteList:function(e){return m({url:"/zyplayer-doc-db/executor/favorite/list",method:"post",data:c.a.stringify(e)})},historyList:function(e){return m({url:"/zyplayer-doc-db/executor/history/list",method:"post",data:c.a.stringify(e)})},transferStart:function(e){return m({url:"/zyplayer-doc-db/transfer/start",method:"post",data:c.a.stringify(e)})},transferCancel:function(e){return m({url:"/zyplayer-doc-db/transfer/cancel",method:"post",data:c.a.stringify(e)})},transferList:function(e){return m({url:"/zyplayer-doc-db/transfer/list",method:"post",data:c.a.stringify(e)})},transferDetail:function(e){return m({url:"/zyplayer-doc-db/transfer/detail",method:"post",data:c.a.stringify(e)})},transferUpdate:function(e){return m({url:"/zyplayer-doc-db/transfer/update",method:"post",data:c.a.stringify(e)})},transferSqlColumns:function(e){return m({url:"/zyplayer-doc-db/transfer/sqlColumns",method:"post",data:c.a.stringify(e)})},assignDbUserAuth:function(e){return m({url:"/zyplayer-doc-db/auth/assign",method:"post",data:c.a.stringify(e)})},dbUserAuthList:function(e){return m({url:"/zyplayer-doc-db/auth/list",method:"post",data:c.a.stringify(e)})},procedureList:function(e){return m({url:"/zyplayer-doc-db/procedure/list",method:"post",data:c.a.stringify(e)})},deleteProcedure:function(e){return m({url:"/zyplayer-doc-db/procedure/delete",method:"post",data:c.a.stringify(e)})},procedureDetail:function(e){return m({url:"/zyplayer-doc-db/procedure/detail",method:"post",data:c.a.stringify(e)})},saveProcedure:function(e){return m({url:"/zyplayer-doc-db/procedure/save",method:"post",data:c.a.stringify(e)})},procedureLogList:function(e){return m({url:"/zyplayer-doc-db/procedure/log/list",method:"post",data:c.a.stringify(e)})},procedureLogDetail:function(e){return m({url:"/zyplayer-doc-db/procedure/log/detail",method:"post",data:c.a.stringify(e)})},dataViewQuery:function(e){return m({url:"/zyplayer-doc-db/data-view/query",method:"post",data:c.a.stringify(e)})},updateTableColumnRelation:function(e){return m({url:"/zyplayer-doc-db/table-relation/update",method:"post",data:c.a.stringify(e)})},getTableColumnRelation:function(e){return m({url:"/zyplayer-doc-db/table-relation/getRelation",method:"post",data:c.a.stringify(e)})},deleteTableLineData:function(e){return m({url:"/zyplayer-doc-db/data-view/deleteTableLineData",method:"post",data:c.a.stringify(e)})}},g=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:"关于",visible:e.aboutDialogVisible,width:"600px","custom-class":"about-zyplayer-doc"},on:{"update:visible":function(t){e.aboutDialogVisible=t}}},[a("div",{},[a("div",{staticStyle:{"font-weight":"bold","font-size":"25px"}},[e._v("zyplayer-doc")]),a("div",{staticStyle:{"line-height":"30px",padding:"10px 0"}},[a("div",[e._v("版本 "+e._s(e.upgradeInfo.nowVersion||"1.0.0"))]),a("div",[e._v("版权所有 © 2018-2021 "),a("a",{attrs:{target:"_blank",href:"http://doc.zyplayer.com"}},[e._v("doc.zyplayer.com")])])]),a("el-tabs",{attrs:{type:"border-card"}},[a("el-tab-pane",{attrs:{label:"支持"}},[a("div",{staticStyle:{"line-height":"30px"}},[a("div",[e._v("文档:"),a("a",{attrs:{target:"_blank",href:"http://doc.zyplayer.com/zyplayer-doc-manage/doc-wiki#/page/share/view?pageId=1&space=23f3f59a60824d21af9f7c3bbc9bc3cb"}},[e._v("http://doc.zyplayer.com")])]),a("div",[e._v("主页:"),a("a",{attrs:{target:"_blank",href:"https://gitee.com/zyplayer/zyplayer-doc"}},[e._v("https://gitee.com/zyplayer/zyplayer-doc")])]),a("div",[e._v("反馈:"),a("a",{attrs:{target:"_blank",href:"https://gitee.com/zyplayer/zyplayer-doc/issues"}},[e._v("https://gitee.com/zyplayer/zyplayer-doc/issues")])]),a("div",[e._v("特性关注&技术交流QQ群:466363173")]),a("el-divider",{attrs:{"content-position":"left"}},[e._v("UI/设计/开发/测试")]),a("div",[a("a",{attrs:{target:"_blank",href:"http://zyplayer.com"}},[e._v("暮光:城中城")])])],1)]),a("el-tab-pane",{attrs:{label:"开源软件"}},[a("div",{staticStyle:{"line-height":"30px"}},[a("div",[e._v("此项目基于以下开源软件构建")]),a("el-divider",{attrs:{"content-position":"left"}},[e._v("后端")]),a("div",[a("a",{attrs:{target:"_blank",href:"https://spring.io/projects/spring-boot"}},[e._v("Spring-Boot")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"http://www.mybatis.org"}},[e._v("MyBatis")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"https://github.com/alibaba/druid"}},[e._v("Druid")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"https://mp.baomidou.com"}},[e._v("MyBatis-Plus")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"https://www.hutool.cn"}},[e._v("Hutool")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"https://github.com/alibaba/fastjson"}},[e._v("Fastjson")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"https://alibaba-easyexcel.github.io"}},[e._v("Easy Excel")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"https://swagger.io"}},[e._v("Swagger")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"https://dubbo.io"}},[e._v("Dubbo")]),e._v("、 "),a("a",{attrs:{target:"_blank",href:"http://www.eclipse.org/jgit"}},[e._v("JGit")]),e._v("、... ")]),a("el-divider",{attrs:{"content-position":"left"}},[e._v("前端")]),e._v(" Vue、element-ui、wangeditor、mavon-editor、qrcodejs2、vant、vue-router、axios、vue-hljs、brace、echarts、sql-formatter、vue-clipboard2、... "),a("div")],1)]),e.upgradeInfo.lastVersion?a("el-tab-pane",{attrs:{label:"软件更新"}},[a("span",{attrs:{slot:"label"},slot:"label"},[e._v(" 软件更新 "),a("sup",{staticClass:"el-badge__content el-badge__content--undefined is-fixed is-dot",staticStyle:{top:"10px",right:"20px"}})]),a("div",{staticStyle:{"line-height":"30px"}},[a("div",[e._v("当前版本:"+e._s(e.upgradeInfo.nowVersion))]),a("div",[e._v("最新版本:"+e._s(e.upgradeInfo.lastVersion))]),a("div",[e._v("升级地址:"),a("a",{attrs:{target:"_blank",href:e.upgradeInfo.upgradeUrl}},[e._v(e._s(e.upgradeInfo.upgradeUrl))])]),a("div",[e._v("升级内容:")]),a("pre",{staticStyle:{margin:"0","max-height":"250px",overflow:"auto"}},[e._v(e._s(e.upgradeInfo.upgradeContent))])])]):e._e()],1)],1)])},v=[],y={systemUpgradeInfo:function(e){return m({url:"/system/info/upgrade",method:"post",data:c.a.stringify(e)})}},w={data:function(){return{aboutDialogVisible:!1,upgradeInfo:{}}},mounted:function(){this.checkSystemUpgrade()},methods:{show:function(){this.aboutDialogVisible=!0},checkSystemUpgrade:function(){var e=this;y.systemUpgradeInfo({}).then((function(t){t.data&&(e.upgradeInfo=t.data,e.upgradeInfo.upgradeContent&&(e.upgradeInfo.upgradeContent=e.upgradeInfo.upgradeContent.replaceAll(";","\n")),console.log("zyplayer-doc发现新版本:\n升级地址:"+t.data.upgradeUrl+"\n当前版本:"+t.data.nowVersion+"\n最新版本:"+t.data.lastVersion+"\n升级内容:"+t.data.upgradeContent))}))}}},x=w,C=(a("1cc7"),a("2877")),S=Object(C["a"])(x,g,v,!1,null,null,null),D=S.exports,_={data:function(){return{isCollapse:!1,userSelfInfo:{},datasourceOptions:[],datasourceList:[],datasourceGroupList:[],choiceDatasourceId:"",choiceDatasourceGroup:"",defaultProps:{children:"children",label:"name"},databaseList:[],databaseListLoading:!1,databaseExpandedKeys:[],rightAsideWidth:300}},computed:{fullscreen:function(){return this.$store.state.global.fullscreen}},components:{"about-dialog":D},mounted:function(){this.getSelfUserInfo(),this.loadDatasourceList(),this.dragChangeRightAsideWidth()},methods:{userSettingDropdown:function(e){console.log("command:"+e),"userSignOut"==e?this.userSignOut():"aboutDoc"==e?this.$refs.aboutDialog.show():"myInfo"==e?this.$router.push({path:"/user/myInfo"}):"console"==e?window.open("./","_blank"):this.$message.warning("功能暂未开放")},userSignOut:function(){f.userLogout().then((function(){location.reload()}))},getSelfUserInfo:function(){var e=this;f.getSelfUserInfo().then((function(t){e.userSelfInfo=t.data}))},sourceGroupChangeEvents:function(){var e=this,t=[];this.datasourceList.forEach((function(a){e.choiceDatasourceGroup&&e.choiceDatasourceGroup!=a.groupName||t.push({label:a.name,value:a.id})})),this.datasourceOptions=t,this.choiceDatasourceId="",this.databaseList=[]},datasourceChangeEvents:function(){var e=this,t=this.datasourceList.find((function(t){return t.id==e.choiceDatasourceId}));this.loadDatabaseList(this.choiceDatasourceId,t.name)},handleNodeClick:function(e){console.log("点击节点:",e),1==e.type?(this.nowClickPath={sourceId:this.choiceDatasourceId,host:e.host,dbName:e.dbName,tableName:e.tableName},this.$router.push({path:"/table/database",query:this.nowClickPath})):2==e.type&&(this.nowClickPath={sourceId:this.choiceDatasourceId,host:e.host,dbName:e.dbName,tableName:e.tableName},this.$router.push({path:"/table/info",query:this.nowClickPath}))},handleNodeExpand:function(e){e.children.length>0&&e.children[0].needLoad&&(console.log("加载节点:",e),1==e.type&&this.loadGetTableList(e))},databaseActionDropdown:function(e){if("refresh"==e.command)e.node.loading=!0,e.node.data.children=[],this.loadGetTableList(e.node.data,(function(){setTimeout((function(){return e.node.loading=!1}),500)}));else if("procedure"==e.command){var t=e.node.data,a={sourceId:this.choiceDatasourceId,dbName:t.dbName,host:t.host};this.$router.push({path:"/procedure/list",query:a})}else if("download"==e.command){var o=e.node.data,n={sourceId:this.choiceDatasourceId,dbName:o.dbName};this.$router.push({path:"/data/export",query:n})}else this.$message.warning("暂未支持的选项")},loadGetTableList:function(e,t){b.tableList({sourceId:this.choiceDatasourceId,dbName:e.dbName}).then((function(a){for(var o=[],n=a.data||[],r=0;r<n.length;r++){var i={id:e.host+"_"+e.dbName+"_"+n[r].tableName,host:e.host,dbName:e.dbName,tableName:n[r].tableName,name:n[r].tableName,type:2,comment:n[r].tableComment};o.push(i)}e.children=o,"function"==typeof t&&t(o)}))},loadDatasourceList:function(){var e=this;b.datasourceList({}).then((function(t){if(e.datasourceList=t.data||[],!(e.datasourceList.length<=0)){var a=[];e.datasourceList.forEach((function(e){return a.push({label:e.name,value:e.id})})),e.datasourceOptions=a;var o=[];e.datasourceList.filter((function(e){return!!e.groupName})).forEach((function(e){return o.push(e.groupName)})),e.datasourceGroupList=Array.from(new Set(o))}}))},loadDatabaseList:function(e,t){var a=this;return new Promise((function(o,n){a.databaseList=[],a.databaseListLoading=!0,b.databaseList({sourceId:e}).then((function(e){a.databaseListLoading=!1;for(var n=e.data||[],r=[],i=[],s=0;s<n.length;s++){var l={id:t+"_"+n[s].dbName,host:t,dbName:n[s].dbName,name:n[s].dbName,type:1,children:[{label:"",needLoad:!0}]};i.push(l)}r.push({id:t,host:t,name:t,children:i}),a.databaseList=r,o()})).catch((function(e){a.choiceDatasourceId="",a.databaseListLoading=!1}))}))},initLoadDataList:function(e){var t=this;this.databaseList.length>0||(this.choiceDatasourceId=parseInt(e.sourceId),this.loadDatabaseList(e.sourceId,e.host).then((function(){t.databaseExpandedKeys=[e.host]})))},dragChangeRightAsideWidth:function(){var e=this,t=this.$refs.rightResize,a=this.$refs.rightResizeBar;t.onmousedown=function(o){var n=o.clientX;return t.style.background="#ccc",a.style.background="#aaa",t.left=t.offsetLeft,document.onmousemove=function(t){var a=t.clientX,o=n-a;(o<0&&e.rightAsideWidth<600||o>0&&e.rightAsideWidth>200)&&(n=a,e.rightAsideWidth-=o)},document.onmouseup=function(){t.style.background="#fafafa",a.style.background="#ccc",document.onmousemove=null,document.onmouseup=null},!1}}}},k=_,I=(a("034f"),Object(C["a"])(k,i,s,!1,null,null,null)),L=I.exports,E=a("8c4f"),P=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{padding:"10px"}},[a("div",{staticStyle:{"max-width":"1200px",margin:"20px auto"}},[a("div",{staticStyle:{"text-align":"center"}},[e._v("欢迎使用"),a("span",{on:{dblclick:e.showErGraph}},[e._v('ヾ(๑╹◡╹)ノ"')]),e._v(" - 在左上角选择一个数据源吧~")])])])},N=[],T={data:function(){return{}},mounted:function(){},methods:{showErGraph:function(){}}},O=T,q=Object(C["a"])(O,P,N,!1,null,null,null),$=q.exports,z=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{padding:"10px"}},[a("er-graph")],1)},j=[],A=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"styles.erGraphDemo"},[a("ERGraphDemo")],1)},R=[],F=a("779d"),V=a.n(F),U=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{width:"100%",height:"650px"}},[a("ERGraph",{attrs:{graphData:e.graphData}})],1)},Q=[],B=(a("d81d"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"er-editor-demo-container"},[a("div",{ref:"refContainer",staticStyle:{width:"100%",height:"100%"},attrs:{id:"refContainer"}}),a("div",{ref:"refMinimapContainer",staticClass:"minimap-container",attrs:{id:"refMinimapContainer"}})])}),M=[],G=(a("a4d3"),a("e439"),a("dbb4"),a("b64b"),a("2fa7")),H=(a("f32d"),a("9f12")),J=a("53fe"),W=a("5728"),K=(a("99af"),a("dfdf")),X=a("2ef0"),Y=a.n(X);a("3e2f");function Z(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function ee(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Z(a,!0).forEach((function(t){Object(G["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Z(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var te="vue-shape",ae=function(){function e(t){Object(H["a"])(this,e),this.graph=t.graph,this.nodes=[],this.edges=[]}return Object(J["a"])(e,[{key:"addNodes",value:function(e){var t=this;e.forEach((function(e){t.addNode(e)}))}},{key:"addNode",value:function(e){console.log(e,"nodeData");var t=e.id,a=e.x,o=e.y,n=e.width,r=e.height,i=e.component,s=(e.data,Object(K["a"])(e,["id","x","y","width","height","component","data"])),l=this.graph.addNode(ee({id:t,x:a||0,y:o||0,width:n||100,height:r||60,shape:te,component:i},s));this.nodes.push(l)}},{key:"updateNode",value:function(e,t){Y.a.isEqual(e.data,t.data)||e.setData(t.data)}},{key:"removeNodes",value:function(e){Y.a.size(e)>0&&(this.graph.removeCells(e),this.nodes=Y.a.pullAll(this.nodes,e))}},{key:"removeNode",value:function(e){if(e)if(e instanceof Node)this.removeNodes([e]);else{var t=this.findNodeById(e);t&&this.removeNodes([t])}}},{key:"addEdges",value:function(e){var t=this;e.forEach((function(e){t.addEdge(e)}))}},{key:"addEdge",value:function(e){var t=e.id,a=e.source,o=e.target,n=(e.render,e.data),r=Object(K["a"])(e,["id","source","target","render","data"]),i=Y.a.find(this.nodes,(function(e){return e.id===a})),s=Y.a.find(this.nodes,(function(e){return e.id===o}));if(!a||!o)throw new Error("edge must has source and target!");var l=this.graph.addEdge(ee({id:t||"".concat(a,"-").concat(o),data:n||void 0,source:i,target:s,attrs:{line:{stroke:"#B4BDCF",strokeWidth:1}}},r));this.edges.push(l)}},{key:"updateEdge",value:function(e,t){Y.a.isEqual(e.data,t.data)||e.setData(t.data)}},{key:"removeEdges",value:function(e){this.graph.removeCells(e),this.edges=Y.a.pullAll(this.edges,e)}},{key:"removeEdge",value:function(e){if(e)if(e instanceof W["a"])this.graph.removeCells([e]),this.removeEdges([e]);else{var t=this.findEdgeById(e);t&&this.removeEdges([t])}}},{key:"findNodeById",value:function(e){return this.nodes.find((function(t){return t.id===e}))}},{key:"findEdgeById",value:function(e){return this.edges.find((function(t){return t.id===e}))}}]),e}(),oe=function e(t){var a=this;Object(H["a"])(this,e),Object(G["a"])(this,"registerEvent",(function(e){e&&e.forEach((function(e){switch(e.eventName){case"scale":a.graph.on("scale",(function(t){var a=t.sx,o=(t.sy,t.ox,t.oy,a);e.handler&&e.handler({scale:o})}));break;case"graph:mouseenter":a.graph.on("graph:mouseenter",(function(t){t.e;e.handler&&e.handler()}));break;case"graph:mouseleave":a.graph.on("graph:mouseleave",(function(t){t.e;e.handler&&e.handler()}));break;case"blank:mouseDown":a.graph.on("blank:mousedown",(function(t){t.e;var a=t.x,o=t.y;e.handler&&e.handler({x:a,y:o})}));break;case"blank:mouseUp":a.graph.on("blank:mouseup",(function(t){t.e;var a=t.x,o=t.y;e.handler&&e.handler({x:a,y:o})}));break;case"node:added":a.graph.on("node:added",(function(e){var t=e.node;a.x6BaseGraph.bringNodesToFront([t])}));break;case"node:removed":a.graph.on("node:removed",(function(e){e.node}));break;case"edge:added":a.graph.on("edge:added",(function(e){e.edge}));break;case"edge:removed":a.graph.on("edge:removed",(function(e){e.edge;a.isDeleteX6DefaultEdge}));break;case"node:mousedown":a.graph.on("node:mousedown",(function(t){t.e;var a=t.view,o=t.x,n=t.y;e.handler&&e.handler({node:a.cell,x:o,y:n})}));break;case"node:mousemove":a.graph.on("node:mousemove",(function(t){t.e;var a=t.view,o=t.x,n=t.y;e.handler&&e.handler({node:a.cell,x:o,y:n})}));break;case"node:mouseup":a.graph.on("node:mouseup",(function(t){t.e;var a=t.view,o=t.x,n=t.y;e.handler&&e.handler({node:a.cell,x:o,y:n})}));break;case"node:click":a.graph.on("node:click",(function(t){var a=t.view;e.handler&&e.handler({node:a.cell})}));break;case"node:dbclick":a.graph.on("node:dblclick",(function(t){var a=t.view;e.handler&&e.handler({node:a.cell})}));break;case"edge:connected":a.graph.on("edge:connected",(function(e){e.edge}));break;case"selection:changed":a.graph.on("selection:changed",(function(t){var o=t.selected,n=t.removed,r=t.added;e.handler&&e.handler({selected:o,removed:n,added:r}),a.x6BaseGraph.bringCellsToFront(o)}));break;default:break}}))})),this.x6BaseGraph=t,this.graph=t.graph};function ne(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function re(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ne(a,!0).forEach((function(t){Object(G["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ne(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var ie=function(){function e(t){Object(H["a"])(this,e);var a=this.getDefaultCfg();this.graph=new W["c"](re({},a,{},t)),this.init()}return Object(J["a"])(e,[{key:"init",value:function(){this.cellController=new ae(this),this.eventController=new oe(this)}},{key:"getDefaultCfg",value:function(){var e={scroller:{enabled:!0,pageVisible:!1,pageBreak:!1,pannable:!0},grid:{visible:!0,size:20,type:"doubleMesh",args:[{color:"#888",thickness:1}]},connecting:{connector:{name:"rounded"},router:{name:"er",args:{direction:"H"}}},snapline:{enabled:!0},keyboard:{enabled:!0},clipboard:{enabled:!0}};return e}},{key:"updateGraph",value:function(e){var t=this;if(!e)throw new Error("graphData must be defined first!");var a=this.graphContentDiff(e),o=a.addNodesData,n=a.addEdgesData;this.graph.batchUpdate("updateGraph",(function(){o&&o.length>0&&t.cellController.addNodes(o),n&&n.length>0&&t.cellController.addEdges(n)}))}},{key:"zoomGraph",value:function(e){"number"===typeof e?this.graph.zoom(e):"fit"===e?this.graph.zoomToFit({padding:12}):e&&(this.graph.scale(1),this.graph.centerContent())}},{key:"focusNodeToGraphCenter",value:function(e){if(e instanceof Node)this.graph.centerCell(e);else{var t=this.cellController.findNodeById(e);t&&this.graph.centerCell(t)}}},{key:"bringNodesToFront",value:function(e){e.forEach((function(e){e.toBack()}))}},{key:"bringNodesToBack",value:function(e){e.forEach((function(e){e.toBack()}))}},{key:"clearGraph",value:function(){}},{key:"registerEvent",value:function(e){this.eventController.registerEvent(e)}},{key:"graphContentDiff",value:function(e){var t=this,a=e.nodes,o=e.edges,n=[];a.forEach((function(e){var a=t.cellController.findNodeById(e.id);a||n.push(e)}));var r=[],i=[],s=[];this.cellController.nodes.forEach((function(e){var o=a.find((function(t){return t.id===e.id}));o?Y.a.isEqual(e.data,o.data)?r.push(e):(i.push(e),t.cellController.updateNode(e,o)):s.push(e)}));var l=[];o.forEach((function(e){if(e.id){var a=t.cellController.findEdgeById(e.id);a||l.push(e)}}));var c=[],u=[],d=[];return this.cellController.edges.forEach((function(e){var a=o.find((function(t){return t.id===e.id}));a?Y.a.isEqual(e.data,a.data)?c.push(e):(u.push(e),t.cellController.updateEdge(e,a)):d.push(e)})),this.cellController.removeNodes(s),this.cellController.removeEdges(d),{addNodesData:n,addEdgesData:l}}}]),e}();function se(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function le(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?se(a,!0).forEach((function(t){Object(G["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):se(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var ce={name:"index",components:{},props:{graphOptions:{type:Object,default:null,required:!1},graphData:{type:Object,default:null,required:!1}},data:function(){return{baseGraph:null}},mounted:function(){var e=this,t=this;setTimeout((function(){e.baseGraph=new ie(le({},e.graphOptions,{container:document.getElementById("refContainer"),grid:{visible:!1},minimap:{enabled:!0,container:document.getElementById("refMinimapContainer"),minScale:.5,maxScale:2}})),e.baseGraph.updateGraph(t.graphData)}),100)},methods:{onHandleToolbar:function(e){switch(e){case"in":console.log("in"),this.baseGraph.zoomGraph(.1);break;case"out":console.log("out"),this.baseGraph.zoomGraph(-.1);break;case"fit":console.log("fit"),this.baseGraph.zoomGraph("fit");break;case"real":console.log("real"),this.baseGraph.zoomGraph("real");break;default:}}}},ue=ce,de=Object(C["a"])(ue,B,M,!1,null,"242cc352",null),he=de.exports,pe=[{propertyId:"propertyId1",name:"业务日期",propertyType:"string",isPK:!0},{propertyId:"propertyId2",name:"交易号1",propertyType:"bigint",isFK:!0},{propertyId:"propertyId3",name:"最长显示的表单名最长显示的表单名",propertyType:"string"},{propertyId:"propertyId4",name:"交易支付外键",propertyType:"string"},{propertyId:"propertyId5",name:"卖家支付日期",propertyType:"string"},{propertyId:"propertyId6",name:"网商银行",propertyType:"string"},{propertyId:"propertyId7",name:"业务日期",propertyType:"string"},{propertyId:"propertyId8",name:"业务日期111",propertyType:"string"},{propertyId:"propertyId9",name:"业务日期222",propertyType:"string"},{propertyId:"propertyId10",name:"业务日期333",propertyType:"string"}],me=[{entityId:"fact_1",name:"事实表",entityType:"FACT",properties:pe,x:550,y:400,width:214,height:248},{entityId:"fact_up",name:"事实表",entityType:"FACT",properties:pe,x:100,y:100,width:214,height:248},{entityId:"dim_up",name:"维度表",entityType:"DIM",properties:pe,x:100,y:400,width:214,height:248},{entityId:"other_up",name:"其他表",entityType:"OTHER",properties:pe,x:100,y:700,width:214,height:248},{entityId:"other_down",name:"其他表",entityType:"OTHER",properties:pe,x:900,y:0,width:214,height:248},{entityId:"fact_down1",name:"事实表",entityType:"FACT",properties:pe,x:900,y:280,width:214,height:248},{entityId:"dim_down",name:"维度表",entityType:"DIM",properties:pe,x:900,y:580,width:214,height:248},{entityId:"fact_down2",name:"事实表",entityType:"FACT",properties:pe,x:900,y:860,width:214,height:248}],fe=[{relationId:"relationId_1",sourceEntityId:"fact_up",targetEntityId:"fact_1"},{relationId:"relationId_2",sourceEntityId:"fact_1",targetEntityId:"fact_up"},{relationId:"relationId_1_loop",sourceEntityId:"fact_1",targetEntityId:"fact_1"},{relationId:"relationId_2",sourceEntityId:"dim_up",targetEntityId:"fact_1"},{relationId:"relationId_3",sourceEntityId:"other_up",targetEntityId:"fact_1"},{relationId:"relationId_4",sourceEntityId:"fact_1",targetEntityId:"other_down"},{relationId:"relationId_5",sourceEntityId:"fact_1",targetEntityId:"fact_down1"},{relationId:"relationId_6",sourceEntityId:"fact_1",targetEntityId:"dim_down"},{relationId:"relationId_7",sourceEntityId:"fact_1",targetEntityId:"fact_down2"}],be=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"entity-container fact"},[a("div",{staticClass:"content other"},[a("div",{staticClass:"head"},[a("div",[a("a-icon",{staticClass:"type",attrs:{type:"bars"}}),a("span",[e._v(e._s(e.entity.name))])],1),a("a-icon",{staticClass:"more",attrs:{type:"ellipsis"}})],1),a("div",{staticClass:"body"},e._l(e.entity.properties,(function(t,o){return a("div",{key:o,staticClass:"body-item"},[a("div",{staticClass:"name"},[e._v(" "+e._s(t.name)+" ")]),a("div",{staticClass:"type"},[e._v(e._s(t.propertyType))])])})),0)])])},ge=[],ve=(a("8f64"),{name:"Entity",props:{entity:{type:Object,default:null,required:!0}},mounted:function(){console.log(this.entity,"this.entity")}}),ye=ve,we=Object(C["a"])(ye,be,ge,!1,null,"56858def",null),xe=we.exports,Ce={name:"index",components:{ERGraph:he},data:function(){return{graphData:{nodes:"",edges:""}}},mounted:function(){this.calRenderData()},methods:{calRenderData:function(){this.graphData.nodes=me.map((function(e){var t=e.entityId,a=e.x,o=e.y,n=e.width,r=e.height;return{x:a,y:o,width:n,height:r,id:t,component:{template:'<Entity :entity="entity"/>',data:function(){return{entity:e}},components:{Entity:xe}}}})),this.graphData.edges=fe.map((function(e){var t=e.relationId,a=e.sourceEntityId,o=e.targetEntityId;return{id:t,source:a,target:o,label:"1:N",data:e}}))}}},Se=Ce,De=Object(C["a"])(Se,U,Q,!1,null,"29ea1468",null),_e=De.exports,ke={name:"index",components:{ERGraphDemo:_e},data:function(){return{visible:!1,graph:"",styles:V.a}},mounted:function(){},methods:{showDrawer:function(){this.visible=!0},onClose:function(){this.visible=!1}}},Ie=ke,Le=Object(C["a"])(Ie,A,R,!1,null,"1e71010a",null),Ee=Le.exports,Pe={data:function(){return{}},components:{erGraph:Ee},mounted:function(){},methods:{}},Ne=Pe,Te=Object(C["a"])(Ne,z,j,!1,null,null,null),Oe=(Te.exports,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{"padding-top":"50px"}},[a("el-form",{ref:"loginParam",staticClass:"demo-ruleForm login-container",attrs:{model:e.loginParam,rules:e.loginRules,"label-position":"left","label-width":"0px"}},[a("h3",{staticClass:"title"},[e._v("系统登录")]),a("el-form-item",{attrs:{prop:"username"}},[a("el-input",{attrs:{type:"text","auto-complete":"off",placeholder:"账号"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.loginSubmit(t)}},model:{value:e.loginParam.username,callback:function(t){e.$set(e.loginParam,"username",t)},expression:"loginParam.username"}})],1),a("el-form-item",{attrs:{prop:"password"}},[a("el-input",{attrs:{type:"password","auto-complete":"off",placeholder:"密码"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.loginSubmit(t)}},model:{value:e.loginParam.password,callback:function(t){e.$set(e.loginParam,"password",t)},expression:"loginParam.password"}})],1),a("el-form-item",{staticStyle:{width:"100%"}},[a("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary",loading:e.logining},nativeOn:{click:function(t){return t.preventDefault(),e.loginSubmit(t)}}},[e._v("登录")])],1)],1)],1)}),qe=[],$e={data:function(){return{logining:!1,redirect:"",loginParam:{username:"",password:""},loginRules:{username:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},checked:!0}},mounted:function(){this.redirect=this.$route.query.redirect},methods:{loginSubmit:function(){var e=this;this.$refs.loginParam.validate((function(t){t&&f.userLogin(e.loginParam).then((function(){e.redirect?location.href=decodeURIComponent(e.redirect):e.$router.back()}))}))}}},ze=$e,je=(a("9231"),Object(C["a"])(ze,Oe,qe,!1,null,null,null)),Ae=je.exports,Re=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"my-info-vue"},[a("div",{staticStyle:{margin:"0 auto","max-width":"1000px"}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e._v("我的信息")]),a("el-form",{staticClass:"search-form-box",attrs:{"label-width":"100px"}},[a("el-form-item",{attrs:{label:"账号:"}},[e._v(e._s(e.userInfo.userNo))]),a("el-form-item",{attrs:{label:"用户名:"}},[e._v(e._s(e.userInfo.userName))]),a("el-form-item",{attrs:{label:"手机号:"}},[e._v(e._s(e.userInfo.phone))]),a("el-form-item",{attrs:{label:"邮箱:"}},[e._v(e._s(e.userInfo.email))]),a("el-form-item",{attrs:{label:"状态:"}},[e._v(e._s(0==e.userInfo.delFlag?"正常":"停用"))]),a("el-form-item",{attrs:{label:"性别:"}},[e._v(e._s(0==e.userInfo.sex?"女":"男"))])],1)],1)],1)])},Fe=[],Ve={data:function(){return{userInfo:{}}},mounted:function(){this.getUserInfo()},methods:{getUserInfo:function(){var e=this;f.getSelfUserInfo().then((function(t){e.userInfo=t.data}))}}},Ue=Ve,Qe=(a("dcfc"),Object(C["a"])(Ue,Re,Fe,!1,null,null,null)),Be=Qe.exports,Me=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("router-view")},Ge=[],He={},Je=Object(C["a"])(He,Me,Ge,!1,null,null,null),We=Je.exports,Ke=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-tabs",{staticStyle:{padding:"5px 10px 0"},attrs:{type:"card",closable:""},on:{"tab-click":e.changePage,"tab-remove":e.removePageTab},model:{value:e.activePage,callback:function(t){e.activePage=t},expression:"activePage"}},e._l(e.pageList,(function(t){return a("el-tab-pane",{key:t.fullPath,attrs:{label:e.pageTabNameMap[t.fullPath]||t.name,name:e.getRouteRealPath(t),fullPath:t.fullPath}})})),1),a("keep-alive",[a("router-view",{key:e.$route.fullPath,on:{initLoadDataList:e.initLoadDataList,loadDatasourceList:e.loadDatasourceList}})],1)],1)},Xe=[],Ye=(a("c975"),{name:"PageTableView",components:{},data:function(){return{pageList:[],linkList:[],activePage:"",multiPage:!0,ignoreParamPath:["/data/export"]}},computed:{pageTabNameMap:function(){return this.$store.state.global.pageTabNameMap}},created:function(){var e=this.$route,t=e.name,a=e.path,o=e.fullPath;this.pageList.push({name:t,path:a,fullPath:o});var n=this.getRouteRealPath(this.$route);this.linkList.push(n),this.activePage=n,this.$router.push(this.$route.fullPath)},watch:{$route:function(e,t){var a=this,o=this.getRouteRealPath(e);if(this.activePage=o,this.linkList.indexOf(o)<0){this.linkList.push(o);var n=e.name,r=e.path,i=e.fullPath;this.pageList.push({name:n,path:r,fullPath:i})}var s=this.pageList.find((function(e){return a.getRouteRealPath(e)===o}));s.fullPath=e.fullPath}},methods:{initLoadDataList:function(e){this.$emit("initLoadDataList",e)},loadDatasourceList:function(){this.$emit("loadDatasourceList")},isIgnoreParamPath:function(e){return this.ignoreParamPath.indexOf(e)>=0},getRouteRealPath:function(e){return this.isIgnoreParamPath(e.path)?e.path:e.fullPath},changePage:function(e){this.activePage=e.name,this.$router.push(e.$attrs.fullPath)},editPage:function(e,t){this[t](e)},removePageTab:function(e){var t=this;if(1!==this.pageList.length){this.pageList=this.pageList.filter((function(a){return t.getRouteRealPath(a)!==e})),this.linkList=this.linkList.filter((function(t){return t!==e}));var a=this.linkList.indexOf(this.activePage);a<0&&(a=this.linkList.length-1,this.activePage=this.linkList[a],this.$router.push(this.activePage))}else this.$message.warning("这是最后一页,不能再关闭了啦")}}}),Ze=Ye,et=Object(C["a"])(Ze,Ke,Xe,!1,null,"6fc73724",null),tt=et.exports,at=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"table-info-vue"},[a("el-tabs",{on:{"tab-click":e.tabActiveNameChange},model:{value:e.tabActiveName,callback:function(t){e.tabActiveName=t},expression:"tabActiveName"}},[a("el-tab-pane",{attrs:{label:"表字段",name:"columns"}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.columnListLoading,expression:"columnListLoading"}]},[a("el-row",{staticClass:"row-bg",staticStyle:{"margin-bottom":"10px"},attrs:{type:"flex",justify:"space-between"}},[a("el-col",{staticStyle:{color:"#606266","line-height":"40px"}},[a("span",[e._v("表名:"+e._s(e.tableStatusInfo.name))]),a("span",{staticStyle:{"margin-left":"20px"}},[1==e.tableInfo.inEdit?a("span",[a("el-input",{staticStyle:{width:"500px"},attrs:{placeholder:"输入表注释"},on:{blur:e.saveTableDescription},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.saveTableDescription(t)}},model:{value:e.tableInfo.newDesc,callback:function(t){e.$set(e.tableInfo,"newDesc",t)},expression:"tableInfo.newDesc"}})],1):a("span",[e._v(e._s(e.tableInfo.description||"暂无表注释")+" "),a("i",{staticClass:"el-icon-edit edit-table-desc",on:{click:function(t){e.tableInfo.inEdit=1}}})])])]),a("el-col",{staticStyle:{width:"100px","text-align":"right"}},[a("el-button",{staticStyle:{"margin-left":"10px"},attrs:{plain:"",type:"primary",icon:"el-icon-magic-stick"},on:{click:e.showCreateTableDdl}},[e._v("DDL")])],1)],1),a("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.columnList,stripe:"",border:""}},[a("el-table-column",{attrs:{prop:"name",label:"字段名",width:"220"}}),a("el-table-column",{attrs:{label:"自增",width:"50"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.selfIncrement?"是":"否"))]}}])}),a("el-table-column",{attrs:{prop:"type",label:"类型",width:"110"}}),a("el-table-column",{attrs:{prop:"length",label:"长度",width:"110"}}),a("el-table-column",{attrs:{prop:"numericScale",label:"小数点",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(0==t.row.numericScale?"":t.row.numericScale))]}}])}),a("el-table-column",{attrs:{prop:"nullable",label:"空值",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(1==t.row.nullable?"允许":"不允许"))]}}])}),a("el-table-column",{attrs:{label:"主键",width:"50"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(1==t.row.primaryKey?"是":"否"))]}}])}),a("el-table-column",{scopedSlots:e._u([{key:"header",fn:function(t){return[e._v(" 注释 "),a("el-tooltip",{attrs:{effect:"dark",content:"点击注释列可编辑字段注释",placement:"top"}},[a("i",{staticClass:"el-icon-info",staticStyle:{color:"#999"}})])]}},{key:"default",fn:function(t){return[1==t.row.inEdit?a("div",[a("el-input",{attrs:{placeholder:"输入字段注释"},on:{blur:function(a){return e.saveColumnDescription(t.row)}},nativeOn:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.saveColumnDescription(t.row)}},model:{value:t.row.newDesc,callback:function(a){e.$set(t.row,"newDesc",a)},expression:"scope.row.newDesc"}})],1):a("div",{staticClass:"description",on:{click:function(a){return e.descBoxClick(t.row)}}},[e._v(e._s(t.row.description))])]}}])})],1)],1)]),a("el-tab-pane",{attrs:{label:"表信息",name:"tableInfo"}},[a("el-row",{staticClass:"status-info-row"},[a("el-col",{attrs:{span:24}},[a("span",{staticClass:"label"},[e._v("数据源:")]),e._v(e._s(e.vueQueryParam.host))])],1),a("el-row",{staticClass:"status-info-row"},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("数据库:")]),e._v(e._s(e.vueQueryParam.dbName))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("数据表:")]),e._v(e._s(e.tableStatusInfo.name))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("引擎:")]),e._v(e._s(e.tableStatusInfo.engine))])],1),a("el-row",{staticClass:"status-info-row"},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("行数:")]),e._v(e._s(e.tableStatusInfo.rows||0))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("自动递增:")]),e._v(e._s(e.tableStatusInfo.avgRowLength||0))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("行格式:")]),e._v(e._s(e.tableStatusInfo.rowFormat))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("排序规则:")]),e._v(e._s(e.tableStatusInfo.collation))])],1),a("el-row",{staticClass:"status-info-row"},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("索引长度:")]),e._v(e._s(e.getBytesSize(e.tableStatusInfo.indexLength)))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("数据长度:")]),e._v(e._s(e.getBytesSize(e.tableStatusInfo.dataLength)))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("最大长度:")]),e._v(e._s(e.getBytesSize(e.tableStatusInfo.maxDataLength)))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("可用空间:")]),e._v(e._s(e.getBytesSize(e.tableStatusInfo.dataFree)))])],1),a("el-row",{staticClass:"status-info-row"},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("创建时间:")]),e._v(e._s(e.tableStatusInfo.createTime))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("修改时间:")]),e._v(e._s(e.tableStatusInfo.updateTime))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("检查时间:")]),e._v(e._s(e.tableStatusInfo.checkTime))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("创建选项:")]),e._v(e._s(e.tableStatusInfo.createOptions))])],1),a("el-row",{staticClass:"status-info-row"},[a("el-col",{attrs:{span:24}},[a("span",{staticClass:"label"},[e._v("表注释:")]),1==e.tableInfo.inEdit?a("span",[a("el-input",{staticStyle:{width:"500px"},attrs:{placeholder:"输入表注释"},on:{blur:e.saveTableDescription},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.saveTableDescription(t)}},model:{value:e.tableInfo.newDesc,callback:function(t){e.$set(e.tableInfo,"newDesc",t)},expression:"tableInfo.newDesc"}})],1):a("span",[e._v(e._s(e.tableInfo.description||"暂无注释")+" "),a("i",{staticClass:"el-icon-edit edit-table-desc",on:{click:function(t){e.tableInfo.inEdit=1}}})])])],1)],1),a("el-tab-pane",{attrs:{label:"关系图",name:"relationChart"}},[a("table-relation-charts",{ref:"relationChart"})],1),a("el-tab-pane",{attrs:{label:"表数据",name:"tableData"}},[a("data-preview",{ref:"dataPreview"})],1)],1),a("el-dialog",{attrs:{visible:e.tableDDLInfoDialogVisible,footer:null,width:"760px"},on:{"update:visible":function(t){e.tableDDLInfoDialogVisible=t}}},[a("div",{attrs:{slot:"title"},slot:"title"},[a("span",{staticStyle:{"margin-right":"15px"}},[e._v("DDL")]),a("el-button",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:e.tableDDLInfo[e.tableDDLInfoTab],expression:"tableDDLInfo[tableDDLInfoTab]",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:e.onCopySuccess,expression:"onCopySuccess",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:e.onCopyError,expression:"onCopyError",arg:"error"}],attrs:{size:"small",icon:"el-icon-document-copy"}},[e._v("复制")])],1),a("el-tabs",{model:{value:e.tableDDLInfoTab,callback:function(t){e.tableDDLInfoTab=t},expression:"tableDDLInfoTab"}},[e.tableDDLInfo.mysql?a("el-tab-pane",{attrs:{label:"mysql",name:"mysql"}},[a("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[a("pre",[a("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.mysql)}})])])]):e._e(),e.tableDDLInfo.sqlserver?a("el-tab-pane",{attrs:{label:"sqlserver",name:"sqlserver"}},[a("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[a("pre",[a("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.sqlserver)}})])])]):e._e(),e.tableDDLInfo.oracle?a("el-tab-pane",{attrs:{label:"oracle",name:"oracle"}},[a("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[a("pre",[a("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.oracle)}})])])]):e._e(),e.tableDDLInfo.postgresql?a("el-tab-pane",{attrs:{label:"postgresql",name:"postgresql"}},[a("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[a("pre",[a("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.postgresql)}})])])]):e._e(),e.tableDDLInfo.hive?a("el-tab-pane",{attrs:{label:"hive",name:"hive"}},[a("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[a("pre",[a("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.hive)}})])])]):e._e()],1)],1)],1)},ot=[],nt=(a("e01a"),a("b680"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"data-executor-vue"},[a("div",{staticStyle:{padding:"0 10px 10px",height:"100%","box-sizing":"border-box"}},[a("el-card",{staticStyle:{"margin-bottom":"10px"}},[a("ace-editor",{staticStyle:{"margin-bottom":"10px"},attrs:{lang:"sql",theme:"monokai",width:"100%",height:"60",options:e.sqlEditorConfig,source:e.executorSource},on:{init:e.sqlExecutorInit},model:{value:e.sqlExecutorContent,callback:function(t){e.sqlExecutorContent=t},expression:"sqlExecutorContent"}}),a("div",[e.sqlExecuting?a("el-button",{attrs:{type:"primary",plain:"",size:"small",icon:"el-icon-video-pause"},on:{click:e.cancelExecutorSql}},[e._v("取消执行")]):a("el-tooltip",{attrs:{effect:"dark",content:"Ctrl+R、Ctrl+Enter",placement:"top"}},[a("el-button",{attrs:{type:"primary",plain:"",size:"small",icon:"el-icon-video-play"},on:{click:e.doExecutorClick}},[e._v("筛选")])],1),a("el-button",{attrs:{icon:"el-icon-refresh-left",size:"small"},on:{click:e.refreshData}},[e._v("重置")]),a("el-button",{staticStyle:{"margin-left":"30px"},attrs:{type:"success",size:"small",icon:"el-icon-download",plain:""},on:{click:e.downloadTableData}},[e._v("导出")])],1)],1),a("el-card",[e.executeError?a("div",{staticStyle:{color:"#f00"}},[e._v(e._s(e.executeError))]):e.sqlExecuting?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.sqlExecuting,expression:"sqlExecuting"}],staticStyle:{padding:"20px 0"}},[e._v("数据加载中...")]):e.executeResultList.length<=0?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.sqlExecuting,expression:"sqlExecuting"}],staticStyle:{padding:"20px 0"}},[e._v("暂无数据")]):a("div",{staticStyle:{position:"relative"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:"table0"!==e.executeShowTable,expression:"executeShowTable !== 'table0'"}],staticStyle:{position:"absolute",right:"0","z-index":"1"}},[a("span",{directives:[{name:"show",rawName:"v-show",value:e.choiceResultObj[e.executeShowTable]&&e.choiceResultObj[e.executeShowTable].length>0,expression:"choiceResultObj[executeShowTable] && choiceResultObj[executeShowTable].length > 0"}]},[a("el-button",{staticStyle:{"margin-right":"10px"},attrs:{icon:"el-icon-delete",size:"small",type:"danger",plain:""},on:{click:e.deleteCheckLine}},[e._v("删除")]),a("el-dropdown",{on:{command:e.handleCopyCheckLineCommand}},[a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-document-copy"}},[e._v(" 复制选中行"),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"insert"}},[e._v("SQL Inserts")]),a("el-dropdown-item",{attrs:{command:"update"}},[e._v("SQL Updates")]),a("el-dropdown-item",{attrs:{command:"json"}},[e._v("JSON")])],1)],1)],1),a("el-tooltip",{attrs:{effect:"dark",content:"选择展示列",placement:"top"}},[a("el-button",{staticStyle:{"margin-left":"10px"},attrs:{icon:"el-icon-setting",size:"small"},on:{click:e.choiceShowColumnDrawerShow}})],1)],1),a("el-tabs",{on:{"tab-click":e.executeShowTableClick},model:{value:e.executeShowTable,callback:function(t){e.executeShowTable=t},expression:"executeShowTable"}},[a("el-tab-pane",{attrs:{label:"信息",name:"table0"}},[a("pre",[e._v(e._s(e.executeResultInfo))])]),e._l(e.executeResultList,(function(t){return t.index?a("el-tab-pane",{attrs:{label:"结果"+t.index,name:t.name}},[t.errMsg?a("div",{staticStyle:{color:"#f00"}},[e._v(e._s(t.errMsg))]):t.dataList.length<=0?a("div",{staticStyle:{"text-align":"center",color:"#aaa",padding:"20px 0"}},[e._v("暂无数据")]):[a("el-table",{staticClass:"execute-result-table",staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:t.dataList,stripe:"",border:"","max-height":e.tableMaxHeight,"default-sort":e.tableSort},on:{"selection-change":e.handleSelectionChange,"sort-change":e.tableSortChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{type:"index",width:"50"}}),e._l(t.dataCols,(function(t){return a("el-table-column",{attrs:{sortable:"",prop:t.prop,label:t.prop,width:t.width},scopedSlots:e._u([{key:"header",fn:function(o){return[a("el-tooltip",{attrs:{effect:"dark",content:t.desc,placement:"top"}},[a("span",[e._v(e._s(t.prop))])])]}},{key:"default",fn:function(e){return[a("textarea",{staticClass:"el-textarea__inner",attrs:{readonly:"",rows:"1"},domProps:{value:e.row[t.prop]}})]}}],null,!0)})}))],2),a("el-pagination",{staticStyle:{"margin-top":"10px"},attrs:{"current-page":e.currentPage,"page-sizes":[50,100,300,500],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.tableTotalCount},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentChange}})]],2):e._e()}))],2)],1)])],1),a("el-dialog",{attrs:{visible:e.exportConditionVisible,width:"500px",title:"选择更新语句条件"},on:{"update:visible":function(t){e.exportConditionVisible=t}}},[a("div",[e._v(" 更新条件列: "),a("el-select",{staticStyle:{width:"370px"},attrs:{multiple:"",placeholder:"请选择"},model:{value:e.conditionDataColsChoice,callback:function(t){e.conditionDataColsChoice=t},expression:"conditionDataColsChoice"}},e._l(e.conditionDataCols,(function(e){return a("el-option",{key:e.prop,attrs:{label:e.prop,value:e.prop}})})),1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.exportConditionVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.doCopyCheckLineUpdate}},[e._v("确 定")])],1)]),a("el-dialog",{attrs:{visible:e.downloadDataVisible,width:"600px",title:"表数据导出"},on:{"update:visible":function(t){e.downloadDataVisible=t}}},[a("el-form",{attrs:{"label-width":"120px"}},[a("el-form-item",{attrs:{label:"导出类型:"}},[a("el-select",{staticStyle:{width:"370px"},attrs:{filterable:"",placeholder:"请选择导出类型"},model:{value:e.downloadDataParam.downloadType,callback:function(t){e.$set(e.downloadDataParam,"downloadType",t)},expression:"downloadDataParam.downloadType"}},[a("el-option",{attrs:{label:"SQL Inserts",value:"insert"}}),a("el-option",{attrs:{label:"SQL Updates",value:"update"}}),a("el-option",{attrs:{label:"JSON",value:"json"}}),a("el-option",{attrs:{label:"Excel",value:"excel"}})],1)],1),"insert"===e.downloadDataParam.downloadType?a("el-form-item",{attrs:{label:"数据表:"}},[a("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.dropTableFlagChange},model:{value:e.downloadDataParam.dropTableFlag,callback:function(t){e.$set(e.downloadDataParam,"dropTableFlag",t)},expression:"downloadDataParam.dropTableFlag"}},[e._v("删除表"+e._s(1==e.downloadDataParam.dropTableFlag?"!!":""))]),a("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.createTableFlagChange},model:{value:e.downloadDataParam.createTableFlag,callback:function(t){e.$set(e.downloadDataParam,"createTableFlag",t)},expression:"downloadDataParam.createTableFlag"}},[e._v("创建表")])],1):e._e(),"update"===e.downloadDataParam.downloadType?a("el-form-item",{attrs:{label:"更新条件列:"}},[a("el-select",{staticStyle:{width:"370px"},attrs:{multiple:"",placeholder:"不选则是没有条件的更新"},model:{value:e.downloadDataParam.conditionColumnArr,callback:function(t){e.$set(e.downloadDataParam,"conditionColumnArr",t)},expression:"downloadDataParam.conditionColumnArr"}},e._l(e.conditionDataCols,(function(e){return a("el-option",{key:e.prop,attrs:{label:e.prop,value:e.prop}})})),1)],1):e._e()],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.downloadDataVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.doDownloadTableData}},[e._v("确 定")])],1)],1),a("el-drawer",{attrs:{size:"350px","with-header":!1,visible:e.choiceShowColumnDrawer,"before-close":e.choiceShowColumnDrawerClose,direction:"rtl"},on:{"update:visible":function(t){e.choiceShowColumnDrawer=t}}},[a("div",{staticStyle:{padding:"10px"}},[a("el-row",[a("el-col",{attrs:{span:12}},[e._v("选择展示列")]),a("el-col",{staticStyle:{"text-align":"right"},attrs:{span:12}},[a("el-checkbox",{on:{change:e.choiceShowColumnAllChange},model:{value:e.choiceShowColumnAll,callback:function(t){e.choiceShowColumnAll=t},expression:"choiceShowColumnAll"}},[e._v("全选")]),a("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary",size:"mini"},on:{click:e.choiceShowColumnOk}},[e._v("确定")])],1)],1)],1),a("div",{staticStyle:{overflow:"auto",height:"calc(100vh - 50px)"}},[a("el-tree",{ref:"showColumnTree",attrs:{"node-key":"name",props:e.showColumnProps,data:e.tableDataColumns,"check-on-click-node":"","show-checkbox":""},on:{"check-change":e.tableDataColumnsCheckChange}})],1)]),a("form",{ref:"downloadForm",attrs:{method:"post",action:e.downloadFormParam.url,target:"_blank"}},e._l(e.downloadFormParam.param,(function(e,t){return a("input",{attrs:{type:"hidden",name:t},domProps:{value:e}})})),0),a("span",{staticStyle:{visibility:"hidden","white-space":"nowrap",position:"fixed"},attrs:{id:"widthCalculate"}})],1)}),rt=[],it=(a("a15b"),a("0d03"),{insert:function(e,t,a,o){var n=a?a+".":"";n+=o||"table";var r="",i="";return e.forEach((function(e){i.length>0&&(i+=", "),i+=e.prop})),t.forEach((function(t){var a="";e.forEach((function(e){a.length>0&&(a+=", ");var o=t[e.prop]||"";"number"!==typeof o||isNaN(o)?(o=String(o).replaceAll("'","''"),a+="'"+o+"'"):a+=o})),r+="insert into "+n+" ("+i+") values ("+a+");\n"})),r},update:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,r=o?o+".":"";r+=n||"table";var i="";return t.forEach((function(t){var o="",n="";e.forEach((function(e){var r=t[e.prop]||"";a.indexOf(e.prop)>=0?"number"!==typeof r||isNaN(r)?(n.length>0&&(n+=" and "),n+=e.prop+" = '"+r+"'"):(n.length>0&&(n+=" and "),n+=e.prop+" = "+r):(o.length>0&&(o+=", "),o+=e.prop+"=","number"!==typeof r||isNaN(r)?(r=String(r).replaceAll("'","''"),o+="'"+r+"'"):o+=r)})),n.length>0&&(n=" where "+n),i+="update "+r+" set "+o+n+";\n"})),i},json:function(e,t,a,o){return JSON.stringify(t)}}),st={insert:function(e,t,a,o){var n=a?a+"..":"";n+=o||"table";var r="",i="";return e.forEach((function(e){i.length>0&&(i+=", "),i+=e.prop})),t.forEach((function(t){var a="";e.forEach((function(e){a.length>0&&(a+=", ");var o=t[e.prop]||"";"number"!==typeof o||isNaN(o)?(o=String(o).replaceAll("'","''"),a+="'"+o+"'"):a+=o})),r+="insert into "+n+" ("+i+") values ("+a+");\n"})),r},update:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,r=o?o+"..":"";r+=n||"table";var i="";return t.forEach((function(t){var o="",n="";e.forEach((function(e){var r=t[e.prop]||"";a.indexOf(e.prop)>=0?"number"!==typeof r||isNaN(r)?(n.length>0&&(n+=" and "),n+=e.prop+" = '"+r+"'"):(n.length>0&&(n+=" and "),n+=e.prop+" = "+r):(o.length>0&&(o+=", "),o+=e.prop+"=","number"!==typeof r||isNaN(r)?(r=String(r).replaceAll("'","''"),o+="'"+r+"'"):o+=r)})),n.length>0&&(n=" where "+n),i+="update "+r+" set "+o+n+";\n"})),i},json:function(e,t,a,o){return JSON.stringify(t)}},lt={format:function(e,t,a,o,n,r,i){var s=this.getProduct(t);return"insert"===e?s.insert(a,o,r,i):"update"===e?s.update(a,o,n,r,i):"json"===e?s.json(a,o,r,i):void 0},getProduct:function(e){return"sqlserver"===e?st:it}},ct=a("db05"),ut=a.n(ct),dt=a("061c"),ht=a.n(dt),pt=(a("2099"),a("842f"),a("6e63"),a("818b"),a("b039"),a("14d4"),a("8a79"),a("96cf"),{isInit:!1,source:{},databaseInfo:{},tableInfo:{},columnInfo:{},lastCallbackArr:[],isAutocomplete:!1,change:function(e){var t=this;if(this.source=e,this.lastCallbackArr=[],console.log("change(sourceId):"+JSON.stringify(this.source)),!this.isInit){console.log("change(sourceId),isInit:"+this.isInit),this.isInit=!0;var a=ace.acequire("ace/ext/language_tools");a.addCompleter(this)}if(this.source.sourceId){var o=this.databaseInfo[this.source.sourceId]||[];if(o.length<=0&&b.databaseList({sourceId:this.source.sourceId}).then((function(e){t.databaseInfo[t.source.sourceId]=e.data||[]})),this.source.dbName){var n=this.source.sourceId+"_"+this.source.dbName,r=this.tableInfo[n]||[];r.length<=0&&b.tableList({sourceId:this.source.sourceId,dbName:this.source.dbName}).then((function(e){t.tableInfo[n]=e.data||[]}))}if(this.source.tableName){var i=this.source.sourceId+"_"+this.source.dbName+"_"+this.source.tableName,s=this.columnInfo[i]||[];s.length<=0&&b.tableColumnList({sourceId:this.source.sourceId,dbName:this.source.dbName,tableName:this.source.tableName}).then((function(e){t.columnInfo[i]=e.data.columnList||[]}))}}},startAutocomplete:function(e){this.isAutocomplete=!0,e.execCommand("startAutocomplete")},getCompletions:function(e,t,a,o,n){var r,i,s;return regeneratorRuntime.async((function(e){while(1)switch(e.prev=e.next){case 0:if(r=[],i=this.isAutocomplete?a.column:a.column-1,s=t.getLine(a.row).substring(0,i),this.isAutocomplete=!1,console.log("Executor.vue getCompletions,sourceId:"+JSON.stringify(this.source)+", lineStr:"+s,a),!this.source.tableName){e.next=12;break}return e.next=8,regeneratorRuntime.awrap(this.getAssignTableColumns(this.source.dbName,this.source.tableName));case 8:r=e.sent,n(null,r),e.next=35;break;case 12:if(!(s.endsWith("from ")||s.endsWith("join ")||s.endsWith("into ")||s.endsWith("update ")||s.endsWith("table "))){e.next=18;break}r=this.getDatabasesAndTables(),this.lastCallbackArr=r,n(null,r),e.next=35;break;case 18:if(!s.endsWith(".")){e.next=26;break}return e.next=21,regeneratorRuntime.awrap(this.getTablesAndColumns(s));case 21:r=e.sent,this.lastCallbackArr=r,n(null,r),e.next=35;break;case 26:if(!(s.endsWith("select ")||s.endsWith("where ")||s.endsWith("and ")||s.endsWith("or ")||s.endsWith("set "))){e.next=34;break}return e.next=29,regeneratorRuntime.awrap(this.getTableColumns(t,a));case 29:r=e.sent,this.lastCallbackArr=r,n(null,r),e.next=35;break;case 34:n(null,this.lastCallbackArr);case 35:case"end":return e.stop()}}),null,this)},getDatabasesAndTables:function(){var e=[],t=this.tableInfo[this.source.sourceId+"_"+this.source.dbName]||[];t.forEach((function(t){return e.push({caption:t.tableComment?t.tableName+"-"+t.tableComment:t.tableName,snippet:t.tableName,meta:"表",type:"snippet",score:1e3})}));var a=this.databaseInfo[this.source.sourceId]||[];return a.forEach((function(t){return e.push({caption:t.dbName,snippet:t.dbName,meta:"库",type:"snippet",score:1e3})})),e},getTablesAndColumns:function(e){var t,a,o,n,r,i,s,l,c,u;return regeneratorRuntime.async((function(d){while(1)switch(d.prev=d.next){case 0:t=!1,a=[],o=this.databaseInfo[this.source.sourceId]||[],n=0;case 4:if(!(n<o.length)){d.next=19;break}if(r=o[n],!e.endsWith(r.dbName+".")){d.next=16;break}if(i=this.tableInfo[this.source.sourceId+"_"+r.dbName]||[],!(i.length<=0)){d.next=14;break}return d.next=11,regeneratorRuntime.awrap(b.tableList({sourceId:this.source.sourceId,dbName:r.dbName}));case 11:s=d.sent,i=s.data||[],this.tableInfo[this.source.sourceId+"_"+r.dbName]=i;case 14:i.forEach((function(e){return a.push({caption:e.tableComment?e.tableName+"-"+e.tableComment:e.tableName,snippet:e.tableName,meta:"表",type:"snippet",score:1e3})})),t=!0;case 16:n++,d.next=4;break;case 19:if(t){d.next=31;break}l=this.tableInfo[this.source.sourceId+"_"+this.source.dbName]||[],c=0;case 22:if(!(c<l.length)){d.next=31;break}if(u=l[c].tableName,!e.endsWith(u+".")){d.next=28;break}return d.next=27,regeneratorRuntime.awrap(this.getAssignTableColumns(this.source.dbName,u));case 27:a=d.sent;case 28:c++,d.next=22;break;case 31:return d.abrupt("return",a);case 32:case"end":return d.stop()}}),null,this)},getTableColumns:function(e,t){var a,o,n,r,i,s,l,c,u,d;return regeneratorRuntime.async((function(h){while(1)switch(h.prev=h.next){case 0:a="",o=t.row;case 2:if(!(o>=0)){h.next=10;break}if(n=e.getLine(o),a=n+" "+a,!(n.indexOf(";")>=0)){h.next=7;break}return h.abrupt("break",10);case 7:o--,h.next=2;break;case 10:r=t.row+1;case 11:if(!(r<e.getLength())){h.next=19;break}if(i=e.getLine(r),a=a+" "+i,!(i.indexOf(";")>=0)){h.next=16;break}return h.abrupt("break",19);case 16:r++,h.next=11;break;case 19:s=[],l=this.tableInfo[this.source.sourceId+"_"+this.source.dbName]||[],c=0;case 22:if(!(c<l.length)){h.next=32;break}if(u=l[c].tableName,!(a.indexOf(u)>=0)){h.next=29;break}return h.next=27,regeneratorRuntime.awrap(this.getAssignTableColumns(this.source.dbName,u));case 27:d=h.sent,s=s.concat(d);case 29:c++,h.next=22;break;case 32:return h.abrupt("return",s);case 33:case"end":return h.stop()}}),null,this)},getAssignTableColumns:function(e,t){var a,o,n,r;return regeneratorRuntime.async((function(i){while(1)switch(i.prev=i.next){case 0:if(a=this.source.sourceId+"_"+e+"_"+t,o=this.columnInfo[a]||[],!(o.length<=0)){i.next=8;break}return i.next=5,regeneratorRuntime.awrap(b.tableColumnList({sourceId:this.source.sourceId,dbName:e,tableName:t}));case 5:n=i.sent,o=n.data.columnList||[],this.columnInfo[a]=o;case 8:return r=[],o.forEach((function(e){var t=e.description?e.name+"-"+e.description:e.name;r.push({caption:t,snippet:e.name,meta:"字段",type:"snippet",score:1e3})})),i.abrupt("return",r);case 11:case"end":return i.stop()}}),null,this)}}),mt=(a("aa11"),{render:function(e){var t=this.height?this.px(this.height):"100%",a=this.width?this.px(this.width):"100%";return e("div",{attrs:{style:"height: "+t+"; width: "+a}})},props:{value:String,source:Object,lang:!0,theme:String,height:!0,width:!0,options:Object},data:function(){return{editor:null,contentBackup:""}},watch:{value:function(e){this.contentBackup!==e&&(this.editor.session.setValue(e,1),this.contentBackup=e)},theme:function(e){this.editor.setTheme("ace/theme/"+e)},lang:function(e){this.editor.getSession().setMode("string"===typeof e?"ace/mode/"+e:e)},options:function(e){this.editor.setOptions(e)},height:function(){this.$nextTick((function(){this.editor.resize()}))},width:function(){this.$nextTick((function(){this.editor.resize()}))},source:function(e){pt.change(e)}},beforeDestroy:function(){this.editor.destroy(),this.editor.container.remove()},activated:function(){pt.change(this.source)},mounted:function(){var e=this,t=this.lang||"text",o=this.theme||"chrome";a("b378");var n=e.editor=ht.a.edit(this.$el);n.$blockScrolling=1/0,this.$emit("init",n),n.getSession().setMode("string"===typeof t?"ace/mode/"+t:t),n.setTheme("ace/theme/"+o),this.value&&n.setValue(this.value,1),this.contentBackup=this.value,n.on("change",(function(){var t=n.getValue();e.$emit("input",t),e.contentBackup=t})),n.commands.addCommand({name:"start-autocomplete",bindKey:{win:"Alt-Enter",mac:"Alt-Enter"},exec:function(e){pt.startAutocomplete(e)}}),e.options&&n.setOptions(e.options),pt.change(this.source)},methods:{px:function(e){return/^\d*$/.test(e)?e+"px":e}}}),ft={name:"dataPreview",data:function(){return{sqlExecuting:!1,executeResultList:[],executeResultInfo:"",executeShowTable:"table1",sqlExecutorEditor:{},nowExecutorId:1,executeError:"",pageParam:{},vueQueryParam:{},pageSize:50,currentPage:1,tableTotalCount:0,tableSort:{},tableMaxHeight:600,tableStatusInfo:{},choiceResultObj:{},exportConditionVisible:!1,tableDataColumns:[],conditionDataCols:[],conditionDataColsChoice:[],downloadDataVisible:!1,downloadDataParam:{downloadType:"insert",dropTableFlag:0,createTableFlag:0,conditionColumnArr:[],retainColumnArr:[]},downloadFormParam:{url:"zyplayer-doc-db/data-view/downloadMultiple",param:{}},choiceShowColumnDrawer:!1,showColumnProps:{label:"name"},choiceShowColumnLast:[],choiceShowColumnAll:!0,sqlExecutorContent:"",sqlEditorConfig:{wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:3,maxLines:3},executorSource:{},columnMap:{},primaryKeyColumn:{}}},components:{"ace-editor":mt},mounted:function(){var e=this,t=function(){e.tableMaxHeight=document.body.clientHeight-420};t(),window.onresize=t},methods:{init:function(e,t){var a=this;this.pageParam.sourceId!=e.sourceId&&(this.pageParam=e,this.executorSource={sourceId:e.sourceId,dbName:e.dbName,tableName:e.tableName},this.columnMap={},t.forEach((function(e){a.columnMap[e.name]=e,1==e.primaryKey&&(a.primaryKeyColumn=e)})),this.tableDataColumns=t,this.doExecutorSqlCommon())},sqlExecutorInit:function(e){this.sqlExecutorEditor=e,this.sqlExecutorEditor.setFontSize(16);var t=this;this.sqlExecutorEditor.commands.addCommand({name:"execute-sql",bindKey:{win:"Ctrl-R|Ctrl-Shift-R|Ctrl-Enter",mac:"Command-R|Command-Shift-R|Command-Enter"},exec:function(e){t.doExecutorClick()}})},handleCurrentChange:function(e){this.currentPage=e,this.doExecutorSqlCommon()},handlePageSizeChange:function(e){this.pageSize=e,this.currentPage=1,this.doExecutorSqlCommon()},tableSortChange:function(e){this.tableSort.prop===e.prop&&this.tableSort.order===e.order||(this.tableSort={prop:e.prop,order:e.order},this.doExecutorSqlCommon())},refreshData:function(){this.tableSort={},this.currentPage=1,this.sqlExecutorEditor.setValue("",1),this.doExecutorSqlCommon()},cancelExecutorSql:function(){var e=this;b.executeSqlCancel({executeId:this.nowExecutorId}).then((function(){e.sqlExecuting=!1,e.$message.success("取消成功")}))},doExecutorClick:function(){this.tableSort={},this.currentPage=1,this.doExecutorSqlCommon()},doExecutorSqlCommon:function(){var e=this;if(this.pageParam.sourceId){this.tableSort.prop||(this.tableSort={prop:this.pageParam.orderColumn,order:"ascending"});var t=this.sqlExecutorEditor.getSelectedText();t=t||this.sqlExecutorEditor.getValue(),t=t||"",this.executeError="",this.executeUseTime="",this.choiceResultObj={},this.executeResultList=[],this.nowExecutorId=(new Date).getTime()+Math.ceil(1e3*Math.random()),this.sqlExecuting=!0;var a={sourceId:this.pageParam.sourceId,dbName:this.pageParam.dbName,tableName:this.pageParam.tableName,executeId:this.nowExecutorId,condition:t,retainColumn:this.choiceShowColumnLast.join(","),pageNum:this.currentPage,pageSize:this.pageSize,orderColumn:this.tableSort.prop,orderType:"ascending"===this.tableSort.order?"asc":"desc",params:""};b.dataViewQuery(a).then((function(t){if(e.sqlExecuting=!1,200===t.errCode){for(var a=t.data||[],o=[],n="",r=1,i=0;i<a.length;i++){var s=JSON.parse(a[i]);n+=e.getExecuteInfoStr(s);var l=e.dealExecuteResult(s);l.updateCount<0&&(l.index=r,l.name="table"+r,r++),o.push(l)}t.total&&(e.tableTotalCount=t.total||0),e.executeShowTable=1===r?"table0":"table1",e.executeResultInfo=n,e.executeResultList=o,e.executeShowTableClick()}else e.executeError=t.errMsg})).catch((function(t){e.sqlExecuting=!1}))}else this.$message.error("请先选择数据源")},getExecuteInfoStr:function(e){var t=e.sql;return t+="\n> 状态:"+(e.errMsg?"ERROR":"OK"),e.updateCount>=0&&(t+="\n> 影响行数:"+e.updateCount),t+="\n> 耗时:"+(e.useTime||0)/1e3+"s",t+="\n\n",t},dealExecuteResult:function(e){var t=e.result||[],a=[];if(t.length>0){var o=t[0];for(var n in o){document.getElementById("widthCalculate").innerText=n;var r=document.getElementById("widthCalculate").offsetWidth;document.getElementById("widthCalculate").innerText=o[n];var i=document.getElementById("widthCalculate").offsetWidth,s=r>i?r:i;s=s<50?50:s,s=s>200?200:s;var l=this.columnMap[n]||{};a.push({prop:n,width:s+50,desc:l.description||n})}}var c={};return c.dataList=t,c.dataCols=a,c.useTime=e.useTime||0,c.errMsg=e.errMsg||"",c.updateCount=e.updateCount,c},handleSelectionChange:function(e){this.$set(this.choiceResultObj,this.executeShowTable,e)},executeShowTableClick:function(){var e=this,t=this.executeResultList.find((function(t){return t.name===e.executeShowTable}));t&&(this.choiceShowColumnLast=t.dataCols.map((function(e){return e.prop})))},doCopyCheckLineUpdate:function(){var e=this,t=this.choiceResultObj[this.executeShowTable]||[];if(t.length>0){var a=this.executeResultList.find((function(t){return t.name===e.executeShowTable})).dataCols,o=lt.format("update",this.pageParam.dbType,a,t,this.conditionDataColsChoice,this.pageParam.dbName,this.pageParam.tableName);this.conditionDataColsChoice=[],this.exportConditionVisible=!1,this.$copyText(o).then((function(t){return e.$message.success("内容已复制到剪切板!")}),(function(t){return e.$message.error("抱歉,复制失败!")}))}},deleteCheckLine:function(){var e=this,t=this.choiceResultObj[this.executeShowTable]||[];if(t.length>0){var a=this.primaryKeyColumn.name;if(!a)return void this.$message.error("删除失败,未找到数据表的主键列");var o=[];t.forEach((function(e){var t={};t[a]=e[a],o.push(t)})),this.$confirm("确定要删除选中的".concat(t.length,"行数据吗?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var t={sourceId:e.pageParam.sourceId,dbName:e.pageParam.dbName,tableName:e.pageParam.tableName,lineJson:JSON.stringify(o)};b.deleteTableLineData(t).then((function(){e.$message.success("删除成功!"),e.refreshData()}))})).catch((function(){}))}},handleCopyCheckLineCommand:function(e){var t=this,a=this.choiceResultObj[this.executeShowTable]||[];if(a.length>0){this.conditionDataColsChoice=[];var o=this.executeResultList.find((function(e){return e.name===t.executeShowTable})).dataCols;if("update"===e){if(!this.primaryKeyColumn.name)return this.conditionDataCols=o,void(this.exportConditionVisible=!0);this.conditionDataColsChoice=[this.primaryKeyColumn.name]}var n=lt.format(e,this.pageParam.dbType,o,a,this.conditionDataColsChoice,this.pageParam.dbName,this.pageParam.tableName);this.$copyText(n).then((function(e){return t.$message.success("内容已复制到剪切板!")}),(function(e){return t.$message.error("抱歉,复制失败!")}))}},doDownloadTableData:function(){var e=this,t=this.sqlExecutorEditor.getSelectedText();t=t||this.sqlExecutorEditor.getValue(),t=t||"",this.nowExecutorId=(new Date).getTime()+Math.ceil(1e3*Math.random());var a={},o={},n={};a[this.pageParam.tableName]=t,o[this.pageParam.tableName]=this.downloadDataParam.conditionColumnArr.join(","),n[this.pageParam.tableName]=this.choiceShowColumnLast.join(","),this.downloadFormParam.param={executeId:this.nowExecutorId,sourceId:this.pageParam.sourceId,dbName:this.pageParam.dbName,tableNames:this.pageParam.tableName,downloadType:this.downloadDataParam.downloadType,dropTableFlag:this.downloadDataParam.dropTableFlag,createTableFlag:this.downloadDataParam.createTableFlag,conditionJson:JSON.stringify(a),conditionColumnJson:JSON.stringify(o),retainColumnJson:JSON.stringify(n)},setTimeout((function(){return e.$refs.downloadForm.submit()}),0),this.downloadDataVisible=!1},downloadTableData:function(){var e=this,t=this.executeResultList.find((function(t){return t.name===e.executeShowTable}));if(!t||!t.dataList||t.dataList.length<=0)this.$message.warning("当前筛选条件下无数据,请重新筛选后再操作导出");else{var a=this.primaryKeyColumn.name;this.downloadDataParam.conditionColumnArr.length<=0&&a&&(this.downloadDataParam.conditionColumnArr=[a]),this.conditionDataCols=t.dataCols,this.downloadDataVisible=!0}},dropTableFlagChange:function(){1===this.downloadDataParam.dropTableFlag&&(this.downloadDataParam.createTableFlag=1)},createTableFlagChange:function(){0==this.downloadDataParam.createTableFlag&&(this.downloadDataParam.dropTableFlag=0)},choiceShowColumnDrawerShow:function(){var e=this;this.choiceShowColumnDrawer=!0,setTimeout((function(){e.$refs.showColumnTree.setCheckedKeys(e.choiceShowColumnLast),e.choiceShowColumnAll=e.choiceShowColumnLast.length===e.tableDataColumns.length}),10)},choiceShowColumnDrawerClose:function(){this.choiceShowColumnDrawer=!1},choiceShowColumnOk:function(){var e=this.$refs.showColumnTree.getCheckedKeys();e.length<=0?this.$message.warning("必须选择一列展示"):(this.choiceShowColumnLast=e,this.choiceShowColumnDrawer=!1,this.doExecutorClick())},tableDataColumnsCheckChange:function(){var e=this.$refs.showColumnTree.getCheckedKeys();this.choiceShowColumnAll=e.length===this.tableDataColumns.length},choiceShowColumnAllChange:function(){var e=[];this.choiceShowColumnAll&&(e=this.tableDataColumns.map((function(e){return e.name}))),this.$refs.showColumnTree.setCheckedKeys(e)}}},bt=ft,gt=(a("f52e"),Object(C["a"])(bt,nt,rt,!1,null,null,null)),vt=gt.exports,yt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"data-executor-vue"},[e._m(0),a("el-dialog",{attrs:{visible:e.choiceRelationColumnVisible,width:"750px",title:"选择关联的表字段 "+e.editNodeInfo.tableName+"."+e.editNodeInfo.columnName},on:{"update:visible":function(t){e.choiceRelationColumnVisible=t}}},[e._l(e.editRelationArr,(function(t){return a("div",{staticStyle:{"margin-top":"10px"}},[a("el-select",{staticStyle:{"margin-right":"10px",width:"200px"},attrs:{filterable:"",placeholder:"请选择数据库"},on:{change:function(a){return e.dbNameChangeEvents(t)}},model:{value:t.dbName,callback:function(a){e.$set(t,"dbName",a)},expression:"item.dbName"}},e._l(e.databaseList,(function(e){return a("el-option",{key:e.dbName,attrs:{label:e.dbName,value:e.dbName}})})),1),a("el-select",{staticStyle:{"margin-right":"10px",width:"200px"},attrs:{filterable:"",placeholder:"请选择数据表"},on:{change:function(a){return e.tableNameChangeEvents(t)}},model:{value:t.tableName,callback:function(a){e.$set(t,"tableName",a)},expression:"item.tableName"}},e._l(e.dbTableList[t.dbName],(function(e){return a("el-option",{key:e.tableName,attrs:{label:e.tableName,value:e.tableName}})})),1),a("el-select",{staticStyle:{"margin-right":"10px",width:"200px"},attrs:{filterable:"",placeholder:"请选择表字段"},model:{value:t.columnName,callback:function(a){e.$set(t,"columnName",a)},expression:"item.columnName"}},e._l(e.dbTableColumnList[t.dbName+"."+t.tableName],(function(e){return a("el-option",{key:e.name,attrs:{label:e.name,value:e.name}})})),1),a("el-button",{attrs:{icon:"el-icon-delete",circle:""},on:{click:function(a){return e.delTableColumnRelation(t)}}})],1)})),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.addTableColumnRelation}},[e._v("添加关联")]),a("el-button",{attrs:{type:"primary"},on:{click:e.doUpdateTableColumnRelation}},[e._v("确 定")])],1)],2)],1)},wt=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{width:"max(100%, 1000px)",height:"calc(100vh - 160px)",overflow:"auto"}},[a("div",{staticStyle:{width:"1500px",height:"1000px"},attrs:{id:"relationChart"}})])}],xt=a("313e"),Ct={name:"tableRelation",data:function(){return{pageParam:{},relationChart:{},relationChartData:{},relationChartOption:{},editNodeInfo:{},editRelationArr:[],databaseList:[],dbTableList:{},dbTableColumnList:{},choiceRelationColumnVisible:!1,columnListLoading:!1}},mounted:function(){},methods:{init:function(e){var t=this;this.pageParam.sourceId!=e.sourceId&&(this.pageParam=e,this.relationChartData.name=e.tableName,this.relationChart=xt["init"](document.getElementById("relationChart")),this.relationChartOption={tooltip:{trigger:"item",triggerOn:"mousemove"},series:[{type:"tree",id:0,name:"tree1",data:[this.relationChartData],top:"10%",left:"8%",bottom:"22%",right:"20%",symbolSize:7,edgeShape:"polyline",edgeForkPosition:"63%",initialTreeDepth:3,lineStyle:{width:2},label:{backgroundColor:"#fff",position:"right",verticalAlign:"middle",align:"left"},leaves:{label:{position:"right",verticalAlign:"middle",align:"left"}},emphasis:{focus:"descendant"},expandAndCollapse:!1,animationDuration:550,animationDurationUpdate:750}]},this.relationChart.setOption(this.relationChartOption),this.relationChart.on("click",(function(e){if(1==e.data.nodeType){t.editNodeInfo=e.data;var a=t.editNodeInfo.children||[];t.editRelationArr=[],a.length<=0?t.editRelationArr.push({dbName:t.pageParam.dbName,tableName:"",columnName:""}):a.forEach((function(e){t.editRelationArr.push({dbName:e.dbName,tableName:e.tableName,columnName:e.columnName})}));var o=[],n=[];t.editRelationArr.forEach((function(e){o.indexOf(e.dbName)<0&&(o.push(e.dbName),t.dbNameChangeEvents(e)),n.indexOf(e.dbName+"."+e.tableName)<0&&(n.push(e.dbName+"."+e.tableName),t.tableNameChangeEvents(e))})),t.choiceRelationColumnVisible=!0}})),this.relationChart.on("contextmenu",(function(e){console.log(e)})),this.doGetTableColumnRelation(),b.databaseList({sourceId:this.pageParam.sourceId}).then((function(e){t.databaseList=e.data||[]})))},doGetTableColumnRelation:function(){var e=this;this.relationChart.clear(),b.getTableColumnRelation(this.pageParam).then((function(t){e.relationChartData=t.data||{},e.relationChartOption.series[0].data=[t.data||{}],e.columnListLoading=!1,e.relationChart.setOption(e.relationChartOption),setTimeout((function(){return e.relationChart.resize()}),0)}))},delTableColumnRelation:function(e){this.editRelationArr=this.editRelationArr.filter((function(t){return t!==e}))},addTableColumnRelation:function(){this.editRelationArr.push({dbName:this.pageParam.dbName,tableName:"",columnName:""})},doUpdateTableColumnRelation:function(){var e=this,t={dbName:this.editNodeInfo.dbName,tableName:this.editNodeInfo.tableName,columnName:this.editNodeInfo.columnName,sourceId:this.pageParam.sourceId,relation:JSON.stringify(this.editRelationArr)};b.updateTableColumnRelation(t).then((function(t){e.choiceRelationColumnVisible=!1,e.doGetTableColumnRelation()}))},dbNameChangeEvents:function(e){var t=this;b.tableList({sourceId:this.pageParam.sourceId,dbName:e.dbName}).then((function(a){t.$set(t.dbTableList,e.dbName,a.data||[])}))},tableNameChangeEvents:function(e){var t=this;b.tableColumnList({sourceId:this.pageParam.sourceId,dbName:e.dbName,tableName:e.tableName}).then((function(a){t.$set(t.dbTableColumnList,e.dbName+"."+e.tableName,a.data.columnList||[])}))}}},St=Ct,Dt=(a("499b"),Object(C["a"])(St,yt,wt,!1,null,null,null)),_t=Dt.exports,kt={data:function(){return{columnListLoading:!1,vueQueryParam:{},tableStatusInfo:{},columnList:[],tableInfo:{},nowExecutorId:1,tableDDLInfoTab:"",tableDDLInfo:"",tableDDLInfoDialogVisible:!1,tabActiveName:"columns"}},mounted:function(){var e=this;setTimeout((function(){e.$emit("initLoadDataList",{sourceId:e.vueQueryParam.sourceId,host:e.vueQueryParam.host,dbName:e.vueQueryParam.dbName})}),500)},activated:function(){this.initQueryParam(this.$route)},components:{"data-preview":vt,"table-relation-charts":_t},methods:{initQueryParam:function(e){var t=this;this.columnListLoading||(this.columnListLoading=!0,this.vueQueryParam=e.query,b.tableColumnList(this.vueQueryParam).then((function(e){for(var a=e.data.columnList||[],o=0;o<a.length;o++)a[o].inEdit=0,a[o].description=a[o].description||"",a[o].newDesc=a[o].description;t.columnList=a;var n=e.data.tableInfo||{};n.inEdit=0,n.newDesc=n.description,t.tableInfo=n;var r={key:t.$route.fullPath,val:n.tableName};t.$store.commit("global/addTableName",r),t.columnListLoading=!1})),b.tableStatus(this.vueQueryParam).then((function(e){t.tableStatusInfo=e.data||{}})))},tabActiveNameChange:function(){var e=this;if("relationChart"==this.tabActiveName)this.$refs.relationChart.init({sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,tableName:this.vueQueryParam.tableName});else if("tableData"==this.tabActiveName){if(!this.columnList||this.columnList.length<=0)return this.$message.error("字段信息尚未加载成功,请稍候..."),void setTimeout((function(){return e.tabActiveName="columns"}),0);var t=this.columnList.find((function(e){return 1==e.primaryKey}))||this.columnList[0];this.$refs.dataPreview.init({sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,tableName:this.vueQueryParam.tableName,host:this.vueQueryParam.host,dbType:this.tableStatusInfo.dbType,orderColumn:t.name},this.columnList)}},onCopySuccess:function(e){this.$message.success("内容已复制到剪切板!")},onCopyError:function(e){this.$message.error("抱歉,复制失败!")},showCreateTableDdl:function(){var e=this;this.tableDDLInfo="";var t={sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,tableName:this.vueQueryParam.tableName},a=this.$loading({lock:!0,text:"加载中...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});this.tableDDLInfoTab="",this.tableDDLInfoDialogVisible=!1,b.queryTableDdl(t).then((function(t){a.close(),e.tableDDLInfo=t.data||{},e.tableDDLInfoTab=e.tableDDLInfo.current,setTimeout((function(){return e.tableDDLInfoDialogVisible=!0}),0)})).catch((function(){a.close()}))},descBoxClick:function(e){e.inEdit=1},getBytesSize:function(e){if(!e)return"0 bytes";var t=1024;return e<t?e+" bytes":e<Math.pow(t,2)?(e/t).toFixed(2)+"KB":e<Math.pow(t,3)?(e/Math.pow(t,2)).toFixed(2)+"MB":e<Math.pow(t,4)?(e/Math.pow(t,3)).toFixed(2)+"GB":(e/Math.pow(t,4)).toFixed(2)+"TB"},saveColumnDescription:function(e){var t=this;0!=e.inEdit&&e.description!=e.newDesc?(e.inEdit=0,this.vueQueryParam.columnName=e.name,this.vueQueryParam.newDesc=e.newDesc,b.updateTableColumnDesc(this.vueQueryParam).then((function(){e.description=e.newDesc,t.$message.success("修改成功")}))):e.inEdit=0},saveTableDescription:function(){var e=this;0!=this.tableInfo.inEdit&&this.tableInfo.description!=this.tableInfo.newDesc?(this.tableInfo.inEdit=0,this.vueQueryParam.newDesc=this.tableInfo.newDesc,b.updateTableDesc(this.vueQueryParam).then((function(){e.tableInfo.description=e.tableInfo.newDesc,e.$message.success("修改成功")}))):this.tableInfo.inEdit=0}}},It=kt,Lt=(a("ecf2"),Object(C["a"])(It,at,ot,!1,null,null,null)),Et=Lt.exports,Pt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"table-database-vue"},[a("el-card",{staticStyle:{margin:"10px"},attrs:{shadow:"never"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e._v("库信息")]),a("el-row",{staticStyle:{"margin-bottom":"20px"}},[a("el-col",{attrs:{span:12}},[a("span",{staticClass:"label"},[e._v("数据源:")]),e._v(e._s(e.vueQueryParam.host))]),a("el-col",{attrs:{span:12}},[a("span",{staticClass:"label"},[e._v("数据库:")]),e._v(e._s(e.vueQueryParam.dbName))])],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("span",{staticClass:"label"},[e._v("关键字:")]),a("el-input",{staticStyle:{width:"350px","margin-right":"10px"},attrs:{placeholder:"输入字段名或注释搜索库中相关的表或字段信息"},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),a("el-button",{staticClass:"search-submit",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.searchSubmit}},[e._v("模糊搜索")]),a("el-button",{attrs:{icon:"el-icon-coin"},on:{click:e.funcManage}},[e._v("函数管理")])],1)],1)],1),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.columnListLoading,expression:"columnListLoading"}],staticStyle:{padding:"10px"}},[a("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.columnList,stripe:"",border:""}},[a("el-table-column",{attrs:{prop:"tableName",label:"表名",width:"200"}}),a("el-table-column",{attrs:{prop:"columnName",label:"字段名",width:"200"}}),a("el-table-column",{attrs:{prop:"description",label:"注释"}})],1)],1)],1)},Nt=[],Tt={data:function(){return{columnListLoading:!1,vueQueryParam:{},columnList:[],tableInfo:[],keyword:""}},mounted:function(){var e=this;setTimeout((function(){e.$emit("initLoadDataList",{sourceId:e.vueQueryParam.sourceId,host:e.vueQueryParam.host,dbName:e.vueQueryParam.dbName})}),500)},activated:function(){this.initQueryParam(this.$route)},methods:{initQueryParam:function(e){this.vueQueryParam=e.query;var t={key:this.$route.fullPath,val:this.vueQueryParam.dbName};this.$store.commit("global/addTableName",t)},searchSubmit:function(){var e=this;this.columnListLoading=!0,this.vueQueryParam.searchText=this.keyword,b.tableAndColumnBySearch(this.vueQueryParam).then((function(t){e.columnList=t.data||[],e.columnListLoading=!1}))},funcManage:function(){this.$router.push({path:"/procedure/list",query:this.vueQueryParam})}}},Ot=Tt,qt=(a("0d0e"),Object(C["a"])(Ot,Pt,Nt,!1,null,null,null)),$t=qt.exports,zt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"table-procedure-vue"},[a("el-card",{staticStyle:{margin:"10px"},attrs:{shadow:"never"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e._v("库信息")]),a("el-row",[a("el-col",{attrs:{span:12}},[a("span",{staticClass:"label"},[e._v("数据源:")]),e._v(e._s(e.vueQueryParam.host))]),a("el-col",{attrs:{span:12}},[a("span",{staticClass:"label"},[e._v("数据库:")]),e._v(e._s(e.vueQueryParam.dbName))])],1)],1),a("el-card",{staticStyle:{margin:"10px"},attrs:{shadow:"never",header:"函数管理"}},[a("el-form",{attrs:{inline:!0}},[a("el-form-item",{attrs:{label:"名称"}},[a("el-input",{attrs:{placeholder:"名字"},model:{value:e.searchParam.name,callback:function(t){e.$set(e.searchParam,"name",t)},expression:"searchParam.name"}})],1),a("el-form-item",{attrs:{label:"类型"}},[a("el-select",{attrs:{placeholder:"类型"},model:{value:e.searchParam.type,callback:function(t){e.$set(e.searchParam,"type",t)},expression:"searchParam.type"}},[a("el-option",{attrs:{value:""}},[e._v("全部")]),a("el-option",{attrs:{value:"PROCEDURE",label:"存储过程"}}),a("el-option",{attrs:{value:"FUNCTION",label:"函数"}})],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",loading:e.procedureListLoading,icon:"el-icon-search"},on:{click:e.searchProcedureList}},[e._v("查询")]),a("el-button",{attrs:{icon:"el-icon-circle-plus-outline"},on:{click:e.createProc}},[e._v("新建函数")])],1)],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.procedureList,stripe:"",border:""}},[a("el-table-column",{attrs:{prop:"name",label:"名称",width:"200"}}),a("el-table-column",{attrs:{prop:"type",label:"类型",width:"200"}}),a("el-table-column",{attrs:{prop:"definer",label:"定义者"}}),a("el-table-column",{attrs:{prop:"created",label:"创建时间"}}),a("el-table-column",{attrs:{prop:"action",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"primary"},on:{click:function(a){return e.doEditProc(t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"danger"},on:{click:function(a){return e.doDeleteProc(t.row)}}},[e._v("删除")])]}}])})],1),a("el-pagination",{staticStyle:{"margin-top":"10px"},attrs:{"current-page":e.currentPage,"page-sizes":[10,30,50],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.tableTotalCount},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentChange}})],1),a("el-dialog",{attrs:{inline:!0,title:"新建函数",visible:e.newProcedureDialogVisible,width:"760px"},on:{"update:visible":function(t){e.newProcedureDialogVisible=t}}},[a("el-form",{attrs:{"label-width":"120px"}},[a("el-form-item",{attrs:{label:"类型:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型"},model:{value:e.newProcedureInfo.type,callback:function(t){e.$set(e.newProcedureInfo,"type",t)},expression:"newProcedureInfo.type"}},[a("el-option",{attrs:{value:"PROCEDURE",label:"存储过程"}}),a("el-option",{attrs:{value:"FUNCTION",label:"函数"}})],1)],1),a("el-form-item",{attrs:{label:"函数名:"}},[a("el-input",{attrs:{placeholder:"请输入函数名"},model:{value:e.newProcedureInfo.name,callback:function(t){e.$set(e.newProcedureInfo,"name",t)},expression:"newProcedureInfo.name"}})],1)],1),a("div",{staticStyle:{"text-align":"center"},attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.newProcedureOk}},[e._v("下一步")]),a("el-button",{attrs:{plain:""},on:{click:function(t){e.newProcedureDialogVisible=!1}}},[e._v("取消")])],1)],1)],1)},jt=[];function At(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function Rt(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?At(a,!0).forEach((function(t){Object(G["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):At(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var Ft={data:function(){return{procedureListLoading:!1,vueQueryParam:{},procedureList:[],newProcedureDialogVisible:!1,newProcedureInfo:{type:"",name:""},searchParam:{name:"",type:""},pageSize:30,currentPage:1,tableTotalCount:0}},mounted:function(){var e=this;setTimeout((function(){e.$emit("initLoadDataList",{sourceId:e.vueQueryParam.sourceId,host:e.vueQueryParam.host,dbName:e.vueQueryParam.dbName})}),500),this.initQueryParam(this.$route),this.searchProcedureList()},methods:{initQueryParam:function(e){this.vueQueryParam=e.query;var t={key:this.$route.fullPath,val:"函数管理"};this.$store.commit("global/addTableName",t)},handleCurrentChange:function(e){this.currentPage=e,this.searchProcedureList()},handlePageSizeChange:function(e){this.pageSize=e,this.searchProcedureList()},searchProcedureList:function(){var e=this;this.procedureListLoading=!0;var t=Rt({},this.vueQueryParam,{},this.searchParam,{pageNum:this.currentPage,pageSize:this.pageSize});b.procedureList(t).then((function(t){1==e.currentPage&&(e.tableTotalCount=t.total||0),e.procedureList=t.data||[],e.procedureListLoading=!1})).catch((function(){e.procedureListLoading=!1}))},doEditProc:function(e){var t=Rt({},this.vueQueryParam,{typeName:e.type,procName:e.name});this.$router.push({path:"/procedure/edit",query:t})},createProc:function(){this.newProcedureDialogVisible=!0},newProcedureOk:function(){if(this.newProcedureInfo.type)if(this.newProcedureInfo.name){var e=Rt({},this.vueQueryParam,{typeName:this.newProcedureInfo.type,procName:this.newProcedureInfo.name});this.newProcedureDialogVisible=!1,this.newProcedureInfo={type:"",name:""},this.$router.push({path:"/procedure/edit",query:e})}else this.$message.error("请先输入函数名");else this.$message.error("请先选择类型")},doDeleteProc:function(e){var t=this,a={sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,typeName:e.type,procName:e.name};this.$confirm("确定要删除此存储过程吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){b.deleteProcedure(a).then((function(e){t.$message.success("删除成功!"),t.searchProcedureList()}))})).catch((function(){}))}}},Vt=Ft,Ut=(a("6f29"),Object(C["a"])(Vt,zt,jt,!1,null,null,null)),Qt=Ut.exports,Bt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"table-procedure-edit-vue"},[a("el-card",{staticStyle:{margin:"10px"},attrs:{shadow:"never"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e._v("函数信息")]),a("el-row",[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("数据源:")]),e._v(e._s(e.vueQueryParam.host))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("数据库:")]),e._v(e._s(e.vueQueryParam.dbName))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("类型:")]),e._v(e._s(e.vueQueryParam.typeName))]),a("el-col",{attrs:{span:6}},[a("span",{staticClass:"label"},[e._v("名称:")]),e._v(e._s(e.vueQueryParam.procName))])],1)],1),a("el-card",{directives:[{name:"loading",rawName:"v-loading",value:e.procedureInfoLoading,expression:"procedureInfoLoading"}],staticStyle:{margin:"10px"},attrs:{shadow:"never"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"margin-right":"20px"}},[e._v("编辑函数")]),a("el-button",{attrs:{type:"primary",icon:"el-icon-document-checked",size:"mini"},on:{click:e.saveProcedure}},[e._v("保存")]),a("el-button",{attrs:{type:"",icon:"el-icon-document",size:"mini"},on:{click:e.showProcedureLog}},[e._v("修改日志")])],1),a("ace-editor",{staticStyle:{"margin-bottom":"10px"},attrs:{lang:"sql",theme:"monokai",width:"100%",height:"500",options:e.sqlEditorConfig},on:{init:e.sqlExecutorInit},model:{value:e.sqlExecutorContent,callback:function(t){e.sqlExecutorContent=t},expression:"sqlExecutorContent"}})],1),a("el-dialog",{attrs:{title:"保存函数失败",visible:e.saveProcedureErrVisible,footer:null},on:{"update:visible":function(t){e.saveProcedureErrVisible=t}}},[a("div",{staticStyle:{width:"700px","max-height":"500px",overflow:"auto"}},[a("pre",[e._v(e._s(e.saveProcedureErrInfo))])])]),a("el-dialog",{attrs:{title:"函数修改日志",visible:e.procLogVisible,footer:null},on:{"update:visible":function(t){e.procLogVisible=t}}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.procLogList,stripe:"",border:"",height:"400"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"100"}}),a("el-table-column",{attrs:{prop:"createUserName",label:"修改人"}}),a("el-table-column",{attrs:{prop:"createTime",label:"修改时间"}}),a("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.status?a("el-tag",{attrs:{type:"success"}},[e._v("保存成功")]):2==t.row.status?a("el-tag",{attrs:{type:"danger"}},[e._v("保存失败")]):a("el-tag",{attrs:{type:"danger"}},[e._v("-")])]}}])}),a("el-table-column",{attrs:{prop:"action",label:"操作",width:"130"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:""},on:{click:function(a){return e.reEditProc(t.row.id)}}},[e._v("重新编辑")])]}}])})],1),a("el-pagination",{staticStyle:{"margin-top":"10px"},attrs:{"current-page":e.currentPage,"page-sizes":[10,30,50],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.tableTotalCount},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentChange}})],1)],1)},Mt=[];function Gt(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function Ht(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Gt(a,!0).forEach((function(t){Object(G["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Gt(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var Jt={data:function(){return{procedureInfoLoading:!1,vueQueryParam:{},procedureInfo:{},sqlExecutorEditor:{},saveProcedureErrInfo:"",saveProcedureErrVisible:!1,procLogVisible:!1,procLogList:[],pageSize:30,currentPage:1,tableTotalCount:0,sqlExecutorContent:"",sqlEditorConfig:{wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:20,maxLines:40}}},components:{"ace-editor":mt},mounted:function(){var e=this;setTimeout((function(){e.$emit("initLoadDataList",{sourceId:e.vueQueryParam.sourceId,host:e.vueQueryParam.host,dbName:e.vueQueryParam.dbName})}),500),this.initQueryParam(this.$route),this.searchProcedureDetail()},methods:{initQueryParam:function(e){this.vueQueryParam=e.query;var t={key:this.$route.fullPath,val:"编辑函数"};this.$store.commit("global/addTableName",t)},sqlExecutorInit:function(e){this.sqlExecutorEditor=e,this.sqlExecutorEditor.setFontSize(16);var t=this;this.sqlExecutorEditor.commands.addCommand({name:"execute-sql",bindKey:{win:"Ctrl-S",mac:"Command-S"},exec:function(e){t.saveProcedure()}})},handleCurrentChange:function(e){this.currentPage=e,this.searchProcedureLogList()},handlePageSizeChange:function(e){this.pageSize=e,this.searchProcedureLogList()},showProcedureLog:function(){this.currentPage=1,this.procLogVisible=!0,this.searchProcedureLogList()},searchProcedureLogList:function(){var e=this,t=Ht({},this.vueQueryParam,{},this.searchParam,{pageNum:this.currentPage,pageSize:this.pageSize});b.procedureLogList(t).then((function(t){1==e.currentPage&&(e.tableTotalCount=t.total||0),e.procLogList=t.data||[]}))},reEditProc:function(e){var t=this;b.procedureLogDetail({logId:e}).then((function(e){var a=e.data||{};t.sqlExecutorEditor.setValue(a.procBody,1),t.procLogVisible=!1}))},searchProcedureDetail:function(){var e=this;this.procedureInfoLoading=!0,b.procedureDetail(this.vueQueryParam).then((function(t){e.procedureInfo=t.data||{},e.procedureInfoLoading=!1,e.sqlExecutorEditor.setValue(e.procedureInfo.body,1)})).catch((function(){e.procedureInfoLoading=!1}))},saveProcedure:function(){var e=this;this.procedureInfoLoading=!0;var t=Ht({},this.vueQueryParam,{procSql:this.sqlExecutorEditor.getValue()});b.saveProcedure(t).then((function(t){e.procedureInfoLoading=!1;var a=t.data||{};a.errMsg?(e.saveProcedureErrInfo=a.errMsg,e.saveProcedureErrVisible=!0):e.$message.success("保存成功!")})).catch((function(){e.procedureInfoLoading=!1}))},doDeleteProc:function(e){var t=this,a={sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,typeName:e.type,procName:e.name};this.$confirm("确定要删除此存储过程吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){b.deleteProcedure(a).then((function(e){t.$message.success("删除成功!")}))})).catch((function(){}))},initAceEditor:function(e,t){return ace.edit(e,{theme:"ace/theme/monokai",mode:"ace/mode/sql",wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:t,maxLines:40})}}},Wt=Jt,Kt=(a("94e2"),Object(C["a"])(Wt,Bt,Mt,!1,null,null,null)),Xt=Kt.exports,Yt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{padding:"0 10px"}},[a("el-form",{attrs:{inline:!0}},[a("el-form-item",{attrs:{label:"名字"}},[a("el-input",{attrs:{placeholder:"名字"},model:{value:e.searchParam.name,callback:function(t){e.$set(e.searchParam,"name",t)},expression:"searchParam.name"}})],1),a("el-form-item",{attrs:{label:"分组"}},[a("el-select",{attrs:{placeholder:"分组"},model:{value:e.searchParam.groupName,callback:function(t){e.$set(e.searchParam,"groupName",t)},expression:"searchParam.groupName"}},[a("el-option",{attrs:{value:""}},[e._v("全部")]),e._l(e.datasourceGroupList,(function(e){return a("el-option",{attrs:{value:e}})}))],2)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",loading:e.loadDataListLoading,icon:"el-icon-search"},on:{click:e.getDatasourceList}},[e._v("查询")]),a("el-button",{attrs:{icon:"el-icon-circle-plus-outline"},on:{click:e.addDatasource}},[e._v("新增")])],1)],1),a("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.datasourceList,stripe:"",border:""}},[a("el-table-column",{attrs:{prop:"name",label:"名字"}}),a("el-table-column",{attrs:{prop:"groupName",label:"分组"}}),a("el-table-column",{attrs:{prop:"driverClassName",label:"驱动类"}}),a("el-table-column",{attrs:{prop:"sourceName",label:"账号"}}),a("el-table-column",{attrs:{label:"操作",width:"220"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.editDatasource(t.row)}}},[e._v("修改")]),a("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(a){return e.editDbAuth(t.row)}}},[e._v("权限")]),a("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(a){return e.deleteDatasource(t.row)}}},[e._v("删除")])]}}])})],1),a("el-pagination",{staticStyle:{"margin-top":"10px"},attrs:{"current-page":e.currentPage,"page-sizes":[10,30,50],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.tableTotalCount},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentChange}}),a("el-dialog",{attrs:{inline:!0,title:e.newDatasource.id>0?"编辑数据源":"新增数据源",visible:e.datasourceDialogVisible,width:"760px","close-on-click-modal":!1},on:{"update:visible":function(t){e.datasourceDialogVisible=t}}},[a("el-form",{attrs:{"label-width":"120px"}},[a("el-form-item",{attrs:{label:"分组:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择或输入新的分组名字",filterable:"","allow-create":""},model:{value:e.newDatasource.groupName,callback:function(t){e.$set(e.newDatasource,"groupName",t)},expression:"newDatasource.groupName"}},[a("el-option",{attrs:{value:""}},[e._v("未分组")]),e._l(e.datasourceGroupList,(function(e){return a("el-option",{attrs:{value:e}})}))],2)],1),a("el-form-item",{attrs:{label:"数据源名称:"}},[a("el-input",{attrs:{placeholder:"给数据源起个中文名称"},model:{value:e.newDatasource.name,callback:function(t){e.$set(e.newDatasource,"name",t)},expression:"newDatasource.name"}})],1),a("el-form-item",{attrs:{label:"驱动类:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"驱动类"},on:{change:e.driverClassNameChange},model:{value:e.newDatasource.driverClassName,callback:function(t){e.$set(e.newDatasource,"driverClassName",t)},expression:"newDatasource.driverClassName"}},[a("el-option",{attrs:{label:"com.mysql.jdbc.Driver",value:"com.mysql.jdbc.Driver"}}),a("el-option",{attrs:{label:"net.sourceforge.jtds.jdbc.Driver",value:"net.sourceforge.jtds.jdbc.Driver"}}),a("el-option",{attrs:{label:"oracle.jdbc.driver.OracleDriver",value:"oracle.jdbc.driver.OracleDriver"}}),a("el-option",{attrs:{label:"org.postgresql.Driver",value:"org.postgresql.Driver"}}),a("el-option",{attrs:{label:"org.apache.hive.jdbc.HiveDriver",value:"org.apache.hive.jdbc.HiveDriver"}})],1)],1),a("el-form-item",{attrs:{label:"数据源URL:"}},[a("el-input",{attrs:{placeholder:e.urlPlaceholder},model:{value:e.newDatasource.sourceUrl,callback:function(t){e.$set(e.newDatasource,"sourceUrl",t)},expression:"newDatasource.sourceUrl"}})],1),a("el-form-item",{attrs:{label:"账号:"}},[a("el-input",{attrs:{placeholder:"账号"},model:{value:e.newDatasource.sourceName,callback:function(t){e.$set(e.newDatasource,"sourceName",t)},expression:"newDatasource.sourceName"}})],1),a("el-form-item",{attrs:{label:"密码:"}},[a("el-input",{attrs:{placeholder:"密码"},model:{value:e.newDatasource.sourcePassword,callback:function(t){e.$set(e.newDatasource,"sourcePassword",t)},expression:"newDatasource.sourcePassword"}})],1),a("el-form-item",{attrs:{label:"测试连接:"}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.testDatasourceErrLoading,expression:"testDatasourceErrLoading"}],attrs:{type:"primary"},on:{click:e.testDatasource}},[e._v("测试数据源")])],1)],1),a("div",{staticStyle:{"text-align":"center"},attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.saveDatasource}},[e._v("保存")]),a("el-button",{attrs:{plain:""},on:{click:function(t){e.datasourceDialogVisible=!1}}},[e._v("取消")])],1)],1),a("el-dialog",{attrs:{visible:e.dbSourceAuthDialogVisible,width:"900px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dbSourceAuthDialogVisible=t}}},[a("span",{attrs:{slot:"title"},slot:"title"},[a("span",[e._v("权限编辑")]),a("span",{staticStyle:{"margin-left":"10px",color:"#999","font-size":"12px"}},[a("i",{staticClass:"el-icon-info"}),e._v(" 添加、删除或编辑之后记得点击保存哦~")])]),a("el-row",[a("el-select",{staticStyle:{width:"750px","margin-right":"10px"},attrs:{filterable:"",remote:"","reserve-keyword":"",autoComplete:"new-password",placeholder:"请输入名字、邮箱、账号搜索用户","remote-method":e.getSearchUserList,loading:e.dbSourceAuthUserLoading},model:{value:e.dbSourceAuthNewUser,callback:function(t){e.dbSourceAuthNewUser=t},expression:"dbSourceAuthNewUser"}},e._l(e.searchUserList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.userName,value:e.id}})})),1),a("el-button",{on:{click:e.addDbSourceAuthUser}},[e._v("添加")])],1),a("el-table",{staticStyle:{width:"100%",margin:"10px 0"},attrs:{data:e.dbSourceAuthUserList,border:"",size:"mini"}},[a("el-table-column",{attrs:{prop:"userName",label:"用户",width:"150"}}),a("el-table-column",{attrs:{label:"权限"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-select",{staticStyle:{width:"150px","margin-right":"10px"},attrs:{placeholder:"选择权限"},model:{value:t.row.executeAuth,callback:function(a){e.$set(t.row,"executeAuth",a)},expression:"scope.row.executeAuth"}},[a("el-option",{attrs:{value:""}},[e._v("无权限")]),a("el-option",{attrs:{value:1,label:"库表查看权"}}),a("el-option",{attrs:{value:2,label:"数据查询权"}}),a("el-option",{attrs:{value:3,label:"所有权限"}})],1),a("el-checkbox",{attrs:{"true-label":1,"false-label":0},model:{value:t.row.descEditAuth,callback:function(a){e.$set(t.row,"descEditAuth",a)},expression:"scope.row.descEditAuth"}},[e._v("表字段注释修改权")]),a("el-checkbox",{attrs:{"true-label":1,"false-label":0},model:{value:t.row.procEditAuth,callback:function(a){e.$set(t.row,"procEditAuth",a)},expression:"scope.row.procEditAuth"}},[e._v("函数修改权")])]}}])}),a("el-table-column",{attrs:{label:"操作",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"small",type:"danger",plain:""},on:{click:function(a){return e.deleteUserDbSourceAuth(t.row)}}},[e._v("删除")])]}}])})],1),a("div",[a("el-button",{attrs:{type:"primary"},on:{click:e.saveUserDbSourceAuth}},[e._v("保存配置")])],1)],1),a("el-dialog",{attrs:{title:"测试数据源失败",visible:e.testDatasourceErrVisible,footer:null,width:"760px"},on:{"update:visible":function(t){e.testDatasourceErrVisible=t}}},[a("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[a("pre",[a("code",{domProps:{innerHTML:e._s(e.testDatasourceErrInfo)}})])])])],1)},Zt=[];function ea(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function ta(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ea(a,!0).forEach((function(t){Object(G["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ea(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var aa={data:function(){return{loadDataListLoading:!1,datasourceDialogVisible:!1,datasourceList:[],searchParam:{name:"",groupName:""},pageSize:30,currentPage:1,tableTotalCount:0,newDatasource:{},urlPlaceholder:"数据源URL",dbSourceAuthDialogVisible:!1,dbSourceAuthUserList:[],dbSourceAuthUserLoading:!1,searchUserList:[],dbSourceAuthNewUser:"",testDatasourceErrInfo:"",testDatasourceErrVisible:!1,testDatasourceErrLoading:!1,datasourceGroupList:[]}},mounted:function(){this.getDatasourceList(),this.getDatasourceGroupList()},methods:{editDbAuth:function(e){this.newDatasource=JSON.parse(JSON.stringify(e)),this.dbSourceAuthDialogVisible=!0,this.loadDbAuthUserList()},loadDbAuthUserList:function(){var e=this;this.dbSourceAuthNewUser=[],this.dbSourceAuthUserList=[];var t={sourceId:this.newDatasource.id};b.dbUserAuthList(t).then((function(t){e.dbSourceAuthUserList=t.data||[]}))},saveUserDbSourceAuth:function(){var e=this,t={sourceId:this.newDatasource.id,authList:JSON.stringify(this.dbSourceAuthUserList)};b.assignDbUserAuth(t).then((function(){e.$message.success("保存成功")}))},deleteUserDbSourceAuth:function(e){for(var t=[],a=0;a<this.dbSourceAuthUserList.length;a++){var o=this.dbSourceAuthUserList[a];o.userId!=e.userId&&t.push(this.dbSourceAuthUserList[a])}this.dbSourceAuthUserList=t},addDbSourceAuthUser:function(){if(this.dbSourceAuthNewUser.length<=0)this.$message.warning("请先选择用户");else{for(var e="",t=0;t<this.searchUserList.length;t++)if(this.dbSourceAuthNewUser==this.searchUserList[t].id){e=this.searchUserList[t].userName;break}this.dbSourceAuthUserList.push({userName:e,userId:this.dbSourceAuthNewUser,executeAuth:"",descEditAuth:0,procEditAuth:0}),this.dbSourceAuthNewUser=""}},getSearchUserList:function(e){var t=this;e&&(this.dbSourceAuthUserLoading=!0,f.getUserBaseInfo({search:e}).then((function(e){t.searchUserList=e.data||[],t.dbSourceAuthUserLoading=!1})))},addDatasource:function(){this.datasourceDialogVisible=!0,this.testDatasourceErrLoading=!1,this.newDatasource={name:"",driverClassName:"",sourceUrl:"",sourceName:"",sourcePassword:"",groupName:""}},editDatasource:function(e){this.newDatasource=JSON.parse(JSON.stringify(e)),this.datasourceDialogVisible=!0,this.testDatasourceErrLoading=!1},deleteDatasource:function(e){var t=this;this.$confirm("确定要删除此数据源吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.yn=0,b.manageUpdateDatasource(e).then((function(){t.$message.success("删除成功!"),t.$emit("loadDatasourceList"),t.getDatasourceList()}))})).catch((function(){}))},saveDatasource:function(){var e=this;b.manageUpdateDatasource(this.newDatasource).then((function(){e.datasourceDialogVisible=!1,e.$message.success("保存成功!"),e.$emit("loadDatasourceList"),e.getDatasourceList()}))},testDatasource:function(){var e=this;this.testDatasourceErrLoading=!0,b.queryTestDatasource(this.newDatasource).then((function(t){e.testDatasourceErrLoading=!1,200==t.errCode?e.$message.success("连接成功!"):(e.testDatasourceErrVisible=!0,e.testDatasourceErrInfo=t.errMsg||"")})).catch((function(t){e.testDatasourceErrLoading=!1,e.testDatasourceErrVisible=!0,e.testDatasourceErrInfo=t.message||"请求出错"}))},driverClassNameChange:function(){"com.mysql.jdbc.Driver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:mysql://127.0.0.1:3306/user_info?useUnicode=true&characterEncoding=utf8":"net.sourceforge.jtds.jdbc.Driver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:jtds:sqlserver://127.0.0.1:33434;DatabaseName=user_info;socketTimeout=60;":"oracle.jdbc.driver.OracleDriver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:oracle:thin:@127.0.0.1:1521/user_info":"org.postgresql.Driver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:postgresql://127.0.0.1:5432/user_info":"org.apache.hive.jdbc.HiveDriver"==this.newDatasource.driverClassName&&(this.urlPlaceholder="例:jdbc:hive2://127.0.0.1:21050/user_info;auth=noSasl")},handleCurrentChange:function(e){this.currentPage=e,this.getDatasourceList()},handlePageSizeChange:function(e){this.pageSize=e,this.getDatasourceList()},getDatasourceList:function(){var e=this;this.loadDataListLoading=!0;var t=ta({},this.searchParam,{pageNum:this.currentPage,pageSize:this.pageSize});b.manageDatasourceList(t).then((function(t){1==e.currentPage&&(e.tableTotalCount=t.total||0),e.datasourceList=t.data||[],setTimeout((function(){e.loadDataListLoading=!1}),800)})).catch((function(){e.loadDataListLoading=!1}))},getDatasourceGroupList:function(){var e=this;b.manageDatasourceGroupList({}).then((function(t){e.datasourceGroupList=t.data||[]}))}}},oa=aa,na=Object(C["a"])(oa,Yt,Zt,!1,null,null,null),ra=na.exports,ia=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{padding:"0 10px",height:"100%","box-sizing":"border-box"}},[a("el-card",[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[e._v("数据库表导出")])]),a("div",{staticStyle:{"margin-bottom":"10px"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择数据源"},on:{change:e.datasourceChangeEvents},model:{value:e.choiceDatasourceId,callback:function(t){e.choiceDatasourceId=t},expression:"choiceDatasourceId"}},e._l(e.datasourceOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),a("el-select",{staticStyle:{margin:"0 10px"},attrs:{filterable:"",placeholder:"请选择数据库"},on:{change:e.databaseChangeEvents},model:{value:e.choiceDatabase,callback:function(t){e.choiceDatabase=t},expression:"choiceDatabase"}},e._l(e.databaseList,(function(e){return a("el-option",{key:e.dbName,attrs:{label:e.dbName,value:e.dbName}})})),1),a("el-button",{staticStyle:{margin:"0 10px 0 20px"},attrs:{type:"primary"},on:{click:e.showExportTypeChoice}},[e._v("导出选中的表")]),a("a",{attrs:{target:"_blank",title:"点击查看如何使用",href:"http://doc.zyplayer.com/zyplayer-doc-manage/doc-wiki#/page/share/view?pageId=117&space=23f3f59a60824d21af9f7c3bbc9bc3cb"}},[a("i",{staticClass:"el-icon-info",staticStyle:{color:"#999"}})])],1),a("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.tableList,stripe:"",border:""},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"tableName",label:"表名"}}),a("el-table-column",{attrs:{prop:"tableComment",label:"表注释"}})],1)],1),a("form",{ref:"downloadForm",attrs:{method:"post",action:e.downloadFormParam.url,target:"_blank"}},e._l(e.downloadFormParam.param,(function(e,t){return a("input",{attrs:{type:"hidden",name:t},domProps:{value:e}})})),0),a("el-dialog",{attrs:{visible:e.exportTypeChoiceVisible,width:"600px"},on:{"update:visible":function(t){e.exportTypeChoiceVisible=t}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v("库表导出选项")]),a("el-form",{attrs:{"label-width":"100px"}},[a("el-form-item",{attrs:{label:"导出类型:"}},[a("el-radio-group",{on:{change:e.exportTypeChange},model:{value:e.exportType,callback:function(t){e.exportType=t},expression:"exportType"}},[a("el-radio",{attrs:{label:3}},[e._v("表数据")]),a("el-radio",{attrs:{label:1}},[e._v("表结构文档")]),a("el-radio",{attrs:{label:2}},[e._v("建表语句SQL")])],1)],1),1==e.exportType?a("el-form-item",{attrs:{label:"导出格式:"}},[a("el-select",{staticStyle:{width:"430px"},attrs:{filterable:"",placeholder:"请选择导出格式"},model:{value:e.exportFormat,callback:function(t){e.exportFormat=t},expression:"exportFormat"}},[a("el-option",{attrs:{label:"HTML格式",value:1}}),a("el-option",{attrs:{label:"Excel格式",value:2}}),a("el-option",{attrs:{label:"Word格式",value:3}})],1)],1):3==e.exportType?[a("el-form-item",{attrs:{label:"导出格式:"}},[a("el-select",{staticStyle:{width:"430px"},attrs:{filterable:"",placeholder:"请选择导出类型"},model:{value:e.downloadType,callback:function(t){e.downloadType=t},expression:"downloadType"}},[a("el-option",{attrs:{label:"SQL Inserts",value:"insert"}}),a("el-option",{attrs:{label:"SQL Updates",value:"update"}}),a("el-option",{attrs:{label:"JSON",value:"json"}}),a("el-option",{attrs:{label:"Excel",value:"excel"}})],1)],1),"insert"===e.downloadType?a("el-form-item",{attrs:{label:"数据表:"}},[a("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.dropTableFlagChange},model:{value:e.dropTableFlag,callback:function(t){e.dropTableFlag=t},expression:"dropTableFlag"}},[e._v("删除表"+e._s(1==e.dropTableFlag?"!!":""))]),a("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.createTableFlagChange},model:{value:e.createTableFlag,callback:function(t){e.createTableFlag=t},expression:"createTableFlag"}},[e._v("创建表")])],1):e._e(),a("el-form-item",{attrs:{label:"导出方式:"}},[a("el-radio-group",{model:{value:e.downloadFileType,callback:function(t){e.downloadFileType=t},expression:"downloadFileType"}},[a("el-radio",{attrs:{label:1}},[e._v("单个文件")]),a("el-radio",{attrs:{label:2}},[e._v("zip压缩文件")])],1)],1)]:e._e()],2),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.exportTypeChoiceVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.doExport}},[e._v("确 定")])],1)],1)],1)},sa=[],la={data:function(){return{datasourceOptions:[],datasourceList:[],choiceDatasourceId:"",choiceDatabase:"",choiceTable:"",exportType:3,exportFormat:1,downloadFileType:1,exportTypeChoiceVisible:!1,databaseList:[],tableList:[],selectTables:[],downloadFormParam:{url:"zyplayer-doc-db/doc-db/exportDatabase",param:{}},downloadType:"insert",dropTableFlag:0,createTableFlag:0}},activated:function(){this.initQueryParam(this.$route)},mounted:function(){this.loadDatasourceList()},methods:{initQueryParam:function(e){var t=e.query,a=parseInt(t.sourceId);a&&t.dbName&&(this.choiceDatasourceId===a&&this.choiceDatabase===t.dbName||(this.choiceDatasourceId=a,this.choiceDatabase=t.dbName,this.datasourceChangeEvents(),this.databaseChangeEvents()))},datasourceChangeEvents:function(){this.loadDatabaseList(this.choiceDatasourceId)},databaseChangeEvents:function(){this.loadGetTableList()},exportTypeChange:function(){this.exportFormat=1,console.log(this.exportType)},doExport:function(){var e=this;if(this.exportType)if(this.exportFormat){for(var t="",a=0;a<this.selectTables.length;a++)""!==t&&(t+=","),t+=this.selectTables[a].tableName;this.downloadFormParam.param={sourceId:this.choiceDatasourceId,exportType:this.exportType,exportFormat:this.exportFormat,dbName:this.choiceDatabase,downloadType:this.downloadType,dropTableFlag:this.dropTableFlag,createTableFlag:this.createTableFlag,downloadFileType:this.downloadFileType,tableNames:t},3==this.exportType?this.downloadFormParam.url="zyplayer-doc-db/data-view/downloadMultiple":this.downloadFormParam.url="zyplayer-doc-db/doc-db/exportDatabase",setTimeout((function(){return e.$refs.downloadForm.submit()}),0),this.exportTypeChoiceVisible=!1}else this.$message.info("请选择导出格式");else this.$message.info("请选择导出类型")},showExportTypeChoice:function(){this.selectTables.length<=0?this.$message.info("请选择需要导出的表"):this.exportTypeChoiceVisible=!0},loadGetTableList:function(){var e=this;b.tableList({sourceId:this.choiceDatasourceId,dbName:this.choiceDatabase}).then((function(t){e.tableList=t.data||[]}))},loadDatasourceList:function(){var e=this;b.datasourceList({}).then((function(t){e.datasourceList=t.data||[];for(var a=[],o=0;o<e.datasourceList.length;o++)a.push({label:e.datasourceList[o].name,value:e.datasourceList[o].id});e.datasourceOptions=a}))},loadDatabaseList:function(){var e=this;b.databaseList({sourceId:this.choiceDatasourceId}).then((function(t){e.databaseList=t.data||[]}))},handleSelectionChange:function(e){this.selectTables=e},dropTableFlagChange:function(){1===this.dropTableFlag&&(this.createTableFlag=1)},createTableFlagChange:function(){0==this.createTableFlag&&(this.dropTableFlag=0)}}},ca=la,ua=(a("9100"),Object(C["a"])(ca,ia,sa,!1,null,null,null)),da=ua.exports,ha=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"data-executor-vue"},[a("div",{staticStyle:{padding:"0 10px 10px",height:"100%","box-sizing":"border-box"}},[a("el-card",{staticStyle:{"margin-bottom":"10px"}},[a("ace-editor",{ref:"sqlEditor",staticStyle:{"margin-bottom":"10px"},attrs:{lang:"sql",theme:"monokai",width:"100%",height:"500",options:e.sqlEditorConfig,source:e.executorSource},on:{init:e.sqlExecutorInit},model:{value:e.sqlExecutorContent,callback:function(t){e.sqlExecutorContent=t},expression:"sqlExecutorContent"}}),a("div",[e.sqlExecuting?a("el-button",{attrs:{type:"primary",plain:"",size:"small",icon:"el-icon-video-pause"},on:{click:e.cancelExecutorSql}},[e._v("取消执行")]):a("el-tooltip",{attrs:{effect:"dark",content:"Ctrl+R、Ctrl+Enter",placement:"top"}},[a("el-button",{attrs:{type:"primary",plain:"",size:"small",icon:"el-icon-video-play"},on:{click:e.doExecutorSql}},[e._v("执行")])],1),a("el-button",{attrs:{icon:"el-icon-brush",size:"small"},on:{click:e.formatterSql}},[e._v("SQL美化")]),a("el-button",{attrs:{plain:"",size:"small",icon:"el-icon-star-off"},on:{click:function(t){return e.addFavorite("")}}},[e._v("收藏")]),a("div",{staticStyle:{float:"right"}},[a("el-select",{staticStyle:{width:"300px","margin-left":"10px"},attrs:{size:"small",filterable:"",placeholder:"请选择数据源"},on:{change:e.datasourceChangeEvents},model:{value:e.choiceDatasourceId,callback:function(t){e.choiceDatasourceId=t},expression:"choiceDatasourceId"}},e._l(e.datasourceOptions,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1),a("el-select",{staticStyle:{width:"200px","margin-left":"10px"},attrs:{size:"small",filterable:"",placeholder:"请选择数据库"},on:{change:e.databaseChangeEvents},model:{value:e.choiceDatabase,callback:function(t){e.choiceDatabase=t},expression:"choiceDatabase"}},e._l(e.databaseList,(function(e){return a("el-option",{key:e.dbName,attrs:{label:e.dbName,value:e.dbName}})})),1)],1)],1),e.sqlParams.length>0?a("div",{staticClass:"sql-params"},e._l(e.sqlParams,(function(t){return a("el-input",{attrs:{placeholder:"请输入"+t.key+"的值"},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"param.value"}},[a("template",{slot:"prepend"},[e._v(e._s(t.key))])],2)})),1):e._e()],1),a("el-card",[a("div",{staticStyle:{position:"relative"}},[a("div",{staticStyle:{position:"absolute",right:"0","z-index":"1"}},[a("el-dropdown",{directives:[{name:"show",rawName:"v-show",value:this.choiceResultObj[this.executeShowTable]&&this.choiceResultObj[this.executeShowTable].length>0,expression:"this.choiceResultObj[this.executeShowTable] && this.choiceResultObj[this.executeShowTable].length > 0"}],on:{command:e.handleCopyCheckLineCommand}},[a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-document-copy"}},[e._v(" 复制选中行"),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"insert"}},[e._v("SQL Inserts")]),a("el-dropdown-item",{attrs:{command:"update"}},[e._v("SQL Updates")]),a("el-dropdown-item",{attrs:{command:"json"}},[e._v("JSON")])],1)],1)],1),a("el-tabs",{model:{value:e.executeShowTable,callback:function(t){e.executeShowTable=t},expression:"executeShowTable"}},[a("el-tab-pane",{attrs:{label:"执行历史",name:"tabHistory"}},[a("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.myHistoryListList,stripe:"",border:""}},[a("el-table-column",{attrs:{prop:"createTime",label:"执行时间",width:"160px"}}),a("el-table-column",{attrs:{prop:"content",label:"SQL"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("pre",{staticClass:"sql-content-line",attrs:{title:t.row.content},on:{dblclick:function(a){return e.inputFavoriteSql(t.row)}}},[e._v(e._s(t.row.content))])]}}])}),a("el-table-column",{attrs:{label:"操作",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(a){return e.inputFavoriteSql(t.row)}}},[e._v("输入")]),a("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini",type:"success"},on:{click:function(a){return e.addFavorite(t.row.content)}}},[e._v("收藏")])]}}])})],1)],1),a("el-tab-pane",{attrs:{label:"我的收藏",name:"tabFavorite"}},[a("el-table",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll"}],staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.myFavoriteList,stripe:"",border:""}},[a("el-table-column",{attrs:{prop:"createTime",label:"执行时间",width:"160px"}}),a("el-table-column",{attrs:{prop:"content",label:"SQL"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("pre",{staticClass:"sql-content-line",attrs:{title:t.row.content},on:{dblclick:function(a){return e.inputFavoriteSql(t.row)}}},[e._v(e._s(t.row.content))])]}}])}),a("el-table-column",{attrs:{label:"操作",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(a){return e.inputFavoriteSql(t.row)}}},[e._v("输入")]),a("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini",type:"danger"},on:{click:function(a){return e.delFavorite(t.row)}}},[e._v("删除")])]}}])})],1)],1),e.executeResultInfo?a("el-tab-pane",{attrs:{label:"信息",name:"tabInfo"}},[a("pre",{staticStyle:{"white-space":"pre-wrap"}},[e._v(e._s(e.executeResultInfo))])]):e._e(),e.executeError?a("el-tab-pane",{attrs:{label:"错误",name:"tabError"}},[a("div",{staticStyle:{color:"#f00"}},[e._v(e._s(e.executeError))])]):e._l(e.executeResultList,(function(t){return t.index?a("el-tab-pane",{attrs:{label:"结果"+t.index,name:t.name}},[t.errMsg?a("div",{staticStyle:{color:"#f00"}},[e._v(e._s(t.errMsg))]):t.dataList.length<=0?a("div",{staticStyle:{"text-align":"center",color:"#aaa",padding:"20px 0"}},[e._v("暂无数据")]):a("el-table",{staticClass:"execute-result-table",staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:t.dataList,stripe:"",border:"","max-height":"600"},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{type:"index",width:"50"}}),e._l(t.dataCols,(function(t){return a("el-table-column",{attrs:{prop:t.prop,label:t.prop,width:t.width},scopedSlots:e._u([{key:"default",fn:function(e){return[a("textarea",{staticClass:"el-textarea__inner",attrs:{readonly:"",rows:"1"},domProps:{value:e.row[t.prop]}})]}}],null,!0)})}))],2)],1):e._e()}))],2)],1)])],1),a("el-dialog",{attrs:{visible:e.exportConditionVisible,width:"500px",title:"选择更新语句条件"},on:{"update:visible":function(t){e.exportConditionVisible=t}}},[a("div",[e._v(" 更新条件列: "),a("el-select",{staticStyle:{width:"370px"},attrs:{multiple:"",placeholder:"请选择"},model:{value:e.conditionDataColsChoice,callback:function(t){e.conditionDataColsChoice=t},expression:"conditionDataColsChoice"}},e._l(e.conditionDataCols,(function(e){return a("el-option",{key:e.prop,attrs:{label:e.prop,value:e.prop}})})),1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.exportConditionVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.doCopyCheckLineUpdate}},[e._v("确 定")])],1)]),a("span",{staticStyle:{visibility:"hidden","white-space":"nowrap",position:"fixed"},attrs:{id:"widthCalculate"}})],1)},pa=[],ma={parser:function(e,t,a){var o=[];if(!e)return o;var n=e.indexOf(t,0);if(-1==n)return o;var r=0,i="";while(n>-1){if(n>0&&"\\"==e[n-1])r=n+t.length;else{i="",r=n+t.length;var s=e.indexOf(a,r);while(s>-1){if(!(s>r&&"\\"==e[s-1])){i+=e.substr(r,s-r),r=s+a.length;break}i+=e.substr(r,s-r-1),r=s+a.length,s=e.indexOf(a,r)}-1==s?r=e.length:(i&&o.push(i),r=s+a.length)}n=e.indexOf(t,r)}return o},parserArr:function(e,t){var a=this,o={};t.forEach((function(t){var n=a.parser(e,t.start,t.end);n.forEach((function(e){return o[e]=1}))}));var n=[];for(var r in o)n.push(r);return n}},fa={data:function(){return{datasourceList:[],choiceDatasourceId:"",datasourceOptions:[],datasourceGroupList:[],choiceDatasourceGroup:"",databaseList:[],choiceDatabase:"",editorDbProduct:"",editorDbInfo:[],editorDbTableInfo:{},editorColumnInfo:{},sqlExecuting:!1,executeResultList:[],executeResultInfo:"",executeShowTable:"tabHistory",sqlExecutorEditor:{},nowExecutorId:1,executeError:"",myFavoriteList:[],myHistoryListList:[],choiceResultObj:{},exportConditionVisible:!1,conditionDataCols:[],conditionDataColsChoice:[],sqlExecutorContent:"",sqlEditorConfig:{wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:15,maxLines:40},executorSource:{},sqlParams:[],sqlParamWaiting:!1,sqlParamHistory:{}}},components:{"ace-editor":mt},mounted:function(){this.loadDatasourceList()},methods:{sqlExecutorInit:function(e){var t=this;this.sqlExecutorEditor=e,this.sqlExecutorEditor.setFontSize(16);var a=this;this.sqlExecutorEditor.commands.addCommand({name:"execute-sql",bindKey:{win:"Ctrl-R|Ctrl-Shift-R|Ctrl-Enter",mac:"Command-R|Command-Shift-R|Command-Enter"},exec:function(e){a.doExecutorSql()}}),e.on("change",(function(){t.sqlParamWaiting||(t.sqlParamWaiting=!0,setTimeout((function(){var a=e.getValue(),o=ma.parserArr(a,[{start:"${",end:"}"},{start:"#{",end:"}"}]);t.sqlParams=[],o.forEach((function(e){t.sqlParams.push({key:e,value:t.sqlParamHistory[e]||""})})),t.sqlParamWaiting=!1}),300))}))},cancelExecutorSql:function(){var e=this;b.executeSqlCancel({executeId:this.nowExecutorId}).then((function(){e.$message.success("取消成功")}))},loadHistoryAndFavoriteList:function(){this.loadHistoryList(),this.loadFavoriteList()},loadFavoriteList:function(){var e=this;b.favoriteList({sourceId:this.choiceDatasourceId}).then((function(t){e.myFavoriteList=t.data||[]}))},loadHistoryList:function(){var e=this;b.historyList({sourceId:this.choiceDatasourceId}).then((function(t){e.myHistoryListList=t.data||[]}))},addFavorite:function(e){var t=this;e||(e=this.sqlExecutorEditor.getSelectedText(),e||(e=this.sqlExecutorEditor.getValue()));var a={};this.sqlParams.forEach((function(e){e.value&&(a[e.key]=e.value)}));var o={name:"我的收藏",content:e,paramJson:JSON.stringify(a),datasourceId:this.choiceDatasourceId};b.updateFavorite(o).then((function(){t.$message.success("收藏成功"),t.loadFavoriteList()}))},delFavorite:function(e){var t=this;b.updateFavorite({id:e.id,yn:0}).then((function(){t.$message.success("删除成功"),t.loadFavoriteList()}))},inputFavoriteSql:function(e){if(this.sqlExecutorEditor.setValue(e.content,1),e.paramJson){var t=JSON.parse(e.paramJson);for(var a in t)this.sqlParamHistory[a]=t[a]}},formatterSql:function(){var e=this.sqlExecutorEditor.getSelectedText();if(e){var t=this.sqlExecutorEditor.getSelectionRange();this.sqlExecutorEditor.remove(t)}else e=this.sqlExecutorEditor.getValue(),this.sqlExecutorEditor.setValue("",1);e&&(e=ut.a.format(e),this.sqlExecutorEditor.insert(e))},doExecutorSql:function(){var e=this;if(this.choiceDatasourceId){this.executeError="",this.executeUseTime="",this.executeResultList=[];var t={};this.sqlParams.forEach((function(a){a.value&&(t[a.key]=a.value,e.sqlParamHistory[a.key]=a.value)})),this.nowExecutorId=(new Date).getTime()+Math.ceil(1e3*Math.random());var a=this.sqlExecutorEditor.getSelectedText();a||(a=this.sqlExecutorEditor.getValue()),this.sqlExecuting=!0,b.queryExecuteSql({sourceId:this.choiceDatasourceId,dbName:this.choiceDatabase,executeId:this.nowExecutorId,sql:a,params:JSON.stringify(t)}).then((function(t){if(e.sqlExecuting=!1,200!=t.errCode)return e.executeShowTable="tabError",void(e.executeError=t.errMsg);for(var a=t.data||[],o=[],n="",r=1,i=0;i<a.length;i++){var s=JSON.parse(a[i]);n+=e.getExecuteInfoStr(s);var l=e.dealExecuteResult(s);l.updateCount<0&&(l.index=r,l.name="tab"+r,r++),o.push(l)}e.executeShowTable=1===r?"tabInfo":"tab1",e.executeResultInfo=n,e.executeResultList=o,e.loadHistoryList()}))}else this.$message.error("请先选择数据源")},loadDatasourceList:function(){var e=this;b.datasourceList({}).then((function(t){e.datasourceList=t.data||[],e.datasourceOptions=e.datasourceList;var a=[];e.datasourceList.filter((function(e){return!!e.groupName})).forEach((function(e){return a.push(e.groupName||"")})),e.datasourceGroupList=Array.from(new Set(a)),e.datasourceList.length>0&&(e.choiceDatasourceId=e.datasourceList[0].id,e.executorSource={sourceId:e.choiceDatasourceId},e.loadDatabaseList(),e.loadSourceBaseInfo(),e.loadHistoryAndFavoriteList())}))},loadDatabaseList:function(){var e=this;b.databaseList({sourceId:this.choiceDatasourceId}).then((function(t){if(e.databaseList=t.data||[],e.databaseList.length>0){var a=["information_schema","master","model","msdb","tempdb"],o=e.databaseList.find((function(e){return a.indexOf(e.dbName)<0}));e.choiceDatabase=o?o.dbName:e.databaseList[0].dbName,e.executorSource={sourceId:e.choiceDatasourceId,dbName:e.choiceDatabase}}}))},loadSourceBaseInfo:function(){var e=this;b.getSourceBaseInfo({sourceId:this.choiceDatasourceId}).then((function(t){var a=t.data||{};e.editorDbProduct=a.product||""}))},sourceGroupChangeEvents:function(){for(var e=[],t=0;t<this.datasourceList.length;t++){var a=this.datasourceList[t];this.choiceDatasourceGroup&&this.choiceDatasourceGroup!=a.groupName||e.push(a)}this.datasourceOptions=e,e.length>0&&(this.choiceDatasourceId=e[0].id,this.executorSource={sourceId:this.choiceDatasourceId},this.loadDatabaseList(),this.loadSourceBaseInfo(),this.loadHistoryAndFavoriteList())},datasourceChangeEvents:function(){this.executorSource={sourceId:this.choiceDatasourceId},this.loadDatabaseList(),this.loadSourceBaseInfo(),this.loadHistoryAndFavoriteList()},databaseChangeEvents:function(){this.executorSource={sourceId:this.choiceDatasourceId,dbName:this.choiceDatabase}},getExecuteInfoStr:function(e){var t=e.sql;return t+="\n> 状态:"+(e.errMsg?"ERROR":"OK"),e.updateCount>=0&&(t+="\n> 影响行数:"+e.updateCount),t+="\n> 耗时:"+(e.useTime||0)/1e3+"s",t+="\n\n",t},dealExecuteResult:function(e){var t=e.result||[],a=[];if(t.length>0){var o=t[0];for(var n in o){document.getElementById("widthCalculate").innerText=n;var r=document.getElementById("widthCalculate").offsetWidth;document.getElementById("widthCalculate").innerText=o[n];var i=document.getElementById("widthCalculate").offsetWidth,s=r>i?r:i;s=s<50?50:s,s=s>200?200:s,a.push({prop:n,width:s+25})}}var l={};return l.dataList=t,l.dataCols=a,l.useTime=e.useTime||0,l.errMsg=e.errMsg||"",l.updateCount=e.updateCount,l},handleSelectionChange:function(e){this.$set(this.choiceResultObj,this.executeShowTable,e)},doCopyCheckLineUpdate:function(){var e=this,t=this.choiceResultObj[this.executeShowTable]||[];if(t.length>0){var a=this.executeResultList.find((function(t){return t.name===e.executeShowTable})).dataCols,o=lt.format("update",this.editorDbProduct,a,t,this.conditionDataColsChoice);this.conditionDataColsChoice=[],this.exportConditionVisible=!1,this.$copyText(o).then((function(t){return e.$message.success("内容已复制到剪切板!")}),(function(t){return e.$message.error("抱歉,复制失败!")}))}},handleCopyCheckLineCommand:function(e){var t=this,a=this.choiceResultObj[this.executeShowTable]||[];if(a.length>0){var o=this.executeResultList.find((function(e){return e.name===t.executeShowTable})).dataCols;if("update"===e)return this.conditionDataCols=o,void(this.exportConditionVisible=!0);var n=lt.format(e,this.editorDbProduct,o,a,"");this.$copyText(n).then((function(e){return t.$message.success("内容已复制到剪切板!")}),(function(e){return t.$message.error("抱歉,复制失败!")}))}}}},ba=fa,ga=(a("7002"),Object(C["a"])(ba,ha,pa,!1,null,null,null)),va=ga.exports,ya=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"data-transfer-vue"},[a("div",{staticStyle:{padding:"0 10px",height:"100%","box-sizing":"border-box"}},[a("el-card",[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[e._v("数据互导工具")]),a("a",{attrs:{target:"_blank",title:"点击查看如何使用",href:"http://doc.zyplayer.com/zyplayer-doc-manage/doc-wiki#/page/share/view?pageId=128&space=23f3f59a60824d21af9f7c3bbc9bc3cb"}},[a("i",{staticClass:"el-icon-info",staticStyle:{color:"#999"}})])]),a("div",{staticStyle:{"margin-bottom":"10px","text-align":"right"}},[a("el-button",{attrs:{type:"success",icon:"el-icon-plus"},on:{click:e.createNewTask}},[e._v("新建")]),a("el-button",{attrs:{type:"primary",loading:e.loadDataListLoading,icon:"el-icon-refresh"},on:{click:e.loadGetTaskList}},[e._v("查询")])],1),a("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.taskList,stripe:"",border:""}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"55"}}),a("el-table-column",{attrs:{prop:"name",label:"任务名称"}}),a("el-table-column",{attrs:{label:"条数查询"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(1==t.row.needCount?"是":"否"))]}}])}),a("el-table-column",{attrs:{prop:"lastExecuteStatus",label:"最后执行状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[0==t.row.lastExecuteStatus?a("el-tag",[e._v("未执行")]):1==t.row.lastExecuteStatus?a("el-tag",{attrs:{type:"info"}},[e._v("执行中")]):2==t.row.lastExecuteStatus?a("el-tag",{attrs:{type:"success"}},[e._v("执行成功")]):3==t.row.lastExecuteStatus?a("el-tag",{attrs:{type:"danger"}},[e._v("执行失败")]):4==t.row.lastExecuteStatus?a("el-tag",{attrs:{type:"warning"}},[e._v("取消执行")]):e._e()]}}])}),a("el-table-column",{attrs:{prop:"lastExecuteTime",label:"最后执行时间"}}),a("el-table-column",{attrs:{prop:"createUserName",label:"创建人"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间"}}),a("el-table-column",{attrs:{label:"操作",width:"290"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(a){return e.viewTask(t.row.id)}}},[e._v("查看")]),a("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(a){return e.editTask(t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(a){return e.executeTask(t.row.id)}}},[e._v("执行")]),a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(a){return e.deleteTask(t.row.id)}}},[e._v("删除")])]}}])})],1)],1)],1),a("el-dialog",{attrs:{visible:e.taskEditDialogVisible,width:"900px","close-on-click-modal":!1},on:{"update:visible":function(t){e.taskEditDialogVisible=t}}},[e.taskEditInfo.id?a("span",{attrs:{slot:"title"},slot:"title"},[e._v("编辑任务")]):a("span",{attrs:{slot:"title"},slot:"title"},[e._v("新建任务")]),a("el-form",{attrs:{"label-width":"120px"}},[a("el-form-item",{attrs:{label:"任务名称:"}},[a("el-input",{attrs:{placeholder:"任务名称"},model:{value:e.taskEditInfo.name,callback:function(t){e.$set(e.taskEditInfo,"name",t)},expression:"taskEditInfo.name"}})],1),a("el-form-item",{attrs:{label:"查询数据源:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择查询数据源"},model:{value:e.taskEditInfo.queryDatasourceId,callback:function(t){e.$set(e.taskEditInfo,"queryDatasourceId",t)},expression:"taskEditInfo.queryDatasourceId"}},e._l(e.datasourceOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"查询SQL:"}},[a("ace-editor",{attrs:{lang:"sql",theme:"monokai",width:"100%",height:"100",options:e.editSqlConfig},on:{init:e.querySqlInit},model:{value:e.querySqlContent,callback:function(t){e.querySqlContent=t},expression:"querySqlContent"}})],1),a("el-form-item",{attrs:{label:"总条数查询:"}},[a("el-radio",{attrs:{label:0},model:{value:e.taskEditInfo.needCount,callback:function(t){e.$set(e.taskEditInfo,"needCount",t)},expression:"taskEditInfo.needCount"}},[e._v("不查询")]),a("el-radio",{attrs:{label:1},model:{value:e.taskEditInfo.needCount,callback:function(t){e.$set(e.taskEditInfo,"needCount",t)},expression:"taskEditInfo.needCount"}},[e._v("自动查询")])],1),a("el-form-item",{attrs:{label:"入库数据源:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择写入数据源"},model:{value:e.taskEditInfo.storageDatasourceId,callback:function(t){e.$set(e.taskEditInfo,"storageDatasourceId",t)},expression:"taskEditInfo.storageDatasourceId"}},e._l(e.datasourceOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"入库SQL:"}},[a("ace-editor",{attrs:{lang:"sql",theme:"monokai",width:"100%",height:"100",options:e.editSqlConfig},on:{init:e.storageSqlInit},model:{value:e.storageSqlContent,callback:function(t){e.storageSqlContent=t},expression:"storageSqlContent"}}),a("el-button",{staticStyle:{"margin-top":"10px"},on:{click:e.autoFillStorageSql}},[e._v("智能填充")])],1)],1),a("div",{staticStyle:{"text-align":"center"}},[a("el-button",{attrs:{type:"primary"},on:{click:e.saveEditTask}},[e._v("保存")]),a("el-button",{attrs:{type:"warning"},on:{click:function(t){e.taskEditDialogVisible=!1}}},[e._v("取消")])],1)],1),a("el-dialog",{attrs:{visible:e.taskViewDialogVisible,width:"80%"},on:{"update:visible":function(t){e.taskViewDialogVisible=t}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v("查看任务")]),a("el-form",{attrs:{"label-width":"120px"}},[a("el-form-item",{attrs:{label:"任务名称:"}},[e._v(e._s(e.taskEditInfo.name))]),a("el-form-item",{attrs:{label:"最后执行状态:"}},[0==e.taskEditInfo.lastExecuteStatus?a("el-tag",[e._v("未执行")]):1==e.taskEditInfo.lastExecuteStatus?a("el-tag",{attrs:{type:"info"}},[e._v("执行中")]):2==e.taskEditInfo.lastExecuteStatus?a("el-tag",{attrs:{type:"success"}},[e._v("执行成功")]):3==e.taskEditInfo.lastExecuteStatus?a("el-tag",{attrs:{type:"danger"}},[e._v("执行失败")]):4==e.taskEditInfo.lastExecuteStatus?a("el-tag",{attrs:{type:"warning"}},[e._v("取消执行")]):e._e()],1),a("el-form-item",{attrs:{label:"最后执行时间:"}},[e._v(e._s(e.taskEditInfo.lastExecuteTime))]),a("el-form-item",{attrs:{label:"执行信息:"}},[a("pre",{staticStyle:{"word-wrap":"break-word","word-break":"break-all","white-space":"pre-wrap","line-height":"22px"}},[e._v(e._s(e.taskEditInfo.lastExecuteInfo))])]),1==e.taskEditInfo.lastExecuteStatus?a("el-form-item",{attrs:{label:"操作:"}},[a("el-button",{attrs:{type:"success",icon:"el-icon-refresh",loading:e.viewTaskLoading},on:{click:function(t){return e.viewTask(e.taskEditInfo.id)}}},[e._v("刷新")]),a("el-button",{attrs:{type:"danger"},on:{click:e.cancelTask}},[e._v("取消执行")])],1):e._e()],1)],1)],1)},wa=[],xa={data:function(){return{viewTaskLoading:!1,loadDataListLoading:!1,datasourceOptions:[],queryDatasourceId:"",storageDatasourceId:"",taskList:[],datasourceMap:{},taskViewDialogVisible:!1,taskEditDialogVisible:!1,taskEditInfo:{},querySqlEditor:{},storageSqlEditor:{},querySqlContent:"",storageSqlContent:"",editSqlConfig:{wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:10,maxLines:25}}},components:{"ace-editor":mt},mounted:function(){this.loadDatasourceList()},methods:{editTask:function(e){var t=this;this.taskEditInfo=JSON.parse(JSON.stringify(e)),this.taskEditDialogVisible=!0,setTimeout((function(){t.querySqlEditor.setValue(t.taskEditInfo.querySql,1),t.storageSqlEditor.setValue(t.taskEditInfo.storageSql,1)}),200)},querySqlInit:function(e){this.querySqlEditor=e,this.querySqlEditor.setFontSize(16)},storageSqlInit:function(e){this.storageSqlEditor=e,this.storageSqlEditor.setFontSize(16)},createNewTask:function(){var e=this;this.taskEditInfo={querySql:"",storageSql:"",name:"",needCount:1,queryDatasourceId:"",storageDatasourceId:""},this.taskEditDialogVisible=!0,setTimeout((function(){e.querySqlEditor.setValue("",1),e.storageSqlEditor.setValue("",1)}),200)},deleteTask:function(e){var t=this;this.$confirm("确定要删除此任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){b.transferUpdate({id:e,delFlag:1}).then((function(){t.$message.success("删除成功"),t.loadGetTaskList()}))})).catch((function(){}))},executeTask:function(e){var t=this;this.$confirm("确定要执行一次此任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){b.transferStart({id:e}).then((function(){t.$message.success("任务提交成功")}))})).catch((function(){}))},saveEditTask:function(){var e=this;this.taskEditInfo.querySql=this.querySqlEditor.getValue(),this.taskEditInfo.storageSql=this.storageSqlEditor.getValue(),b.transferUpdate(this.taskEditInfo).then((function(){e.$message.success("保存成功"),e.taskEditDialogVisible=!1,e.loadGetTaskList()}))},viewTask:function(e){var t=this;this.viewTaskLoading=!0,this.taskViewDialogVisible=!0,b.transferDetail({id:e}).then((function(e){t.taskEditInfo=e.data||{},setTimeout((function(){t.viewTaskLoading=!1}),300)}))},cancelTask:function(){var e=this;this.$confirm("确定要取消执行此任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){b.transferCancel({id:e.taskEditInfo.id}).then((function(){e.$message.success("取消成功"),e.viewTask(e.taskEditInfo.id)}))})).catch((function(){}))},loadGetTaskList:function(){var e=this;this.loadDataListLoading=!0,b.transferList({}).then((function(t){e.taskList=t.data||[],setTimeout((function(){e.loadDataListLoading=!1}),800)}))},autoFillStorageSql:function(){var e=this,t=this.querySqlEditor.getValue();b.transferSqlColumns({sql:t}).then((function(t){var a=t.data||[];if(a.length<=0)e.$message.error("查询的字段不明确,不能自动填充");else{var o="\n";o+="insert into TableName (\n";for(var n=0;n<a.length;n++)o+="\t"+(0===n?"":",")+a[n]+"\n";o+=") values (\n";for(var r=0;r<a.length;r++)o+="\t"+(0===r?"":",")+"#{"+a[r]+"}\n";o+=")\n\n",e.storageSqlEditor.setValue(o,1)}}))},loadDatasourceList:function(){var e=this;b.datasourceList({}).then((function(t){e.datasourceList=t.data||[];for(var a=[],o={},n=0;n<e.datasourceList.length;n++)o[e.datasourceList[n].id]=e.datasourceList[n].name,a.push({label:e.datasourceList[n].name,value:e.datasourceList[n].id});e.datasourceMap=o,e.datasourceOptions=a,e.loadGetTaskList()}))},initAceEditor:function(e,t){return ace.edit(e,{theme:"ace/theme/monokai",mode:"ace/mode/sql",wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:t,maxLines:25})}}},Ca=xa,Sa=(a("9743"),Object(C["a"])(Ca,ya,wa,!1,null,null,null)),Da=Sa.exports,_a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[e._v("没有权限访问该模块")])},ka=[],Ia={data:function(){return{}},mounted:function(){},methods:{}},La=Ia,Ea=Object(C["a"])(La,_a,ka,!1,null,null,null),Pa=Ea.exports,Na=[{path:"/home",component:$,name:"主页",meta:{requireAuth:!0}},{path:"/",redirect:"/home"},{path:"/",name:"Tab标签页",component:tt,children:[{path:"/table/info",name:"表信息",component:Et},{path:"/table/database",name:"库信息",component:$t},{path:"/procedure/list",name:"存储过程",component:Qt},{path:"/procedure/edit",name:"编辑存储过程",component:Xt},{path:"/data/datasourceManage",name:"数据源管理",component:ra},{path:"/data/export",name:"数据库导出",component:da},{path:"/data/executor",name:"SQL执行器",component:va},{path:"/data/transferData",name:"数据互导工具",component:Da},{path:"/data/dataPreview",name:"表数据预览",component:vt},{path:"/user/myInfo",name:"我的信息",component:Be}]},{path:"/user",name:"用户管理",component:We,children:[{path:"login",name:"系统登录",component:Ae,meta:{fullscreen:!0}}]},{path:"/common",name:"",component:We,children:[{path:"noAuth",name:"没有权限",component:Pa}]}],Ta=Na,Oa=a("2f62"),qa={namespaced:!0,state:{pageTabNameMap:{},fullscreen:!1},getters:{getPageTabNameMap:function(e){return e.pageTabNameMap}},mutations:{addTableName:function(e,t){var a=Object.assign({},e.pageTabNameMap);a[t.key]=t.val,e.pageTabNameMap=a},setFullscreen:function(e,t){e.fullscreen=t}}};o["default"].use(Oa["a"]);var $a=new Oa["a"].Store({modules:{global:qa}}),za=a("a7fe"),ja=a.n(za),Aa=a("2315"),Ra=a.n(Aa),Fa=(a("f1e9"),a("4eb5")),Va=a.n(Fa);o["default"].use(Va.a),o["default"].use(r.a),o["default"].use(E["a"]),o["default"].use(ja.a,d.a),o["default"].use(Ra.a),o["default"].prototype.$store=$a;var Ua=new E["a"]({routes:Ta});Ua.beforeEach((function(e,t,a){e.meta.title&&(document.title=e.meta.title),$a.commit("global/setFullscreen",!!e.meta.fullscreen),a()}));var Qa=new o["default"]({el:"#app",router:Ua,render:function(e){return e(L)}}),Ba=t["default"]=Qa},"6f29":function(e,t,a){"use strict";var o=a("ef61"),n=a.n(o);n.a},7002:function(e,t,a){"use strict";var o=a("a6e7"),n=a.n(o);n.a},"779d":function(e,t,a){},"85ec":function(e,t,a){},"8f64":function(e,t,a){},9100:function(e,t,a){"use strict";var o=a("44c2"),n=a.n(o);n.a},9231:function(e,t,a){"use strict";var o=a("40c0"),n=a.n(o);n.a},"94e2":function(e,t,a){"use strict";var o=a("ec66"),n=a.n(o);n.a},9743:function(e,t,a){"use strict";var o=a("21eb"),n=a.n(o);n.a},a6e7:function(e,t,a){},aa11:function(e,t,a){},c523:function(e,t,a){},d1f1:function(e,t,a){},dcfc:function(e,t,a){"use strict";var o=a("ed55"),n=a.n(o);n.a},ec66:function(e,t,a){},ecf2:function(e,t,a){"use strict";var o=a("c523"),n=a.n(o);n.a},ed55:function(e,t,a){},ef61:function(e,t,a){},f32d:function(e,t,a){},f52e:function(e,t,a){"use strict";var o=a("0ea6"),n=a.n(o);n.a},fb92:function(e,t,a){}}); |