From-wh пре 2 година
родитељ
комит
7051d9e04e

+ 11 - 7
template/admin/src/pages/system/backendRouting/debugging.vue

@@ -247,6 +247,7 @@
 import request from './request';
 import MonacoEditor from './components/MonacoEditor.vue';
 import vuedraggable from 'vuedraggable';
+import { getCookies } from '@/libs/util';
 
 function requestMethod(url, method, params, data, headerItem) {
   return request({
@@ -402,13 +403,13 @@ export default {
     },
     changeTab(name) {
       if (name === 'Header') {
-        // if (!this.$refs.zTable.getTableData().tableData.length) {
-        //   this.insertEvent('zTable', {
-        //     attribute: 'Content-Type',
-        //     value: 'application/x-www-form-urlencoded',
-        //   });
-        //   this.insertEvent('zaTable');
-        // }
+        if (!this.$refs.zTable.getTableData().tableData.length) {
+          this.insertEvent('zTable', {
+            attribute: 'Authori-Zation',
+            value: 'Bearer ' + getCookies('token'),
+          });
+          this.insertEvent('zaTable');
+        }
       }
     },
     async insertEvent(type, d) {
@@ -518,4 +519,7 @@ export default {
   display: flex;
   justify-content: right;
 }
+/deep/ .monaco-editor{
+    min-height: 700px
+}
 </style>

+ 2 - 2
template/admin/src/pages/system/backendRouting/index.vue

@@ -417,14 +417,14 @@
       <label>分组名称:</label>
       <Input v-model="value" placeholder="请输入分组名称" style="width: 85%" />
     </Modal>
-    <Modal v-model="debuggingModal" :title="formValidate.name" width="70%" footer-hide :loading="loading">
+    <Drawer v-model="debuggingModal" :title="formValidate.name" width="70%" footer-hide :loading="loading">
       <debugging
         v-if="debuggingModal"
         :formValidate="formValidate"
         :typeList="intTypeList"
         :requestTypeList="requestTypeList"
       />
-    </Modal>
+    </Drawer>
   </div>
 </template>
 

+ 3 - 3
template/admin/src/pages/system/backendRouting/request.js

@@ -36,9 +36,9 @@ service.interceptors.request.use(
 
     const token = getCookies('token');
     const kefuToken = getCookies('kefu_token');
-    if (token || kefuToken) {
-      config.headers['Authori-zation'] = config.kefu ? 'Bearer ' + kefuToken : 'Bearer ' + token;
-    }
+    // if (token || kefuToken) {
+    //   config.headers['Authori-zation'] = config.kefu ? 'Bearer ' + kefuToken : 'Bearer ' + token;
+    // }
     return config;
   },
   (error) => {

+ 9 - 9
template/admin/src/pages/system/codeGeneration/components/StorageLoc.vue

@@ -12,39 +12,39 @@
     </Alert>
     <Form ref="foundation" :model="storage" :rules="storageRules" :label-width="130">
       <FormItem label="生成controller位置">
-        <Input class="form-width" v-model="storage.controller" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.controller" readonly placeholder="请输入"></Input>
         <div class="tip">生成后端控制器文件存放位置</div>
       </FormItem>
       <FormItem label="生成service位置">
-        <Input class="form-width" v-model="storage.service" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.service" readonly placeholder="请输入"></Input>
         <div class="tip">生成后端service文件存放位置</div>
       </FormItem>
       <FormItem label="生成dao位置">
-        <Input class="form-width" v-model="storage.dao" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.dao" readonly placeholder="请输入"></Input>
         <div class="tip">生成后端dao文件存放位置</div>
       </FormItem>
       <FormItem label="生成model位置">
-        <Input class="form-width" v-model="storage.model" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.model" readonly placeholder="请输入"></Input>
         <div class="tip">生成后端model文件存放位置</div>
       </FormItem>
       <FormItem label="生成route位置">
-        <Input class="form-width" v-model="storage.route" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.route" readonly placeholder="请输入"></Input>
         <div class="tip">生成后端路由存放位置</div>
       </FormItem>
       <FormItem label="生成validate位置">
-        <Input class="form-width" v-model="storage.validate" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.validate" readonly placeholder="请输入"></Input>
         <div class="tip">生成后端验证器存放位置</div>
       </FormItem>
       <FormItem label="生成pages位置">
-        <Input class="form-width" v-model="storage.pages" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.pages" readonly placeholder="请输入"></Input>
         <div class="tip">生成前端页面文件存放位置</div>
       </FormItem>
       <FormItem label="生成api位置">
-        <Input class="form-width" v-model="storage.api" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.api" readonly placeholder="请输入"></Input>
         <div class="tip">生成前端api接口文件存放位置</div>
       </FormItem>
       <FormItem label="生成router位置">
-        <Input class="form-width" v-model="storage.router" placeholder="请输入"></Input>
+        <Input class="form-width" v-model="storage.router" readonly placeholder="请输入"></Input>
         <div class="tip">生成前端路由存放位置</div>
       </FormItem>
     </Form>

+ 38 - 4
template/admin/src/pages/system/codeGeneration/list.vue

@@ -70,12 +70,12 @@
         <span>{{ title }}</span>
       </p>
       <div class="file" style="height: 100%">
-        <Button class="save" type="primary" @click="crudSaveFile">保存</Button>
+        <Button class="save" type="primary" @click="pwdModal = true">保存</Button>
 
         <div class="file-box">
           <div class="file-fix"></div>
           <div class="file-content">
-            <Tabs
+            <!-- <Tabs
               type="card"
               v-model="indexEditor"
               style="height: 100%"
@@ -97,11 +97,30 @@
                   style="height: 100%; min-height: calc(100vh - 110px)"
                 ></div>
               </TabPane>
-            </Tabs>
+            </Tabs> -->
+            <el-tabs v-model="indexEditor" type="card" @tab-click="toggleEditor">
+              <el-tab-pane v-for="value in editorIndex" :key="value.index">
+                <span slot="label">
+                  <el-tooltip class="item" effect="dark" :content="value.title" placement="top">
+                    <span>{{ value.file_name }}</span>
+                  </el-tooltip>
+                </span>
+                <div
+                  ref="container"
+                  :id="'container_' + value.index"
+                  style="height: 100%; min-height: calc(100vh - 110px)"
+                ></div>
+              </el-tab-pane>
+              <!-- <el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane>
+              <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
+              <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
+              <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane> -->
+            </el-tabs>
           </div>
           <Spin size="large" fix v-if="spinShow"></Spin>
         </div>
       </div>
+
       <!-- </Modal> -->
       <!-- <div class="demo-drawer-footer">
         <Button style="margin-right: 8px" @click="modals = false">关闭</Button>
@@ -123,6 +142,15 @@
         <div v-for="(item, index) in codeBuildList" :key="index">{{ item }}</div>
       </div>
     </Modal>
+    <Modal
+      v-model="pwdModal"
+      title="文件管理密码"
+      :closable="false"
+      @on-ok="crudSaveFile"
+      @on-cancel="pwdModal = false"
+    >
+      <Input v-model="pwd" type="password" placeholder="请输入文件管理密码"></Input>
+    </Modal>
   </div>
 </template>
 
@@ -132,7 +160,7 @@ import { crudList, crudDet, crudDownload, crudSaveFile } from '@/api/systemCodeG
 import * as monaco from 'monaco-editor';
 import { getCookies, removeCookies } from '@/libs/util';
 import Setting from '@/setting';
-
+import { Input } from 'view-design';
 export default {
   data() {
     return {
@@ -155,7 +183,9 @@ export default {
         position: 'static',
       },
       loading: false,
+      pwdModal: false,
       buildModals: false,
+      pwd: '',
       tabList: [],
       codeBuildList: [],
       total: 0,
@@ -238,9 +268,11 @@ export default {
       let data = {
         filepath: this.editorIndex[this.indexEditor].pathname,
         comment: this.editorList[this.indexEditor].editor.getValue(),
+        pwd: this.pwd,
       };
       crudSaveFile(this.editId, data)
         .then((res) => {
+          this.pwd = '';
           this.$Message.success(res.msg);
         })
         .catch((err) => {
@@ -356,6 +388,7 @@ export default {
                 tab: true,
                 index: index + '',
                 title: data.name,
+                file_name: data.file_name,
                 pathname: data.path,
               });
               that.code = data.content;
@@ -365,6 +398,7 @@ export default {
                 that.editorList[index].path = data.path;
                 that.editorList[index].oldCode = that.content;
                 that.editorIndex[index].title = data.name;
+                that.editorIndex[index].file_name = data.file_name;
               });
             });
             that.modals = true;

+ 11 - 11
template/admin/src/plugin/error-store/index.js

@@ -2,16 +2,16 @@ import store from '@/store';
 export default {
   install(Vue, options) {
     if (options.developmentOff && process.env.NODE_ENV === 'development') return;
-    Vue.config.errorHandler = (error, vm, mes) => {
-      let info = {
-        type: 'script',
-        code: 0,
-        mes: error.message,
-        url: window.location.href,
-      };
-      Vue.nextTick(() => {
-        store.dispatch('addErrorLog', info);
-      });
-    };
+    // Vue.config.errorHandler = (error, vm, mes) => {
+    //   let info = {
+    //     type: 'script',
+    //     code: 0,
+    //     mes: error.message,
+    //     url: window.location.href,
+    //   };
+    //   Vue.nextTick(() => {
+    //     store.dispatch('addErrorLog', info);
+    //   });
+    // };
   },
 };

+ 2 - 2
template/admin/src/theme/element.scss

@@ -190,13 +190,13 @@
 }
 .columns-round {
   .el-menu-item {
-    margin: 0 5px;
+    margin: 0 5px 5px 5px;
     border-radius: 5px;
   }
   .el-submenu {
     border-radius: 5px;
     .el-submenu__title {
-      margin: 0 5px;
+      margin: 5px 5px;
     }
     .el-submenu__title:hover {
       border-radius: 5px;