CRMEB/crmeb/public/admin/system_static/js/chunk-3dab7114.72107ec1.js
2023-09-19 17:39:39 +08:00

1 line
18 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-3dab7114"],{"1b12":function(t,e,n){"use strict";var i=n("b213");n.n(i).a},"448b":function(t,e,n){"use strict";n.r(e),n("a4d3"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("3410"),n("d9e2"),n("131a"),n("fb6a");var i=n("0122"),r=n("c964"),o=n("f3f3"),a=(n("a434"),n("b0c0"),n("d81d"),n("d3b7"),n("159b"),n("a9e3"),n("2f62")),c=n("a9e7"),s=n("c2c6"),l=n("c276"),u=n("d708");function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(e){l=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var o,a,c,s;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),i=new L(i||[]);return r(e,"_invoke",{value:(o=t,a=n,c=i,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(c.method=t,c.arg=e;;){var n=c.delegate;if(n&&(n=function t(e,n){var i=n.method,r=e.iterator[i];return void 0===r?(n.delegate=null,"throw"===i&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),f):(i=h(r,e.iterator,n.arg),"throw"===i.type?(n.method="throw",n.arg=i.arg,n.delegate=null,f):(r=i.arg,r?r.done?(n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,f):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)))}(n,c),n)){if(n===f)continue;return n}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===s)throw s="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);if(s="executing",n=h(o,a,c),"normal"===n.type){if(s=c.done?"completed":"suspendedYield",n.arg===f)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(s="completed",c.method="throw",c.arg=n.arg)}})}),e}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function m(){}function g(){}o={};var v=(l(o,a,(function(){return this})),Object.getPrototypeOf),y=(v=v&&v(v(k([]))),v&&v!==e&&n.call(v,a)&&(o=v),g.prototype=p.prototype=Object.create(o));function b(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;r(this,"_invoke",{value:function(r,a){function c(){return new e((function(o,c){!function r(o,a,c,s){var l;o=h(t[o],t,a);if("throw"!==o.type)return(a=(l=o.arg).value)&&"object"==Object(i.a)(a)&&n.call(a,"__await")?e.resolve(a.__await).then((function(t){r("next",t,c,s)}),(function(t){r("throw",t,c,s)})):e.resolve(a).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,s)}));s(o.arg)}(r,a,o,c)}))}return o=o?o.then(c,c):c()}})}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function k(t){if(t){var e,i=t[a];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(i=function i(){for(;++e<t.length;)if(n.call(t,e))return i.value=t[e],i.done=!1,i;return i.value=void 0,i.done=!0,i}).next=i}return{next:E}}function E(){return{value:void 0,done:!0}}return r(y,"constructor",{value:m.prototype=g,configurable:!0}),r(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,s,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(w.prototype),l(w.prototype,c,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new w(u(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),l(y,s,"Generator"),l(y,a,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,n=Object(t),i=[];for(e in n)i.push(e);return i.reverse(),function t(){for(;i.length;){var e=i.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=k,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;0<=i;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}var a=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,i,r=this.tryEntries[e];if(r.tryLoc===t)return"throw"===(n=r.completion).type&&(i=n.arg,x(r)),i}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}o={data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},formValidate:{page:1,limit:20,title:""},styles:{height:"calc(100% - 55px)",overflow:"auto",paddingBottom:"53px",position:"static"},loading:!1,pwdModal:!1,buildModals:!1,pwd:"",tabList:[],codeBuildList:[],total:0,columns1:[{title:"ID",key:"id",width:80},{title:"菜单名",key:"name",minWidth:130},{title:"表名",key:"table_name",minWidth:130},{title:"字符集",key:"table_collation",minWidth:130},{title:"表备注",key:"table_comment",minWidth:130},{title:"添加时间",key:"add_time",minWidth:130},{title:"操作",slot:"action",fixed:"right",minWidth:150}],FromData:null,titleFrom:"",groupId:0,addId:"",editorList:[],indexEditor:0,code:"",contextData:null,fileType:"",className:"",spinShow:!1,modals:!1,editor:"",editorIndex:[],title:"",editId:0}},computed:Object(o.a)(Object(o.a)({},Object(a.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:"80px"},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){this.getList()},beforeDestroy:function(){this.source&&this.source.close()},methods:{crudSaveFile:function(){var t=this,e={filepath:this.editorIndex[this.indexEditor].pathname,comment:this.editorList[this.indexEditor].editor.getValue(),pwd:this.pwd};Object(c.k)(this.editId,e).then((function(e){t.pwd="",t.$message.success(e.msg)})).catch((function(e){t.$message.error(e.msg)}))},downLoad:function(t){Object(c.g)(t.id).then((function(t){window.open(t.data.download_url,"_blank")}))},buildCode:function(){var t;this.buildModals=!0,"undefined"!=typeof EventSource&&(t=u.a.apiBaseURL+"/system/crud/npm?token="+Object(l.c)("token"),this.source=new EventSource(t),this.source.onopen=function(t){},this.source.onmessage=function(t){},this.source.onerror=function(t){})},goList:function(t){this.$router.push({path:this.$routeProStr+"/system/config/system_group/list/"+t.id})},getList:function(){var t=this;this.loading=!0,Object(c.i)(this.formValidate).then(function(){var e=Object(r.a)(d().mark((function e(n){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=n.data,t.tabList=i.list,t.total=i.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$message.error(e.msg)}))},userSearchs:function(){this.formValidate.page=1,this.getList()},groupAdd:function(){this.$router.push({name:"system_code_generation"})},del:function(t,e,n){var i=this;e={title:e,num:n,url:"system/crud/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){i.$message.success(t.msg),i.tabList.splice(n,1),i.getList()})).catch((function(t){i.$message.error(t.msg)}))},edit:function(t){var e=this;this.spinShow=!0,this.title=t.name,this.$nextTick((function(n){e.openfile(t.id,!1)}))},editItem:function(t){this.$router.push({name:"system_code_generation",query:{id:t.id}})},openfile:function(t){var e=this;try{this.editId=t;var n=this;this.editorIndex=[],this.editorList=[],Object(c.f)(t).then(function(){var t=Object(r.a)(d().mark((function t(i){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i.data.file[0],i.data.file.map((function(t,i){var r=t;e.editorIndex.push({tab:!0,index:i+"",title:r.name,file_name:r.file_name,pathname:r.path}),n.code=r.content,e.initEditor(i,r.content),e.$nextTick((function(t){n.editorList[i].path=r.path,n.editorList[i].oldCode=n.content,n.editorIndex[i].title=r.name,n.editorIndex[i].file_name=r.file_name}))})),n.modals=!0,n.spinShow=!1;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){n.catchFun(t)}))}catch(t){}},winChanges:function(){this.className?this.className="":this.className="diy-fullscreen"},initEditor:function(t,e){try{var n=this;n.$nextTick((function(){n.editor=s.editor.create(document.getElementById("container_"+t),{value:e,language:"sql",automaticLayout:!0,theme:"vs",foldingStrategy:"indentation",overviewRulerBorder:!1,scrollbar:{verticalScrollbarSize:4,horizontalScrollbarSize:10},autoIndent:!0,tabSize:4,autoClosingOvertype:"always",readOnly:!1}),n.editorList.push({editor:n.editor,oldCode:n.code,path:"",index:t})}))}catch(t){}},catchFun:function(t){t.status&&(400==t.status&&this.$message.error(t.msg),110008==t.status&&(this.isShowLogn=!0,this.isShowList=!1,this.loading=!1)),this.spinShow&&(this.spinShow=!1),this.loading&&(this.loading=!1)},editModalChange:function(){var t=this;t.editorList.forEach((function(e,n){t.editorList[n].editor.dispose(),t.editorList[n].editor=null})),t.modals=!1,t.editor="",t.editorIndex=[{tab:!0,index:"0",title:"",icon:""}],t.editorList=[],t.indexEditor="0",t.code="",t.contextData=null},toggleEditor:function(t){t=Number(t),this.code=this.editorList[t].oldCode,this.editor=this.editorList[t].editor},handleTabRemove:function(t){this.editorIndex[t].tab=!1}}},n("1b12"),a=n("2877"),n=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-card",{directives:[{name:"loading",rawName:"v-loading",value:t.spinShow,expression:"spinShow"}],staticClass:"ivu-mt",attrs:{bordered:!1,shadow:"never"}},[n("el-button",{staticClass:"mr20",attrs:{type:"primary"},on:{click:function(e){return t.groupAdd()}}},[t._v("添加功能")]),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"table",staticClass:"mt14",attrs:{data:t.tabList,"highlight-current-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"}},[n("el-table-column",{attrs:{label:"ID",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.id))])]}}])}),n("el-table-column",{attrs:{label:"菜单名","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.name))])]}}])}),n("el-table-column",{attrs:{label:"表名","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.table_name))])]}}])}),n("el-table-column",{attrs:{label:"表备注","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.table_comment))])]}}])}),n("el-table-column",{attrs:{label:"添加时间","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.add_time))])]}}])}),n("el-table-column",{attrs:{label:"操作",fixed:"right",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("a",{on:{click:function(n){return t.edit(e.row,"编辑")}}},[t._v("查看代码")]),n("el-divider",{attrs:{direction:"vertical"}}),n("a",{on:{click:function(n){return t.editItem(e.row)}}},[t._v("编辑")]),n("el-divider",{attrs:{direction:"vertical"}}),n("a",{on:{click:function(n){return t.downLoad(e.row)}}},[t._v("下载")]),n("el-divider",{attrs:{direction:"vertical"}}),n("a",{on:{click:function(n){return t.del(e.row,"删除",e.$index)}}},[t._v("删除")])]}}])})],1),n("div",{staticClass:"acea-row row-right page"},[t.total?n("pagination",{attrs:{total:t.total,page:t.formValidate.page,limit:t.formValidate.limit},on:{"update:page":function(e){return t.$set(t.formValidate,"page",e)},"update:limit":function(e){return t.$set(t.formValidate,"limit",e)},pagination:t.getList}}):t._e()],1)],1),n("el-drawer",{attrs:{visible:t.modals,"custom-class":t.className,title:"Create",size:"80%",wrapperClosable:!1,styles:t.styles},on:{"update:visible":function(e){t.modals=e},closed:t.editModalChange}},[n("p",{ref:"diyHeader",staticClass:"diy-header",attrs:{slot:"header"},slot:"header"},[n("span",[t._v(t._s(t.title))])]),n("div",{staticClass:"file",staticStyle:{height:"100%"}},[n("el-button",{staticClass:"save",attrs:{type:"primary"},on:{click:function(e){t.pwdModal=!0}}},[t._v("保存")]),n("div",{staticClass:"file-box"},[n("div",{staticClass:"file-fix"}),n("div",{staticClass:"file-content"},[n("el-tabs",{attrs:{type:"card"},on:{"tab-click":t.toggleEditor},model:{value:t.indexEditor,callback:function(e){t.indexEditor=e},expression:"indexEditor"}},t._l(t.editorIndex,(function(e){return n("el-tab-pane",{key:e.index},[n("span",{attrs:{slot:"label"},slot:"label"},[n("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:e.title,placement:"top"}},[n("span",[t._v(t._s(e.file_name))])])],1),n("div",{ref:"container",refInFor:!0,staticStyle:{height:"100%","min-height":"calc(100vh - 110px)"},attrs:{id:"container_"+e.index}})])})),1)],1)])],1)]),n("el-dialog",{attrs:{visible:t.buildModals,title:"终端","show-close":!0,"close-on-click-modal":!1,width:"720px"},on:{"update:visible":function(e){t.buildModals=e},close:t.editModalChange}},[n("el-alert",{attrs:{type:"warning",title:"当前终端未运行于安装服务下,部分命令可能无法执行."}}),n("div",t._l(t.codeBuildList,(function(e,i){return n("div",{key:i},[t._v(t._s(e))])})),0)],1),n("el-dialog",{attrs:{visible:t.pwdModal,width:"470px",title:"文件管理密码","show-close":!0,"close-on-click-modal":!1},on:{"update:visible":function(e){t.pwdModal=e}}},[n("el-input",{attrs:{type:"password",placeholder:"请输入文件管理密码"},model:{value:t.pwd,callback:function(e){t.pwd=e},expression:"pwd"}}),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.pwdModal=!1}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:t.crudSaveFile}},[t._v("确 定")])],1)],1)],1)}),[],!1,null,"7a3eda60",null),e.default=n.exports},a9e7:function(t,e,n){"use strict";n.d(e,"j",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"i",(function(){return c})),n.d(e,"f",(function(){return s})),n.d(e,"g",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return h})),n.d(e,"e",(function(){return f})),n.d(e,"l",(function(){return p})),n.d(e,"k",(function(){return m}));var i=n("6b6c");function r(){return Object(i.a)({url:"/system/crud/menus",method:"get"})}function o(){return Object(i.a)({url:"/system/crud/column_type",method:"get"})}function a(t){return Object(i.a)({url:"/system/crud/file_path",method:"post",data:t})}function c(t){return Object(i.a)({url:"/system/crud",method:"get",params:t})}function s(t){return Object(i.a)({url:"/system/crud/".concat(t),method:"get"})}function l(t){return Object(i.a)({url:"/system/crud/download/".concat(t),method:"get"})}function u(t){return Object(i.a)({url:"/system/crud/data_dictionary",method:"get",params:t})}function d(){return Object(i.a)({url:"/system/crud/association_table",method:"get"})}function h(t){return Object(i.a)({url:"/system/crud/association_table/".concat(t),method:"get"})}function f(t){return Object(i.a)({url:"/system/crud/data_dictionary/".concat(t),method:"get"})}function p(t,e){return Object(i.a)({url:"/system/crud/data_dictionary/".concat(t),method:"post",data:e})}function m(t,e){return Object(i.a)({url:"/system/crud/save_file/".concat(t),method:"post",data:e})}},b213:function(t,e,n){}}]);