提交代码

This commit is contained in:
lVAL 2020-09-27 11:10:56 +08:00
commit dfe83d0d9e
153 changed files with 18065 additions and 0 deletions

3
.browserslistrc Normal file
View File

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

17
.env.development Normal file
View File

@ -0,0 +1,17 @@
# just a flag
NODE_ENV = 'development'
# base api
VUE_APP_BASE_API = 'http://192.168.3.6:9110'
VUE_APP_BASE_RESOURCE_API = 'https://test.joylink.club/jlfile'
VUE_APP_BASE_RESOURCE_URL = 'https://test.joylink.club/oss/tpsq'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().
# This configuration can significantly increase the speed of hot updates,
# when you have a large number of pages.
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
VUE_CLI_BABEL_TRANSPILE_MODULES = true

7
.env.production Normal file
View File

@ -0,0 +1,7 @@
# just a flag
NODE_ENV = 'production'
# base api
VUE_APP_BASE_API = 'https://joylink.club/tpsq-cloud'
VUE_APP_BASE_RESOURCE_API = 'https://joylink.club/jlfile'
VUE_APP_BASE_RESOURCE_URL = 'https://joylink.club/oss/tpsq'

11
.env.staging Normal file
View File

@ -0,0 +1,11 @@
# just a flag
NODE_ENV = 'production'
# base api
VUE_APP_BASE_API = 'https://test.joylink.club/tpsq-cloud'
VUE_APP_BASE_RESOURCE_API = 'https://test.joylink.club/jlfile'
VUE_APP_BASE_RESOURCE_URL = 'https://test.joylink.club/oss/tpsq'
#VUE_APP_BASE_RESOURCE_API = 'https://joylink.club/jlfile'
#VUE_APP_BASE_RESOURCE_URL = 'https://joylink.club/oss/tpsq'

14
.eslintrc.js Normal file
View File

@ -0,0 +1,14 @@
module.exports = {
root: true,
env: {
node: true
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
parserOptions: {
parser: "babel-eslint"
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
}
};

23
.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# official-website
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

3
babel.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"]
};

13429
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

41
package.json Normal file
View File

@ -0,0 +1,41 @@
{
"name": "jl-admin-iview",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"element-ui": "^2.13.2",
"nprogress": "^0.2.0",
"script-ext-html-webpack-plugin": "^2.1.4",
"svg-sprite-loader": "^5.0.0",
"vue": "^2.6.12",
"vue-pdf": "^4.1.0",
"vue-router": "^3.2.0",
"vue-video-player": "^5.0.2",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.2.2",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^10.0.2",
"style-loader": "^1.2.1",
"vue-template-compiler": "^2.6.11"
}
}

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

17
public/index.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

Binary file not shown.

19
src/App.vue Normal file
View File

@ -0,0 +1,19 @@
<template>
<div id="app">
<router-view />
</div>
</template>
<style lang="less">
body {
margin: 0px;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
src/assets/honor/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 MiB

BIN
src/assets/honor/2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

BIN
src/assets/honor/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

15
src/assets/honor/index.js Normal file
View File

@ -0,0 +1,15 @@
import image1 from "@/assets/honor/1.jpg";
import image2 from "@/assets/honor/2.jpg";
import image3 from "@/assets/honor/3.jpg";
export default {
Hr01: {
src: image1
},
Hr02: {
src: image2
},
Hr04: {
src: image3
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

View File

@ -0,0 +1,40 @@
export default {
Act1: {
name: "西铁院",
sources: [
require("@/assets/images/1.西铁院/1.jpg"),
require("@/assets/images/1.西铁院/2.jpg"),
require("@/assets/images/1.西铁院/3.jpg"),
require("@/assets/images/1.西铁院/4.jpg"),
require("@/assets/images/1.西铁院/5.jpg"),
require("@/assets/images/1.西铁院/6.jpg"),
require("@/assets/images/1.西铁院/7.jpg"),
require("@/assets/images/1.西铁院/8.jpg"),
require("@/assets/images/1.西铁院/9.jpg")
]
},
Act2: {
name: "上海轨道交通展",
sources: [
require("@/assets/images/2.上海轨道交通展/1.jpg"),
require("@/assets/images/2.上海轨道交通展/2.jpg"),
require("@/assets/images/2.上海轨道交通展/3.jpg"),
require("@/assets/images/2.上海轨道交通展/4.jpg"),
require("@/assets/images/2.上海轨道交通展/5.jpg"),
require("@/assets/images/2.上海轨道交通展/6.jpg"),
require("@/assets/images/2.上海轨道交通展/7.jpg")
]
},
Act3: {
name: "第四届“中国创翼”暨“创业北京”创业创新大赛",
sources: [
require("@/assets/images/3.第四届“中国创翼”暨“创业北京”创业创新大赛/1.jpg"),
require("@/assets/images/3.第四届“中国创翼”暨“创业北京”创业创新大赛/2.jpg"),
require("@/assets/images/3.第四届“中国创翼”暨“创业北京”创业创新大赛/3.jpg"),
require("@/assets/images/3.第四届“中国创翼”暨“创业北京”创业创新大赛/4.jpg"),
require("@/assets/images/3.第四届“中国创翼”暨“创业北京”创业创新大赛/5.jpg"),
require("@/assets/images/3.第四届“中国创翼”暨“创业北京”创业创新大赛/6.jpg"),
require("@/assets/images/3.第四届“中国创翼”暨“创业北京”创业创新大赛/7.jpg")
]
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 KiB

View File

@ -0,0 +1,56 @@
export default {
JL01: {
src: require("@/assets/knowledge/JL01-中心级综合监控ISCS系统仿真软件V1.0.jpg")
},
JL02: {
src: require("@/assets/knowledge/JL02-车站级综合监控ISCS系统仿真软件V1.0.jpg")
},
JL03: {
src: require("@/assets/knowledge/JL03-ATS行调工作站培训系统软件V1.0.jpg")
},
JL04: {
src: require("@/assets/knowledge/JL04-ATS行调工作站考试系统软件V1.0.jpg")
},
JL05: {
src: require("@/assets/knowledge/JL05-ATS现地工作站培训系统软件V1.0.jpg")
},
JL06: {
src: require("@/assets/knowledge/JL06-ATS现地工作站考试系统软件V1.0.jpg")
},
JL07: {
src: require("@/assets/knowledge/JL07-ATS行调工作站仿真系统软件V1.0.jpg")
},
JL08: {
src: require("@/assets/knowledge/JL02-车站级综合监控ISCS系统仿真软件V1.0.jpg")
},
JL09: {
src: require("@/assets/knowledge/JL09-ATS中心大屏仿真系统软件V1.0.jpg")
},
JL10: {
src: require("@/assets/knowledge/JL10-轨旁仿真软件V1.0.jpg")
},
JL11: {
src: require("@/assets/knowledge/JL11-城市轨道交通综合演练系统简称城轨综合演练平台V1.0.jpg")
},
JL12: {
src: require("@/assets/knowledge/JL12-电子沙盘软件V1.0.jpg")
},
JL13: {
src: require("@/assets/knowledge/JL13-车载仿真软件简称VOBC仿真软件V1.0.jpg")
},
JL14: {
src: require("@/assets/knowledge/JL14-区域控制器仿真软件简称ZC仿真软件V1.0.jpg")
},
JL15: {
src: require("@/assets/knowledge/JL15-虚拟列车仿真软件V1.0.jpg")
},
JL16: {
src: require("@/assets/knowledge/JL16-模拟驾驶仿真软件简称列车模拟驾驶V1.0.jpg")
},
JL17: {
src: require("@/assets/knowledge/JL17-城市轨道交通运行图时刻表编辑系统V1.0.jpg")
},
JL18: {
src: require("@/assets/knowledge/JL18-联锁机仿真软件简称CI仿真软件V1.0.jpg")
}
};

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/assets/logo/bxkc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
src/assets/logo/ddy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

BIN
src/assets/logo/gzb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 KiB

BIN
src/assets/logo/heb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
src/assets/logo/jyd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
src/assets/logo/tky.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
src/assets/logo/xadt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
src/assets/logo/xty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -0,0 +1,22 @@
export default {
Pn1: {
src: require("@/assets/partner/北京交通大学.jpg"),
href: ""
},
Pn2: {
src: require("@/assets/partner/东北电力大学.jpg"),
href: ""
},
Pn3: {
src: require("@/assets/partner/贵州装备.jpg"),
href: ""
},
Pn4: {
src: require("@/assets/partner/南京铁道.jpg"),
href: ""
},
pn5: {
src: require("@/assets/partner/西安铁路职业技术学院.jpg"),
href: ""
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

BIN
src/assets/source/offer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

BIN
src/assets/source/world.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

BIN
src/assets/wchat/wchat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,59 @@
<template>
<div class="btn-group">
<router-link
v-for="(el, i) in buttonList"
:key="i"
:to="el.href"
class="btn-rect"
>
{{ el.name }}
</router-link>
</div>
</template>
<script>
export default {
props: {
buttonList: {
type: Array,
required: true
}
},
data() {
return {};
}
};
</script>
<style lang="scss" scoped>
a {
margin: 0 15px;
text-decoration: none;
color: #333333;
}
.btn-group {
margin-top: 20px;
position: relproduct;
display: inline-block;
vertical-align: middle;
.btn-rect {
padding: 0 30px;
min-width: 140px;
height: 40px !important;
line-height: 40px !important;
text-align: center;
border: 1px solid #d1d1d1;
display: inline-block;
color: #111;
padding-left: 20px;
padding-right: 20px;
font-size: 16px;
background: #efefef;
&:hover {
color: #fff;
background: #000;
}
}
}
</style>

View File

@ -0,0 +1,148 @@
<template>
<div class="card">
<div class="image-box">
<div class="mask" />
<picture>
<el-image style="height: 100%;width: 100%" :src="source" />
</picture>
</div>
<div class="text-box">
<div class="category">{{ option.type || "产品" }}</div>
<div class="name" style="overflow-wrap: break-word;">
{{ option.name || "HUAWEI P40 Pro+ 超感知影像" }}
</div>
<div class="text">
{{ option.describe || "超感知徕卡五摄100倍双目变焦" }}
</div>
<div class="read-more">
<span>了解更多</span>
<i class="el-icon-arrow-right" />
</div>
</div>
</div>
</template>
<script>
export default {
props: {
el: {
type: Object,
required: true
}
},
computed: {
source() {
return this.el.source || "";
},
option() {
return this.el.option || {};
}
}
};
</script>
<style lang="scss" scoped>
.card {
&:hover {
.el-image {
transition: all 0.5s;
transform: scale(1.05);
}
.mask {
height: 100%;
background: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 70%);
}
.read-more {
opacity: 1;
}
}
.image-box {
position: relative;
height: 100%;
.mask {
position: absolute;
z-index: 3;
visibility: visible;
opacity: 1;
height: 50%;
width: 100%;
content: "";
background: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 70%);
display: block;
top: auto;
bottom: 0;
}
}
.text-box {
width: 100%;
height: auto;
position: absolute;
left: 0;
color: #fff;
text-align: left;
transition: all 0.5s;
z-index: 4;
padding: 25px 30px;
font-size: 20px;
bottom: -50px;
box-sizing: border-box;
&:hover {
bottom: 0;
}
.category {
line-height: 1.8em;
color: #fff;
}
.name {
font-size: 1.2em;
line-height: 1.4em;
font-weight: bold;
margin: 0;
}
.text {
font-size: 0.875em;
display: block;
margin-bottom: 12px;
line-height: 1.8em;
opacity: 0.7;
}
.read-more {
position: relative;
display: inline-block;
text-decoration: none;
vertical-align: middle;
outline: none;
margin-top: 0;
transition: all 0.5s;
font-size: 0.875em;
line-height: 1.875em;
color: #fff;
span {
float: left;
}
i {
transition: all 0.2s;
color: #000;
font-weight: bold;
font-size: 1em;
line-height: inherit;
display: inline;
vertical-align: middle;
float: left;
&:hover {
transform: translateX(5px);
}
}
}
}
}
</style>

View File

@ -0,0 +1,112 @@
<template>
<div class="inline-buy" @mouseenter="onMouseEnter" @mouseleave="onMouseLeave">
<transition name="el-fade-in">
<div class="block" v-show="show">
<i class="el-icon-shopping-bag-1" />
<span>在线购买</span>
<i
class="arrow"
:class="active ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
/>
</div>
</transition>
<div class="card" v-if="active">
<ul>
<li v-for="(el, i) in menus" :key="i" @click="onClick(el, i)">
<i :class="el.icon" style="margin-right: 10px;font-size: 18px" />
<span>{{ el.name }}</span>
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
props: {
show: {
type: Boolean,
default: true
},
menus: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
active: false
};
},
methods: {
onMouseEnter() {
this.active = true;
},
onMouseLeave() {
this.active = false;
},
onClick(el, i) {
if (el.click) {
el.click(el, i);
}
}
}
};
</script>
<style lang="scss" scoped>
.inline-buy {
position: relative;
display: flex;
justify-content: center;
height: 40px;
.block {
display: flex;
align-items: center;
justify-content: center;
i {
font-size: 26px;
}
.arrow {
font-size: 14px;
}
}
.card {
color: transparent;
position: absolute;
z-index: 3;
ul {
padding: 0;
margin: 0;
transform: translateY(59px);
background: #fff;
list-style: none;
display: flex;
flex-direction: column;
justify-content: flex-start;
min-width: 180px;
width: auto;
li {
border: 1px solid #d4d4d4;
border-top: 0;
height: 42px;
line-height: 42px;
padding-left: 26px;
background: #fff;
color: #777;
text-align: left;
display: flex;
align-items: center;
cursor: pointer;
&:hover {
color: #000;
}
}
}
}
}
</style>

View File

@ -0,0 +1,40 @@
<template>
<router-link class="logo" :to="home">
<el-image style="width:40px; height:40px" :src="logo" />
<h2>北京玖琏技术有限公司</h2>
</router-link>
</template>
<script>
import logo from "@/assets/logo.png";
export default {
props: {
home: {
type: String,
default: "/home"
}
},
computed: {
logo() {
return logo;
}
}
};
</script>
<style lang="scss">
a {
text-decoration: none;
color: #333333;
}
.logo {
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
h2 {
padding: 0 10px;
}
}
</style>

View File

@ -0,0 +1,146 @@
<template>
<div v-loading="loading">
<template v-if="single">
<canvas :id="base" />
</template>
<template v-else>
<canvas v-for="page in numPages" :id="createDomId(page)" :key="page" />
</template>
</div>
</template>
<script>
let pdfjsLib = require("pdfjs-dist");
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.js";
export default {
props: {
single: {
type: Boolean,
default: false
},
url: {
type: String,
default: ""
},
width: {
type: Number,
default: 1000
},
curPage: {
type: Number,
default: 1
}
},
data() {
return {
pdfDoc: null,
numPages: 0,
loading: false,
rendering: false
};
},
computed: {
base() {
return "pdf-canvas";
}
},
watch: {
url: function(url) {
this.loadFile(url);
},
curPage: function(num) {
this.renderPage(num);
}
},
mounted() {
if (this.url) {
this.loadFile(this.url);
}
},
methods: {
createDomId(num) {
return this.single ? this.base : `${this.base}-${num}`;
},
getCanvas(num) {
return document.getElementById(this.createDomId(num));
},
loadFile(url) {
this.loading = true;
let loadingTask = pdfjsLib.getDocument(url);
loadingTask.promise
.then(pdf => {
this.pdfDoc = pdf;
this.numPages = this.pdfDoc.numPages;
this.renderPage(this.curPage);
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
renderPage(num) {
if (this.pdfDoc && !this.rendering) {
this.rendering = true;
this.pdfDoc
.getPage(num)
.then(page => {
const canvas = this.getCanvas(num);
const ctx = canvas.getContext("2d");
const dpr = window.devicePixelRatio || 1;
const bsr =
ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
ctx.msBackingStorePixelRatio ||
ctx.oBackingStorePixelRatio ||
ctx.backingStorePixelRatio ||
1;
const ratio = dpr / bsr;
const minWidth = Math.min(this.$el.clientWidth, this.width);
const viewport = page.getViewport(
minWidth / page.getViewport(1).width
);
const width = Math.min(viewport.width, this.$el.clientWidth);
const height = Math.max(viewport.height, this.$el.clientHeight);
if (canvas) {
canvas.width = width * ratio;
canvas.height = height * ratio;
canvas.style.width = width + "px";
canvas.style.height = height + "px";
ctx.setTransform(ratio, 0, 0, ratio, 0, 0);
let renderTask = page.render({
canvasContext: ctx,
viewport: viewport
});
renderTask.promise
.then(() => {
if (!this.single) {
if (this.numPages > num) {
this.renderPage(num + 1);
} else {
this.rendering = false;
}
} else {
this.rendering = false;
}
})
.catch((this.rendering = false));
}
})
.catch((this.rendering = false));
}
}
}
};
</script>
<style scoped>
canvas {
display: block;
margin: 0;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<div class="search-box">
<transition name="el-fade-in">
<el-input
v-show="show"
style="width:430px"
placeholder="请输入关键词"
v-model="search"
>
<el-button slot="append" icon="el-icon-search" @click="onSearch" />
</el-input>
</transition>
<transition name="el-fade-in">
<div v-if="show">
<a
class="el-icon-close"
@click="onHide"
style="font-size: 26px;margin-left: 10px"
/>
</div>
<div v-else class="flex">
<slot name="before" />
<a
class="el-icon-search"
@click="onShow"
style="font-size: 26px;margin-left: 10px"
/>
<slot name="after" />
</div>
</transition>
</div>
</template>
<script>
export default {
data() {
return {
show: false,
search: ""
};
},
methods: {
onHide() {
this.show = false;
this.$emit("show", this.show);
},
onShow() {
this.show = true;
this.$emit("hide", this.show);
},
onSearch() {
this.$emit("search", this.search);
}
}
};
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
.search-box {
display: flex;
align-items: center;
justify-content: center;
a {
text-decoration: none;
color: #595757;
user-select: none;
cursor: pointer;
}
}
</style>

View File

@ -0,0 +1,43 @@
<template>
<svg :class="svgClass" aria-hidden="true" v-on="$listeners">
<use :xlink:href="iconName" />
</svg>
</template>
<script>
export default {
name: "SvgIcon",
props: {
iconClass: {
type: String,
required: true
},
className: {
type: String,
default: ""
}
},
computed: {
iconName() {
return `#icon-${this.iconClass}`;
},
svgClass() {
if (this.className) {
return "svg-icon " + this.className;
} else {
return "svg-icon";
}
}
}
};
</script>
<style scoped>
.svg-icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
</style>

View File

@ -0,0 +1,127 @@
<template>
<div class="video">
<div class="wrapper">
<video-player
ref="videoPlayer"
class="vjs-custom-skin"
:playsinline="true"
:options="playerOptions"
@ready="onPlayerReadied"
@timeupdate="onTimeupdate"
@play="onPlayerPlay"
@pause="onPlayerPause"
@ended="onPlayerEnded"
/>
<slot />
</div>
</div>
</template>
<script>
import POSTER_URL from "@/assets/logo.png";
export default {
props: {
el: {
type: Object,
required: true
},
autoplay: {
type: Boolean,
default: false
}
},
data() {
return {};
},
computed: {
source() {
return this.el.source || {};
},
option() {
return this.el.option || {};
},
playerOptions() {
return {
language: "zh-CN",
aspectRatio: "16:9",
fluid: true,
overNative: true,
preload: "auto",
sourceOrder: true,
autoplay: this.autoplay,
controls: true,
techOrder: ["html5"], // flash
flash: {
hls: {
withCredentials: false
}
},
html5: {
hls: {
withCredentials: false
}
},
sources: [this.source],
poster: POSTER_URL,
notSupportedMessage: "此视频暂无法播放,请稍后再试",
controlBar: {
timeDivider: false, // 线
durationDisplay: false, //
progressControl: true, //
customControlSpacer: true, //
fullscreenToggle: true //
}
};
},
player() {
return this.$refs.videoPlayer;
}
},
methods: {
onPlayerReadied() {},
onTimeupdate() {},
onPlayerPlay() {},
onPlayerPause() {},
onPlayerEnded() {}
}
};
</script>
<style lang="scss" scoped>
@media screen and (min-width: 576px) {
.video {
max-width: 540px;
}
}
@media screen and (min-width: 768px) {
.video {
max-width: 720px;
}
}
@media screen and (min-width: 992px) {
.video {
max-width: 960px;
}
}
@media screen and (min-width: 1200px) {
.video {
max-width: 1140px;
}
}
.video {
width: 100%;
margin: auto;
.wrapper {
position: relative;
top: 0;
width: 100%;
height: 100%;
}
}
</style>

8
src/icons/index.js Normal file
View File

@ -0,0 +1,8 @@
import Vue from "vue";
import SvgIcon from "@/components/eSvgIcon/index";
Vue.component("svg-icon", SvgIcon);
const req = require.context("./svg", false, /\.svg$/);
const requireAll = requireContext => requireContext.keys().map(requireContext);
requireAll(req);

1
src/icons/svg/eye.svg Normal file
View File

@ -0,0 +1 @@
<svg width="128" height="64" xmlns="http://www.w3.org/2000/svg"><path d="M127.072 7.994c1.37-2.208.914-5.152-.914-6.87-2.056-1.717-4.797-1.226-6.396.982-.229.245-25.586 32.382-55.74 32.382-29.24 0-55.74-32.382-55.968-32.627-1.6-1.963-4.57-2.208-6.397-.49C-.17 3.086-.399 6.275 1.2 8.238c.457.736 5.94 7.36 14.62 14.72L4.17 35.96c-1.828 1.963-1.6 5.152.228 6.87.457.98 1.6 1.471 2.742 1.471s2.284-.49 3.198-1.472l12.564-13.983c5.94 4.416 13.021 8.587 20.788 11.53l-4.797 17.418c-.685 2.699.686 5.397 3.198 6.133h1.37c2.057 0 3.884-1.472 4.341-3.68L52.6 42.83c3.655.736 7.538 1.227 11.422 1.227 3.883 0 7.767-.49 11.422-1.227l4.797 17.173c.457 2.208 2.513 3.68 4.34 3.68.457 0 .914 0 1.143-.246 2.513-.736 3.883-3.434 3.198-6.133l-4.797-17.172c7.767-2.944 14.848-7.114 20.788-11.53l12.336 13.738c.913.981 2.056 1.472 3.198 1.472s2.284-.49 3.198-1.472c1.828-1.963 1.828-4.906.228-6.87l-11.65-13.001c9.366-7.36 14.849-14.474 14.849-14.474z"/></svg>

After

Width:  |  Height:  |  Size: 944 B

View File

@ -0,0 +1 @@
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><defs><style/></defs><path d="M512 128q69.675 0 135.51 21.163t115.498 54.997 93.483 74.837 73.685 82.006 51.67 74.837 32.17 54.827L1024 512q-2.347 4.992-6.315 13.483T998.87 560.17t-31.658 51.669-44.331 59.99-56.832 64.34-69.504 60.16-82.347 51.5-94.848 34.687T512 896q-69.675 0-135.51-21.163t-115.498-54.826-93.483-74.326-73.685-81.493-51.67-74.496-32.17-54.997L0 513.707q2.347-4.992 6.315-13.483t18.816-34.816 31.658-51.84 44.331-60.33 56.832-64.683 69.504-60.331 82.347-51.84 94.848-34.816T512 128.085zm0 85.333q-46.677 0-91.648 12.331t-81.152 31.83-70.656 47.146-59.648 54.485-48.853 57.686-37.675 52.821-26.325 43.99q12.33 21.674 26.325 43.52t37.675 52.351 48.853 57.003 59.648 53.845T339.2 767.02t81.152 31.488T512 810.667t91.648-12.331 81.152-31.659 70.656-46.848 59.648-54.186 48.853-57.344 37.675-52.651T927.957 512q-12.33-21.675-26.325-43.648t-37.675-52.65-48.853-57.345-59.648-54.186-70.656-46.848-81.152-31.659T512 213.334zm0 128q70.656 0 120.661 50.006T682.667 512 632.66 632.661 512 682.667 391.339 632.66 341.333 512t50.006-120.661T512 341.333zm0 85.334q-35.328 0-60.33 25.002T426.666 512t25.002 60.33T512 597.334t60.33-25.002T597.334 512t-25.002-60.33T512 426.666z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M884.736 102.4l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456C696.32 311.296 712.704 327.68 733.184 327.68l147.456 0c20.48 0 36.864-16.384 36.864-36.864L917.504 139.264C921.6 118.784 905.216 102.4 884.736 102.4zM884.736 290.816l-147.456 0L737.28 139.264l147.456 0L884.736 290.816zM884.736 696.32l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C921.6 712.704 905.216 696.32 884.736 696.32zM884.736 884.736l-147.456 0 0-147.456 147.456 0L884.736 884.736zM884.736 401.408l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C921.6 417.792 905.216 401.408 884.736 401.408zM884.736 585.728l-147.456 0 0-147.456 147.456 0L884.736 585.728zM585.728 401.408l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C622.592 417.792 606.208 401.408 585.728 401.408zM585.728 585.728l-147.456 0 0-147.456 147.456 0L585.728 585.728zM585.728 102.4l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864L622.592 139.264C622.592 118.784 606.208 102.4 585.728 102.4zM585.728 290.816l-147.456 0L438.272 139.264l147.456 0L585.728 290.816zM585.728 696.32l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C622.592 712.704 606.208 696.32 585.728 696.32zM585.728 884.736l-147.456 0 0-147.456 147.456 0L585.728 884.736zM290.816 696.32 139.264 696.32c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C327.68 712.704 311.296 696.32 290.816 696.32zM290.816 884.736 139.264 884.736l0-147.456 147.456 0L286.72 884.736zM290.816 401.408 139.264 401.408c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C327.68 417.792 311.296 401.408 290.816 401.408zM290.816 585.728 139.264 585.728l0-147.456 147.456 0L286.72 585.728zM290.816 102.4 139.264 102.4c-20.48 0-36.864 16.384-36.864 36.864l0 147.456C102.4 311.296 118.784 327.68 139.264 327.68l147.456 0C311.296 327.68 327.68 311.296 327.68 290.816L327.68 139.264C327.68 118.784 311.296 102.4 290.816 102.4zM290.816 290.816 139.264 290.816 139.264 139.264l147.456 0L286.72 290.816z" /></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

Some files were not shown because too many files have changed in this diff Show More