0e55cab697fc72cf1bcec10fe73b496b.json 24 KB

1
  1. {"remainingRequest":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\front\\item\\zyAdmin\\src\\pages\\system\\codeGeneration\\list.vue?vue&type=style&index=0&id=69b6072c&lang=scss&scoped=true","dependencies":[{"path":"D:\\front\\item\\zyAdmin\\src\\pages\\system\\codeGeneration\\list.vue","mtime":1761614939070},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\css-loader\\index.js","mtime":1761614929364},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":1761614937403},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\postcss-loader\\src\\index.js","mtime":1761614935133},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\sass-loader\\dist\\cjs.js","mtime":1761614936391},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1761614927801},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\index.js","mtime":1761614937402}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:DQovLyDoh6rlrprkuYnmlrnms5XnvKnlsI8NCjo6di1kZWVwIC5kaXktZnVsbHNjcmVlbiB7DQogIG92ZXJmbG93OiBoaWRkZW47DQoNCiAgLml2dS1tb2RhbCB7DQogICAgdG9wOiAwcHg7DQogICAgbGVmdDogMHB4Ow0KICAgIHJpZ2h0OiAwcHg7DQogICAgYm90dG9tOiAwcHg7DQogICAgaGVpZ2h0OiAxMDAlOw0KICAgIHdpZHRoOiAxMDAlICFpbXBvcnRhbnQ7DQoNCiAgICAuaXZ1LW1vZGFsLWNvbnRlbnQgew0KICAgICAgaGVpZ2h0OiAxMDAlOw0KDQogICAgICAuaXZ1LW1vZGFsLWJvZHkgew0KICAgICAgICBoZWlnaHQ6IDEwMCU7DQogICAgICB9DQogICAgfQ0KDQogICAgLml2dS10YWJzIHsNCiAgICAgIC5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Q0KfQ0KLmZpbGUtYm94IHsNCiAgaGVpZ2h0OiAxMDAlOw0KfQ0K"},{"version":3,"sources":["list.vue"],"names":[],"mappings":";AAqgBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"list.vue","sourceRoot":"src/pages/system/codeGeneration","sourcesContent":["<template>\r\n <div>\r\n <el-card :bordered=\"false\" shadow=\"never\" class=\"ivu-mt\" v-loading=\"spinShow\">\r\n <el-button type=\"primary\" v-db-click @click=\"groupAdd()\" class=\"mr20\">添加功能</el-button>\r\n <!-- <el-button type=\"success\" v-db-click @click=\"buildCode()\" class=\"mr20\">重新发布</el-button> -->\r\n <el-table\r\n :data=\"tabList\"\r\n ref=\"table\"\r\n class=\"mt14\"\r\n v-loading=\"loading\"\r\n highlight-current-row\r\n no-userFrom-text=\"暂无数据\"\r\n no-filtered-userFrom-text=\"暂无筛选结果\"\r\n >\r\n <el-table-column label=\"ID\" width=\"80\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.id }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"菜单名\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.name }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"表名\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.table_name }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"表备注\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.table_comment }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"添加时间\" min-width=\"130\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.add_time }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"操作\" fixed=\"right\" width=\"200\">\r\n <template slot-scope=\"scope\">\r\n <a v-db-click @click=\"edit(scope.row, '编辑')\">查看代码</a>\r\n <el-divider direction=\"vertical\"></el-divider>\r\n <a v-db-click @click=\"editItem(scope.row)\">编辑</a>\r\n <el-divider direction=\"vertical\"></el-divider>\r\n <a v-db-click @click=\"downLoad(scope.row)\">下载</a>\r\n <el-divider direction=\"vertical\"></el-divider>\r\n <a v-db-click @click=\"del(scope.row, '删除', scope.$index)\">删除</a>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n <div class=\"acea-row row-right page\">\r\n <pagination\r\n v-if=\"total\"\r\n :total=\"total\"\r\n :page.sync=\"formValidate.page\"\r\n :limit.sync=\"formValidate.limit\"\r\n @pagination=\"getList\"\r\n />\r\n </div>\r\n </el-card>\r\n <el-drawer\r\n :visible.sync=\"modals\"\r\n :custom-class=\"className\"\r\n title=\"Create\"\r\n size=\"80%\"\r\n :wrapperClosable=\"false\"\r\n :styles=\"styles\"\r\n @closed=\"editModalChange\"\r\n >\r\n <p slot=\"header\" class=\"diy-header\" ref=\"diyHeader\">\r\n <span>{{ title }}</span>\r\n </p>\r\n <div class=\"file\" style=\"height: 100%\">\r\n <el-button class=\"save\" type=\"primary\" v-db-click @click=\"pwdModal = true\">保存</el-button>\r\n\r\n <div class=\"file-box\">\r\n <div class=\"file-fix\"></div>\r\n <div class=\"file-content\">\r\n <!-- <el-tabs\r\n type=\"card\"\r\n v-model=\"indexEditor\"\r\n style=\"height: 100%\"\r\n @on-click=\"toggleEditor\"\r\n :animated=\"false\"\r\n closable\r\n @on-tab-remove=\"handleTabRemove\"\r\n >\r\n <el-tab-pane\r\n v-for=\"value in editorIndex\"\r\n :key=\"value.index\"\r\n :name=\"value.index.toString()\"\r\n :label=\"value.title\"\r\n :icon=\"value.icon\"\r\n >\r\n <div\r\n ref=\"container\"\r\n :id=\"'container_' + value.index\"\r\n style=\"height: 100%; min-height: calc(100vh - 110px)\"\r\n ></div>\r\n </el-tab-pane>\r\n </el-tabs> -->\r\n <el-tabs v-model=\"indexEditor\" type=\"card\" @tab-click=\"toggleEditor\">\r\n <el-tab-pane v-for=\"value in editorIndex\" :key=\"value.index\">\r\n <span slot=\"label\">\r\n <el-tooltip effect=\"light\" class=\"item\" :content=\"value.title\" placement=\"top\">\r\n <span>{{ value.file_name }}</span>\r\n </el-tooltip>\r\n </span>\r\n <div\r\n ref=\"container\"\r\n :id=\"'container_' + value.index\"\r\n style=\"height: 100%; min-height: calc(100vh - 110px)\"\r\n ></div>\r\n </el-tab-pane>\r\n <!-- <el-tab-pane label=\"用户管理\" name=\"first\">用户管理</el-tab-pane>\r\n <el-tab-pane label=\"配置管理\" name=\"second\">配置管理</el-tab-pane>\r\n <el-tab-pane label=\"角色管理\" name=\"third\">角色管理</el-tab-pane>\r\n <el-tab-pane label=\"定时任务补偿\" name=\"fourth\">定时任务补偿</el-tab-pane> -->\r\n </el-tabs>\r\n </div>\r\n </div>\r\n </div>\r\n </el-drawer>\r\n <el-dialog\r\n :visible.sync=\"buildModals\"\r\n title=\"终端\"\r\n :show-close=\"true\"\r\n :close-on-click-modal=\"false\"\r\n width=\"720px\"\r\n @close=\"editModalChange\"\r\n >\r\n <el-alert type=\"warning\" title=\"当前终端未运行于安装服务下,部分命令可能无法执行.\"></el-alert>\r\n <div>\r\n <div v-for=\"(item, index) in codeBuildList\" :key=\"index\">{{ item }}</div>\r\n </div>\r\n </el-dialog>\r\n <el-dialog\r\n :visible.sync=\"pwdModal\"\r\n width=\"470px\"\r\n title=\"文件管理密码\"\r\n :show-close=\"true\"\r\n :close-on-click-modal=\"false\"\r\n >\r\n <el-input v-model=\"pwd\" type=\"password\" placeholder=\"请输入文件管理密码\"></el-input>\r\n <span slot=\"footer\" class=\"dialog-footer\">\r\n <el-button v-db-click @click=\"pwdModal = false\">取 消</el-button>\r\n <el-button type=\"primary\" v-db-click @click=\"crudSaveFile\">确 定</el-button>\r\n </span>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { mapState } from 'vuex';\r\nimport { crudList, crudDet, crudDownload, crudSaveFile } from '@/api/systemCodeGeneration';\r\nimport * as monaco from 'monaco-editor';\r\nimport { getCookies, removeCookies } from '@/libs/util';\r\nimport Setting from '@/setting';\r\nexport default {\r\n data() {\r\n return {\r\n grid: {\r\n xl: 7,\r\n lg: 7,\r\n md: 12,\r\n sm: 24,\r\n xs: 24,\r\n },\r\n formValidate: {\r\n page: 1,\r\n limit: 20,\r\n title: '',\r\n },\r\n styles: {\r\n height: 'calc(100% - 55px)',\r\n overflow: 'auto',\r\n paddingBottom: '53px',\r\n position: 'static',\r\n },\r\n loading: false,\r\n pwdModal: false,\r\n buildModals: false,\r\n pwd: '',\r\n tabList: [],\r\n codeBuildList: [],\r\n total: 0,\r\n columns1: [\r\n {\r\n title: 'ID',\r\n key: 'id',\r\n width: 80,\r\n },\r\n {\r\n title: '菜单名',\r\n key: 'name',\r\n minWidth: 130,\r\n },\r\n {\r\n title: '表名',\r\n key: 'table_name',\r\n minWidth: 130,\r\n },\r\n {\r\n title: '字符集',\r\n key: 'table_collation',\r\n minWidth: 130,\r\n },\r\n {\r\n title: '表备注',\r\n key: 'table_comment',\r\n minWidth: 130,\r\n },\r\n {\r\n title: '添加时间',\r\n key: 'add_time',\r\n minWidth: 130,\r\n },\r\n {\r\n title: '操作',\r\n slot: 'action',\r\n fixed: 'right',\r\n minWidth: 150,\r\n },\r\n ],\r\n FromData: null,\r\n titleFrom: '',\r\n groupId: 0,\r\n addId: '',\r\n editorList: [], //编辑器数组\r\n indexEditor: 0, //当前编辑器索引\r\n code: '', //当前文件打开时的内容\r\n contextData: null, //左侧导航右键点击是产生的数据对象\r\n\r\n fileType: '', // 文件操作类型 createFolder|创建文件夹 createFile|创建文件 delFolder|删除文件夹或者文件\r\n className: '', //全屏 class名\r\n spinShow: false,\r\n modals: false, //编辑器开关\r\n editor: '', //当前编辑器对象\r\n editorIndex: [],\r\n title: '',\r\n editId: 0,\r\n };\r\n },\r\n computed: {\r\n ...mapState('media', ['isMobile']),\r\n labelWidth() {\r\n return this.isMobile ? undefined : '80px';\r\n },\r\n labelPosition() {\r\n return this.isMobile ? 'top' : 'right';\r\n },\r\n },\r\n mounted() {\r\n this.getList();\r\n },\r\n beforeDestroy() {\r\n if (this.source) {\r\n this.source.close(); //关闭EventSource\r\n }\r\n },\r\n methods: {\r\n crudSaveFile() {\r\n let data = {\r\n filepath: this.editorIndex[this.indexEditor].pathname,\r\n comment: this.editorList[this.indexEditor].editor.getValue(),\r\n pwd: this.pwd,\r\n };\r\n crudSaveFile(this.editId, data)\r\n .then((res) => {\r\n this.pwd = '';\r\n this.$message.success(res.msg);\r\n })\r\n .catch((err) => {\r\n this.$message.error(err.msg);\r\n });\r\n },\r\n downLoad(row) {\r\n crudDownload(row.id).then((res) => {\r\n window.open(res.data.download_url, '_blank');\r\n });\r\n },\r\n buildCode() {\r\n this.buildModals = true;\r\n if (typeof EventSource !== 'undefined') {\r\n //支持eventSource\r\n var postURL = Setting.apiBaseURL + '/system/crud/npm?token=' + getCookies('token');\r\n this.source = new EventSource(postURL);\r\n let self = this; //因EventSource中this的指向变了,所以要提前存储一下\r\n this.source.onopen = function (res) {};\r\n this.source.onmessage = function (data) {};\r\n this.source.onerror = function (err) {\r\n //链接失败后EventSource会每隔三秒左右重新发起链接\r\n };\r\n } else {\r\n console.log('暂不支持EventSource');\r\n }\r\n },\r\n // 跳转到组合数据列表页面\r\n goList(row) {\r\n this.$router.push({\r\n path: this.$routeProStr + '/system/config/system_group/list/' + row.id,\r\n });\r\n },\r\n // 列表\r\n getList() {\r\n this.loading = true;\r\n crudList(this.formValidate)\r\n .then(async (res) => {\r\n let data = res.data;\r\n this.tabList = data.list;\r\n this.total = data.count;\r\n this.loading = false;\r\n })\r\n .catch((res) => {\r\n this.loading = false;\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n // 表格搜索\r\n userSearchs() {\r\n this.formValidate.page = 1;\r\n this.getList();\r\n },\r\n // 点击添加\r\n groupAdd() {\r\n this.$router.push({\r\n name: 'system_code_generation',\r\n });\r\n },\r\n // 删除\r\n del(row, tit, num) {\r\n let delfromData = {\r\n title: tit,\r\n num: num,\r\n url: `system/crud/${row.id}`,\r\n method: 'DELETE',\r\n ids: '',\r\n };\r\n this.$modalSure(delfromData)\r\n .then((res) => {\r\n this.$message.success(res.msg);\r\n this.tabList.splice(num, 1);\r\n this.getList();\r\n })\r\n .catch((res) => {\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n // 编辑\r\n edit(row) {\r\n this.spinShow = true;\r\n // 创建代码容器\r\n this.title = row.name;\r\n this.$nextTick((e) => {\r\n this.openfile(row.id, false);\r\n });\r\n },\r\n editItem(row) {\r\n this.$router.push({\r\n name: 'system_code_generation',\r\n query: {\r\n id: row.id,\r\n },\r\n });\r\n },\r\n //打开文件\r\n openfile(id) {\r\n try {\r\n this.editId = id;\r\n let that = this;\r\n this.editorIndex = [];\r\n this.editorList = [];\r\n crudDet(id)\r\n .then(async (res) => {\r\n let data = res.data.file[0];\r\n res.data.file.map((i, index) => {\r\n let data = i;\r\n this.editorIndex.push({\r\n tab: true,\r\n index: index + '',\r\n title: data.name,\r\n file_name: data.file_name,\r\n pathname: data.path,\r\n });\r\n that.code = data.content;\r\n this.initEditor(index, data.content);\r\n this.$nextTick((e) => {\r\n // 保存相对信息\r\n that.editorList[index].path = data.path;\r\n that.editorList[index].oldCode = that.content;\r\n that.editorIndex[index].title = data.name;\r\n that.editorIndex[index].file_name = data.file_name;\r\n });\r\n });\r\n that.modals = true;\r\n that.spinShow = false;\r\n })\r\n .catch((res) => {\r\n that.catchFun(res);\r\n });\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n },\r\n /**\r\n * 窗口最大化\r\n */\r\n winChanges() {\r\n if (this.className) {\r\n this.className = '';\r\n } else {\r\n this.className = 'diy-fullscreen';\r\n }\r\n },\r\n /**\r\n * 初始化编辑器\r\n */\r\n initEditor(index, conetnt) {\r\n try {\r\n let that = this;\r\n that.$nextTick(() => {\r\n // 初始化编辑器,确保dom已经渲染\r\n that.editor = monaco.editor.create(document.getElementById('container_' + index), {\r\n value: conetnt, //编辑器初始显示文字\r\n language: 'sql', //语言支持自行查阅demo\r\n automaticLayout: true, //自动布局\r\n theme: 'vs', //官方自带三种主题vs, hc-black, or vs-dark\r\n foldingStrategy: 'indentation', // 代码可分小段折叠\r\n overviewRulerBorder: false, // 不要滚动条的边框\r\n scrollbar: {\r\n // 滚动条设置\r\n verticalScrollbarSize: 4, // 竖滚动条\r\n horizontalScrollbarSize: 10, // 横滚动条\r\n },\r\n autoIndent: true, // 自动布局\r\n tabSize: 4, // tab缩进长度\r\n autoClosingOvertype: 'always',\r\n readOnly: false,\r\n });\r\n that.editorList.push({\r\n editor: that.editor,\r\n oldCode: that.code,\r\n path: '',\r\n index: index,\r\n });\r\n });\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n },\r\n\r\n /**\r\n * 处理接口回调\r\n * @param {Object} res\r\n */\r\n catchFun(res) {\r\n if (res.status) {\r\n if (res.status == 400) this.$message.error(res.msg);\r\n if (res.status == 110008) {\r\n // this.$message.error(res.msg);\r\n this.isShowLogn = true;\r\n this.isShowList = false;\r\n this.loading = false;\r\n }\r\n } else {\r\n // this.$message.error('文件编码不被兼容,无法正确读取文件!');\r\n }\r\n //关闭蒙版层\r\n if (this.spinShow) this.spinShow = false;\r\n // 关闭文件列表展示\r\n if (this.loading) this.loading = false;\r\n },\r\n //编辑器状态变化\r\n editModalChange() {\r\n let that = this;\r\n that.editorList.forEach(function (value, index) {\r\n // 销毁当前编辑器\r\n that.editorList[index].editor.dispose();\r\n that.editorList[index].editor = null;\r\n });\r\n // 初始话数据\r\n that.modals = false; //编辑器开关\r\n that.editor = ''; //当前编辑器对象\r\n that.editorIndex = [\r\n //选项卡数组\r\n {\r\n tab: true,\r\n index: '0',\r\n title: '',\r\n icon: '',\r\n },\r\n ];\r\n that.editorList = []; //编辑器数组\r\n that.indexEditor = '0'; //当前编辑器索引\r\n that.code = ''; //当前文件打开时的内容\r\n that.contextData = null; //左侧导航右键点击是产生的数据对象\r\n },\r\n /**\r\n * 切换选项卡\r\n * @param {Object} index\r\n */\r\n toggleEditor(index) {\r\n index = Number(index);\r\n this.code = this.editorList[index].oldCode; //设置文件打开时的代码\r\n this.editor = this.editorList[index].editor; //设置编辑器实例\r\n },\r\n handleTabRemove(index) {\r\n let that = this;\r\n // 关闭选项卡\r\n that.editorIndex[index].tab = false; // 关闭选项卡\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n// 自定义方法缩小\r\n::v-deep .diy-fullscreen {\r\n overflow: hidden;\r\n\r\n .ivu-modal {\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n height: 100%;\r\n width: 100% !important;\r\n\r\n .ivu-modal-content {\r\n height: 100%;\r\n\r\n .ivu-modal-body {\r\n height: 100%;\r\n }\r\n }\r\n\r\n .ivu-tabs {\r\n .ivu-tabs-content-animated {\r\n height: 92%;\r\n background-color: #2f2f2f !important;\r\n }\r\n }\r\n\r\n .ivu-tabs-content {\r\n height: 100%;\r\n }\r\n\r\n .ivu-tabs {\r\n .ivu-tabs-tabpane {\r\n height: 92%;\r\n }\r\n }\r\n }\r\n}\r\n.diy-header {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n\r\n .diy-header-icon {\r\n margin-right: 30px;\r\n cursor: pointer;\r\n }\r\n\r\n .diy-header-icon:hover {\r\n opacity: 0.8;\r\n }\r\n}\r\n::v-deep .ivu-modal {\r\n top: 70px;\r\n}\r\n\r\n.ivu-modal-content {\r\n .ivu-modal-body {\r\n min-height: 632px;\r\n height: 80vh;\r\n overflow: hidden;\r\n }\r\n}\r\n\r\n.ivu-tabs {\r\n .ivu-tabs-content-animated {\r\n min-height: 560px;\r\n height: 73vh;\r\n margin-top: -1px;\r\n }\r\n\r\n .ivu-tabs-tabpane {\r\n min-height: 560px;\r\n margin-top: -1px;\r\n }\r\n}\r\n\r\n.ivu-tabs-nav .ivu-tabs-tab .ivu-icon {\r\n color: #f00;\r\n}\r\n\r\n::v-deepbody .ivu-select-dropdown .ivu-dropdown-transfer {\r\n background: red !important;\r\n}\r\n\r\n// 导航栏右键样式 无效\r\n.file-left ::v-deep .ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu .ivu-dropdown-item:hover {\r\n background-color: #e5e5e5 !important;\r\n}\r\n\r\n// 选项卡头部\r\n::v-deep .ivu-tabs.ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-nav-container {\r\n background-color: #fff;\r\n}\r\n.demo-drawer-footer {\r\n width: 100%;\r\n position: absolute;\r\n bottom: 0;\r\n left: 0;\r\n border-top: 1px solid #e8e8e8;\r\n padding: 10px 16px;\r\n text-align: right;\r\n background: #fff;\r\n}\r\n.file {\r\n position: relative;\r\n .save {\r\n position: absolute;\r\n left: 50%;\r\n bottom: -10px;\r\n z-index: 99;\r\n }\r\n}\r\n.file-box {\r\n height: 100%;\r\n}\r\n</style>\r\n"]}]}