导航、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. 11
      src/components/breadcrumb/index.vue
  4. 110
      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"> <div class="breadcrumb">
<el-breadcrumb separator=">"> <el-breadcrumb separator=">">
<template v-for="(item, index) in pages">
<el-breadcrumb-item <el-breadcrumb-item
v-for="(item, index) in pages" v-if="index != pages.length - 1"
:key="index" :key="index"
:to="{ path: index == pages.length - 1 ? '.' : route }"> :to="{ path: route }">
{{item}} {{item}}
</el-breadcrumb-item> </el-breadcrumb-item>
<el-breadcrumb-item
v-else
:key="index">
{{item}}
</el-breadcrumb-item>
</template>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
</template> </template>

@ -1,15 +1,22 @@
<template> <template>
<div class="quill" :class="classes"> <div class="quill" ref="quill" :class="classes">
<div ref="editor" :style="styles" v-loading="loading"></div> <div ref="editor" :style="styles" v-loading="loading"></div>
<el-upload :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess" <el-upload
style="display: none"> :headers="headers"
<el-button class="editorUpload" size="small" type="primary">点击上传</el-button> :action="this.api.fileupload"
:before-upload="beforeUpload"
:on-success="editorUploadSuccess"
style="display: none"
>
<el-button class="editorUpload" type="primary">点击上传</el-button>
</el-upload> </el-upload>
</div> </div>
</template> </template>
<script> <script>
import util from "@/libs/util";
import Setting from "@/setting";
import Quill from "quill"; import Quill from "quill";
import "quill/dist/quill.core.css"; import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css"; import "quill/dist/quill.snow.css";
@ -40,10 +47,20 @@ export default {
}, },
minHeight: { minHeight: {
type: Number type: Number
},
/*
* 原本的readOnly失效,对比其他项目发现是quill版本不同导致
* 使用props传入elseRead = 'true'手动隐藏工具栏
*/
elseRead: {
type: String, default: "false"
} }
}, },
data() { data() {
return { return {
headers: {
token: util.local.get(Setting.tokenKey)
},
Quill: null, Quill: null,
currentValue: "", currentValue: "",
options: { options: {
@ -89,6 +106,7 @@ export default {
} }
return style; return style;
} }
}, },
watch: { watch: {
value: { value: {
@ -103,8 +121,18 @@ export default {
immediate: true immediate: true
} }
}, },
created() {
},
mounted() { mounted() {
this.init(); 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() { beforeDestroy() {
// //
@ -115,35 +143,62 @@ export default {
const editor = this.$refs.editor; const editor = this.$refs.editor;
// //
this.Quill = new Quill(editor, this.options); this.Quill = new Quill(editor, this.options);
const ins = this.Quill
// //
this.Quill.pasteHTML(this.currentValue); ins.pasteHTML(this.currentValue);
if(this.toTop){ if(this.toTop){
this.$nextTick(() => { 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 html = this.$refs.editor.children[0].innerHTML;
const text = this.Quill.getText(); const text = ins.getText();
const quill = this.Quill; const quill = this.Quill;
// //
this.currentValue = html; this.currentValue = html;
// v-model // 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 // quill
this.Quill.on("text-change", (delta, oldDelta, source) => { ins.on('text-change', (delta, oldDelta, source) => {
this.$emit("on-text-change", delta, oldDelta, source); this.$emit('on-text-change', delta, oldDelta, source);
}); });
this.Quill.on("selection-change", (range, oldRange, source) => { ins.on('selection-change', (range, oldRange, source) => {
this.$emit("on-selection-change", range, oldRange, source); this.$emit('on-selection-change', range, oldRange, source);
}); });
this.Quill.on("editor-change", (eventName, ...args) => { ins.on('editor-change', (eventName, ...args) => {
this.$emit("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) { beforeUpload(file) {
this.loading = true; this.loading = true;
@ -160,7 +215,7 @@ export default {
// //
quill.setSelection(length + 1); quill.setSelection(length + 1);
} else { } else {
this.$message.success("图片插入失败"); util.successMsg("图片插入失败");
} }
this.loading = false; this.loading = false;
} }
@ -178,4 +233,23 @@ export default {
border: none; 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> </style>

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

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

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

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

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

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

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

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

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

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

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

@ -130,8 +130,10 @@
<img src="@/assets/img/report5.png" alt=""> <img src="@/assets/img/report5.png" alt="">
实验总结与体会 实验总结与体会
</h6> </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> <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> </div>
</div> </div>
@ -144,7 +146,7 @@ import html2Canvas from "html2canvas";
import JsPDF from "jspdf"; import JsPDF from "jspdf";
import util from "@/libs/util"; import util from "@/libs/util";
import breadcrumb from '@/components/breadcrumb' import breadcrumb from '@/components/breadcrumb'
import quill from "@/components/quill";
export default { export default {
data() { data() {
return { return {
@ -166,7 +168,8 @@ export default {
}; };
}, },
components: { components: {
breadcrumb breadcrumb,
quill
}, },
mounted() { mounted() {
this.getData(); this.getData();

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

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

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

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

Loading…
Cancel
Save