chunk-e67c.fbdc1bb7.js 13 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-e67c","chunk-fe2c"],{JOut:function(e,t,a){"use strict";a.r(t);var n=a("S3Ld"),i={data:function(){return{visible:!1,tables:[],total:0,dbTableList:[],queryParams:{page:1,limit:10,tableName:void 0,tableComment:void 0}}},methods:{show:function(){this.getList(),this.visible=!0},handleSelectionChange:function(e){this.tables=e.map(function(e){return e.tableName})},getList:function(){var e=this;Object(n.d)(this.queryParams).then(function(t){e.dbTableList=t.data.data.items,e.total=t.data.data.count})},handleQuery:function(){this.queryParams.page=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleImportTable:function(){var e=this;Object(n.c)({tables:this.tables.join(",")}).then(function(t){t.data.data?(e.msgSuccess(t.data.errmsg),e.visible=!1,e.$emit("ok")):e.msgError(t.data.errmsg)})}}},l=a("KHd+"),o=Object(l.a)(i,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:e.visible,title:"导入表",width:"800px",top:"5vh"},on:{"update:visible":function(t){e.visible=t}}},[a("el-form",{ref:"queryForm",attrs:{model:e.queryParams,inline:!0}},[a("el-form-item",{attrs:{label:"表名称",prop:"tableName"}},[a("el-input",{attrs:{placeholder:"请输入表名称",clearable:"",size:"small"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.handleQuery(t):null}},model:{value:e.queryParams.tableName,callback:function(t){e.$set(e.queryParams,"tableName",t)},expression:"queryParams.tableName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"表描述",prop:"tableComment"}},[a("el-input",{attrs:{placeholder:"请输入表描述",clearable:"",size:"small"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.handleQuery(t):null}},model:{value:e.queryParams.tableComment,callback:function(t){e.$set(e.queryParams,"tableComment",t)},expression:"queryParams.tableComment"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),e._v(" "),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),e._v(" "),a("el-row",[a("el-table",{attrs:{data:e.dbTableList,height:"494px"},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,prop:"tableName",label:"表名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"tableComment",label:"表描述"}}),e._v(" "),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.parseTime(t.row.createTime)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"updateTime",label:"更新时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.parseTime(t.row.updateTime)))])]}}])})],1),e._v(" "),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],staticStyle:{padding:"0"},attrs:{total:e.total,page:e.queryParams.page,limit:e.queryParams.limit},on:{"update:page":function(t){e.$set(e.queryParams,"page",t)},"update:limit":function(t){e.$set(e.queryParams,"limit",t)},pagination:e.getList}})],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.handleImportTable}},[e._v("确 定")]),e._v(" "),a("el-button",{on:{click:function(t){e.visible=!1}}},[e._v("取 消")])],1)],1)},[],!1,null,null,null);o.options.__file="importTable.vue";t.default=o.exports},S3Ld:function(e,t,a){"use strict";a.d(t,"e",function(){return o}),a.d(t,"d",function(){return r}),a.d(t,"b",function(){return s}),a.d(t,"g",function(){return u}),a.d(t,"h",function(){return c}),a.d(t,"c",function(){return m}),a.d(t,"f",function(){return d}),a.d(t,"a",function(){return p});var n=a("QbLZ"),i=a.n(n),l=a("t3Un");function o(e){return Object(l.a)({method:"get",params:i()({_gp:"admin.tools.gen",_mt:"list"},e)})}function r(e){return Object(l.a)({method:"get",params:i()({_gp:"admin.tools.gen",_mt:"getDbList"},e)})}function s(e){return Object(l.a)({method:"get",params:{_gp:"admin.tools.gen",_mt:"get",id:e}})}function u(e){return Object(l.a)({method:"post",params:{_gp:"admin.tools.gen",_mt:"update",genTable:e}})}function c(e){return Object(l.a)({method:"post",params:{_gp:"admin.tools.gen",_mt:"updateColumn",genTableColumn:e}})}function m(e){return Object(l.a)({method:"post",params:i()({_gp:"admin.tools.gen",_mt:"importTableSave"},e)})}function d(e){return Object(l.a)({method:"get",params:{_gp:"admin.tools.gen",_mt:"preview",tableId:e}})}function p(e){return Object(l.a)({method:"post",params:{_gp:"admin.tools.gen",_mt:"delete",tableIds:e}})}},g3vW:function(e,t,a){"use strict";a.r(t);var n=a("S3Ld"),i=a("JOut"),l=a("vDqi"),o=a.n(l),r=a("X4fA"),s={xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",zip:"application/zip"},u="https://shiyaopinche.cspc.cn:10443";function c(e,t){var a=u+e;o()({method:"get",url:a,responseType:"blob",headers:{Authorization:Object(r.a)()}}).then(function(e){!function(e,t){var a=document.createElement("a"),n=new Blob([e.data],{type:t}),i=new RegExp("filename=([^;]+\\.[^\\.;]+);*"),l=decodeURI(e.headers["content-disposition"]),o=i.exec(l)[1];o=o.replace(/\"/g,""),a.href=URL.createObjectURL(n),a.setAttribute("download",o),document.body.appendChild(a),a.click(),document.body.appendChild(a)}(e,s.zip)})}var m={name:"Gen",components:{importTable:i.default},data:function(){return{loading:!0,uniqueId:"",ids:[],tableNames:[],single:!0,multiple:!0,total:0,tableList:[],dateRange:"",queryParams:{pageNum:1,pageSize:10,tableName:void 0,tableComment:void 0},preview:{open:!1,title:"代码预览",data:{},activeName:"domain.java"}}},created:function(){this.getList()},activated:function(){var e=this.$route.query.t;null!=e&&e!==this.uniqueId&&(this.uniqueId=e,this.resetQuery())},methods:{getList:function(){var e=this;this.loading=!0,Object(n.e)(this.addDateRange(this.queryParams,this.dateRange)).then(function(t){e.tableList=t.data.data.items,e.total=t.data.data.count,e.loading=!1})},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},handleGenTable:function(e){var t=e.tableName||this.tableNames.join(",");0!==t.length?c("/common/batchGenCode?tables="+t):this.msgError("请选择要生成的数据")},openImportTable:function(){this.$refs.import.show()},resetQuery:function(){this.dateRange=[],this.resetForm("queryForm"),this.handleQuery()},handlePreview:function(e){var t=this;Object(n.f)(e.tableId).then(function(e){t.preview.data=e.data.data,t.preview.open=!0})},handleSelectionChange:function(e){this.ids=e.map(function(e){return e.tableId}),this.tableNames=e.map(function(e){return e.tableName}),this.single=1!==e.length,this.multiple=!e.length},handleEditTable:function(e){var t=e.tableId||this.ids[0];this.$router.push("/tools/gen/editTable/"+t)},handleDelete:function(e){var t=this,a=e.tableId||this.ids.join(",");this.$confirm('是否确认删除表编号为"'+a+'"的数据项?',"警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){return Object(n.a)(a)}).then(function(){t.getList(),t.$notify.success({title:"成功",message:"删除成功"})}).catch(function(){})}}},d=a("KHd+"),p=Object(d.a)(m,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{ref:"queryForm",attrs:{model:e.queryParams,inline:!0,"label-width":"68px"}},[a("el-form-item",{attrs:{label:"表名称",prop:"tableName"}},[a("el-input",{attrs:{placeholder:"请输入表名称",clearable:"",size:"small"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.handleQuery(t):null}},model:{value:e.queryParams.tableName,callback:function(t){e.$set(e.queryParams,"tableName",t)},expression:"queryParams.tableName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"表描述",prop:"tableComment"}},[a("el-input",{attrs:{placeholder:"请输入表描述",clearable:"",size:"small"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.handleQuery(t):null}},model:{value:e.queryParams.tableComment,callback:function(t){e.$set(e.queryParams,"tableComment",t)},expression:"queryParams.tableComment"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"创建时间"}},[a("el-date-picker",{attrs:{size:"small","value-format":"yyyy-MM-dd HH:mm:ss",type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),e._v(" "),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),e._v(" "),a("el-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["tool:gen:code"],expression:"['tool:gen:code']"}],attrs:{disabled:e.multiple,type:"primary",icon:"el-icon-download",size:"mini"},on:{click:e.handleGenTable}},[e._v("生成")])],1),e._v(" "),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["tool:gen:import"],expression:"['tool:gen:import']"}],attrs:{type:"info",icon:"el-icon-upload",size:"mini"},on:{click:e.openImportTable}},[e._v("导入")])],1),e._v(" "),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["tool:gen:edit"],expression:"['tool:gen:edit']"}],attrs:{disabled:e.single,type:"success",icon:"el-icon-edit",size:"mini"},on:{click:e.handleEditTable}},[e._v("修改")])],1),e._v(" "),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["tool:gen:remove"],expression:"['tool:gen:remove']"}],attrs:{disabled:e.multiple,type:"danger",icon:"el-icon-delete",size:"mini"},on:{click:e.handleDelete}},[e._v("删除")])],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.tableList},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),a("el-table-column",{attrs:{label:"序号",align:"center",prop:"tableId",width:"50px"}}),e._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,label:"表名称",align:"center",prop:"tableName"}}),e._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,label:"表描述",align:"center",prop:"tableComment"}}),e._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,label:"实体",align:"center",prop:"className"}}),e._v(" "),a("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.parseTime(t.row.createTime)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"更新时间",align:"center",prop:"updateTime",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.parseTime(t.row.updateTime)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["tool:gen:preview"],expression:"['tool:gen:preview']"}],attrs:{type:"text",size:"small",icon:"el-icon-view"},on:{click:function(a){e.handlePreview(t.row)}}},[e._v("预览")]),e._v(" "),a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["tool:gen:edit"],expression:"['tool:gen:edit']"}],attrs:{type:"text",size:"small",icon:"el-icon-edit"},on:{click:function(a){e.handleEditTable(t.row)}}},[e._v("编辑")]),e._v(" "),a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["tool:gen:remove"],expression:"['tool:gen:remove']"}],attrs:{type:"text",size:"small",icon:"el-icon-delete"},on:{click:function(a){e.handleDelete(t.row)}}},[e._v("删除")]),e._v(" "),a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["tool:gen:code"],expression:"['tool:gen:code']"}],attrs:{type:"text",size:"small",icon:"el-icon-download"},on:{click:function(a){e.handleGenTable(t.row)}}},[e._v("生成代码")])]}}])})],1),e._v(" "),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),e._v(" "),a("el-dialog",{attrs:{title:e.preview.title,visible:e.preview.open,width:"80%",top:"5vh"},on:{"update:visible":function(t){e.$set(e.preview,"open",t)}}},[a("el-tabs",{model:{value:e.preview.activeName,callback:function(t){e.$set(e.preview,"activeName",t)},expression:"preview.activeName"}},e._l(e.preview.data,function(t,n){return a("el-tab-pane",{key:n,attrs:{label:n.substring(n.lastIndexOf("/")+1,n.indexOf(".vm")),name:n.substring(n.lastIndexOf("/")+1,n.indexOf(".vm"))}},[a("pre",{staticStyle:{height:"600px",overflow:"auto"}},[e._v(e._s(t))])])}))],1),e._v(" "),a("import-table",{ref:"import",on:{ok:e.handleQuery}})],1)},[],!1,null,null,null);p.options.__file="index.vue";t.default=p.exports}}]);