瀏覽代碼

✨ feat(system-name): 翻译系统名称

陈雪 1 月之前
父節點
當前提交
b57cf9aaec
共有 3 個文件被更改,包括 168 次插入156 次删除
  1. 1 1
      src/renderer/views/cashier/index.vue
  2. 109 98
      src/renderer/views/home/index.vue
  3. 58 57
      src/renderer/views/setting/index.vue

+ 1 - 1
src/renderer/views/cashier/index.vue

@@ -376,7 +376,7 @@ export default {
   data() {
     return {
       // 系统名称
-      systemName: process.env.userConfig.SYSTEM_NAME,
+      systemName: this.$t('app.title'),
       // 导航tab
       navTab: '0',
       isOpen: true,

+ 109 - 98
src/renderer/views/home/index.vue

@@ -1,128 +1,139 @@
 <template>
   <div id="app" class="app-container">
     <el-drawer
-        :withHeader="false"
-        :visible.sync="isOpen"
-        direction="ttb"
-        size="100%"
-        :show-close="false">
+      :withHeader="false"
+      :visible.sync="isOpen"
+      direction="ttb"
+      size="100%"
+      :show-close="false"
+    >
       <div class="main">
-         <div class="nav">欢迎使用{{ systemName }}</div>
-         <div class="tool">
-           <div class="item" @click="target('/cashier')"><i class="el-icon-user"></i>进入收银</div>
-           <div class="item" @click="target('/setting')"><i class="el-icon-setting"></i>系统设置</div>
-           <div class="item logout" @click="logout"><i class="icon el-icon-switch-button"></i>退出</div>
-         </div>
+        <div class="nav">欢迎使用{{ systemName }}</div>
+        <div class="tool">
+          <div class="item" @click="target('/cashier')">
+            <i class="el-icon-user"></i>
+            进入收银
+          </div>
+          <div class="item" @click="target('/setting')">
+            <i class="el-icon-setting"></i>
+            系统设置
+          </div>
+          <div class="item logout" @click="logout">
+            <i class="icon el-icon-switch-button"></i>
+            退出
+          </div>
+        </div>
       </div>
     </el-drawer>
   </div>
 </template>
 
 <script>
-import { useUserStore } from "@/store/user";
-import { removeUserId } from '@/utils/auth';
-import { Message } from "element-ui";
-const { logOut } = useUserStore();
+import { useUserStore } from '@/store/user'
+import { removeUserId } from '@/utils/auth'
+import { Message } from 'element-ui'
+const { logOut } = useUserStore()
 export default {
   data() {
     return {
       // 系统名称
-      systemName: process.env.userConfig.SYSTEM_NAME,
+      systemName: this.$t('app.title'),
       isOpen: true,
     }
   },
   methods: {
     target(url) {
-       this.$router.push( url );
+      this.$router.push(url)
     },
     logout() {
       this.$confirm('确定注销并退出系统吗?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        logOut().then(() => {
-          Message({
-            message: "退出成功",
-            type: "success"
-          });
-          removeUserId();
-          this.$router.push( '/login' );
+        type: 'warning',
+      })
+        .then(() => {
+          logOut().then(() => {
+            Message({
+              message: '退出成功',
+              type: 'success',
+            })
+            removeUserId()
+            this.$router.push('/login')
+          })
         })
-      }).catch(() => {});
-    }
-  }
+        .catch(() => {})
+    },
+  },
 }
 </script>
 
 <style rel="stylesheet/scss" lang="scss" scoped>
-   .main {
-      // background: #113a28;
-      height: 100%;
-      width: 100%;
-      display: block;
-     .nav {
-       display: block;
-       clear: both;
-       height: 45px;
-       width: 100%;
-       background: #f5f5f5;
-       border-bottom: #cccccc solid 1px;
-       padding: 10px 0px 0px 40px;
-       margin-bottom: 12%;
-     }
-     .tool {
-       width: 1000px;
-       height: 300px;
-       margin: 0 auto;
-       border: solid 1px #cccccc;
-       border-radius: 10px;
-       color: #ffffff;
-       text-align: center;
-       padding-top: 92px;
-       padding-left: 125px;
-       backdrop-filter: saturate(180%) blur(20px);
-       background: rgba(0, 0, 0, .65);
-       border-radius: 10px;
-       box-shadow: 0 0.4px 0.6px rgba(0, 0, 0, 0.141),
-       0 1px 1.3px rgba(0, 0, 0, 0.202), 0 1.9px 2.5px rgba(0, 0, 0, 0.25),
-       0 3.4px 4.5px rgba(0, 0, 0, 0.298), 0 6.3px 8.4px rgba(0, 0, 0, 0.359),
-       0 15px 20px rgba(0, 0, 0, .26);
-       .item {
-          float: left;
-          width: 300px;
-          height: 120px;
-          line-height: 120px;
-          text-align: center;
-          border: solid 3px #ffffff;
-          color: #ffffff;
-          cursor: pointer;
-          font-weight: bold;
-          margin-left: 50px;
-          border-radius: 6px;
-       }
-       .item:hover {
-        //  border: #113a28 3px solid;
-       }
-       .logout {
-          border: none;
-          width: 50px;
-          height: 50px;
-          border: #ffffff 2px solid;
-          border-radius: 5px;
-          line-height: 50px;
-          margin-top: 36px;
-          margin-left: 60px;
-          font-weight: normal;
-          font-size: 10px;
-          color: #ffffff;
-          background: #e03e2d;
-          i {
-            margin-right: 1px;
-            font-size: 12px;
-            font-weight: bold;
-          }
-       }
-     }
-   }
+.main {
+  // background: #113a28;
+  height: 100%;
+  width: 100%;
+  display: block;
+  .nav {
+    display: block;
+    clear: both;
+    height: 45px;
+    width: 100%;
+    background: #f5f5f5;
+    border-bottom: #cccccc solid 1px;
+    padding: 10px 0px 0px 40px;
+    margin-bottom: 12%;
+  }
+  .tool {
+    width: 1000px;
+    height: 300px;
+    margin: 0 auto;
+    border: solid 1px #cccccc;
+    border-radius: 10px;
+    color: #ffffff;
+    text-align: center;
+    padding-top: 92px;
+    padding-left: 125px;
+    backdrop-filter: saturate(180%) blur(20px);
+    background: rgba(0, 0, 0, 0.65);
+    border-radius: 10px;
+    box-shadow: 0 0.4px 0.6px rgba(0, 0, 0, 0.141), 0 1px 1.3px rgba(0, 0, 0, 0.202),
+      0 1.9px 2.5px rgba(0, 0, 0, 0.25), 0 3.4px 4.5px rgba(0, 0, 0, 0.298),
+      0 6.3px 8.4px rgba(0, 0, 0, 0.359), 0 15px 20px rgba(0, 0, 0, 0.26);
+    .item {
+      float: left;
+      width: 300px;
+      height: 120px;
+      line-height: 120px;
+      text-align: center;
+      border: solid 3px #ffffff;
+      color: #ffffff;
+      cursor: pointer;
+      font-weight: bold;
+      margin-left: 50px;
+      border-radius: 6px;
+    }
+    .item:hover {
+      //  border: #113a28 3px solid;
+    }
+    .logout {
+      border: none;
+      width: 50px;
+      height: 50px;
+      border: #ffffff 2px solid;
+      border-radius: 5px;
+      line-height: 50px;
+      margin-top: 36px;
+      margin-left: 60px;
+      font-weight: normal;
+      font-size: 10px;
+      color: #ffffff;
+      background: #e03e2d;
+      i {
+        margin-right: 1px;
+        font-size: 12px;
+        font-weight: bold;
+      }
+    }
+  }
+}
 </style>

+ 58 - 57
src/renderer/views/setting/index.vue

@@ -1,81 +1,82 @@
 <template>
   <div id="app" class="app-container">
     <el-drawer
-        :withHeader="false"
-        :visible.sync="isOpen"
-        direction="ttb"
-        size="100%"
-        :show-close="false">
+      :withHeader="false"
+      :visible.sync="isOpen"
+      direction="ttb"
+      size="100%"
+      :show-close="false"
+    >
       <div class="main">
-         <div class="nav">欢迎使用{{ systemName }}</div>
-         <div class="content">
-           <div class="name">{{ systemName }}</div>
-           <div class="version">当前版本:V3.0.9</div>
-           <div class="back" @click="target()">
-             <el-button type="danger" size="mini">返回主页</el-button>
-           </div>
-         </div>
+        <div class="nav">欢迎使用{{ systemName }}</div>
+        <div class="content">
+          <div class="name">{{ systemName }}</div>
+          <div class="version">当前版本:V3.0.9</div>
+          <div class="back" @click="target()">
+            <el-button type="danger" size="mini">返回主页</el-button>
+          </div>
+        </div>
       </div>
     </el-drawer>
   </div>
 </template>
 
 <script>
-import { useUserStore } from "@/store/user";
-import { Message } from "element-ui";
-const { logOut } = useUserStore();
+import { useUserStore } from '@/store/user'
+import { Message } from 'element-ui'
+const { logOut } = useUserStore()
 export default {
   data() {
     return {
       // 系统名称
-      systemName: process.env.userConfig.SYSTEM_NAME,
+      systemName: this.$t('app.title'),
       isOpen: true,
     }
   },
   methods: {
     target() {
-       this.$router.push( '/' );
-    }
-  }
+      this.$router.push('/')
+    },
+  },
 }
 </script>
 
 <style rel="stylesheet/scss" lang="scss" scoped>
-   .main {
-      // background: #113a28;
-      height: 100%;
-      width: 100%;
-      display: block;
-     .nav {
-       display: block;
-       clear: both;
-       height: 45px;
-       width: 100%;
-       background: #f5f5f5;
-       border-bottom: #cccccc solid 1px;
-       padding: 10px 0px 0px 40px;
-       margin-bottom: 12%;
-     }
-     .content {
-       width: 500px;
-       height: 350px;
-       margin: 0 auto;
-       border: solid 1px #cccccc;
-       border-radius: 5px;
-       color: #666666;
-       text-align: center;
-       backdrop-filter: saturate(180%) blur(20px);
-       background: #ffffff;
-       border-radius: 10px;
-       .name {
-          color: #666666;
-          margin-top: 100px;
-          font-size: 20px;
-          margin-bottom: 50px;
-       }
-       .back {
-          margin-top: 50px;
-       }
-     }
-   }
+.main {
+  // background: #113a28;
+  height: 100%;
+  width: 100%;
+  display: block;
+  .nav {
+    display: block;
+    clear: both;
+    height: 45px;
+    width: 100%;
+    background: #f5f5f5;
+    border-bottom: #cccccc solid 1px;
+    padding: 10px 0px 0px 40px;
+    margin-bottom: 12%;
+  }
+  .content {
+    width: 500px;
+    height: 350px;
+    margin: 0 auto;
+    border: solid 1px #cccccc;
+    border-radius: 5px;
+    color: #666666;
+    text-align: center;
+    backdrop-filter: saturate(180%) blur(20px);
+    background: #ffffff;
+    border-radius: 10px;
+    .name {
+      color: #666666;
+      margin-top: 100px;
+      font-size: 20px;
+      margin-bottom: 50px;
+    }
+    .back {
+      margin-top: 50px;
+    }
+  }
+}
 </style>