Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue
Conflicts:
ruoyi-ui/package.json
ruoyi-ui/src/api/system/config.js
ruoyi-ui/src/api/system/dict/data.js
ruoyi-ui/src/api/system/dict/type.js
ruoyi-ui/src/assets/styles/element-variables.scss
ruoyi-ui/src/components/SvgIcon/index.vue
ruoyi-ui/src/layout/components/Sidebar/Link.vue
ruoyi-ui/src/layout/components/Sidebar/index.vue
ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue
ruoyi-ui/src/layout/components/TagsView/index.vue
ruoyi-ui/src/views/monitor/job/index.vue
ruoyi-ui/src/views/system/config/index.vue
ruoyi-ui/src/views/system/dept/index.vue
ruoyi-ui/src/views/system/dict/data.vue
ruoyi-ui/src/views/system/dict/index.vue
ruoyi-ui/src/views/system/menu/index.vue
ruoyi-ui/src/views/system/notice/index.vue
ruoyi-ui/src/views/system/post/index.vue
ruoyi-ui/src/views/system/role/index.vue
ruoyi-ui/src/views/system/user/index.vue
ruoyi-ui/src/views/system/user/profile/resetPwd.vue
ruoyi-ui/src/views/system/user/profile/userAvatar.vue
ruoyi-ui/src/views/system/user/profile/userInfo.vue
ruoyi-ui/vue.config.js
ruoyi/pom.xml
ruoyi/src/main/java/com/ruoyi/common/constant/Constants.java
ruoyi/src/main/java/com/ruoyi/common/utils/StringUtils.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysConfigController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictDataController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysConfigService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysDictDataService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysDictTypeService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysDictDataServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysDictTypeServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysMenuServiceImpl.java
ruoyi/src/main/resources/application.yml
ruoyi/src/main/resources/vm/sql/sql.vm
ruoyi/src/main/resources/vm/vue/index.vue.vm
| | |
| | | * æé认è¯ä½¿ç¨Jwtï¼æ¯æå¤ç»ç«¯è®¤è¯ç³»ç»ã |
| | | * æ¯æå è½½å¨ææéèåï¼å¤æ¹å¼è½»æ¾æéæ§å¶ã |
| | | * 髿çå¼åï¼ä½¿ç¨ä»£ç çæå¨å¯ä»¥ä¸é®çæåå端代ç ã |
| | | * æä¾äºä¸ä¸ªOracleçæ¬[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle)ï¼ä¿æåæ¥æ´æ°ã |
| | | * æè°¢[Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin)ï¼[eladmin-web](https://gitee.com/elunez/eladmin-web?_from=gitee_search)ã |
| | | * ä¸åç¦»çæ¬ï¼è¯·ç§»æ¥[RuoYi](https://gitee.com/y_project/RuoYi)ï¼å¾®æå¡çæ¬ï¼è¯·ç§»æ¥[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud) |
| | | * é¿éäºä¼æ å¸ï¼[ç¹æè¿å
¥](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link)ï¼è
¾è®¯äºä¼æ å¸ï¼[ç¹æé¢å](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console) |
| | |
| | | { |
| | | "name": "ruoyi", |
| | | "version": "2.2.0", |
| | | "version": "2.3.0", |
| | | "description": "è¥ä¾ç®¡çç³»ç»", |
| | | "author": "è¥ä¾", |
| | | "license": "MIT", |
| | | "scripts": { |
| | | "dev": "vue-cli-service serve", |
| | | "dev": "vue-cli-service serve --open", |
| | | "build:prod": "vue-cli-service build", |
| | | "build:stage": "vue-cli-service build --mode staging", |
| | | "preview": "node build/index.js --preview", |
| | |
| | | }) |
| | | } |
| | | |
| | | // æ¸
çåæ°ç¼å |
| | | export function clearCache() { |
| | | return request({ |
| | | url: '/system/config/clearCache', |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // 导åºåæ° |
| | | export function exportConfig(query) { |
| | | return request({ |
| | |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | } |
| | |
| | | // æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | | export function getDicts(dictType) { |
| | | return request({ |
| | | url: '/system/dict/data/dictType/' + dictType, |
| | | url: '/system/dict/data/type/' + dictType, |
| | | method: 'get' |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | // æ¸
çåæ°ç¼å |
| | | export function clearCache() { |
| | | return request({ |
| | | url: '/system/dict/type/clearCache', |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // 导åºåå
¸ç±»å |
| | | export function exportType(query) { |
| | | return request({ |
| | |
| | | url: '/system/dict/type/optionselect', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | } |
| | |
| | | /* theme color */ |
| | | $--color-primary: #1890ff; |
| | | $--color-success: #13ce66; |
| | | $--color-warning: #FFBA00; |
| | | $--color-warning: #ffba00; |
| | | $--color-danger: #ff4949; |
| | | // $--color-info: #1E1E1E; |
| | | |
| | |
| | | <template> |
| | | <div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" /> |
| | | <svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners"> |
| | | <use :href="iconName" /> |
| | | <use :xlink:href="iconName" /> |
| | | </svg> |
| | | </template> |
| | | |
| | |
| | | |
| | | <template> |
| | | <!-- eslint-disable vue/require-component-is --> |
| | | <component v-bind="linkProps(to)"> |
| | | <component :is="type" v-bind="linkProps(to)"> |
| | | <slot /> |
| | | </component> |
| | | </template> |
| | |
| | | required: true |
| | | } |
| | | }, |
| | | computed: { |
| | | isExternal() { |
| | | return isExternal(this.to) |
| | | }, |
| | | type() { |
| | | if (this.isExternal) { |
| | | return 'a' |
| | | } |
| | | return 'router-link' |
| | | } |
| | | }, |
| | | methods: { |
| | | linkProps(url) { |
| | | if (isExternal(url)) { |
| | | linkProps(to) { |
| | | if (this.isExternal) { |
| | | return { |
| | | is: 'a', |
| | | href: url, |
| | | href: to, |
| | | target: '_blank', |
| | | rel: 'noopener' |
| | | } |
| | | } |
| | | return { |
| | | is: 'router-link', |
| | | to: url |
| | | to: to |
| | | } |
| | | } |
| | | } |
| | |
| | | mode="vertical" |
| | | > |
| | | <sidebar-item |
| | | v-for="route in permission_routes" |
| | | :key="route.path" |
| | | v-for="(route, index) in permission_routes" |
| | | :key="route.path + index" |
| | | :item="route" |
| | | :base-path="route.path" |
| | | /> |
| | |
| | | return this.$refs.scrollContainer.$refs.wrap |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.scrollWrapper.addEventListener('scroll', this.emitScroll, true) |
| | | }, |
| | | beforeDestroy() { |
| | | this.scrollWrapper.removeEventListener('scroll', this.emitScroll) |
| | | }, |
| | | methods: { |
| | | handleScroll(e) { |
| | | const eventDelta = e.wheelDelta || -e.deltaY * 40 |
| | | const $scrollWrapper = this.scrollWrapper |
| | | $scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4 |
| | | }, |
| | | emitScroll() { |
| | | this.$emit('scroll') |
| | | }, |
| | | moveToTarget(currentTag) { |
| | | const $container = this.$refs.scrollContainer.$el |
| | | const $containerWidth = $container.offsetWidth |
| | |
| | | <template> |
| | | <div id="tags-view-container" class="tags-view-container"> |
| | | <scroll-pane ref="scrollPane" class="tags-view-wrapper"> |
| | | <router-link |
| | | v-for="tag in visitedViews" |
| | | ref="tag" |
| | | :key="tag.path" |
| | | :class="isActive(tag)?'active':''" |
| | | :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" |
| | | tag="span" |
| | | class="tags-view-item" |
| | | :style="activeStyle(tag)" |
| | | @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''" |
| | | @contextmenu.prevent.native="openMenu(tag,$event)" |
| | | > |
| | | {{ tag.title }} |
| | | <span |
| | | v-if="!isAffix(tag)" |
| | | class="el-icon-close" |
| | | @click.prevent.stop="closeSelectedTag(tag)" |
| | | /> |
| | | </router-link> |
| | | </scroll-pane> |
| | | <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu"> |
| | | <li @click="refreshSelectedTag(selectedTag)">å·æ°é¡µé¢</li> |
| | | <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">å
³éå½å</li> |
| | | <li @click="closeOthersTags">å
³éå
¶ä»</li> |
| | | <li @click="closeAllTags(selectedTag)">å
³éææ</li> |
| | | </ul> |
| | | </div> |
| | | <div id="tags-view-container" class="tags-view-container"> |
| | | <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll"> |
| | | <router-link |
| | | v-for="tag in visitedViews" |
| | | ref="tag" |
| | | :key="tag.path" |
| | | :class="isActive(tag)?'active':''" |
| | | :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" |
| | | tag="span" |
| | | class="tags-view-item" |
| | | :style="activeStyle(tag)" |
| | | @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''" |
| | | @contextmenu.prevent.native="openMenu(tag,$event)" |
| | | > |
| | | {{ tag.title }} |
| | | <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" /> |
| | | </router-link> |
| | | </scroll-pane> |
| | | <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu"> |
| | | <li @click="refreshSelectedTag(selectedTag)">å·æ°é¡µé¢</li> |
| | | <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">å
³éå½å</li> |
| | | <li @click="closeOthersTags">å
³éå
¶ä»</li> |
| | | <li @click="closeAllTags(selectedTag)">å
³éææ</li> |
| | | </ul> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ScrollPane from "./ScrollPane"; |
| | | import path from "path"; |
| | | import ScrollPane from './ScrollPane' |
| | | import path from 'path' |
| | | |
| | | export default { |
| | | components: { ScrollPane }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | top: 0, |
| | | left: 0, |
| | | selectedTag: {}, |
| | | affixTags: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | | visitedViews() { |
| | | return this.$store.state.tagsView.visitedViews; |
| | | }, |
| | | routes() { |
| | | return this.$store.state.permission.routes; |
| | | }, |
| | | theme() { |
| | | return this.$store.state.settings.theme; |
| | | } |
| | | }, |
| | | watch: { |
| | | $route() { |
| | | this.addTags(); |
| | | this.moveToCurrentTag(); |
| | | }, |
| | | visible(value) { |
| | | if (value) { |
| | | document.body.addEventListener("click", this.closeMenu); |
| | | } else { |
| | | document.body.removeEventListener("click", this.closeMenu); |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.initTags(); |
| | | this.addTags(); |
| | | }, |
| | | methods: { |
| | | isActive(route) { |
| | | return route.path === this.$route.path; |
| | | }, |
| | | activeStyle(tag) { |
| | | if (!this.isActive(tag)) return {}; |
| | | return { |
| | | "background-color": this.theme, |
| | | "border-color": this.theme |
| | | }; |
| | | }, |
| | | isAffix(tag) { |
| | | return tag.meta && tag.meta.affix; |
| | | }, |
| | | filterAffixTags(routes, basePath = "/") { |
| | | let tags = []; |
| | | routes.forEach(route => { |
| | | if (route.meta && route.meta.affix) { |
| | | const tagPath = path.resolve(basePath, route.path); |
| | | tags.push({ |
| | | fullPath: tagPath, |
| | | path: tagPath, |
| | | name: route.name, |
| | | meta: { ...route.meta } |
| | | }); |
| | | } |
| | | if (route.children) { |
| | | const tempTags = this.filterAffixTags( |
| | | route.children, |
| | | route.path |
| | | ); |
| | | if (tempTags.length >= 1) { |
| | | tags = [...tags, ...tempTags]; |
| | | } |
| | | } |
| | | }); |
| | | return tags; |
| | | }, |
| | | initTags() { |
| | | const affixTags = (this.affixTags = this.filterAffixTags( |
| | | this.routes |
| | | )); |
| | | for (const tag of affixTags) { |
| | | // Must have tag name |
| | | if (tag.name) { |
| | | this.$store.dispatch("tagsView/addVisitedView", tag); |
| | | } |
| | | } |
| | | }, |
| | | addTags() { |
| | | const { name } = this.$route; |
| | | if (name) { |
| | | this.$store.dispatch("tagsView/addView", this.$route); |
| | | } |
| | | return false; |
| | | }, |
| | | moveToCurrentTag() { |
| | | const tags = this.$refs.tag; |
| | | this.$nextTick(() => { |
| | | for (const tag of tags) { |
| | | if (tag.to.path === this.$route.path) { |
| | | this.$refs.scrollPane.moveToTarget(tag); |
| | | // when query is different then update |
| | | if (tag.to.fullPath !== this.$route.fullPath) { |
| | | this.$store.dispatch( |
| | | "tagsView/updateVisitedView", |
| | | this.$route |
| | | ); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | refreshSelectedTag(view) { |
| | | this.$store.dispatch("tagsView/delCachedView", view).then(() => { |
| | | const { fullPath } = view; |
| | | this.$nextTick(() => { |
| | | this.$router.replace({ |
| | | path: "/redirect" + fullPath |
| | | }); |
| | | }); |
| | | }); |
| | | }, |
| | | closeSelectedTag(view) { |
| | | this.$store |
| | | .dispatch("tagsView/delView", view) |
| | | .then(({ visitedViews }) => { |
| | | if (this.isActive(view)) { |
| | | this.toLastView(visitedViews, view); |
| | | } |
| | | }); |
| | | }, |
| | | closeOthersTags() { |
| | | this.$router.push(this.selectedTag); |
| | | this.$store |
| | | .dispatch("tagsView/delOthersViews", this.selectedTag) |
| | | .then(() => { |
| | | this.moveToCurrentTag(); |
| | | }); |
| | | }, |
| | | closeAllTags(view) { |
| | | this.$store |
| | | .dispatch("tagsView/delAllViews") |
| | | .then(({ visitedViews }) => { |
| | | if (this.affixTags.some(tag => tag.path === view.path)) { |
| | | return; |
| | | } |
| | | this.toLastView(visitedViews, view); |
| | | }); |
| | | }, |
| | | toLastView(visitedViews, view) { |
| | | const latestView = visitedViews.slice(-1)[0]; |
| | | if (latestView) { |
| | | this.$router.push(latestView.fullPath); |
| | | } else { |
| | | // now the default is to redirect to the home page if there is no tags-view, |
| | | // you can adjust it according to your needs. |
| | | if (view.name === "Dashboard") { |
| | | // to reload home page |
| | | this.$router.replace({ path: "/redirect" + view.fullPath }); |
| | | } else { |
| | | this.$router.push("/"); |
| | | } |
| | | } |
| | | }, |
| | | openMenu(tag, e) { |
| | | const menuMinWidth = 105; |
| | | const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left |
| | | const offsetWidth = this.$el.offsetWidth; // container width |
| | | const maxLeft = offsetWidth - menuMinWidth; // left boundary |
| | | const left = e.clientX - offsetLeft + 15; // 15: margin right |
| | | |
| | | if (left > maxLeft) { |
| | | this.left = maxLeft; |
| | | } else { |
| | | this.left = left; |
| | | } |
| | | |
| | | this.top = e.clientY; |
| | | this.visible = true; |
| | | this.selectedTag = tag; |
| | | }, |
| | | closeMenu() { |
| | | this.visible = false; |
| | | } |
| | | components: { ScrollPane }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | top: 0, |
| | | left: 0, |
| | | selectedTag: {}, |
| | | affixTags: [] |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | visitedViews() { |
| | | return this.$store.state.tagsView.visitedViews |
| | | }, |
| | | routes() { |
| | | return this.$store.state.permission.routes |
| | | }, |
| | | theme() { |
| | | return this.$store.state.settings.theme; |
| | | } |
| | | }, |
| | | watch: { |
| | | $route() { |
| | | this.addTags() |
| | | this.moveToCurrentTag() |
| | | }, |
| | | visible(value) { |
| | | if (value) { |
| | | document.body.addEventListener('click', this.closeMenu) |
| | | } else { |
| | | document.body.removeEventListener('click', this.closeMenu) |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.initTags() |
| | | this.addTags() |
| | | }, |
| | | methods: { |
| | | isActive(route) { |
| | | return route.path === this.$route.path |
| | | }, |
| | | activeStyle(tag) { |
| | | if (!this.isActive(tag)) return {}; |
| | | return { |
| | | "background-color": this.theme, |
| | | "border-color": this.theme |
| | | }; |
| | | }, |
| | | isAffix(tag) { |
| | | return tag.meta && tag.meta.affix |
| | | }, |
| | | filterAffixTags(routes, basePath = '/') { |
| | | let tags = [] |
| | | routes.forEach(route => { |
| | | if (route.meta && route.meta.affix) { |
| | | const tagPath = path.resolve(basePath, route.path) |
| | | tags.push({ |
| | | fullPath: tagPath, |
| | | path: tagPath, |
| | | name: route.name, |
| | | meta: { ...route.meta } |
| | | }) |
| | | } |
| | | if (route.children) { |
| | | const tempTags = this.filterAffixTags(route.children, route.path) |
| | | if (tempTags.length >= 1) { |
| | | tags = [...tags, ...tempTags] |
| | | } |
| | | } |
| | | }) |
| | | return tags |
| | | }, |
| | | initTags() { |
| | | const affixTags = this.affixTags = this.filterAffixTags(this.routes) |
| | | for (const tag of affixTags) { |
| | | // Must have tag name |
| | | if (tag.name) { |
| | | this.$store.dispatch('tagsView/addVisitedView', tag) |
| | | } |
| | | } |
| | | }, |
| | | addTags() { |
| | | const { name } = this.$route |
| | | if (name) { |
| | | this.$store.dispatch('tagsView/addView', this.$route) |
| | | } |
| | | return false |
| | | }, |
| | | moveToCurrentTag() { |
| | | const tags = this.$refs.tag |
| | | this.$nextTick(() => { |
| | | for (const tag of tags) { |
| | | if (tag.to.path === this.$route.path) { |
| | | this.$refs.scrollPane.moveToTarget(tag) |
| | | // when query is different then update |
| | | if (tag.to.fullPath !== this.$route.fullPath) { |
| | | this.$store.dispatch('tagsView/updateVisitedView', this.$route) |
| | | } |
| | | break |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | refreshSelectedTag(view) { |
| | | this.$store.dispatch('tagsView/delCachedView', view).then(() => { |
| | | const { fullPath } = view |
| | | this.$nextTick(() => { |
| | | this.$router.replace({ |
| | | path: '/redirect' + fullPath |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | closeSelectedTag(view) { |
| | | this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { |
| | | if (this.isActive(view)) { |
| | | this.toLastView(visitedViews, view) |
| | | } |
| | | }) |
| | | }, |
| | | closeOthersTags() { |
| | | this.$router.push(this.selectedTag) |
| | | this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => { |
| | | this.moveToCurrentTag() |
| | | }) |
| | | }, |
| | | closeAllTags(view) { |
| | | this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => { |
| | | if (this.affixTags.some(tag => tag.path === view.path)) { |
| | | return |
| | | } |
| | | this.toLastView(visitedViews, view) |
| | | }) |
| | | }, |
| | | toLastView(visitedViews, view) { |
| | | const latestView = visitedViews.slice(-1)[0] |
| | | if (latestView) { |
| | | this.$router.push(latestView.fullPath) |
| | | } else { |
| | | // now the default is to redirect to the home page if there is no tags-view, |
| | | // you can adjust it according to your needs. |
| | | if (view.name === 'Dashboard') { |
| | | // to reload home page |
| | | this.$router.replace({ path: '/redirect' + view.fullPath }) |
| | | } else { |
| | | this.$router.push('/') |
| | | } |
| | | } |
| | | }, |
| | | openMenu(tag, e) { |
| | | const menuMinWidth = 105 |
| | | const offsetLeft = this.$el.getBoundingClientRect().left // container margin left |
| | | const offsetWidth = this.$el.offsetWidth // container width |
| | | const maxLeft = offsetWidth - menuMinWidth // left boundary |
| | | const left = e.clientX - offsetLeft + 15 // 15: margin right |
| | | |
| | | if (left > maxLeft) { |
| | | this.left = maxLeft |
| | | } else { |
| | | this.left = left |
| | | } |
| | | |
| | | this.top = e.clientY |
| | | this.visible = true |
| | | this.selectedTag = tag |
| | | }, |
| | | closeMenu() { |
| | | this.visible = false |
| | | }, |
| | | handleScroll() { |
| | | this.closeMenu() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .tags-view-container { |
| | | height: 34px; |
| | | width: 100%; |
| | | height: 34px; |
| | | width: 100%; |
| | | background: #fff; |
| | | border-bottom: 1px solid #d8dce5; |
| | | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04); |
| | | .tags-view-wrapper { |
| | | .tags-view-item { |
| | | display: inline-block; |
| | | position: relative; |
| | | cursor: pointer; |
| | | height: 26px; |
| | | line-height: 26px; |
| | | border: 1px solid #d8dce5; |
| | | color: #495060; |
| | | background: #fff; |
| | | padding: 0 8px; |
| | | font-size: 12px; |
| | | margin-left: 5px; |
| | | margin-top: 4px; |
| | | &:first-of-type { |
| | | margin-left: 15px; |
| | | } |
| | | &:last-of-type { |
| | | margin-right: 15px; |
| | | } |
| | | &.active { |
| | | background-color: #42b983; |
| | | color: #fff; |
| | | border-color: #42b983; |
| | | &::before { |
| | | content: ''; |
| | | background: #fff; |
| | | display: inline-block; |
| | | width: 8px; |
| | | height: 8px; |
| | | border-radius: 50%; |
| | | position: relative; |
| | | margin-right: 2px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .contextmenu { |
| | | margin: 0; |
| | | background: #fff; |
| | | border-bottom: 1px solid #d8dce5; |
| | | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); |
| | | .tags-view-wrapper { |
| | | .tags-view-item { |
| | | display: inline-block; |
| | | position: relative; |
| | | cursor: pointer; |
| | | height: 26px; |
| | | line-height: 26px; |
| | | border: 1px solid #d8dce5; |
| | | color: #495060; |
| | | background: #fff; |
| | | padding: 0 8px; |
| | | font-size: 12px; |
| | | margin-left: 5px; |
| | | margin-top: 4px; |
| | | &:first-of-type { |
| | | margin-left: 15px; |
| | | } |
| | | &:last-of-type { |
| | | margin-right: 15px; |
| | | } |
| | | &.active { |
| | | background-color: #42b983; |
| | | color: #fff; |
| | | border-color: #42b983; |
| | | &::before { |
| | | content: ""; |
| | | background: #fff; |
| | | display: inline-block; |
| | | width: 8px; |
| | | height: 8px; |
| | | border-radius: 50%; |
| | | position: relative; |
| | | margin-right: 2px; |
| | | } |
| | | } |
| | | } |
| | | z-index: 3000; |
| | | position: absolute; |
| | | list-style-type: none; |
| | | padding: 5px 0; |
| | | border-radius: 4px; |
| | | font-size: 12px; |
| | | font-weight: 400; |
| | | color: #333; |
| | | box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3); |
| | | li { |
| | | margin: 0; |
| | | padding: 7px 16px; |
| | | cursor: pointer; |
| | | &:hover { |
| | | background: #eee; |
| | | } |
| | | } |
| | | .contextmenu { |
| | | margin: 0; |
| | | background: #fff; |
| | | z-index: 3000; |
| | | position: absolute; |
| | | list-style-type: none; |
| | | padding: 5px 0; |
| | | border-radius: 4px; |
| | | font-size: 12px; |
| | | font-weight: 400; |
| | | color: #333; |
| | | box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3); |
| | | li { |
| | | margin: 0; |
| | | padding: 7px 16px; |
| | | cursor: pointer; |
| | | &:hover { |
| | | background: #eee; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | |
| | | <style lang="scss"> |
| | | //reset element css of el-icon-close |
| | | .tags-view-wrapper { |
| | | .tags-view-item { |
| | | .el-icon-close { |
| | | width: 16px; |
| | | height: 16px; |
| | | vertical-align: 2px; |
| | | border-radius: 50%; |
| | | text-align: center; |
| | | transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); |
| | | transform-origin: 100% 50%; |
| | | &:before { |
| | | transform: scale(0.6); |
| | | display: inline-block; |
| | | vertical-align: -3px; |
| | | } |
| | | &:hover { |
| | | background-color: #b4bccc; |
| | | color: #fff; |
| | | } |
| | | } |
| | | .tags-view-item { |
| | | .el-icon-close { |
| | | width: 16px; |
| | | height: 16px; |
| | | vertical-align: 2px; |
| | | border-radius: 50%; |
| | | text-align: center; |
| | | transition: all .3s cubic-bezier(.645, .045, .355, 1); |
| | | transform-origin: 100% 50%; |
| | | &:before { |
| | | transform: scale(.6); |
| | | display: inline-block; |
| | | vertical-align: -3px; |
| | | } |
| | | &:hover { |
| | | background-color: #b4bccc; |
| | | color: #fff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | v-hasPermi="['system:config:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-refresh" |
| | | size="mini" |
| | | @click="handleClearCache" |
| | | v-hasPermi="['system:config:remove']" |
| | | >æ¸
çç¼å</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listConfig, getConfig, delConfig, addConfig, updateConfig, exportConfig } from "@/api/system/config"; |
| | | import { listConfig, getConfig, delConfig, addConfig, updateConfig, exportConfig, clearCache } from "@/api/system/config"; |
| | | |
| | | export default { |
| | | name: "Config", |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | }).catch(function() {}); |
| | | }, |
| | | /** æ¸
çç¼åæé®æä½ */ |
| | | handleClearCache() { |
| | | clearCache().then(response => { |
| | | if (response.code === 200) { |
| | | this.msgSuccess("æ¸
çæå"); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:dept:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | @click="handleAdd(scope.row)" |
| | | v-hasPermi="['system:dept:add']" |
| | | >æ°å¢</el-button> |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | v-hasPermi="['system:dict:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-refresh" |
| | | size="mini" |
| | | @click="handleClearCache" |
| | | v-hasPermi="['system:dict:remove']" |
| | | >æ¸
çç¼å</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listType, getType, delType, addType, updateType, exportType } from "@/api/system/dict/type"; |
| | | import { listType, getType, delType, addType, updateType, exportType, clearCache } from "@/api/system/dict/type"; |
| | | |
| | | export default { |
| | | name: "Dict", |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | }).catch(function() {}); |
| | | }, |
| | | /** æ¸
çç¼åæé®æä½ */ |
| | | handleClearCache() { |
| | | clearCache().then(response => { |
| | | if (response.code === 200) { |
| | | this.msgSuccess("æ¸
çæå"); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | <el-button size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:menu:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | @click="handleAdd(scope.row)" |
| | | v-hasPermi="['system:menu:add']" |
| | | >æ°å¢</el-button> |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.openDataScope = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | resetUserPwd(row.userId, value).then(response => { |
| | | if (response.code === 200) { |
| | | this.msgSuccess("ä¿®æ¹æåï¼æ°å¯ç æ¯ï¼" + value); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | }).catch(() => {}); |
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | response => { |
| | | if (response.code === 200) { |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | } |
| | | ); |
| | |
| | | this.open = false; |
| | | this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl; |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | this.$refs.cropper.clearCrop(); |
| | | }); |
| | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | <el-form ref="form" :model="user" :rules="rules" label-width="80px"> |
| | | <el-form-item label="ç¨æ·æµç§°" prop="nickName"> |
| | | <el-input v-model="user.nickName" /> |
| | | </el-form-item> |
| | | </el-form-item> |
| | | <el-form-item label="ææºå·ç " prop="phonenumber"> |
| | | <el-input v-model="user.phonenumber" maxlength="11" /> |
| | | </el-form-item> |
| | |
| | | updateUserProfile(this.user).then(response => { |
| | | if (response.code === 200) { |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | |
| | | .end() |
| | | |
| | | config |
| | | // https://webpack.js.org/configuration/devtool/#development |
| | | .when(process.env.NODE_ENV === 'development', |
| | | config => config.devtool('cheap-source-map') |
| | | ) |
| | | |
| | | config |
| | | .when(process.env.NODE_ENV !== 'development', |
| | | config => { |
| | | config |
| | |
| | | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi</artifactId> |
| | | <version>2.2.0</version> |
| | | <version>2.3.0</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <name>ruoyi</name> |
| | |
| | | <java.version>1.8</java.version> |
| | | <mybatis.spring.boot.starter.version>1.3.2</mybatis.spring.boot.starter.version> |
| | | <pagehelper.spring.boot.starter.version>1.2.5</pagehelper.spring.boot.starter.version> |
| | | <fastjson.version>1.2.68</fastjson.version> |
| | | <fastjson.version>1.2.70</fastjson.version> |
| | | <druid.version>1.1.14</druid.version> |
| | | <commons.io.version>2.5</commons.io.version> |
| | | <commons.fileupload.version>1.3.3</commons.fileupload.version> |
| | |
| | | public static final String JWT_AUTHORITIES = "authorities"; |
| | | |
| | | /** |
| | | * åæ°ç®¡ç cache key |
| | | */ |
| | | public static final String SYS_CONFIG_KEY = "sys_config:"; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç cache key |
| | | */ |
| | | public static final String SYS_DICT_KEY = "sys_dict:"; |
| | | |
| | | /** |
| | | * èµæºæ å°è·¯å¾ åç¼ |
| | | */ |
| | | public static final String RESOURCE_PREFIX = "/profile"; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import java.util.Collection;
|
| | | import java.util.List;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.utils.spring.SpringUtils;
|
| | | import com.ruoyi.framework.redis.RedisCache;
|
| | | import com.ruoyi.project.system.domain.SysDictData;
|
| | |
|
| | | /**
|
| | | * åå
¸å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class DictUtils
|
| | | {
|
| | | /**
|
| | | * 设置åå
¸ç¼å
|
| | | * |
| | | * @param key åæ°é®
|
| | | * @param dictDatas åå
¸æ°æ®å表
|
| | | */
|
| | | public static void setDictCache(String key, List<SysDictData> dictDatas)
|
| | | {
|
| | | SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·ååå
¸ç¼å
|
| | | * |
| | | * @param key åæ°é®
|
| | | * @return dictDatas åå
¸æ°æ®å表
|
| | | */
|
| | | public static List<SysDictData> getDictCache(String key)
|
| | | {
|
| | | Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
| | | if (StringUtils.isNotNull(cacheObj))
|
| | | {
|
| | | List<SysDictData> DictDatas = StringUtils.cast(cacheObj);
|
| | | return DictDatas;
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¸
空åå
¸ç¼å
|
| | | */
|
| | | public static void clearDictCache()
|
| | | {
|
| | | Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*");
|
| | | SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置cache key
|
| | | * |
| | | * @param configKey åæ°é®
|
| | | * @return ç¼åé®key
|
| | | */
|
| | | public static String getCacheKey(String configKey)
|
| | | {
|
| | | return Constants.SYS_DICT_KEY + configKey;
|
| | | }
|
| | | }
|
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public static <T> T cast(Object obj) |
| | | { |
| | | return (T) obj; |
| | | } |
| | | } |
| | |
| | | { |
| | | return toAjax(configService.deleteConfigByIds(configIds)); |
| | | } |
| | | |
| | | /** |
| | | * æ¸
空ç¼å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clearCache") |
| | | public AjaxResult clearCache() |
| | | { |
| | | configService.clearCache(); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.system.domain.SysDictData; |
| | | import com.ruoyi.project.system.service.ISysDictDataService; |
| | | import com.ruoyi.project.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * æ°æ®åå
¸ä¿¡æ¯ |
| | |
| | | { |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/dictType/{dictType}") |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult dictType(@PathVariable String dictType) |
| | | { |
| | | return AjaxResult.success(dictDataService.selectDictDataByType(dictType)); |
| | | return AjaxResult.success(dictTypeService.selectDictDataByType(dictType)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¸
空ç¼å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clearCache") |
| | | public AjaxResult clearCache() |
| | | { |
| | | dictTypeService.clearCache(); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * è·ååå
¸éæ©æ¡å表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | |
| | | public int updateConfig(SysConfig config); |
| | | |
| | | /** |
| | | * å é¤åæ°é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param configId åæ°ID |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteConfigById(Long configId); |
| | | |
| | | /** |
| | | * æ¹éå é¤åæ°ä¿¡æ¯ |
| | | * |
| | | * @param configIds éè¦å é¤çåæ°ID |
| | |
| | | public int deleteConfigByIds(Long[] configIds); |
| | | |
| | | /** |
| | | * æ¸
空ç¼åæ°æ® |
| | | */ |
| | | public void clearCache(); |
| | | |
| | | /** |
| | | * æ ¡éªåæ°é®åæ¯å¦å¯ä¸ |
| | | * |
| | | * @param config åæ°ä¿¡æ¯ |
| | |
| | | public List<SysDictData> selectDictDataList(SysDictData dictData); |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ® |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * @return åå
¸æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | public List<SysDictData> selectDictDataByType(String dictType); |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åååå
¸é®å¼æ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | |
| | | * @return åå
¸æ°æ® |
| | | */ |
| | | public SysDictData selectDictDataById(Long dictCode); |
| | | |
| | | /** |
| | | * éè¿åå
¸IDå é¤åå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param dictCode åå
¸æ°æ®ID |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDictDataById(Long dictCode); |
| | | |
| | | /** |
| | | * æ¹éå é¤åå
¸æ°æ®ä¿¡æ¯ |
| | |
| | | package com.ruoyi.project.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.project.system.domain.SysDictData; |
| | | import com.ruoyi.project.system.domain.SysDictType; |
| | | |
| | | /** |
| | |
| | | public List<SysDictType> selectDictTypeAll(); |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ® |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * @return åå
¸æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | public List<SysDictData> selectDictDataByType(String dictType); |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åIDæ¥è¯¢ä¿¡æ¯ |
| | | * |
| | | * @param dictId åå
¸ç±»åID |
| | |
| | | public SysDictType selectDictTypeByType(String dictType); |
| | | |
| | | /** |
| | | * éè¿åå
¸IDå é¤åå
¸ä¿¡æ¯ |
| | | * |
| | | * @param dictId åå
¸ID |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDictTypeById(Long dictId); |
| | | |
| | | /** |
| | | * æ¹éå é¤åå
¸ä¿¡æ¯ |
| | | * |
| | | * @param dictIds éè¦å é¤çåå
¸ID |
| | |
| | | public int deleteDictTypeByIds(Long[] dictIds); |
| | | |
| | | /** |
| | | * æ¸
空ç¼åæ°æ® |
| | | */ |
| | | public void clearCache(); |
| | | |
| | | /** |
| | | * æ°å¢ä¿ååå
¸ç±»åä¿¡æ¯ |
| | | * |
| | | * @param dictType åå
¸ç±»åä¿¡æ¯ |
| | |
| | | package com.ruoyi.project.system.service.impl; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import javax.annotation.PostConstruct; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.redis.RedisCache; |
| | | import com.ruoyi.project.system.domain.SysConfig; |
| | | import com.ruoyi.project.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.project.system.service.ISysConfigService; |
| | |
| | | { |
| | | @Autowired |
| | | private SysConfigMapper configMapper; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * 项ç®å¯å¨æ¶ï¼åå§ååæ°å°ç¼å |
| | | */ |
| | | @PostConstruct |
| | | public void init() |
| | | { |
| | | List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig()); |
| | | for (SysConfig config : configsList) |
| | | { |
| | | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ°é
ç½®ä¿¡æ¯ |
| | |
| | | @Override |
| | | public String selectConfigByKey(String configKey) |
| | | { |
| | | String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); |
| | | if (StringUtils.isNotEmpty(configValue)) |
| | | { |
| | | return configValue; |
| | | } |
| | | SysConfig config = new SysConfig(); |
| | | config.setConfigKey(configKey); |
| | | SysConfig retConfig = configMapper.selectConfig(config); |
| | | return StringUtils.isNotNull(retConfig) ? retConfig.getConfigValue() : ""; |
| | | if (StringUtils.isNotNull(retConfig)) |
| | | { |
| | | redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); |
| | | return retConfig.getConfigValue(); |
| | | } |
| | | return StringUtils.EMPTY; |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public int insertConfig(SysConfig config) |
| | | { |
| | | return configMapper.insertConfig(config); |
| | | int row = configMapper.insertConfig(config); |
| | | if (row > 0) |
| | | { |
| | | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public int updateConfig(SysConfig config) |
| | | { |
| | | return configMapper.updateConfig(config); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åæ°é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param configId åæ°ID |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteConfigById(Long configId) |
| | | { |
| | | return configMapper.deleteConfigById(configId); |
| | | int row = configMapper.updateConfig(config); |
| | | if (row > 0) |
| | | { |
| | | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public int deleteConfigByIds(Long[] configIds) |
| | | { |
| | | return configMapper.deleteConfigByIds(configIds); |
| | | int count = configMapper.deleteConfigByIds(configIds); |
| | | if (count > 0) |
| | | { |
| | | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); |
| | | redisCache.deleteObject(keys); |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | /** |
| | | * æ¸
空ç¼åæ°æ® |
| | | */ |
| | | public void clearCache() |
| | | { |
| | | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); |
| | | redisCache.deleteObject(keys); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 设置cache key |
| | | * |
| | | * @param configKey åæ°é® |
| | | * @return ç¼åé®key |
| | | */ |
| | | private String getCacheKey(String configKey) |
| | | { |
| | | return Constants.SYS_CONFIG_KEY + configKey; |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.project.system.domain.SysDictData; |
| | | import com.ruoyi.project.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.project.system.service.ISysDictDataService; |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ® |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * @return åå
¸æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<SysDictData> selectDictDataByType(String dictType) |
| | | { |
| | | return dictDataMapper.selectDictDataByType(dictType); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åååå
¸é®å¼æ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | |
| | | } |
| | | |
| | | /** |
| | | * éè¿åå
¸IDå é¤åå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param dictCode åå
¸æ°æ®ID |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteDictDataById(Long dictCode) |
| | | { |
| | | return dictDataMapper.deleteDictDataById(dictCode); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤åå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param dictCodes éè¦å é¤çåå
¸æ°æ®ID |
| | |
| | | */ |
| | | public int deleteDictDataByIds(Long[] dictCodes) |
| | | { |
| | | return dictDataMapper.deleteDictDataByIds(dictCodes); |
| | | int row = dictDataMapper.deleteDictDataByIds(dictCodes); |
| | | if (row > 0) |
| | | { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public int insertDictData(SysDictData dictData) |
| | | { |
| | | return dictDataMapper.insertDictData(dictData); |
| | | int row = dictDataMapper.insertDictData(dictData); |
| | | if (row > 0) |
| | | { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public int updateDictData(SysDictData dictData) |
| | | { |
| | | return dictDataMapper.updateDictData(dictData); |
| | | int row = dictDataMapper.updateDictData(dictData); |
| | | if (row > 0) |
| | | { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import javax.annotation.PostConstruct; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.system.domain.SysDictData; |
| | | import com.ruoyi.project.system.domain.SysDictType; |
| | | import com.ruoyi.project.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.project.system.mapper.SysDictTypeMapper; |
| | |
| | | |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | | |
| | | /** |
| | | * 项ç®å¯å¨æ¶ï¼åå§ååå
¸å°ç¼å |
| | | */ |
| | | @PostConstruct |
| | | public void init() |
| | | { |
| | | List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll(); |
| | | for (SysDictType dictType : dictTypeList) |
| | | { |
| | | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); |
| | | DictUtils.setDictCache(dictType.getDictType(), dictDatas); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢åå
¸ç±»å |
| | |
| | | public List<SysDictType> selectDictTypeAll() |
| | | { |
| | | return dictTypeMapper.selectDictTypeAll(); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ® |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * @return åå
¸æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<SysDictData> selectDictDataByType(String dictType) |
| | | { |
| | | List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); |
| | | if (StringUtils.isNotNull(dictDatas)) |
| | | { |
| | | return dictDatas; |
| | | } |
| | | dictDatas = dictDataMapper.selectDictDataByType(dictType); |
| | | if (StringUtils.isNotNull(dictDatas)) |
| | | { |
| | | DictUtils.setDictCache(dictType, dictDatas); |
| | | return dictDatas; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * éè¿åå
¸IDå é¤åå
¸ä¿¡æ¯ |
| | | * |
| | | * @param dictId åå
¸ID |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteDictTypeById(Long dictId) |
| | | { |
| | | return dictTypeMapper.deleteDictTypeById(dictId); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤åå
¸ç±»åä¿¡æ¯ |
| | | * |
| | | * @param dictIds éè¦å é¤çåå
¸ID |
| | |
| | | */ |
| | | public int deleteDictTypeByIds(Long[] dictIds) |
| | | { |
| | | return dictTypeMapper.deleteDictTypeByIds(dictIds); |
| | | for (Long dictId : dictIds) |
| | | { |
| | | SysDictType dictType = selectDictTypeById(dictId); |
| | | if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) |
| | | { |
| | | throw new CustomException(String.format("%1$så·²åé
,ä¸è½å é¤", dictType.getDictName())); |
| | | } |
| | | } |
| | | int count = dictTypeMapper.deleteDictTypeByIds(dictIds); |
| | | if (count > 0) |
| | | { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | /** |
| | | * æ¸
空ç¼åæ°æ® |
| | | */ |
| | | public void clearCache() |
| | | { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public int insertDictType(SysDictType dictType) |
| | | { |
| | | return dictTypeMapper.insertDictType(dictType); |
| | | int row = dictTypeMapper.insertDictType(dictType); |
| | | if (row > 0) |
| | | { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId()); |
| | | dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType()); |
| | | return dictTypeMapper.updateDictType(dictType); |
| | | int row = dictTypeMapper.updateDictType(dictType); |
| | | if (row > 0) |
| | | { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | RouterVo router = new RouterVo(); |
| | | router.setHidden("1".equals(menu.getVisible())); |
| | | router.setName(StringUtils.capitalize(menu.getPath())); |
| | | router.setName(getRouteName(menu)); |
| | | router.setPath(getRouterPath(menu)); |
| | | router.setComponent(getComponent(menu)); |
| | | router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åè·¯ç±åç§° |
| | | * |
| | | * @param menu èåä¿¡æ¯ |
| | | * @return è·¯ç±åç§° |
| | | */ |
| | | public String getRouteName(SysMenu menu) |
| | | { |
| | | String routerName = StringUtils.capitalize(menu.getPath()); |
| | | // éå¤é¾å¹¶ä¸æ¯ä¸çº§ç®å½ï¼ç±»å为ç®å½ï¼ |
| | | if (isMeunFrame(menu)) |
| | | { |
| | | routerName = StringUtils.EMPTY; |
| | | } |
| | | return routerName; |
| | | } |
| | | |
| | | /** |
| | | * è·åè·¯ç±å°å |
| | | * |
| | | * @param menu èåä¿¡æ¯ |
| | |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 2.2.0 |
| | | version: 2.3.0 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2019 |
| | | # å®ä¾æ¼ç¤ºå¼å
³ |
| | |
| | | SELECT @parentId := LAST_INSERT_ID(); |
| | | |
| | | -- æé® SQL |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('${functionName}æ¥è¯¢', @parentId, '1', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('${functionName}æ°å¢', @parentId, '2', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('${functionName}ä¿®æ¹', @parentId, '3', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('${functionName}å é¤', @parentId, '4', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('${functionName}导åº', @parentId, '5', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); |
| | |
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | |
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |