From 5313d8736c40de0693f89dce77cb93e9983b5ace Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期五, 01 九月 2023 14:30:21 +0800
Subject: [PATCH] 添加 角色列表中英文json包
---
CanadaMes-ui/src/views/role/index.vue | 78 +++---
CanadaMes-ui/src/views/power/index.vue | 4
CanadaMes-ui/src/views/user/index.vue | 61 +++-
CanadaMes-ui/src/layout/tag.vue | 138 ++++-------
CanadaMes-ui/src/layout/index.vue | 76 +++++-
CanadaMes-ui/src/lang/locales/zh-CN.json | 42 +++
/dev/null | 77 -------
CanadaMes-ui/package.json | 3
CanadaMes-ui/src/views/device/alarm.vue | 71 +++---
CanadaMes-ui/src/views/login/index.vue | 5
CanadaMes-ui/src/main.js | 4
CanadaMes-ui/package-lock.json | 19 +
CanadaMes-ui/src/lang/locales/en-US.json | 35 +++
13 files changed, 330 insertions(+), 283 deletions(-)
diff --git a/CanadaMes-ui/package-lock.json b/CanadaMes-ui/package-lock.json
index dd945e1..f0dcccf 100644
--- a/CanadaMes-ui/package-lock.json
+++ b/CanadaMes-ui/package-lock.json
@@ -5,7 +5,7 @@
"requires": true,
"packages": {
"": {
- "name": "canadames",
+ "name": "springboot-vue3",
"version": "0.1.0",
"dependencies": {
"axios": "^0.19.2",
@@ -16,7 +16,8 @@
"less-loader": "^6.2.0",
"vue": "^2.6.11",
"vue-i18n": "^8.26.5",
- "vue-router": "^3.3.4"
+ "vue-router": "^3.3.4",
+ "vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
@@ -13243,6 +13244,14 @@
"integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
"dev": true
},
+ "node_modules/vuex": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
+ "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
+ "peerDependencies": {
+ "vue": "^2.0.0"
+ }
+ },
"node_modules/watchpack": {
"version": "1.7.5",
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.5.tgz",
@@ -25281,6 +25290,12 @@
"integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
"dev": true
},
+ "vuex": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
+ "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
+ "requires": {}
+ },
"watchpack": {
"version": "1.7.5",
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.5.tgz",
diff --git a/CanadaMes-ui/package.json b/CanadaMes-ui/package.json
index 4f0351c..276a358 100644
--- a/CanadaMes-ui/package.json
+++ b/CanadaMes-ui/package.json
@@ -16,7 +16,8 @@
"less-loader": "^6.2.0",
"vue": "^2.6.11",
"vue-i18n": "^8.26.5",
- "vue-router": "^3.3.4"
+ "vue-router": "^3.3.4",
+ "vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 3f06531..3ae9217 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -36,5 +36,38 @@
"northglassMESsystem":"NorthGlassMesSystem",
"exit":"exit",
"changePassword":"changePassword",
- "resetPassword": "resetPassword"
+ "resetPassword": "resetPassword",
+ "home":"Home",
+ "role":"role",
+ "langRoleManagement": "Role Management",
+ "langRoleList": "Role List",
+ "langEnterRoleName": "Please enter role name",
+ "langAddRole": "Add Role",
+ "langName": "Name",
+ "langIsValid": "Is Valid",
+ "langOperation": "Operation",
+ "langPleaseSelect": "Please select",
+ "langValid": "Valid",
+ "langInvalid": "Invalid",
+ "langAddRoleSuccess": "Add role successfully",
+ "langEnterName": "Please enter name",
+ "langLengthBetween": "Length should be between",
+ "langAnd": "and",
+ "langCharacters": "characters",
+ "langEnterState": "Please enter state",
+ "langUpdateState": "Update state successfully",
+ "langEditRole": "Edit Role",
+ "langEditRoleSuccess": "Edit role successfully",
+ "langDeleteRoleConfirm": "Are you sure you want to delete this role?",
+ "langPrompt": "Prompt",
+ "langDeleteRoleSuccess": "Delete role successfully",
+ "langCancelDelete": "Cancelled deleting",
+ "langRoleName":"langRoleName",
+ "updateSuccessMessage":"updateSuccessMessage",
+ "paginationTotal": "Total {total}",
+ "paginationSizes": "Items per page",
+ "paginationPrev": "Previous",
+ "paginationPager": "{currentPage}/{pageCount}",
+ "paginationNext": "Next",
+ "paginationJumper": "Jump to"
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index 0f358a8..be273d6 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -31,11 +31,47 @@
"langPassword": "瀵嗙爜",
"langState": "鐘舵��",
"langSelect": "璇烽�夋嫨",
- "langCancel": "鍙栨秷",
- "langConfirm": "纭畾",
+
+
"langEditUserTitle": "淇敼鐢ㄦ埛",
"northglassMESsystem":"鍖楃幓MES绯荤粺",
"exit":"閫�鍑�",
- "changePassword":"淇敼瀵嗙爜"
+ "changePassword":"淇敼瀵嗙爜",
+ "resetPassword": "閲嶇疆瀵嗙爜",
+ "home":"涓婚〉",
+ "role":"瑙掕壊",
+ "langRoleManagement": "瑙掕壊绠$悊",
+ "langRoleList": "瑙掕壊鍒楄〃",
+ "langEnterRoleName": "璇疯緭鍏ヨ鑹插悕绉�",
+ "langAddRole": "娣诲姞瑙掕壊",
+ "langName": "鍚嶇О",
+ "langIsValid": "鏄惁鏈夋晥",
+ "langOperation": "鎿嶄綔",
+ "langPleaseSelect": "璇烽�夋嫨",
+ "langValid": "鏈夋晥",
+ "langInvalid": "鏃犳晥",
+ "langConfirm": "纭畾",
+ "langCancel": "鍙栨秷",
+ "langAddRoleSuccess": "娣诲姞瑙掕壊鎴愬姛",
+ "langEnterName": "璇疯緭鍏ュ悕绉�",
+ "langLengthBetween": "闀垮害鍦�",
+ "langAnd": "鍜�",
+ "langCharacters": "涓瓧绗︿箣闂�",
+ "langEnterState": "璇疯緭鍏ョ姸鎬�",
+ "langUpdateState": "鐘舵�佹洿鏂版垚鍔�",
+ "langEditRole": "缂栬緫瑙掕壊",
+ "langEditRoleSuccess": "缂栬緫瑙掕壊鎴愬姛",
+ "langDeleteRoleConfirm": "纭畾瑕佸垹闄よ瑙掕壊鍚楋紵",
+ "langPrompt": "鎻愮ず",
+ "langDeleteRoleSuccess": "鍒犻櫎瑙掕壊鎴愬姛",
+ "langCancelDelete": "宸插彇娑堝垹闄�",
+ "langRoleName":"瑙掕壊鍚嶇О",
+ "updateSuccessMessage":"鏇存柊鎴愬姛",
+ "paginationTotal": "鍏� {total} 鏉�",
+ "paginationSizes": "姣忛〉鏄剧ず",
+ "paginationPrev": "涓婁竴椤�",
+ "paginationPager": "{currentPage}/{pageCount}",
+ "paginationNext": "涓嬩竴椤�",
+ "paginationJumper": "璺宠嚦"
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/layout/index.vue b/CanadaMes-ui/src/layout/index.vue
index 1ce7f0f..f18018f 100644
--- a/CanadaMes-ui/src/layout/index.vue
+++ b/CanadaMes-ui/src/layout/index.vue
@@ -5,16 +5,25 @@
<el-aside :width="isCollapse?'70px':'250px'">
<el-col :gutter="20">
<el-row :span="4">
- <div class="logo">
- <div class="sys-name" v-show="!isCollapse">{{ $t('northglassMESsystem') }}</div>
- </div>
+ <div class="logo" @click="goToHome">
+ <div class="sys-name" v-show="!isCollapse">{{ $t('northglassMESsystem') }}</div>
+</div>
</el-row>
<el-row :span="20">
<el-menu :default-active="activePath" class="el-menu-vertical-demo"
background-color="#222f3e" text-color="#fff" active-text-color="#ffd04b"
:collapse="isCollapse" :unique-opened="true"
:collapse-transition="false" :router="true">
- <!--涓�绾ц彍鍗�-->
+ <el-menu-item index="/" @click="goToHome">
+ <template slot="title">
+ <!--鍥炬爣-->
+ <i class="el-icon-menu"></i>
+ <!--鏂囨湰-->
+ <span>{{ $t('home') }}</span>
+ </template>
+</el-menu-item>
+
+ <!--涓�绾ц彍鍗�-->
<el-submenu :index="item.id.toString()" v-for="item in menuList" :key="item.id">
<!--涓�绾ц彍鍗曟ā鏉垮尯鍩�-->
<template slot="title">
@@ -26,7 +35,7 @@
<!--浜岀骇鑿滃崟-->
<el-menu-item :index="'/'+menu.router"
v-for="menu in item.menuLists" :key="menu.id"
- @click="saveNavState('/'+menu.router)">
+ @click="saveNavState('/'+menu.router)" @select="saveNavState" :default-active="$route.path">
<template slot="title">
<!--鍥炬爣-->
<i :class="menu.icon"></i>
@@ -34,19 +43,27 @@
<span>{{ menu.name }}</span>
</template>
</el-menu-item>
+
</el-submenu>
+
</el-menu>
</el-row>
</el-col>
</el-aside>
</div>
<el-container>
-
+ <div>
+
+ </div>
<el-header class="header-container">
<!-- <div class="tagContainer">
<tag></tag>
- </div> -->
+ </div> -->
+
+ <div class="tagContainer">
+ <tag v-for="(tag, index) in tags" :key="index" :tag="tag" @removeTag="removeTag"></tag>
+ </div>
<el-menu :default-active="activePath1" class="el-menu-demo" mode="horizontal"
background-color="#576574" text-color="#fff" active-text-color="#ffd04b">
<div class="header-left">
@@ -55,7 +72,7 @@
<el-submenu index="1" class="user-icon">
<template slot="title">
- <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png">
+ <el-avatar src="../assets/emi.png">
</el-avatar>
</template>
<el-menu-item index="1-1" @click="logout">{{ $t('exit') }}</el-menu-item>
@@ -96,13 +113,18 @@
import {changePassword} from '../api/user'
import {removeToken} from "../utils/auth";
import LanguageMixin from '../lang/LanguageMixin'
-// import Tag from '../layout/tag.vue';
+import { mapState, mapMutations } from 'vuex';
+ import Tag from '../layout/tag.vue';
+ import store from '../store';
export default {
name: "Layout",
+ store,
mixins: [LanguageMixin],
data() {
return {
+
+ activeTag: '', // 褰撳墠婵�娲荤殑鏍囩
dialogVisible: false,
formData: {
oldPassword: '',
@@ -120,9 +142,9 @@
}
}
},
- // components: {
- // Tag
- // },
+ components: {
+ Tag
+ },
created() {
selectList(this.menuListForm).then(res => {
this.menuList = res.data
@@ -135,12 +157,36 @@
this.activePath = window.sessionStorage.getItem('activePath')
});
},
+ computed: {
+ ...mapState('tags', ['tags'])
+ },
methods: {
logout: function () {
removeToken()
this.$router.push('/login')
},
+ goToHome() {
+ this.$router.push('/home');
+ },
+ // 浣跨敤 mapMutations 杈呭姪鍑芥暟璋冪敤 Store 涓殑 mutations
+ ...mapMutations('tags', ['addTag', 'removeTag']),
+ // 鍒囨崲鏍囩鏃惰Е鍙戠殑鏂规硶
+ saveNavState(activePath) {
+ window.sessionStorage.setItem('activePath', activePath);
+ const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === activePath));
+ if (menuItem) {
+ const submenuItem = menuItem.menuLists.find(menu => menu.router === activePath);
+ if (submenuItem) {
+ const tag = submenuItem.name;
+ this.$store.commit('tags/addTag', tag); // 璋冪敤 Vuex Store 涓殑 addTag mutation
+ }
+ }
+ },
+ // 鍏抽棴鏍囩鏃惰Е鍙戠殑鏂规硶
+ removeTag(tag) {
+ this.removeTag(tag); // 浠� Vuex Store 涓Щ闄ゆ爣绛�
+ },
showChangePasswordDialog() {
@@ -173,9 +219,9 @@
toggleCollapse: function () {
this.isCollapse = !this.isCollapse;
},
- saveNavState: function (activePath) {
- window.sessionStorage.setItem('activePath', activePath)
- },
+ // saveNavState: function (activePath) {
+ // window.sessionStorage.setItem('activePath', activePath)
+ // },
replaceChineseWithEnglish(menuData) {
// 瀹氫箟涓嫳鏂囧鐓у叧绯诲璞�
const translation = {
diff --git a/CanadaMes-ui/src/layout/tag.vue b/CanadaMes-ui/src/layout/tag.vue
index 246ce7c..ccf38fd 100644
--- a/CanadaMes-ui/src/layout/tag.vue
+++ b/CanadaMes-ui/src/layout/tag.vue
@@ -1,91 +1,59 @@
<template>
- <div class="_tag">
- <el-scrollbar style="margin-right: 6px;">
- <div class="left">
- <el-tag
- v-for="tag in tagsList"
- :key="tag.title"
- :closable="!tag.hideclose"
- :type="isActive(tag)"
- @close="removeTag(tag)"
- @click="handleTagClick(tag)"
- >
- <router-link :to="tag.path" class="tag-title">{{ tag.title }}</router-link>
- </el-tag>
- </div>
- </el-scrollbar>
-
- <el-dropdown @command="handleCloseBtn" class="_dropdown">
- <el-button type="primary" size="small">
- 鏍囩閫夐」
- <i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="closeOther">鍏抽棴鍏跺畠</el-dropdown-item>
- <el-dropdown-item command="closeAll">鍏抽棴鎵�鏈�</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
+ <div class="tagContainer">
+ <div v-for="(tag, index) in tags" :key="index" class="tagItem">
+ {{ tag }}
+ <span class="closeBtn" @click="removeTag(index)">x</span>
</div>
- </template>
-
- <script>
- import { mapState, mapMutations } from "vuex";
-
- export default {
- computed: {
- ...mapState("tags", ["tagsList"]),
- activeTag() {
- return this.tagsList.find(tag => tag.path === this.$route.fullPath);
- }
- },
- methods: {
- ...mapMutations("tags", ["removeTag"]),
- handleCloseBtn(command) {
- if (command === "closeOther") {
- const activeTag = this.activeTag;
- if (!activeTag || activeTag.hideclose) return;
- this.$store.commit("tags/removeOtherTags", activeTag);
- } else if (command === "closeAll") {
- this.$store.commit("tags/removeAllTags");
- this.$router.push({ name: "sadmasMain" });
- }
- },
- isActive(tag) {
- return tag.path === this.$route.fullPath ? "" : "info";
- },
- handleTagClick(tag) {
- this.$router.push(tag.path);
- }
- },
- watch: {
- $route(newValue) {
- const isExist = this.tagsList.some(item => item.path === newValue.fullPath);
- if (!isExist) {
- this.$store.commit("tags/addTag", {
- title: newValue.meta.title || "",
- path: newValue.fullPath,
- hideclose: newValue.meta.hideclose || false
- });
- }
+ </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from 'vuex';
+
+export default {
+ computed: {
+ ...mapState('tags', { // 杩欓噷娣诲姞浜� 'tags' 妯″潡鐨勫懡鍚嶇┖闂村墠缂�
+ tags: state => state.tags.tags
+ })
+ },
+ methods: {
+ ...mapMutations('tag', ['removeTag']),
+ saveNavState(activePath) {
+ window.sessionStorage.setItem('activePath', activePath);
+
+ const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === activePath));
+ if (menuItem) {
+ const submenuItem = menuItem.menuLists.find(menu => menu.router === activePath);
+ if (submenuItem) {
+ const tag = submenuItem.name;
+ this.addTag(tag); // 娣诲姞鏍囩鍒� Vuex Store
}
}
- };
- </script>
-
- <style scoped>
- ._tag {
- display: flex;
- align-items: center;
- padding: 10px;
}
-
- .left {
- display: flex;
- flex-wrap: wrap;
}
-
- .tag-title {
- cursor: pointer;
- }
- </style>
-
\ No newline at end of file
+}
+</script>
+
+<style scoped>
+.tagContainer {
+ display: flex;
+ flex-wrap: wrap;
+ margin-bottom: 10px;
+}
+
+.tagItem {
+ background-color: #eee;
+ border-radius: 4px;
+ padding: 4px 8px;
+ margin-right: 8px;
+ margin-bottom: 8px;
+ display: flex;
+ align-items: center;
+}
+
+.closeBtn {
+ margin-left: 4px;
+ color: red;
+ cursor: pointer;
+}
+</style>
diff --git a/CanadaMes-ui/src/main.js b/CanadaMes-ui/src/main.js
index 0bb44ef..11d1158 100644
--- a/CanadaMes-ui/src/main.js
+++ b/CanadaMes-ui/src/main.js
@@ -8,12 +8,13 @@
import VueI18n from 'vue-i18n'
import zhCN from './lang/locales/zh-CN.json' // 涓枃璇█鍖�
import enUS from './lang/locales/en-US.json' // 鑻辨枃璇█鍖�
+import store from './store'
// import store from './store'
Vue.use(VueI18n)
const i18n = new VueI18n({
- locale: 'zh-CN', // 璁剧疆榛樿璇█涓轰腑鏂�
+ locale: 'en-US',
messages: {
'zh-CN': zhCN, // 娉ㄥ唽涓枃璇█鍖�
'en-US': enUS // 娉ㄥ唽鑻辨枃璇█鍖�
@@ -34,6 +35,7 @@
new Vue({
router,
i18n,
+ store,
render: h => h(App)
}).$mount('#app');
diff --git a/CanadaMes-ui/src/store/store,js b/CanadaMes-ui/src/store/store,js
deleted file mode 100644
index b2d2afd..0000000
--- a/CanadaMes-ui/src/store/store,js
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-import Vue from 'vue';
-import Vuex from 'vuex';
-
-Vue.use(Vuex);
-
-const store = new Vuex.Store({
- state: {
- // 鍏朵粬妯″潡鐨勭姸鎬�...
- },
- mutations: {
- // 鍏朵粬妯″潡鐨刴utations...
- },
- actions: {
- // 鍏朵粬妯″潡鐨刟ctions...
- },
- modules: {
- tag: {
- namespaced: true,
- state: {
- tags: [], // 鏍囩鍒楄〃
- selectedTag: null // 閫変腑鐨勬爣绛�
- },
- mutations: {
- SET_TAGS(state, tags) {
- state.tags = tags;
- },
- ADD_TAG(state, tag) {
- state.tags.push(tag);
- },
- REMOVE_TAG(state, tag) {
- state.tags = state.tags.filter(t => t !== tag);
- },
- CLEAR_TAGS(state) {
- state.tags = [];
- },
- SET_SELECTED_TAG(state, tag) {
- state.selectedTag = tag;
- },
- CLEAR_SELECTED_TAG(state) {
- state.selectedTag = null;
- }
- },
- actions: {
- setTags({ commit }, tags) {
- commit('SET_TAGS', tags);
- },
- addTag({ commit }, tag) {
- commit('ADD_TAG', tag);
- },
- removeTag({ commit }, tag) {
- commit('REMOVE_TAG', tag);
- },
- clearTags({ commit }) {
- commit('CLEAR_TAGS');
- },
- setSelectedTag({ commit }, tag) {
- commit('SET_SELECTED_TAG', tag);
- },
- clearSelectedTag({ commit }) {
- commit('CLEAR_SELECTED_TAG');
- }
- },
- getters: {
- getTags(state) {
- return state.tags;
- },
- getSelectedTag(state) {
- return state.selectedTag;
- }
- }
- }
- }
-});
-
-export default store;
diff --git a/CanadaMes-ui/src/views/device/alarm.vue b/CanadaMes-ui/src/views/device/alarm.vue
index 3967a9f..b9aa73a 100644
--- a/CanadaMes-ui/src/views/device/alarm.vue
+++ b/CanadaMes-ui/src/views/device/alarm.vue
@@ -1,41 +1,42 @@
<template>
- <div class="app">
+ <div>
+ <p>{{ receivedMessage }}</p>
+ <button @click="sendMessage">Send Message</button>
+ </div>
+</template>
+<script>
+export default {
+ name:'alarm',
+ data() {
+ return {
+ websocket: null,
+ receivedMessage: ''
+ };
+ },
+ mounted() {
+ this.websocket = new WebSocket('ws://localhost:8080');
- <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
- <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
- <el-button type="text">璁惧绠$悊</el-button>
- <router-link to="/device/iostate" tag="el-button" type="text">IO鐘舵��</router-link>
- <router-link to="/device/alarm" tag="el-button" type="text">鎶ヨ淇℃伅</router-link>
- <router-link to="/device/parameter" tag="el-button" type="text">鍙傛暟涓嬪彂</router-link>
- <router-link to="/device/control" tag="el-button" type="text">寮�鍏虫帶鍒�</router-link>
- </el-breadcrumb>
- <div>鎶ヨ淇℃伅</div>
- </div>
- </template>
-
- <script>
+ this.websocket.onopen = () => {
+ console.log('WebSocket connection opened');
+ };
-
- export default {
- name: "alarm",
-
+ this.websocket.onmessage = (event) => {
+ this.receivedMessage = event.data;
+ };
+
+ this.websocket.onclose = () => {
+ console.log('WebSocket connection closed');
+ };
+ },
+ methods: {
+ sendMessage() {
+ if (this.websocket.readyState === WebSocket.OPEN) {
+ this.websocket.send('Hello WebSocket!');
+ } else {
+ console.log('WebSocket connection is not open');
+ }
}
-
- </script>
-
- <style lang="less" scoped>
- .el-table {
- margin-top: 15px;
- font-size: 12px;
}
-
- .el-pagination {
- margin-top: 15px;
- }
-
- .app .el-card {
- width: 99%;
- }
- </style>
-
+};
+</script>
diff --git a/CanadaMes-ui/src/views/login/index.vue b/CanadaMes-ui/src/views/login/index.vue
index 8f6f52a..b34532b 100644
--- a/CanadaMes-ui/src/views/login/index.vue
+++ b/CanadaMes-ui/src/views/login/index.vue
@@ -1,6 +1,6 @@
<template>
<div class="login_container">
- <div class="system_title">{{ $t('systemTitle') }}</div>
+ <div class="system_title" >{{ $t('northglassMESsystem') }}</div>
<div class="login_box">
<!--澶村儚鍖哄煙-->
<!-- <div class="avatar_box">
@@ -139,7 +139,8 @@
font-weight: bold;
text-align: center;
margin-bottom: 20px;
- top:50px;
+ position: relative; top: 100px;
+
}
.btns {
display: flex;
diff --git a/CanadaMes-ui/src/views/power/index.vue b/CanadaMes-ui/src/views/power/index.vue
index 7b2e488..567af94 100644
--- a/CanadaMes-ui/src/views/power/index.vue
+++ b/CanadaMes-ui/src/views/power/index.vue
@@ -56,7 +56,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
- :page-sizes="[10, 20, 30, 40]"
+ :page-sizes="[6, 12, 18, 24]"
:page-size="queryInfo.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="powerList.total">
@@ -157,7 +157,7 @@
return {
queryInfo: {
pageNum: 1,
- pageSize: 10
+ pageSize: 6
},
powerList: {
records: [],
diff --git a/CanadaMes-ui/src/views/role/index.vue b/CanadaMes-ui/src/views/role/index.vue
index 1ccc221..ebcc35a 100644
--- a/CanadaMes-ui/src/views/role/index.vue
+++ b/CanadaMes-ui/src/views/role/index.vue
@@ -2,30 +2,30 @@
<div class="app">
<!--闈㈠寘灞戝鑸尯鍩�-->
<el-breadcrumb separator-class="el-icon-arrow-right">
- <el-breadcrumb-item :to="{ path: '/home' }">棣栭〉</el-breadcrumb-item>
- <el-breadcrumb-item>瑙掕壊绠$悊</el-breadcrumb-item>
- <el-breadcrumb-item>瑙掕壊鍒楄〃</el-breadcrumb-item>
+ <el-breadcrumb-item :to="{ path: '/home' }">{{$t('langHome')}}</el-breadcrumb-item>
+ <el-breadcrumb-item>{{$t('langRoleManagement')}}</el-breadcrumb-item>
+ <el-breadcrumb-item>{{$t('langRoleList')}}</el-breadcrumb-item>
</el-breadcrumb>
<!--鍗$墖瑙嗗浘鍖哄煙-->
<el-card class="el-card">
<el-row :gutter="20">
<!--鎼滅储涓庢坊鍔犲尯鍩�-->
<el-col :span="6">
- <el-input placeholder="璇疯緭鍏ヨ鑹插悕绉�" v-model="queryInfo.name" clearable @clear="getRoleList()">
- <el-button slot="append" icon="el-icon-search" @click="getRoleList()"></el-button>
- </el-input>
- </el-col>
+ <el-input :placeholder="$t('langEnterRoleName')" v-model="queryInfo.name" clearable @clear="getRoleList()">
+ <el-button slot="append" icon="el-icon-search" @click="getRoleList()"></el-button>
+ </el-input>
+</el-col>
<!--娣诲姞鍖哄煙-->
<el-col :span="4">
- <el-button type="primary" @click="showAddDialog">娣诲姞瑙掕壊</el-button>
+ <el-button type="primary" @click="showAddDialog">{{$t('langAddRole')}}</el-button>
</el-col>
</el-row>
<!--瑙掕壊鍒楄〃鍖哄煙-->
<el-table :data="roleList.records" border stripe>
<el-table-column label="#" type="index"></el-table-column>
- <el-table-column label="鍚嶇О" prop="name"></el-table-column>
- <el-table-column label="鍒涘缓鏃堕棿" prop="createTime"></el-table-column>
- <el-table-column label="鏄惁鏈夋晥">
+ <el-table-column :label="$t('langRoleName')" prop="name"></el-table-column>
+ <el-table-column :label="$t('langCreateTime')" prop="createTime"></el-table-column>
+ <el-table-column :label="$t('langIsValid')">
<template slot-scope="scope">
<el-switch :active-value=1
:inactive-value=0
@@ -34,19 +34,17 @@
</el-switch>
</template>
</el-table-column>
- <el-table-column label="鎿嶄綔">
+ <el-table-column :label="$t('langOperation')">
<template slot-scope="scope">
- <!--淇敼-->
- <el-tooltip effect="dark" content="淇敼" placement="top" :enterable="false">
- <el-button type="primary" icon="el-icon-edit" size="mini"
- @click="showEditDialog(scope.row)"></el-button>
- </el-tooltip>
- <!--鍒犻櫎-->
- <el-tooltip effect="dark" content="鍒犻櫎" placement="top" :enterable="false">
- <el-button type="danger" icon="el-icon-delete" size="mini"
- @click="removeById(scope.row)"></el-button>
- </el-tooltip>
- </template>
+ <!-- 淇敼 -->
+ <el-tooltip effect="dark" :content="$t('langEdit')" placement="top" :enterable="false">
+ <el-button type="primary" icon="el-icon-edit" size="mini" @click="showEditDialog(scope.row)"></el-button>
+ </el-tooltip>
+ <!-- 鍒犻櫎 -->
+ <el-tooltip effect="dark" :content="$t('langDelete')" placement="top" :enterable="false">
+ <el-button type="danger" icon="el-icon-delete" size="mini" @click="removeById(scope.row)"></el-button>
+ </el-tooltip>
+</template>
</el-table-column>
</el-table>
<!--鍒嗛〉鍖哄煙-->
@@ -62,17 +60,17 @@
</el-card>
<!--娣诲姞瑙掕壊鐨勫璇濇-->
<el-dialog
- title="娣诲姞瑙掕壊"
+ :title="$t('langAddRole')"
:visible.sync="addDialogVisible"
width="50%"
@close="addDialogClosed">
<!--鍐呭涓讳綋鍖哄煙-->
- <el-form :model="addRoleForm" :rules="addRoleRules" ref="addRoleRef" label-width="70px">
- <el-form-item label="鍚嶇О" prop="name">
+ <el-form :model="addRoleForm" :rules="addRoleRules" ref="addRoleRef" label-width="130px">
+ <el-form-item :label="$t('langRoleName')" prop="name">
<el-input v-model="addRoleForm.name"></el-input>
</el-form-item>
- <el-form-item label="鐘舵��" prop="state">
- <el-select v-model="addRoleForm.state" placeholder="璇烽�夋嫨">
+ <el-form-item :label="$t('langState')" prop="state">
+ <el-select v-model="addRoleForm.state" placeholder="$t('langPleaseSelect')">
<el-option v-for="(item,index) in options"
:key="index"
:value="item.value"
@@ -82,22 +80,22 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
- <el-button @click="addDialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="addRole">纭� 瀹�</el-button>
+ <el-button @click="addDialogVisible = false">{{$t('langCancel')}}</el-button>
+ <el-button type="primary" @click="addRole">{{$t('langConfirm')}}</el-button>
</span>
</el-dialog>
<!--淇敼瑙掕壊鐨勫璇濇-->
<el-dialog
- title="淇敼瑙掕壊"
+ :title="$t('langEditRole')"
:visible.sync="editDialogVisible"
width="50%">
<!--鍐呭涓讳綋鍖哄煙-->
- <el-form :model="editRoleForm" :rules="addRoleRules" ref="addRoleRef" label-width="70px">
- <el-form-item label="鍚嶇О" prop="name">
+ <el-form :model="editRoleForm" :rules="addRoleRules" ref="addRoleRef" label-width="130px">
+ <el-form-item :label="$t('langRoleName')" prop="name">
<el-input v-model="editRoleForm.name"></el-input>
</el-form-item>
- <el-form-item label="鐘舵��" prop="state">
- <el-select v-model="editRoleForm.state" placeholder="璇烽�夋嫨">
+ <el-form-item :label="$t('langState')" prop="state">
+ <el-select v-model="editRoleForm.state" placeholder="$t('langPleaseSelect')">
<el-option v-for="(item,index) in options"
:key="index"
:value="item.value"
@@ -107,8 +105,8 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
- <el-button @click="editDialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="editRoleInfo">纭� 瀹�</el-button>
+ <el-button @click="editDialogVisible = false">{{$t('langCancel')}}</el-button>
+ <el-button type="primary" @click="editRoleInfo">{{$t('langConfirm')}}</el-button>
</span>
</el-dialog>
</div>
@@ -116,9 +114,11 @@
<script>
import {getById, removeById, saveOrUpdate, selectPage} from "../../api/role";
-
+import LanguageMixin from '../../lang/LanguageMixin'
export default {
name: "Role",
+ mixins: [LanguageMixin],
+
data() {
return {
queryInfo: {
@@ -259,4 +259,4 @@
.app .el-card {
width: 99%;
}
-</style>
+</style>
\ No newline at end of file
diff --git a/CanadaMes-ui/src/views/user/index.vue b/CanadaMes-ui/src/views/user/index.vue
index 0a0421c..b2bf51c 100644
--- a/CanadaMes-ui/src/views/user/index.vue
+++ b/CanadaMes-ui/src/views/user/index.vue
@@ -67,15 +67,19 @@
</el-table-column>
</el-table>
<!--鍒嗛〉鍖哄煙-->
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="queryInfo.pageNum"
- :page-sizes="[10, 20, 30, 40]"
- :page-size="queryInfo.pageSize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="userList.total">
- </el-pagination>
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="queryInfo.pageNum"
+ :page-sizes="[6, 12, 18, 24]"
+ :page-size="queryInfo.pageSize"
+ :total="userList.total"
+ :prev-text="$t('pagination.prev')"
+ :next-text="$t('pagination.next')"
+ :pager-count="7"
+ :layout="layout"
+ >
+ </el-pagination>
</el-card>
<!--娣诲姞鐢ㄦ埛鐨勫璇濇-->
<el-dialog
@@ -131,7 +135,7 @@
<el-form-item :label="$t('langUsername')" prop="username">
<el-input v-model="editUserForm.username" disabled></el-input>
</el-form-item>
- <el-form-item label="瑙掕壊" prop="roleId">
+ <el-form-item :label="$t('role')" prop="roleId">
<el-select filterable v-model="editUserForm.roleId" placeholder="璇烽�夋嫨">
<el-option v-for="item in roleList"
:key="item.id"
@@ -170,11 +174,13 @@
export default {
name: "User",
mixins: [LanguageMixin],
+
data() {
return {
+ layout: 'total, sizes, prev, pager, next, jumper',
queryInfo: {
pageNum: 1,
- pageSize: 10
+ pageSize: 6
},
userList: {
records: [],
@@ -227,6 +233,7 @@
this.userList.records = res.data.records;
this.userList.total = res.data.total
});
+
// test().then(res => {
// console.log(res.data)
// });
@@ -248,25 +255,39 @@
// });
},
-
+
showAddDialog() {
this.addDialogVisible = true;
select().then(res => {
this.roleList = res.data;
});
},
+ // stateChange(info) {
+ // saveOrUpdate(info).then(() => {
+ // this.$message.success("鏇存柊鐘舵�佹垚鍔�")
+ // });
+ // },
stateChange(info) {
- saveOrUpdate(info).then(() => {
- this.$message.success("鏇存柊鐘舵�佹垚鍔�")
- });
- },
+ saveOrUpdate(info).then(() => {
+ const successMessage = this.$t('updateSuccessMessage');
+ this.$message.success(successMessage);
+ });
+},
resetPassword(info) {
+ this.$confirm('纭閲嶇疆瀵嗙爜涓洪粯璁ゅ�煎悧锛�', '閲嶇疆瀵嗙爜', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ })
+ .then(() => {
resetPass(info).then(() => {
- this.$message.success("瀵嗙爜宸查噸缃负榛樿鍊�");
+ this.$message.success('瀵嗙爜宸查噸缃负榛樿鍊�');
});
-
-
- },
+ })
+ .catch(() => {
+ // 鐢ㄦ埛鍙栨秷閲嶇疆瀵嗙爜鎿嶄綔
+ });
+},
showEditDialog(id) {
getById({id: id}).then(res => {
this.editUserForm = res.data;
--
Gitblit v1.8.0