Просмотр исходного кода

Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

liaofei 2 лет назад
Родитель
Сommit
a71d605445

+ 10 - 0
template/admin/src/api/systemCodeGeneration.js

@@ -58,3 +58,13 @@ export function crudDet(id) {
     method: 'get',
   });
 }
+
+/**
+ * @description 代码生成 - 下载
+ */
+export function crudDownload(id) {
+  return request({
+    url: `/system/crud/download/${id}`,
+    method: 'get',
+  });
+}

+ 9 - 2
template/admin/src/pages/system/codeGeneration/list.vue

@@ -2,7 +2,7 @@
   <div>
     <Card :bordered="false" dis-hover class="ivu-mt">
       <Button type="primary" @click="groupAdd()" class="mr20">代码生成</Button>
-      <Button type="success" @click="buildCode()" class="mr20">重新发布</Button>
+      <!-- <Button type="success" @click="buildCode()" class="mr20">重新发布</Button> -->
       <Table
         :columns="columns1"
         :data="tabList"
@@ -29,6 +29,8 @@
         <template slot-scope="{ row, index }" slot="action">
           <a @click="edit(row, '编辑')">查看</a>
           <Divider type="vertical" />
+          <a @click="downLoad(row)">下载</a>
+          <Divider type="vertical" />
           <a @click="del(row, '删除', index)">删除</a>
         </template>
       </Table>
@@ -104,7 +106,7 @@
 
 <script>
 import { mapState } from 'vuex';
-import { crudList, crudDet } from '@/api/systemCodeGeneration';
+import { crudList, crudDet, crudDownload } from '@/api/systemCodeGeneration';
 import * as monaco from 'monaco-editor';
 import { getCookies, removeCookies } from '@/libs/util';
 import Setting from '@/setting';
@@ -203,6 +205,11 @@ export default {
     }
   },
   methods: {
+    downLoad(row) {
+      crudDownload(row.id).then((res) => {
+        window.open(res.data.download_url, '_blank');
+      });
+    },
     buildCode() {
       this.buildModals = true;
       if (typeof EventSource !== 'undefined') {

+ 3 - 20
template/admin/src/pages/system/maintain/systemDatabackup/index.vue

@@ -30,23 +30,7 @@
             </Table>
           </Card>
           <!-- 详情模态框-->
-          <Drawer
-            :closable="false"
-            width="740"
-            v-model="modals"
-            closable
-            :title="'[ ' + rows.name + ' ]' + rows.comment"
-          >
-            <!--          <Modal-->
-            <!--              v-model="modals"-->
-            <!--              class="tableBox"-->
-            <!--              scrollable-->
-            <!--              footer-hide-->
-            <!--              closable-->
-            <!--              :title="'[ ' + rows.name + ' ]' + rows.comment"-->
-            <!--              :mask-closable="false"-->
-            <!--              width="750"-->
-            <!--          >-->
+          <Drawer :closable="false" width="740" v-model="modals" :title="'[ ' + rows.name + ' ]' + rows.comment">
             <Table
               ref="selection"
               :columns="columns2"
@@ -270,13 +254,12 @@ export default {
       this.markModal = true;
     },
     ok() {
-      console.log('1');
       this.changeMarkData.mark = this.mark;
-      console.log(this.changeMarkData);
       updateMark(this.changeMarkData).then((res) => {
         this.$Message.success(res.msg);
+        console.log(this.rows);
         if (this.changeMarkData.is_field) {
-          this.Info({ name: this.changeMarkData.table });
+          this.Info({ name: this.changeMarkData.table, comment: this.rows.comment });
         } else {
           this.getList();
         }