From f0bee6af6358e07b5426df16aab37f4259de52f6 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期一, 29 六月 2020 09:08:18 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue --- ruoyi-ui/src/views/tool/gen/index.vue | 4 ++-- ruoyi-ui/src/views/tool/gen/editTable.vue | 4 ++-- ruoyi/src/main/java/com/ruoyi/RuoYiApplication.java | 2 +- ruoyi-ui/src/views/system/user/index.vue | 11 ++++++++++- ruoyi-ui/src/views/system/user/profile/userAvatar.vue | 14 +++++++++++--- ruoyi/src/main/resources/META-INF/spring-devtools.properties | 1 + ruoyi-ui/src/router/index.js | 2 +- ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java | 12 ++++++------ 8 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 4af90e7..8b4ebb1 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -111,7 +111,7 @@ hidden: true, children: [ { - path: 'edit', + path: 'edit/:tableId(\\d+)', component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), name: 'GenEdit', meta: { title: '淇敼鐢熸垚閰嶇疆' } diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index ca6781b..9585371 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -211,6 +211,8 @@ <treeselect v-model="form.deptId" :options="deptOptions" :disable-branch-nodes="true" :show-count="true" placeholder="璇烽�夋嫨褰掑睘閮ㄩ棬" /> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="12"> <el-form-item label="鎵嬫満鍙风爜" prop="phonenumber"> <el-input v-model="form.phonenumber" placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" maxlength="11" /> @@ -221,6 +223,8 @@ <el-input v-model="form.email" placeholder="璇疯緭鍏ラ偖绠�" maxlength="50" /> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="12"> <el-form-item v-if="form.userId == undefined" label="鐢ㄦ埛鍚嶇О" prop="userName"> <el-input v-model="form.userName" placeholder="璇疯緭鍏ョ敤鎴峰悕绉�" /> @@ -231,6 +235,8 @@ <el-input v-model="form.password" placeholder="璇疯緭鍏ョ敤鎴峰瘑鐮�" type="password" /> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="12"> <el-form-item label="鐢ㄦ埛鎬у埆"> <el-select v-model="form.sex" placeholder="璇烽�夋嫨"> @@ -254,7 +260,8 @@ </el-radio-group> </el-form-item> </el-col> - + </el-row> + <el-row> <el-col :span="12"> <el-form-item label="宀椾綅"> <el-select v-model="form.postIds" multiple placeholder="璇烽�夋嫨"> @@ -281,6 +288,8 @@ </el-select> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="24"> <el-form-item label="澶囨敞"> <el-input v-model="form.remark" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�"></el-input> diff --git a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue index 9bb5d4a..334cc11 100644 --- a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue +++ b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue @@ -1,7 +1,7 @@ <template> <div> <img v-bind:src="options.img" @click="editCropper()" title="鐐瑰嚮涓婁紶澶村儚" class="img-circle img-lg" /> - <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> + <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened"> <el-row> <el-col :xs="24" :md="12" :style="{height: '350px'}"> <vue-cropper @@ -13,6 +13,7 @@ :autoCropHeight="options.autoCropHeight" :fixedBox="options.fixedBox" @realTime="realTime" + v-if="visible" /> </el-col> <el-col :xs="24" :md="12" :style="{height: '350px'}"> @@ -67,6 +68,8 @@ return { // 鏄惁鏄剧ず寮瑰嚭灞� open: false, + // 鏄惁鏄剧ずcropper + visible: false, // 寮瑰嚭灞傛爣棰� title: "淇敼澶村儚", options: { @@ -83,6 +86,10 @@ // 缂栬緫澶村儚 editCropper() { this.open = true; + }, + // 鎵撳紑寮瑰嚭灞傜粨鏉熸椂鐨勫洖璋� + modalOpened() { + this.visible = true; }, // 瑕嗙洊榛樿鐨勪笂浼犺涓� requestUpload() { @@ -121,9 +128,10 @@ if (response.code === 200) { this.open = false; this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl; + store.commit('SET_AVATAR', this.options.img); this.msgSuccess("淇敼鎴愬姛"); } - this.$refs.cropper.clearCrop(); + this.visible = false; }); }); }, @@ -133,4 +141,4 @@ } } }; -</script> +</script> \ No newline at end of file diff --git a/ruoyi-ui/src/views/tool/gen/editTable.vue b/ruoyi-ui/src/views/tool/gen/editTable.vue index 425ffdd..39a8c66 100644 --- a/ruoyi-ui/src/views/tool/gen/editTable.vue +++ b/ruoyi-ui/src/views/tool/gen/editTable.vue @@ -147,8 +147,8 @@ info: {} }; }, - beforeCreate() { - const { tableId } = this.$route.query; + created() { + const tableId = this.$route.params && this.$route.params.tableId; if (tableId) { // 鑾峰彇琛ㄨ缁嗕俊鎭� getGenTable(tableId).then(res => { diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index c026329..6e9183f 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/index.vue @@ -270,7 +270,7 @@ /** 淇敼鎸夐挳鎿嶄綔 */ handleEditTable(row) { const tableId = row.tableId || this.ids[0]; - this.$router.push({ path: "/gen/edit", query: { tableId: tableId } }); + this.$router.push("/gen/edit/" + tableId); }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { @@ -288,4 +288,4 @@ } } }; -</script> +</script> \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi/src/main/java/com/ruoyi/RuoYiApplication.java index 2104fa8..3ae6f96 100644 --- a/ruoyi/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi/src/main/java/com/ruoyi/RuoYiApplication.java @@ -14,7 +14,7 @@ { public static void main(String[] args) { -// System.setProperty("spring.devtools.restart.enabled", "false"); + System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); System.out.println("(鈾モ棤鈥库棤)锞夛緸 鑻ヤ緷鍚姩鎴愬姛 醿�(麓凇`醿�)锞�"); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java index 54178c1..0559d56 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java +++ b/ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java @@ -144,9 +144,9 @@ public void importGenTable(List<GenTable> tableList) { String operName = SecurityUtils.getUsername(); - for (GenTable table : tableList) + try { - try + for (GenTable table : tableList) { String tableName = table.getTableName(); GenUtils.initTable(table, operName); @@ -162,10 +162,10 @@ } } } - catch (Exception e) - { - log.error("琛ㄥ悕 " + table.getTableName() + " 瀵煎叆澶辫触锛�", e); - } + } + catch (Exception e) + { + throw new CustomException("瀵煎叆澶辫触锛�" + e.getMessage()); } } diff --git a/ruoyi/src/main/resources/META-INF/spring-devtools.properties b/ruoyi/src/main/resources/META-INF/spring-devtools.properties new file mode 100644 index 0000000..2b23f85 --- /dev/null +++ b/ruoyi/src/main/resources/META-INF/spring-devtools.properties @@ -0,0 +1 @@ +restart.include.json=/com.alibaba.fastjson.*.jar \ No newline at end of file -- Gitblit v1.9.3