提交 69d32dda authored 作者: caicai's avatar caicai

移除未使用

上级 79701a2a
......@@ -36,19 +36,14 @@
"cropperjs": "^1.5.12",
"element-ui": "^2.15.6",
"icns": "^0.1.0",
"js-cookie": "^3.0.1",
"mock-aws-s3": "^4.0.2",
"nock": "^13.3.0",
"node-machine-id": "^1.1.12",
"pbkdf2": "3.1.1",
"unsplash-js": "^7.0.15",
"vue": "^2.6.11",
"vue-clipboard2": "^0.3.3",
"vue-i18n": "^8.26.7",
"vue-infinite-scroll": "^2.0.2",
"vue-router": "^3.2.0",
"vue-router-tab": "^1.2.8",
"vue-waterfall-easy": "^2.4.4",
"vuedraggable": "^2.24.3",
"vuex": "^3.4.0",
"vuex-persistedstate": "^4.1.0"
......
......@@ -18,19 +18,11 @@ class IpcEvents {
this.softListPlugin = new softListPlugin(this.windowManager.mainWindow)
this.cateWinPlugin = new cateWinPlugin(this.windowManager.mainWindow)
/* 翻译器函数
Translator function */
// const $t = appManager.translator.get()
// ipc通信示例 / ipc demo
ipcMain.on('showDialog', (sys, msg) => {
dialog.showMessageBox({
type: 'info',
title: '收到消息!',
// 在任何能调用翻译器函数的地方都能使用多语言
// Multi-language support where translator functions are available
// message: $t('reciveFromRenderer'),
message: 'reciveFromRenderer',
detail: msg
})
......
......@@ -6,11 +6,8 @@ import EventManager from './event'
import WindowManager from './window'
import MenuManager from './menu'
// import Translator from '../plugins/translator'
class AppManager {
constructor () {
// this.translator = new Translator()
this.windowManager = new WindowManager(this)
this.menuManager = new MenuManager(this)
this.eventManager = new EventManager(this)
......@@ -23,14 +20,6 @@ class AppManager {
// this.createAppTray()
}
languageChange (lang) {
// this.translator.changeLang(lang)
/* 重新设置托盘菜单(变更语言)
Reset the language of the tray menu to change language of the tray */
// this.setAppTrayMenu()
}
/* Create app tray
创建托盘 */
createAppTray () {
......
......@@ -4,17 +4,15 @@ class MenuManager {
constructor (appManager) {
this.appManager = appManager
this.windowManager = appManager.windowManager
// this.translator = appManager.translator
}
AppTrayMenu () {
// const $t = this.translator.get()
// // Menu template
const template = [
{
key: '1',
label: "显示菜单", // 支持多国语言 / support multi-languauge
label: "显示菜单",
click: () => {
if (!this.windowManager.mainWindow.win) {
this.windowManager.mainWindow.createWindow()
......
// import i18n from '../../plugins/i18n'
class Translator {
constructor (locale, messages, fallbackLocale) {
// this.locale = locale || i18n.locale
// this.messages = messages || i18n.messages
// this.fallbackLocale = fallbackLocale || i18n.fallbackLocale
}
/* Change language
改变翻译器语言 */
changeLang (locale) {
// this.locale = locale
}
/* 获取翻译函数(为了保持this正确指向)
Get the translation function (to keep this pointed to correctly) */
get () {
return i => {
// return this.$t(i)
return 1
}
}
/* 翻译函数
Translation function */
$t (original) {
// function $query (trans) {
// for (let i = 0; i < textList.length; i++) {
// const key = textList[i]
// if (typeof trans === 'object') trans = trans[key]
// }
// return trans || original
// }
// const textList = original.split('.')
// let re = $query(this.messages[this.locale])
// if (re === original) re = $query(this.messages[this.fallbackLocale])
// return re
return 1
}
}
export default Translator
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
/* 读取语言文件夹下所有的翻译文件及内容
Read all translation files and content in the language folder */
function loadLocaleMessages () {
const locales = require.context('../locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
const messages = {}
locales.keys().forEach(key => {
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
if (matched && matched.length > 1) {
const locale = matched[1]
messages[locale] = locales(key)
}
})
return messages
}
export default new VueI18n({
locale: 'zh',
fallbackLocale: 'en',
/* 可以在vue页面中使用 console.log(this.$i18n.messages) 看到读取到的翻译内容
You can use console.log (this.$i18n.messages) in the vue page to see the translations read */
messages: loadLocaleMessages()
})
<template>
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path" v-if="item.meta.title">
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{item.meta.title}}</span>
<router-link v-else :to="item.redirect||item.path">{{item.meta.title}}</router-link>
</el-breadcrumb-item>
</transition-group>
</el-breadcrumb>
</template>
<script>
export default {
created() {
this.getBreadcrumb()
},
data() {
return {
levelList: null
}
},
watch: {
$route() {
this.getBreadcrumb()
}
},
methods: {
getBreadcrumb() {
let matched = this.$route.matched.filter(item => item.name)
const first = matched[0]
// if (first && first.name !== 'dashboard') {
// matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
// }
this.levelList = matched
}
}
}
</script>
<style lang="less" scoped>
.app-breadcrumb.el-breadcrumb {
display: inline-block;
font-size: 14px;
line-height: 50px;
margin-left: 10px;
.no-redirect {
color: #97a8be;
cursor: text;
}
}
</style>
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import VueI18n from "vue-i18n";
import infiniteScroll from "vue-infinite-scroll";
import componentsInstall from './components/install'
import { navAndOpenTagPage, isElectron } from '@/libs/utils/tools'
// 引入组件和样式
import RouterTab from "vue-router-tab";
import "vue-router-tab/dist/lib/vue-router-tab.css";
// web不引入 以下在打包时不生效
// if (!!process.env.IS_ELECTRON) require("./styles/electron.less");
if ( isElectron() ) require("./styles/electron.less");
......@@ -51,41 +47,18 @@ import {
DropdownMenu,
Select,
Option,
Tabs,
TabPane,
Tree,
Tooltip,
Upload,
Dialog,
Breadcrumb,
BreadcrumbItem,
Loading,
Tag,
Image,
Progress,
ColorPicker,
CheckboxGroup,
Checkbox,
Card,
Switch,
Container,
Header,
Aside,
Main,
Carousel,
CarouselItem,
Collapse,
CollapseItem,
Slider,
DatePicker,
Scrollbar,
Table,
TableColumn
} from "element-ui";
Vue.config.productionTip = false;
Vue.use(VueI18n);
Vue.use(RouterTab);
Vue.use(componentsInstall)
Vue.use(Tooltip);
......@@ -104,34 +77,13 @@ Vue.use(DropdownItem);
Vue.use(DropdownMenu);
Vue.use(Select);
Vue.use(Option);
Vue.use(Tabs);
Vue.use(TabPane);
Vue.use(Tree);
Vue.use(Upload);
Vue.use(Dialog);
Vue.use(Breadcrumb);
Vue.use(BreadcrumbItem);
Vue.use(Tag);
Vue.use(Image);
Vue.use(Progress);
Vue.use(ColorPicker);
Vue.use(CheckboxGroup);
Vue.use(Checkbox);
Vue.use(Card);
Vue.use(Switch);
Vue.use(Container);
Vue.use(Header);
Vue.use(Aside);
Vue.use(Main);
Vue.use(Carousel);
Vue.use(CarouselItem);
Vue.use(Collapse);
Vue.use(CollapseItem);
Vue.use(Slider);
Vue.use(DatePicker);
Vue.use(Scrollbar);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(infiniteScroll);
......
// RouterTab 内置路由
import { RouterTabRoutes } from 'vue-router-tab'
/**
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu, whatever its child routes length
* if not set alwaysShow, only more than one route under the children
* it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
title: 'title' the name show in submenu and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar,
}
**/
export default [
{ path: '/404', component: () => import('../views/404.vue'), hidden: true },
{
......@@ -27,8 +8,6 @@ export default [
meta: { title: 'Home', icon: 'example' },
hidden: false,
children: [
// 引入 RouterTab 内置路由以支持 Iframe 页签
// ...RouterTabRoutes,
{
path: 'home',
name: 'CourseList',
......
......@@ -3381,15 +3381,6 @@ cli-width@^3.0.0:
resolved "https://registry.npmmirror.com/cli-width/download/cli-width-3.0.0.tgz"
integrity sha1-ovSEN6LKqaIkNueUvwceyeYc7fY=
clipboard@^2.0.0:
version "2.0.11"
resolved "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz"
integrity sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==
dependencies:
good-listener "^1.2.2"
select "^1.1.2"
tiny-emitter "^2.0.0"
clipboardy@^2.3.0:
version "2.3.0"
resolved "https://registry.npmmirror.com/clipboardy/download/clipboardy-2.3.0.tgz"
......@@ -4327,11 +4318,6 @@ delayed-stream@~1.0.0:
resolved "https://registry.npmmirror.com/delayed-stream/download/delayed-stream-1.0.0.tgz"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
delegate@^3.1.2:
version "3.2.0"
resolved "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz"
integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==
depd@2.0.0:
version "2.0.0"
resolved "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz"
......@@ -6005,13 +5991,6 @@ globby@^9.2.0:
pify "^4.0.1"
slash "^2.0.0"
good-listener@^1.2.2:
version "1.2.2"
resolved "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz"
integrity sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==
dependencies:
delegate "^3.1.2"
gopd@^1.0.1:
version "1.0.1"
resolved "https://registry.npmmirror.com/gopd/-/gopd-1.0.1.tgz"
......@@ -7172,11 +7151,6 @@ js-beautify@^1.6.12:
glob "^7.1.3"
nopt "^5.0.0"
js-cookie@^3.0.1:
version "3.0.1"
resolved "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.1.tgz"
integrity sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==
js-message@1.0.7:
version "1.0.7"
resolved "https://registry.npmmirror.com/js-message/download/js-message-1.0.7.tgz"
......@@ -10261,11 +10235,6 @@ select-hose@^2.0.0:
resolved "https://registry.npmmirror.com/select-hose/download/select-hose-2.0.0.tgz"
integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=
select@^1.1.2:
version "1.1.2"
resolved "https://registry.npmmirror.com/select/-/select-1.1.2.tgz"
integrity sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==
selfsigned@^1.10.8:
version "1.10.11"
resolved "https://registry.npmmirror.com/selfsigned/download/selfsigned-1.10.11.tgz"
......@@ -11265,11 +11234,6 @@ timsort@^0.3.0:
resolved "https://registry.npmmirror.com/timsort/download/timsort-0.3.0.tgz"
integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=
tiny-emitter@^2.0.0:
version "2.1.0"
resolved "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz"
integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==
tmp-promise@^3.0.2:
version "3.0.3"
resolved "https://registry.npmmirror.com/tmp-promise/download/tmp-promise-3.0.3.tgz"
......@@ -11875,13 +11839,6 @@ vue-cli-plugin-electron-builder@~2.1.1:
webpack-merge "^4.2.2"
yargs "^15.3.1"
vue-clipboard2@^0.3.3:
version "0.3.3"
resolved "https://registry.npmmirror.com/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz"
integrity sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw==
dependencies:
clipboard "^2.0.0"
vue-eslint-parser@^7.0.0:
version "7.11.0"
resolved "https://registry.npmmirror.com/vue-eslint-parser/download/vue-eslint-parser-7.11.0.tgz"
......@@ -11900,11 +11857,6 @@ vue-hot-reload-api@^2.3.0:
resolved "https://registry.npmmirror.com/vue-hot-reload-api/download/vue-hot-reload-api-2.3.4.tgz"
integrity sha1-UylVzB6yCKPZkLOp+acFdGV+CPI=
vue-i18n@^8.26.7:
version "8.27.0"
resolved "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-8.27.0.tgz"
integrity sha512-SX35iJHL5PJ4Gfh0Mo/q0shyHiI2V6Zkh51c+k8E9O1RKv5BQyYrCxRzpvPrsIOJEnLaeiovet3dsUB0e/kDzw==
vue-infinite-scroll@^2.0.2:
version "2.0.2"
resolved "https://registry.npmmirror.com/vue-infinite-scroll/-/vue-infinite-scroll-2.0.2.tgz"
......@@ -11930,14 +11882,6 @@ vue-loader@^15.9.2:
vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0"
vue-router-tab@^1.2.8:
version "1.2.11"
resolved "https://registry.npmmirror.com/vue-router-tab/-/vue-router-tab-1.2.11.tgz"
integrity sha512-JHOxWoiRAv/AsMLcslURuq0OTg+xjm6RK/4Ofkp30qnS7RxY83gUJ1QhG6GYDkQzRo/9Wg9y7JlW0e0jE5XxSQ==
dependencies:
vue "^2.6.14"
vue-router "^3.2.0"
vue-router@^3.2.0:
version "3.5.3"
resolved "https://registry.npmjs.org/vue-router/-/vue-router-3.5.3.tgz"
......@@ -11964,12 +11908,7 @@ vue-template-es2015-compiler@^1.9.0:
resolved "https://registry.npmmirror.com/vue-template-es2015-compiler/download/vue-template-es2015-compiler-1.9.1.tgz"
integrity sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=
vue-waterfall-easy@^2.4.4:
version "2.4.4"
resolved "https://registry.npmmirror.com/vue-waterfall-easy/-/vue-waterfall-easy-2.4.4.tgz"
integrity sha512-5OkpT2FPNC3rHBy858zk/nmJxqdPaGmj/KVbmA6dgcvtsovKMa+zuf/Z7F+S2NnObeavpIBztTWgcH3S42ZD+g==
vue@^2.6.11, vue@^2.6.14:
vue@^2.6.11:
version "2.6.14"
resolved "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz"
integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论