Browse Source

页面更新

sr 4 years ago
parent
commit
41b81fde59

+ 9 - 0
ruoyi-ui/src/App.vue

@@ -9,3 +9,12 @@ export default  {
   name:  'App',
 }
 </script>
+<style>
+	.el-table--medium th{
+    height: 35px !important;
+		padding: 2px 0 !important;
+	}
+  .el-table--medium td{
+  	padding: 2px 0 !important;
+  }
+</style>

+ 0 - 1
ruoyi-ui/src/components/SignNumArr/index.vue

@@ -38,7 +38,6 @@
         // if (meta.activeMenu) {
         //     return meta.activeMenu;
         // }
-        console.log(this.tabIndex, 887)
         return this.tabIndex;
       },
     },

+ 17 - 4
ruoyi-ui/src/views/system/surface/index.vue

@@ -39,6 +39,10 @@
     delMenu,
     getObject
   } from '@/api/system/table.js'
+  import {
+    mapGetters,
+    mapState
+  } from "vuex";
   export default {
     name: "index",
     data() {
@@ -103,7 +107,20 @@
         }
       }
     },
+    computed: {
+      ...mapGetters(["sidebarRouters", "sidebar", "tabIndex"]),
+    },
     mounted() {
+      const route = this.$route;
+      const {
+        meta,
+        path
+      } = route;
+      console.log(route,this.tabIndex,99112)
+      // if (meta.activeMenu) {
+      //   this.$store.dispatch('TabFn', meta.activeMenu)
+      // }
+      // this.$store.dispatch('TabFn', path)
       this.init();
       this.getList();
     },
@@ -214,11 +231,9 @@
         for (let item of arr) {
           if (item.htmlType == 'checkbox' || item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload') {
             if (this.$refs[item.columnName][0].config.length) {
-              console.log(this.$refs[item.columnName][0].config)
               parForm[item.columnName] = this.$refs[item.columnName][0].config
             }
           } else {
-            console.log(this.$refs[item.columnName][0].config[item.columnName])
             parForm[item.columnName] = this.$refs[item.columnName][0].config[item.columnName]
           }
         }
@@ -229,7 +244,6 @@
           this.tabData = response.data.tableHeadList
           this.postList = response.data.rows;
           this.loading = false;
-          console.log(this.postList, this.tabData, 222)
         });
       },
       init() {
@@ -241,7 +255,6 @@
         })
       },
       handleChange(val) {
-        console.log(val);
       }
     },
   };

+ 70 - 39
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -19,7 +19,8 @@
       <el-tab-pane label="字段信息" name="cloum">
         <el-row type="flex" style="margin-bottom: 20px;" v-if="activeName=='cloum'" :gutter="10" justify="end">
           <el-col :span="1.5" style="display: flex; align-items: center;">
-            <el-button style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;" type="warning" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
+            <el-button style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;" type="warning" plain
+              icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
           </el-col>
           <el-col :span="1.5" style="display: flex; align-items: center;">
             <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
@@ -27,10 +28,11 @@
           </el-col>
           <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
         </el-row>
-        <el-table ref="dragTable" @row-dblclick="dbSelectedZd" align="center" :data="cloumns" row-key="columnId" :max-height="tableHeight" @selection-change="handleSelectionChange">
+        <el-table ref="dragTable" @row-dblclick="dbSelectedZd" align="center" :data="cloumns" row-key="columnId"
+          :max-height="tableHeight" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="55" align="center" />
-          <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag"  align="center"/>
-          <el-table-column label="字段列名" prop="columnName" min-width="10%" :show-overflow-tooltip="true"  align="center"/>
+          <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" align="center" />
+          <el-table-column label="字段列名" prop="columnName" min-width="10%" :show-overflow-tooltip="true" align="center" />
           <el-table-column label="字段描述" min-width="10%" align="center">
             <template slot-scope="scope">
               <el-input v-model="scope.row.columnComment"></el-input>
@@ -54,21 +56,21 @@
               <el-checkbox true-label="1" false-label="0" v-model="scope.row.isQuery"></el-checkbox>
             </template>
           </el-table-column>
-          <el-table-column label="关联HR字段" min-width="13%" align="center" prop="hrParentId" >
+          <el-table-column label="关联HR字段" min-width="13%" align="center" prop="hrParentId">
             <template slot-scope="scope">
-                <div>
-                  {{scope.row.hrParentId | zdFn}}
-                </div>
-              </template>
-            </el-table-column>
+              <div>
+                {{scope.row.hrParentId | zdFn}}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column label="缺省值" min-width="10%" align="center" prop="defaultValue" />
           <el-table-column label="外键" min-width="10%" align="center" prop="foreignKey">
             <template slot-scope="scope">
-                <div>
-                  {{scope.row.foreignKey | zdFn}}
-                </div>
-              </template>
-            </el-table-column>
+              <div>
+                {{scope.row.foreignKey | zdFn}}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column label="必填" min-width="8%" align="center">
             <template slot-scope="scope">
               <el-checkbox true-label="1" false-label="0" v-model="scope.row.isRequired"></el-checkbox>
@@ -297,16 +299,16 @@
           @pagination="tabList" />
       </el-tab-pane>
       <el-tab-pane label="数据库SQL" name="genSql">
-        <el-row>
-          <el-button @click="zxCreaBtn" style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;">执行创建语句</el-button>
-          <el-button @click="sxCreaBtn" style="background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;">刷新创建语句</el-button>
+        <el-row type="flex" justify="end">
+          <el-button @click="zxCreaBtn" size="mini" style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;">执行创建语句</el-button>
+          <el-button @click="sxCreaBtn" size="mini" style="background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;">刷新创建语句</el-button>
         </el-row>
         <el-form>
           <el-form-item label="创建语句:" style="margin-top: 20px;">
-            <el-input class="resizeNone" v-model="tableSqlData.createSql" type="textarea"/>
+            <el-input class="resizeNone" v-model="tableSqlData.createSql" type="textarea" />
           </el-form-item>
           <el-form-item label="修改日志:">
-            <el-input class="resizeNone" v-model="tableSqlData.createLog" type="textarea"/>
+            <el-input class="resizeNone" v-model="tableSqlData.createLog" type="textarea" />
           </el-form-item>
         </el-form>
       </el-tab-pane>
@@ -318,7 +320,8 @@
           <el-input v-model="form.description" placeholder="请输入描述" />
         </el-form-item>
         <el-form-item label="关联表:" prop="relationParentId">
-          <el-select style="width: 100%;" v-model="form.relationParentId" placeholder="请选择关联表" @change="relationFn" v-loadmore="loadMore">
+          <el-select style="width: 100%;" v-model="form.relationParentId" placeholder="请选择关联表" @change="relationFn"
+            v-loadmore="loadMore">
             <el-option v-for="item in tableList.rows" :key="item.tableId" :label="item.tableComment" :value="item.tableId">
             </el-option>
           </el-select>
@@ -538,7 +541,7 @@
         });
         //查询数据库sql
         tableSql(tableId).then(res => {
-          if(res.data){
+          if (res.data) {
             this.tableSqlData = res.data
           }
         })
@@ -615,20 +618,27 @@
           this.msgSuccess('刷新成功')
           //查询数据库sql
           tableSql(tableId).then(res => {
-            if(res.data){
+            if (res.data) {
               this.tableSqlData = res.data
             }
           })
         })
       },
       zxCreaBtn() {
-        zxImplement({
-          tableId: this.$route.params && this.$route.params.tableId,
-          createSql: this.tableSqlData.createSql,
-          createLog: this.tableSqlData.createLog,
-          id: this.tableSqlData.id
+        const _this = this
+        this.$confirm('是否确认执行创建语句?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return zxImplement({
+            tableId: _this.$route.params && _this.$route.params.tableId,
+            createSql: _this.tableSqlData.createSql,
+            createLog: _this.tableSqlData.createLog,
+            id: _this.tableSqlData.id
+          })
         }).then(res => {
-          this.msgSuccess('执行成功')
+          _this.msgSuccess('执行成功')
         })
       },
       dbSelectedZd(row) {
@@ -636,7 +646,7 @@
         const id = row.columnId
         getGenTableColumn(id).then(response => {
           let data = response.data
-          data.foreignKey = data.foreignKey?data.foreignKey-0:''
+          data.foreignKey = data.foreignKey ? data.foreignKey - 0 : ''
           this.formZd = data;
           this.openZd = true;
           this.title = "修改字段信息";
@@ -747,9 +757,27 @@
       },
       /** 提交按钮 */
       submitForm() {
+        let isInFlag = 0
+        let isOutFlag = 0
+        console.log(this.cloumns,333)
+        for(let item of this.cloumns){
+          if(item.isIn=='Y'){
+            isInFlag++
+          }
+          if(item.isOut=='Y'){
+            isOutFlag++
+          }
+        }
+        if(isInFlag>1){
+          this.msgError('"输入字段"最多只能选择一个!')
+          return
+        }
+        if(isOutFlag>1){
+          this.msgError('"显示字段"最多只能选择一个!')
+          return
+        }
         const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
         // const genForm = this.$refs.genInfo.$refs.genInfoForm;
-        // console.log(basicForm)
         Promise.all([basicForm].map(this.getFormPromise)).then(res => {
           const validateResult = res.every(item => !!item);
           if (validateResult) {
@@ -846,12 +874,15 @@
   .pagination-container {
     height: 35px;
   }
-  .resizeNone{
-     width: 60vw;
-     border-radius: 3px;
-     .el-textarea__inner{ //el_input中的隐藏属性
-              resize: none;  //主要是这个样式
-              height: 200px;
-          }
-   }
+
+  .resizeNone {
+    width: 60vw;
+    border-radius: 3px;
+
+    .el-textarea__inner {
+      //el_input中的隐藏属性
+      resize: none; //主要是这个样式
+      height: 200px;
+    }
+  }
 </style>

+ 38 - 38
ruoyi-ui/src/views/tool/gen/index.vue

@@ -1,42 +1,5 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="表名称" prop="tableName">
-        <el-input
-          v-model="queryParams.tableName"
-          placeholder="请输入表名称"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="表描述" prop="tableComment">
-        <el-input
-          v-model="queryParams.tableComment"
-          placeholder="请输入表描述"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间">
-        <el-date-picker
-          v-model="dateRange"
-          size="small"
-          style="width: 240px"
-          value-format="yyyy-MM-dd"
-          type="daterange"
-          range-separator="-"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-        ></el-date-picker>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
@@ -104,6 +67,43 @@
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
+    
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="表名称" prop="tableName">
+        <el-input
+          v-model="queryParams.tableName"
+          placeholder="请输入表名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="表描述" prop="tableComment">
+        <el-input
+          v-model="queryParams.tableComment"
+          placeholder="请输入表描述"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="创建时间">
+        <el-date-picker
+          v-model="dateRange"
+          size="small"
+          style="width: 240px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
 
     <el-table v-loading="loading" style="max-height: calc(100vh - 288px);overflow-y: auto;" :data="tableList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" align="center" width="55"></el-table-column>
@@ -319,7 +319,7 @@ export default {
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 20,
+        pageSize: 10,
         tableName: undefined,
         tableComment: undefined
       },