From d637f03067bfb71c38a52b3fc243a41f279e6e82 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期一, 11 四月 2022 11:58:44 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev --- ruoyi-ui/src/components/TopNav/index.vue | 14 ++----- ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm | 22 ++++++++++ ruoyi-ui/README.md | 2 ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm | 24 +++++++++++ ruoyi-ui/package.json | 2 ruoyi-ui/src/views/tool/gen/index.vue | 4 + ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml | 2 + ruoyi-ui/src/plugins/tab.js | 4 +- ruoyi-ui/bin/package.bat | 6 +- 9 files changed, 60 insertions(+), 20 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm index 96bb520..ac0c2b2 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -78,14 +78,24 @@ v-hasPermi="['${moduleName}:${businessName}:add']" >鏂板</el-button> </el-col> + <el-col :span="1.5"> + <el-button + type="info" + plain + icon="el-icon-sort" + size="mini" + @click="toggleExpandAll" + >灞曞紑/鎶樺彔</el-button> + </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> <el-table + v-if="refreshTable" v-loading="loading" :data="${businessName}List" row-key="${treeCode}" - default-expand-all + :default-expand-all="isExpandAll" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" > #foreach($column in $columns) @@ -293,6 +303,10 @@ title: "", // 鏄惁鏄剧ず寮瑰嚭灞� open: false, + // 鏄惁灞曞紑锛岄粯璁ゅ叏閮ㄥ睍寮� + isExpandAll: true, + // 閲嶆柊娓叉煋琛ㄦ牸鐘舵�� + refreshTable: true, #foreach ($column in $columns) #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) @@ -423,6 +437,14 @@ this.open = true; this.title = "娣诲姞${functionName}"; }, + /** 灞曞紑/鎶樺彔鎿嶄綔 */ + toggleExpandAll() { + this.refreshTable = false; + this.isExpandAll = !this.isExpandAll; + this.$nextTick(() => { + this.refreshTable = true; + }); + }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { this.loading = true; diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm index 629b931..6776687 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -76,14 +76,23 @@ v-hasPermi="['${moduleName}:${businessName}:add']" >鏂板</el-button> </el-col> + <el-col :span="1.5"> + <el-button + type="info" + plain + icon="Sort" + @click="toggleExpandAll" + >灞曞紑/鎶樺彔</el-button> + </el-col> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> </el-row> <el-table + v-if="refreshTable" v-loading="loading" :data="${businessName}List" row-key="${treeCode}" - default-expand-all + :default-expand-all="isExpandAll" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" > #foreach($column in $columns) @@ -282,6 +291,8 @@ const loading = ref(true); const showSearch = ref(true); const title = ref(""); +const isExpandAll = ref(true); +const refreshTable = ref(true); #foreach ($column in $columns) #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) @@ -404,6 +415,15 @@ title.value = "娣诲姞${functionName}"; } +/** 灞曞紑/鎶樺彔鎿嶄綔 */ +function toggleExpandAll() { + refreshTable.value = false; + isExpandAll.value = !isExpandAll.value; + nextTick(() => { + refreshTable.value = true; + }); +} + /** 淇敼鎸夐挳鎿嶄綔 */ async function handleUpdate(row) { loading.value = true; diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index d4fd23f..0b388d1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -32,6 +32,7 @@ <id property="deptId" column="dept_id"/> <result property="parentId" column="parent_id"/> <result property="deptName" column="dept_name"/> + <result property="ancestors" column="ancestors"/> <result property="orderNum" column="order_num"/> <result property="leader" column="leader"/> <result property="status" column="dept_status"/> @@ -66,6 +67,7 @@ u.remark, d.dept_id, d.parent_id, + d.ancestors, d.dept_name, d.order_num, d.leader, diff --git a/ruoyi-ui/README.md b/ruoyi-ui/README.md index a857617..00c0ab8 100644 --- a/ruoyi-ui/README.md +++ b/ruoyi-ui/README.md @@ -11,7 +11,7 @@ npm install # 寤鸿涓嶈鐩存帴浣跨敤 cnpm 瀹夎渚濊禆锛屼細鏈夊悇绉嶈寮傜殑 bug銆傚彲浠ラ�氳繃濡備笅鎿嶄綔瑙e喅 npm 涓嬭浇閫熷害鎱㈢殑闂 -npm install --registry=https://registry.npm.taobao.org +npm install --registry=https://registry.npmmirror.com # 鍚姩鏈嶅姟 npm run dev diff --git a/ruoyi-ui/bin/package.bat b/ruoyi-ui/bin/package.bat index 8281749..9f6e5f4 100644 --- a/ruoyi-ui/bin/package.bat +++ b/ruoyi-ui/bin/package.bat @@ -1,12 +1,12 @@ @echo off echo. -echo [信息] 安装Web工程,生成node_modules文件。 +echo [锟斤拷息] 锟斤拷装Web锟斤拷锟教o拷锟斤拷锟斤拷node_modules锟侥硷拷锟斤拷 echo. %~d0 cd %~dp0 cd .. -npm install --registry=https://registry.npm.taobao.org +npm install --registry=https://registry.npmmirror.com -pause \ No newline at end of file +pause diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 8b36c02..e558353 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -47,7 +47,7 @@ "highlight.js": "9.18.5", "js-beautify": "1.13.0", "js-cookie": "3.0.1", - "jsencrypt": "3.2.1", + "jsencrypt": "3.0.0-rc.1", "nprogress": "0.2.0", "quill": "1.3.7", "screenfull": "5.0.2", diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue index cabb258..0cc24db 100644 --- a/ruoyi-ui/src/components/TopNav/index.vue +++ b/ruoyi-ui/src/components/TopNav/index.vue @@ -30,13 +30,14 @@ <script> import { constantRoutes } from "@/router"; +// 闅愯棌渚ц竟鏍忚矾鐢� +const hideList = ['/index', '/user/profile']; + export default { data() { return { // 椤堕儴鏍忓垵濮嬫暟 visibleNumber: 5, - // 鏄惁涓洪娆″姞杞� - isFrist: false, // 褰撳墠婵�娲昏彍鍗曠殑 index currentIndex: undefined }; @@ -88,17 +89,10 @@ activeMenu() { const path = this.$route.path; let activePath = path; - if (path.lastIndexOf("/") > 0) { + if (path !== undefined && path.lastIndexOf("/") > 0 && hideList.indexOf(path) === -1) { const tmpPath = path.substring(1, path.length); activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/")); this.$store.dispatch('app/toggleSideBarHide', false); - } else if ("/index" == path || "" == path) { - if (!this.isFrist) { - this.isFrist = true; - } else { - activePath = "index"; - } - this.$store.dispatch('app/toggleSideBarHide', true); } else if(!this.$route.children) { activePath = path; this.$store.dispatch('app/toggleSideBarHide', true); diff --git a/ruoyi-ui/src/plugins/tab.js b/ruoyi-ui/src/plugins/tab.js index c8058a9..5e8b834 100644 --- a/ruoyi-ui/src/plugins/tab.js +++ b/ruoyi-ui/src/plugins/tab.js @@ -55,10 +55,10 @@ return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute); }, // 娣诲姞tab椤电 - openPage(title, url) { + openPage(title, url, params) { var obj = { path: url, meta: { title: title } } store.dispatch('tagsView/addView', obj); - return router.push(url); + return router.push({ path: url, query: params }); }, // 淇敼tab椤电 updatePage(obj) { diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index 5de3838..a9c586b 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/index.vue @@ -329,7 +329,9 @@ /** 淇敼鎸夐挳鎿嶄綔 */ handleEditTable(row) { const tableId = row.tableId || this.ids[0]; - this.$router.push({ path: '/tool/gen-edit/index/' + tableId, query: { pageNum: this.queryParams.pageNum } }); + const tableName = row.tableName || this.tableNames[0]; + const params = { pageNum: this.queryParams.pageNum }; + this.$tab.openPage("淇敼[" + tableName + "]鐢熸垚閰嶇疆", '/tool/gen-edit/index/' + tableId, params); }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { -- Gitblit v1.9.3