导航、banner等修复

dev_2020-03-03
yujialong 3 years ago
parent 6d886b3660
commit 9d96324123
  1. BIN
      src/assets/img/info-bg1.png
  2. BIN
      src/assets/img/info-bg2.png
  3. 19
      src/components/breadcrumb/index.vue
  4. 114
      src/components/quill/index.vue
  5. 26
      src/layouts/header/index.vue
  6. 7
      src/layouts/navbar/index.vue
  7. 2
      src/pages/account/login/index.vue
  8. 4
      src/pages/cityPartner/list/index.vue
  9. 8
      src/pages/course/list/index.vue
  10. 4
      src/pages/devPlatform/list/index.vue
  11. 2
      src/pages/index/list/index.vue
  12. 9
      src/pages/info/list/index.vue
  13. 4
      src/pages/match/details/index.vue
  14. 4
      src/pages/match/list/index.vue
  15. 6
      src/pages/record/list/index.vue
  16. 9
      src/pages/record/show/index.vue
  17. 4
      src/pages/station/list/index.vue
  18. 1
      src/pages/station/preview/index.vue
  19. 8
      src/plugins/requests/index.js
  20. 2
      src/router/permission.js

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 51 KiB

@ -2,12 +2,19 @@
<!-- 面包屑 -->
<div class="breadcrumb">
<el-breadcrumb separator=">">
<el-breadcrumb-item
v-for="(item, index) in pages"
:key="index"
:to="{ path: index == pages.length - 1 ? '.' : route }">
{{item}}
</el-breadcrumb-item>
<template v-for="(item, index) in pages">
<el-breadcrumb-item
v-if="index != pages.length - 1"
:key="index"
:to="{ path: route }">
{{item}}
</el-breadcrumb-item>
<el-breadcrumb-item
v-else
:key="index">
{{item}}
</el-breadcrumb-item>
</template>
</el-breadcrumb>
</div>
</template>

@ -1,15 +1,22 @@
<template>
<div class="quill" :class="classes">
<div class="quill" ref="quill" :class="classes">
<div ref="editor" :style="styles" v-loading="loading"></div>
<el-upload :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess"
style="display: none">
<el-button class="editorUpload" size="small" type="primary">点击上传</el-button>
<el-upload
:headers="headers"
:action="this.api.fileupload"
:before-upload="beforeUpload"
:on-success="editorUploadSuccess"
style="display: none"
>
<el-button class="editorUpload" type="primary">点击上传</el-button>
</el-upload>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import Quill from "quill";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
@ -40,10 +47,20 @@ export default {
},
minHeight: {
type: Number
},
/*
* 原本的readOnly失效,对比其他项目发现是quill版本不同导致
* 使用props传入elseRead = 'true'手动隐藏工具栏
*/
elseRead: {
type: String, default: "false"
}
},
data() {
return {
headers: {
token: util.local.get(Setting.tokenKey)
},
Quill: null,
currentValue: "",
options: {
@ -89,6 +106,7 @@ export default {
}
return style;
}
},
watch: {
value: {
@ -103,47 +121,84 @@ export default {
immediate: true
}
},
created() {
},
mounted() {
this.init();
//
if (this.elseRead === "true") {
let children = this.$refs.quill.children[0].style;
children.padding = "0";
children.overflow = "hidden";
children.height = "0";
children.borderTop = "0";
}
},
beforeDestroy() {
//
this.Quill = null;
},
methods: {
init() {
init () {
const editor = this.$refs.editor;
//
this.Quill = new Quill(editor, this.options);
const ins = this.Quill
//
this.Quill.pasteHTML(this.currentValue);
if (this.toTop) {
ins.pasteHTML(this.currentValue);
if(this.toTop){
this.$nextTick(() => {
window.scrollTo(0, 0);
});
window.scrollTo(0,0)
})
}
//
this.Quill.on("text-change", (delta, oldDelta, source) => {
ins.on('text-change', (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML;
const text = this.Quill.getText();
const text = ins.getText();
const quill = this.Quill;
//
this.currentValue = html;
// v-model
this.$emit("input", html);
this.$emit('input', html);
//
this.$emit("on-change", { html, text, quill });
this.$emit('on-change', { html, text, quill });
});
// quill
this.Quill.on("text-change", (delta, oldDelta, source) => {
this.$emit("on-text-change", delta, oldDelta, source);
ins.on('text-change', (delta, oldDelta, source) => {
this.$emit('on-text-change', delta, oldDelta, source);
});
this.Quill.on("selection-change", (range, oldRange, source) => {
this.$emit("on-selection-change", range, oldRange, source);
ins.on('selection-change', (range, oldRange, source) => {
this.$emit('on-selection-change', range, oldRange, source);
});
this.Quill.on("editor-change", (eventName, ...args) => {
this.$emit("on-editor-change", eventName, ...args);
ins.on('editor-change', (eventName, ...args) => {
this.$emit('on-editor-change', eventName, ...args);
});
//
ins.root.addEventListener('paste', evt => {
if (evt.clipboardData && evt.clipboardData.files && evt.clipboardData.files.length) {
evt.preventDefault();
//
[].forEach.call(evt.clipboardData.files, file => {
if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {
return
}
const param = new FormData()
param.append('file', file)
// base64
this.$post(this.api.fileupload, param, {
headers: { "Content-Type": "multipart/form-data" }
}).then(res => {
var range = ins.getSelection()
if (range) {
//
ins.insertEmbed(range.index, 'image', res.data.filesResult.fileUrl)
//
ins.setSelection(range.index + 1)
}
}).catch(res => {})
});
}
}, false)
},
beforeUpload(file) {
this.loading = true;
@ -160,7 +215,7 @@ export default {
//
quill.setSelection(length + 1);
} else {
this.$message.success("图片插入失败");
util.successMsg("图片插入失败");
}
this.loading = false;
}
@ -178,4 +233,23 @@ export default {
border: none;
}
}
.else {
.ql-toolbar.ql-snow {
height: 0;
overflow: hidden;
padding: 0;
border-top: 0;
}
}
/deep/.ql-snow {
position: relative;
.ql-tooltip {
position: absolute !important;
top: 10px !important;
left: 10px !important;
transform: translateY(10px);
}
}
</style>

@ -1,14 +1,14 @@
<template>
<div class="header">
<a class="logo" @click="toIndex">
<template v-if="token">
<img v-if="isIndex" src="@/assets/img/logo.png" alt="">
<template v-else>
<img :src="logoUrl" width="50" height="50" />
<span class="title">{{title}}</span>
</template>
<img v-else src="@/assets/img/logo.png" alt="">
</a>
<div class="inner">
<navbar ref="nav" style="height: 64px;"></navbar>
<navbar class="nav-wrap" ref="nav"></navbar>
<div class="user-wrap">
<template v-if="token">
<div class="user" @click="toPersonal">
@ -34,7 +34,8 @@ import navbar from "../navbar";
export default {
data() {
return {
token: util.local.get(Setting.tokenKey)
token: util.local.get(Setting.tokenKey),
isIndex: Setting.whiteList.find(e => e === this.$route.path) //
};
},
components: {
@ -74,7 +75,9 @@ export default {
this.$router.push("/setting/person");
},
toIndex() {
this.$router.push('/index')
this.$refs.nav.jump({
index: this.isIndex ? '/index/list' : '/station/list'
})
}
}
};
@ -115,6 +118,9 @@ $height: 64px;
font-size: 18px;
font-weight: bold;
}
.nav-wrap {
height: 64px;
}
.user-wrap {
display: inline-flex;
align-items: center;
@ -154,4 +160,14 @@ $height: 64px;
}
}
}
@media (max-width: 1430px) {
.header {
.inner {
padding-right: 20px;
}
.logo {
left: 40px;
}
}
}
</style>

@ -49,7 +49,7 @@ export default {
touristMenu: [
{
index: "/index/list",
title: "实验台"
title: "首页"
},
{
index: "/cityPartner/list",
@ -103,4 +103,9 @@ export default {
}
}
}
@media (max-width: 1430px) {
.nav {
left: 200px;
}
}
</style>

@ -435,7 +435,7 @@ export default {
&:hover img {
opacity: .9;
}
&.active span {
&.active p {
background-color: #9278ff;
}
}

@ -125,8 +125,8 @@ export default {
position: relative;
background-color: #fff;
.banner {
height: 420px;
padding: 140px 0 0 180px;
height: 350px;
padding: 100px 0 0 180px;
background: url(../../../assets/img/city/banner2.png) top right/auto no-repeat,
url(../../../assets/img/city/banner1.png) 0 0/100% 100% no-repeat;
h6 {

@ -9,7 +9,7 @@
</div>
<!-- 课程筛选 -->
<div class="filter">
<div class="wrap-inner">
<div class="wrap-inner" style="padding-bottom: 0">
<dl>
<dt>课程分类</dt>
<dd v-for="(item, index) in classificationList" :key="index" :class="{active: classificationId == item.id}" @click="changeType(item.id)">{{ item.name }}</dd>
@ -130,12 +130,12 @@ export default {
<style lang="scss" scoped>
.search {
position: relative;
padding: 121px 0 167px;
padding: 100px 0 130px;
text-align: center;
background: url(../../../assets/img/course-bg.png) 0 0/100% 100% no-repeat;
h6 {
margin-bottom: 25px;
font-size: 32px;
font-size: 26px;
color: #fff;
}
.input {
@ -163,7 +163,6 @@ export default {
.wrap {
.filter {
width: 100%;
margin-bottom: 10px;
background-color: #fff;
dl {
display: flex;
@ -185,6 +184,7 @@ export default {
}
}
.courses {
padding-top: 10px;
ul {
display: flex;
flex-wrap: wrap;

@ -85,8 +85,8 @@ export default {
position: relative;
background-color: #fff;
.banner {
height: 420px;
padding: 140px 0 0 180px;
height: 350px;
padding: 100px 0 0 180px;
background: url(../../../assets/img/dev/banner2.png) (90% 32px)/auto no-repeat,
url(../../../assets/img/dev/banner1.png) 0 0/100% 100% no-repeat;
h6 {

@ -1,7 +1,7 @@
<template>
<div class="wrap index">
<div class="banner">
<el-carousel height="420px" :autoplay="false">
<el-carousel height="350px" :autoplay="false">
<el-carousel-item>
<div class="bg banner-bg1"></div>
<img class="text" src="@/assets/img/index/banner1-text.png" alt="">

@ -191,14 +191,15 @@ export default {
<style lang="scss" scoped>
.wrap {
.banner {
height: 420px;
padding: 140px 0 0 180px;
height: 350px;
padding: 100px 0 0 180px;
background: url(../../../assets/img/info-bg.png) 0 0/100% 100% no-repeat;
}
}
.main{
background: url(../../../assets/img/info-bg1.png) (0px 179px)/auto auto no-repeat,
url(../../../assets/img/info-bg2.png) (bottom right)/auto auto no-repeat;
min-height: calc(100vh - 524px);
background: url(../../../assets/img/info-bg1.png) (0px 179px)/(190px 171px) no-repeat,
url(../../../assets/img/info-bg2.png) (bottom right)/(407px 273px) no-repeat;
.center-wrap {
display: flex;
justify-content: center;

@ -103,8 +103,8 @@ export default {
<style lang="scss" scoped>
.banner{
width: 100%;
height: 400px;
background-size: 100vw 400px;
height: 350px;
background-size: 100vw 350px;
background-repeat: no-repeat;
}
.main .center-wrap {

@ -329,14 +329,14 @@ export default {
<style lang="scss" scoped>
.search {
position: relative;
padding: 121px 0 167px;
padding: 100px 0 130px;
text-align: center;
background: url(../../../assets/img/match-bg4.png) (72px 180px)/auto no-repeat,
url(../../../assets/img/match-bg5.png) (90% 172px)/auto no-repeat,
url(../../../assets/img/match-bg3.png) 0 0/100% 100% no-repeat;
h6 {
margin-bottom: 25px;
font-size: 32px;
font-size: 26px;
color: #fff;
}
.input {

@ -152,6 +152,10 @@ export default {
</script>
<style lang="scss" scoped>
.main .view {
width: 1280px;
padding: 12px 0 20px;
}
.block {
padding: 16px;
margin-bottom: 20px;
@ -176,7 +180,7 @@ export default {
}
.item {
flex: 1;
padding: 26px 27px;
padding: 27px;
margin-right: 19px;
background-size: 100% 100%;
background-repeat: no-repeat;

@ -130,8 +130,10 @@
<img src="@/assets/img/report5.png" alt="">
实验总结与体会
</h6>
<el-input v-if="editing" type="textarea" v-model="form.summarize"></el-input>
<quill v-if="editing" :border="true" v-model="form.summarize" :minHeight="150" :height="150" />
<div v-else class="pre-wrap" v-html="form.summarize"></div>
<!-- <el-input v-if="editing" type="textarea" v-model="form.summarize"></el-input>
<div v-else class="pre-wrap" v-html="form.summarize"></div> -->
</div>
</div>
</div>
@ -144,7 +146,7 @@ import html2Canvas from "html2canvas";
import JsPDF from "jspdf";
import util from "@/libs/util";
import breadcrumb from '@/components/breadcrumb'
import quill from "@/components/quill";
export default {
data() {
return {
@ -166,7 +168,8 @@ export default {
};
},
components: {
breadcrumb
breadcrumb,
quill
},
mounted() {
this.getData();

@ -50,12 +50,12 @@ export default {
<style lang="scss" scoped>
.search {
position: relative;
padding: 121px 0 167px;
padding: 100px 0 130px;
text-align: center;
background: url(../../../assets/img/station-bg.png) 0 0/100% 100% no-repeat;
h6 {
margin-bottom: 25px;
font-size: 32px;
font-size: 26px;
color: #fff;
}
.input {

@ -330,6 +330,7 @@ $height: 700px;
}
.cover{
flex: 1;
background-color: #252528;
img{
border-radius: 8px;
}

@ -1,6 +1,6 @@
import axios from "axios";
import util from "@/libs/util";
import router from "@/router/index";
import router from "@/router";
import Setting from "@/setting";
const service = axios.create({
@ -21,7 +21,7 @@ service.interceptors.request.use(config => {
util.errorMsg({
message: "退出登陆",
onClose: function() {
router.push({ name: "/index" });
router.push({ name: "/login" });
}
});
return Promise.reject(err);
@ -54,7 +54,7 @@ service.interceptors.response.use(
util.errorMsg("登录过期,请重新登录");
setTimeout(() => {
router.replace({
path: "/index"
path: "/login"
});
}, 1000);
break;
@ -74,7 +74,7 @@ service.interceptors.response.use(
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
router.replace({
path: "/index"
path: "/login"
});
}, 1000);
break;

@ -7,7 +7,7 @@ router.beforeEach((to, from, next) => {
document.title = Setting.titleSuffix;
const role = util.local.get(Setting.tokenKey);
if (!role && !whiteList.includes(to.path)) {
next('/index/list')
next('/login')
} else if(role && to.path === '/login') {
next('/station')
} else {

Loading…
Cancel
Save