dev_review
yujialong 5 months ago
parent 6c2437e6f3
commit d611d682a2
  1. 59
      src/App.vue
  2. 113
      src/components/Header.vue
  3. 105
      src/components/quill/index.vue
  4. 73
      src/setting.js
  5. 134
      src/utils/editor.js
  6. 298
      src/utils/http.js
  7. 551
      src/views/course/contentSettings.vue
  8. 7
      src/views/customer/AddCustomer.vue
  9. 197
      src/views/order/Order.vue
  10. 1149
      src/views/shop/addProduct/index.vue

@ -1,30 +1,47 @@
<template> <template>
<div id="app"> <div id="app">
<router-view></router-view> <el-radio-group v-if="Setting.isDev" v-model="ip" @change="ipChange">
</div> <el-radio :label="0">刘榕ip</el-radio>
<el-radio :label="1">陈赓ip</el-radio>
</el-radio-group>
<router-view></router-view>
</div>
</template> </template>
<script> <script>
export default { import Setting from '@/setting'
name: 'App', export default {
created () { name: 'App',
//sessionStorage data () {
if (sessionStorage.getItem("store") ) { return {
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store")))) Setting,
} ip: localStorage.getItem('nakadaiIp') ? +localStorage.getItem('nakadaiIp') : 0,
};
//vuexsessionStorage },
window.addEventListener("beforeunload",()=>{ created () {
sessionStorage.getItem("token") && sessionStorage.setItem("store",JSON.stringify(this.$store.state)) //sessionStorage
}) if (sessionStorage.getItem("store")) {
} this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("store"))))
} }
//vuexsessionStorage
window.addEventListener("beforeunload", () => {
sessionStorage.getItem("token") && sessionStorage.setItem("store", JSON.stringify(this.$store.state))
})
},
methods: {
ipChange (val) {
localStorage.setItem('nakadaiIp', val)
location.reload()
},
}
}
</script> </script>
<style> <style>
@import "./assets/css/main.css"; @import "./assets/css/main.css";
/* @import "./assets/css/color-dark.css"; */ /* @import "./assets/css/color-dark.css"; */
/*深色主题*/ /*深色主题*/
@import "./assets/css/theme-green/color-green.css"; @import "./assets/css/theme-green/color-green.css";
/* 浅绿色主题 */ /* 浅绿色主题 */
</style> </style>

@ -1,29 +1,16 @@
<template> <template>
<div class="header flex-between"> <div class="header flex-between">
<div class="logo"> <div class="logo">
<img class="cursor" <img class="cursor" @click="goHome" src="../assets/img/logo.png">
@click="goHome"
src="../assets/img/logo.png">
</div> </div>
<el-radio-group v-if="Setting.isDev"
v-model="ip"
@change="ipChange">
<el-radio :label="0">刘榕ip</el-radio>
<el-radio :label="1">陈赓ip</el-radio>
</el-radio-group>
<div class="header-right"> <div class="header-right">
<div class="header-user-con"> <div class="header-user-con">
<div class="user" <div class="user" @click="toPerson">
@click="toPerson"> <el-avatar :size="40" :src="$store.state.avatar"></el-avatar>
<el-avatar :size="40" <span class="user-avator">{{ userName }}</span>
:src="$store.state.avatar"></el-avatar>
<span class="user-avator">{{userName}}</span>
</div> </div>
<el-divider class="ml20" <el-divider class="ml20" direction="vertical"></el-divider>
direction="vertical"></el-divider> <el-button type="text" class="ml20" @click="loginout">退出</el-button>
<el-button type="text"
class="ml20"
@click="loginout">退出</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -36,7 +23,6 @@ export default {
return { return {
Setting, Setting,
userName: '', userName: '',
ip: localStorage.getItem('nakadaiIp') ? +localStorage.getItem('nakadaiIp') : 0,
}; };
}, },
mounted () { mounted () {
@ -112,72 +98,79 @@ export default {
Setting.isPro && this.heartbeatDetection() Setting.isPro && this.heartbeatDetection()
}).catch(err => { }) }).catch(err => { })
}, },
ipChange (val) {
localStorage.setItem('nakadaiIp', val)
location.reload()
},
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header { .header {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: 60px; height: 60px;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
.header .logo { .header .logo {
float: left; float: left;
width: 170px; width: 170px;
height: 40px; height: 40px;
margin-left: 20px; margin-left: 20px;
} }
.header .logo img { .header .logo img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.header-right { .header-right {
float: right; float: right;
padding-right: 50px; padding-right: 50px;
} }
.header-user-con { .header-user-con {
display: flex; display: flex;
height: 70px; height: 70px;
align-items: center; align-items: center;
} }
.header-user-con .user { .header-user-con .user {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
.user-avator { .user-avator {
cursor: pointer; cursor: pointer;
margin-left: 10px; margin-left: 10px;
font-size: 12px; font-size: 12px;
} }
.ml20 { .ml20 {
margin-left: 20px; margin-left: 20px;
} }
.user-avator img { .user-avator img {
display: block; display: block;
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
} }
/deep/.header-right .el-button--text { /deep/.header-right .el-button--text {
color: #333; color: #333;
span {
font-size: 12px; span {
} font-size: 12px;
}
} }
.header-right .el-divider--vertical { .header-right .el-divider--vertical {
width: 2px; width: 2px;
height: 15px; height: 15px;
} }
.header-right .el-divider { .header-right .el-divider {
background-color: #333; background-color: #333;
} }
</style> </style>

@ -1,39 +1,21 @@
<template> <template>
<div> <div>
<el-radio-group v-if="!readonly && radio" <el-radio-group v-if="!readonly && radio" class="type-radio" v-model="editorType" @change="typeChange">
class="type-radio"
v-model="editorType"
@change="typeChange">
<el-radio label="0">富文本</el-radio> <el-radio label="0">富文本</el-radio>
<el-radio label="1">markdown</el-radio> <el-radio label="1">markdown</el-radio>
</el-radio-group> </el-radio-group>
<div v-show="editorType == 0" <div v-show="editorType == 0" class="quill" ref="quill" :class="classes">
class="quill" <div ref="editor" :style="styles" v-loading="loading"></div>
ref="quill" <Upload :max-size="1000" :limit="100" @beforeUpload="beforeUpload" @onSuccess="editorUploadSuccess"
:class="classes"> style="display: none">
<div ref="editor"
:style="styles"
v-loading="loading"></div>
<Upload :max-size="1000"
:limit="100"
@beforeUpload="beforeUpload"
@onSuccess="editorUploadSuccess"
style="display: none">
<div slot="trigger"> <div slot="trigger">
<el-button :id="'editorUpload' + index" <el-button :id="'editorUpload' + index" type="primary">点击上传</el-button>
type="primary">点击上传</el-button>
</div> </div>
</Upload> </Upload>
</div> </div>
<mavon-editor class="md" <mavon-editor class="md" v-model="mdVal" v-show="editorType == 1" ref="md" :ishljs="true" :subfield="false"
v-model="mdVal" @change="mdChange" @imgAdd="imgAdd" />
v-show="editorType == 1"
ref="md"
:ishljs="true"
:subfield="false"
@change="mdChange"
@imgAdd="imgAdd" />
</div> </div>
</template> </template>
@ -300,38 +282,63 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.type-radio { .type-radio {
margin-bottom: 20px; margin-bottom: 20px;
} }
.quill-no-border { .quill-no-border {
.ql-toolbar.ql-snow { .ql-toolbar.ql-snow {
border: none; border: none;
border-bottom: 1px solid #e8eaec; border-bottom: 1px solid #e8eaec;
} }
.ql-container.ql-snow {
border: none; .ql-container.ql-snow {
} border: none;
}
} }
.else { .else {
.ql-toolbar.ql-snow { .ql-toolbar.ql-snow {
height: 0; height: 0;
overflow: hidden; overflow: hidden;
padding: 0; padding: 0;
border-top: 0; border-top: 0;
} }
} }
/deep/.ql-snow { /deep/.ql-snow {
position: relative; position: relative;
.ql-tooltip {
position: absolute !important; .ql-tooltip {
top: 0 !important; position: absolute !important;
left: -100px !important; top: 0 !important;
transform: translateY(10px); left: -100px !important;
} transform: translateY(10px);
}
} }
.md { .md {
max-height: 300px; max-height: 300px;
} }
/deep/.v-note-wrapper .v-note-panel { /deep/.v-note-wrapper .v-note-panel {
min-height: 200px; min-height: 200px;
}
/deep/.markdown-body {
ul {
list-style: disc;
li {
list-style: inherit;
}
}
ol {
list-style: decimal;
li {
list-style: inherit;
}
}
} }
</style> </style>

@ -9,53 +9,54 @@ let jumpPath = `${location.origin}/judgmentPoint/`
let sandPath = `http://121.37.12.51/sandbox` // 沙盘地址 let sandPath = `http://121.37.12.51/sandbox` // 沙盘地址
let host = `${location.origin}/` let host = `${location.origin}/`
if (isDev) { if (isDev) {
console.log("🚀 ~ localStorage.getItem('nakadaiIp'):",localStorage.getItem('nakadaiIp')) console.log("🚀 ~ localStorage.getItem('nakadaiIp'):", localStorage.getItem('nakadaiIp'))
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
// jumpPath = 'https://judgment.huorantech.cn/' // jumpPath = 'https://judgment.huorantech.cn/'
sandPath = `http://${location.hostname}:9520` sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = localStorage.getItem('nakadaiIp') == 1 ? 'http://192.168.31.51:9000/' : 'http://192.168.31.217:9000/' host = localStorage.getItem('nakadaiIp') == 1 ? 'http://192.168.31.51:9000/' : 'http://192.168.31.217:9000/'
// host = 'http://192.168.31.51:9000/'
} else if (isPro) { } else if (isPro) {
sandPath = `https://izhixinyun.com/sandbox` sandPath = `https://izhixinyun.com/sandbox`
jumpPath = 'https://judgment.huorantech.cn/' jumpPath = 'https://judgment.huorantech.cn/'
} }
const Setting = { const Setting = {
/** /**
* 基础配置 * 基础配置
* */ * */
platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人 platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人
platformSource: 0, // 平台来源(0中台,1职站) platformSource: 0, // 平台来源(0中台,1职站)
autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间 autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间
jumpPath, // 判分点系统跳转路径前缀 jumpPath, // 判分点系统跳转路径前缀
sandPath, // 沙盘地址 sandPath, // 沙盘地址
apiBaseURL: host, // 请求路径前缀 apiBaseURL: host, // 请求路径前缀
uploadURL: isDev ? 'http://121.37.12.51/' : location.origin + '/', // 阿里云oss域名 uploadURL: isDev ? 'http://121.37.12.51/' : location.origin + '/', // 阿里云oss域名
// 平台列表 // 平台列表
platformList: [ platformList: [
{ {
id: 1, id: 1,
name: '职站' name: '职站'
}, },
{ {
id: 2, id: 2,
name: '数据平台' name: '数据平台'
}, },
{ {
id: 3, id: 3,
name: '中台' name: '中台'
} }
], ],
isDev, isDev,
isPro, isPro,
// 是否使用动态路由 // 是否使用动态路由
dynamicRoute: true, dynamicRoute: true,
/** /**
* @description 默认密码 * @description 默认密码
*/ */
initialPassword: '1122aa', initialPassword: '1122aa',
}; };
export default Setting; export default Setting;

@ -3,12 +3,12 @@ import { Loading } from 'element-ui'
export default { export default {
//skin:'oxide-dark', //skin:'oxide-dark',
language:'zh_CN', language: 'zh_CN',
language_url: './styles/tinymce/langs/zh_CN.js', language_url: './styles/tinymce/langs/zh_CN.js',
plugins: 'print powerpaste preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template advcode codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize formatpainter', plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize',
toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \ toolbar: 'code undo redo restoredraft | cut copy pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \ styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em formatpainter', table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em',
style_formats: [ style_formats: [
//新增 首行缩进与行高 配置 //新增 首行缩进与行高 配置
{ {
@ -21,40 +21,40 @@ export default {
{ {
title: '行高', title: '行高',
items: [{ items: [{
title: '1', title: '1',
styles: { styles: {
'line-height': '1' 'line-height': '1'
},
inline: 'span'
}, },
{ inline: 'span'
title: '1.5', },
styles: { {
'line-height': '1.5' title: '1.5',
}, styles: {
inline: 'span' 'line-height': '1.5'
}, },
{ inline: 'span'
title: '2', },
styles: { {
'line-height': '2' title: '2',
}, styles: {
inline: 'span' 'line-height': '2'
}, },
{ inline: 'span'
title: '2.5', },
styles: { {
'line-height': '2.5' title: '2.5',
}, styles: {
inline: 'span' 'line-height': '2.5'
}, },
{ inline: 'span'
title: '3', },
styles: { {
'line-height': '3' title: '3',
}, styles: {
inline: 'span' 'line-height': '3'
} },
inline: 'span'
}
] ]
}, },
//默认的配置 //默认的配置
@ -187,16 +187,16 @@ export default {
fontsize_formats: '12px 14px 16px 19px 24px 36px 48px 56px 72px', fontsize_formats: '12px 14px 16px 19px 24px 36px 48px 56px 72px',
font_formats: '苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', font_formats: '苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif',
link_list: [ link_list: [
{ title: '预置链接1', value: 'http://www.tinymce.com' }, { title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' } { title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
], ],
image_list: [ image_list: [
{ title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' },
{ title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' }
], ],
image_class_list: [ image_class_list: [
{ title: 'None', value: '' }, { title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' } { title: 'Some class', value: 'class-name' }
], ],
//为内容模板插件提供预置模板 //为内容模板插件提供预置模板
templates: [], templates: [],
@ -206,7 +206,7 @@ export default {
// template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]', // template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]',
// template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]', // template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]',
// autosave_ask_before_unload: false, // autosave_ask_before_unload: false,
toolbar_mode : 'wrap', toolbar_mode: 'wrap',
// automatic_uploads: true, // automatic_uploads: true,
// images_upload_base_path: '/demo', // images_upload_base_path: '/demo',
// images_upload_url: 'http://10.10.11.7:10000/iasf/sysFiles/upload', // images_upload_url: 'http://10.10.11.7:10000/iasf/sysFiles/upload',
@ -214,25 +214,25 @@ export default {
powerpaste_allow_local_images: true, powerpaste_allow_local_images: true,
powerpaste_word_import: 'clean', powerpaste_word_import: 'clean',
powerpaste_html_import: 'clean', powerpaste_html_import: 'clean',
urlconverter_callback: (url, node, onSave, name) => { urlconverter_callback: (url, node, onSave, name) => {
if (node === 'img' && url.startsWith('blob:')) { if (node === 'img' && url.startsWith('blob:')) {
// Do some custom URL conversion // Do some custom URL conversion
tinymce.activeEditor && tinymce.activeEditor.uploadImages() tinymce.activeEditor && tinymce.activeEditor.uploadImages()
} }
// Return new URL // Return new URL
return url return url
}, },
// 自定义上传 // 自定义上传
images_upload_handler: function (blobInfo, succFun, failFun) { images_upload_handler: function (blobInfo, succFun, failFun) {
const blob = blobInfo.blob() const blob = blobInfo.blob()
// blob转换为file // blob转换为file
const file = new File([blob], blobInfo.filename(), { const file = new File([blob], blobInfo.filename(), {
type: 'application/json', type: 'application/json',
lastModified: Date.now() lastModified: Date.now()
}); });
Oss.upload(file).then(res => { Oss.upload(file).then(res => {
succFun(res.url) succFun(res.url)
}) })
}, },
//自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发 //自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发
file_picker_callback: function (callback, value, meta) { file_picker_callback: function (callback, value, meta) {
@ -248,23 +248,23 @@ export default {
let input = document.createElement('input');//创建一个隐藏的input let input = document.createElement('input');//创建一个隐藏的input
input.setAttribute('type', 'file'); input.setAttribute('type', 'file');
input.setAttribute("accept", ".mp4"); input.setAttribute("accept", ".mp4");
input.onchange = function(){ input.onchange = function () {
let file = this.files[0]; let file = this.files[0];
const load = Loading.service() const load = Loading.service()
Oss.upload(file).then(res => { Oss.upload(file).then(res => {
load.close() load.close()
callback(res.url) callback(res.url)
}).catch(e => { }).catch(e => {
load.close() load.close()
}) })
} }
//触发点击 //触发点击
input.click(); input.click();
} }
}, },
// 初始化事件 // 初始化事件
setup: function(editor) { setup: function (editor) {
editor.on('init', function(ed) { editor.on('init', function (ed) {
// 设置默认字体 // 设置默认字体
ed.target.editorCommands.execCommand("fontName", false, "PingFang SC") ed.target.editorCommands.execCommand("fontName", false, "PingFang SC")
ed.target.editorCommands.execCommand("fontSize", false, "16px") ed.target.editorCommands.execCommand("fontSize", false, "16px")

@ -13,166 +13,182 @@ axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
// 请求拦截器 // 请求拦截器
axios.interceptors.request.use(config => { axios.interceptors.request.use(config => {
let token = sessionStorage.getItem('token') let token = sessionStorage.getItem('token')
if(token){ if (token) {
config.headers.token = token config.headers.token = token
} }
let schoolId = store.state.schoolId let schoolId = store.state.schoolId
if(schoolId) config.headers.schoolId = store.state.schoolId if (schoolId) config.headers.schoolId = store.state.schoolId
return config; return config;
}, err => { }, err => {
Message.error({ Message.error({
message: '退出登陆', message: '退出登陆',
onClose: function () { onClose: function () {
router.push({name: 'login'}); router.push({ name: 'login' });
} }
}) })
return Promise.reject(err); return Promise.reject(err);
}) })
let logouted = 0; let logouted = 0;
// 响应拦截器 // 响应拦截器
axios.interceptors.response.use( axios.interceptors.response.use(
response => { response => {
if (response.status === 200) { if (response.status === 200) {
const { status } = response.data const { status, code, msg } = response.data
if (status) { if (status) {
// 接口定义的非正常返回的时候,应当处于报错状态 // 接口定义的非正常返回的时候,应当处于报错状态
if (status === 10020) { if (status === 10020) {
// 该状态为用户列表启用用户的接口返回的状态,特殊处理 // 该状态为用户列表启用用户的接口返回的状态,特殊处理
return Promise.reject(response) return Promise.reject(response)
} else if (status !== 200) { } else if (status !== 200) {
Message.error(response.data.message) Message.error(response.data.message)
return Promise.reject(response) return Promise.reject(response)
} else {
return Promise.resolve(response)
}
} else {
return Promise.resolve(response)
}
} else { } else {
Message.error(response.message,'res'); return Promise.resolve(response)
return Promise.reject(response);
} }
}, } else if (code === 401) {
// 服务器状态码不是200的情况 // 账号互踢
error => { if (!logouted) {
if (error.response.status) { sessionStorage.removeItem('token')
switch (error.response.status) { Message.error(msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
// 401: 未登录 setTimeout(() => {
// 未登录则跳转登录页面,并携带当前页面的路径 router.replace({
// 在登录成功后返回当前页面,这一步需要在登录页操作。 path: '/login',
case 401: query: {
if (!logouted) { redirect: router.currentRoute.fullPath
Message.error('登录过期,请重新登录!'); }
setTimeout(() => { })
router.replace({ logouted = 0
path: '/login', }, 1500)
query: { logouted = 1
redirect: router.currentRoute.fullPath
}
});
}, 1000);
logouted = 1
}
break;
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
// 清除token
sessionStorage.removeItem('token');
store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
break;
// 404请求不存在
case 404:
Message.error('404网络请求不存在!');
break;
case 500:// 网络错误
Message.error('网络错误!');
// router.replace({
// path: '/login',
// query: { redirect: router.currentRoute.fullPath }
// });
break;
// 其他错误,直接抛出错误提示
default:
Message.error(error.response.data.message);
break;
}
return Promise.reject(error.response);
} }
} else {
return Promise.resolve(response)
}
} else {
Message.error(response.message, 'res');
return Promise.reject(response);
}
},
// 服务器状态码不是200的情况
error => {
if (error.response.status) {
switch (error.response.status) {
// 401: 未登录
// 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401:
if (!logouted) {
Message.error('登录过期,请重新登录!');
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
logouted = 1
}
break;
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
// 清除token
sessionStorage.removeItem('token');
store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
break;
// 404请求不存在
case 404:
Message.error('404网络请求不存在!');
break;
case 500:// 网络错误
Message.error('网络错误!');
// router.replace({
// path: '/login',
// query: { redirect: router.currentRoute.fullPath }
// });
break;
// 其他错误,直接抛出错误提示
default:
Message.error(error.response.data.message);
break;
}
return Promise.reject(error.response);
} }
}
); );
function logouts(){ function logouts () {
store.replaceState({}) store.replaceState({})
localStorage.clear() localStorage.clear()
sessionStorage.clear() sessionStorage.clear()
location.reload() location.reload()
} }
let tokenStatus = { let tokenStatus = {
0: '用户未登录,请登录后操作!', 0: '用户未登录,请登录后操作!',
1: 'token错误,请重新登录!' 1: 'token错误,请重新登录!'
} }
/** /**
* get方法对应get请求 * get方法对应get请求
*/ */
export function get(url, params){ export function get (url, params) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) => {
axios.get(url, { axios.get(url, {
params: params params: params
}) })
.then(res => { .then(res => {
resolve(res.data) resolve(res.data)
}) })
.catch(err => { .catch(err => {
reject(err.data) reject(err.data)
}) })
}); });
} }
/** /**
* post方法对应post请求 * post方法对应post请求
*/ */
export function post(url, params, config) { export function post (url, params, config) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.post(url,params, config) axios.post(url, params, config)
.then(res => { .then(res => {
return resolve(res.data); return resolve(res.data);
}) })
.catch(err => { .catch(err => {
return reject(err.data) return reject(err.data)
}) })
}); });
} }
/** /**
* delete方法对应delete请求 * delete方法对应delete请求
*/ */
export function del(url, params){ export function del (url, params) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) => {
axios.delete(url, { axios.delete(url, {
params: params params: params
}) })
.then(res => { .then(res => {
resolve(res.data); resolve(res.data);
}) })
.catch(err => { .catch(err => {
reject(err.data) reject(err.data)
}) })
}); });
} }
/** /**
@ -180,14 +196,14 @@ export function post(url, params, config) {
* @param {} url * @param {} url
* @param {*} params * @param {*} params
*/ */
export function put(url, params){ export function put (url, params) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) => {
axios.put(url, params) axios.put(url, params)
.then(res => { .then(res => {
resolve(res.data); resolve(res.data);
}) })
.catch(err => { .catch(err => {
reject(err.data) reject(err.data)
}) })
}); });
} }

@ -1,343 +1,215 @@
<template> <template>
<div> <div>
<el-card shadow="hover" <el-card shadow="hover" class="mgb20">
class="mgb20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="back" <el-page-header @back="back" :content="name + '/' + (sorting ? '编辑排序' : '内容设置')"></el-page-header>
:content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header>
</div> </div>
</el-card> </el-card>
<!--内容设置--> <!--内容设置-->
<el-card shadow="hover" <el-card shadow="hover" class="mgb20">
class="mgb20">
<div class="page"> <div class="page">
<div class="relative"> <div class="relative">
<div class="p-title">内容设置</div> <div class="p-title">内容设置</div>
<div class="btns"> <div class="btns">
<template v-if="!sorting"> <template v-if="!sorting">
<el-button type="primary" <el-button type="primary" round @click="addChapter" v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button>
round <el-button type="primary" round @click="sort" v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button>
@click="addChapter"
v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button>
<el-button type="primary"
round
@click="sort"
v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button type="primary" <el-button type="primary" round @click="move">批量移动</el-button>
round <el-button type="primary" round @click="cancelSort">取消</el-button>
@click="move">批量移动</el-button> <el-button type="primary" round @click="saveSort">保存</el-button>
<el-button type="primary"
round
@click="cancelSort">取消</el-button>
<el-button type="primary"
round
@click="saveSort">保存</el-button>
</template> </template>
</div> </div>
</div> </div>
<el-divider></el-divider> <el-divider></el-divider>
<div class="page-content"> <div class="page-content">
<div class="mgb20" <div class="mgb20" v-for="(chapter, index) in chapters" :key="chapter.id">
v-for="(chapter,index) in chapters"
:key="chapter.id">
<div class="flex-between mgb10"> <div class="flex-between mgb10">
<div>{{ chapter.name }}</div> <div>{{ chapter.name }}</div>
<div> <div>
<template v-if="!sorting"> <template v-if="!sorting">
<el-button class="action-btn" <el-button class="action-btn" plain @click="editChapter(chapter)"
plain v-auth="'/curriculum:内容设置:修改章节名称'">修改章节名称</el-button>
@click="editChapter(chapter)" <el-button class="action-btn" plain @click="addSection(chapter.id)"
v-auth="'/curriculum:内容设置:修改章节名称'">修改章节名称</el-button> v-auth="'/curriculum:内容设置:添加小节'">添加小节</el-button>
<el-button class="action-btn" <el-button class="action-btn" plain @click="delChapter(chapter.id)"
plain v-auth="'/curriculum:内容设置:删除章节'">删除</el-button>
@click="addSection(chapter.id)"
v-auth="'/curriculum:内容设置:添加小节'">添加小节</el-button>
<el-button class="action-btn"
plain
@click="delChapter(chapter.id)"
v-auth="'/curriculum:内容设置:删除章节'">删除</el-button>
</template> </template>
<template v-else> <template v-else>
<i class="el-icon-top sort-icon" <i class="el-icon-top sort-icon" :class="{ disabled: index == 0 }" style="margin-right: 5px"
:class="{disabled: index == 0}" @click="sortChapter(chapter, 'up', index == 0, index)"></i>
style="margin-right: 5px" <i class="el-icon-bottom sort-icon" :class="{ disabled: index == chapters.length - 1 }"
@click="sortChapter(chapter,'up',index == 0,index)"></i> @click="sortChapter(chapter, 'down', index == chapter.length - 1, index)"></i>
<i class="el-icon-bottom sort-icon"
:class="{disabled: index == chapters.length-1}"
@click="sortChapter(chapter,'down',index == chapter.length-1,index)"></i>
</template> </template>
</div> </div>
</div> </div>
<el-table :data="chapter.subsectionList" <el-table :data="chapter.subsectionList" class="table" stripe header-align="center" row-key="id">
class="table" <el-table-column v-if="sorting" width="55" align="center">
stripe
header-align="center"
row-key="id">
<el-table-column v-if="sorting"
width="55"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox v-model="scope.row.check"></el-checkbox> <el-checkbox v-model="scope.row.check"></el-checkbox>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="index" <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
width="100" <el-table-column prop="name" label="资源名称">
label="序号"
align="center"></el-table-column>
<el-table-column prop="name"
label="资源名称">
</el-table-column> </el-table-column>
<el-table-column prop="fileType" <el-table-column prop="fileType" label="资源类型" align="center">
label="资源类型"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ transferType(scope.row.fileType) }} {{ transferType(scope.row.fileType) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center" width="300">
align="center"
width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="!sorting"> <template v-if="!sorting">
<el-button type="text" <el-button type="text" @click="download(scope.row)" v-auth="'/curriculum:内容设置:下载'">下载</el-button>
@click="download(scope.row)" <el-button type="text" @click="preview(scope.row)" v-auth="'/curriculum:内容设置:查看'">查看</el-button>
v-auth="'/curriculum:内容设置:下载'">下载</el-button> <el-button type="text" @click="delSection(scope.row)"
<el-button type="text" v-auth="'/curriculum:内容设置:删除小节'">删除</el-button>
@click="preview(scope.row)" <el-button type="text" @click="editSectionName(scope.row, chapter.id)"
v-auth="'/curriculum:内容设置:查看'">查看</el-button> v-auth="'/curriculum:内容设置:修改小节名称'">修改小节名称</el-button>
<el-button type="text" <el-button type="text" @click="switchFile(scope.row, chapter.id)"
@click="delSection(scope.row)" v-auth="'/curriculum:内容设置:更换文件'">更换文件</el-button>
v-auth="'/curriculum:内容设置:删除小节'">删除</el-button>
<el-button type="text"
@click="editSectionName(scope.row,chapter.id)"
v-auth="'/curriculum:内容设置:修改小节名称'">修改小节名称</el-button>
<el-button type="text"
@click="switchFile(scope.row,chapter.id)"
v-auth="'/curriculum:内容设置:更换文件'">更换文件</el-button>
</template> </template>
<template v-else> <template v-else>
<i class="el-icon-top sort-icon" <i class="el-icon-top sort-icon" :class="{ disabled: scope.$index == 0 }" style="margin-right: 5px"
:class="{disabled: scope.$index == 0}" @click="sortSection(index, 'up', scope.$index == 0, scope.$index)"></i>
style="margin-right: 5px"
@click="sortSection(index,'up',scope.$index == 0,scope.$index)"></i>
<i class="el-icon-bottom sort-icon" <i class="el-icon-bottom sort-icon"
:class="{disabled: scope.$index == chapter.subsectionList.length-1}" :class="{ disabled: scope.$index == chapter.subsectionList.length - 1 }"
@click="sortSection(index,'down',scope.$index == chapter.subsectionList.length-1,scope.$index)"></i> @click="sortSection(index, 'down', scope.$index == chapter.subsectionList.length - 1, scope.$index)"></i>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'" <el-dialog :title="chapterId ? '编辑章节' : '新增章节'" :visible.sync="chapterVisible" width="540px"
:visible.sync="chapterVisible" :close-on-click-modal="false">
width="540px"
:close-on-click-modal="false">
<el-form> <el-form>
<el-form-item> <el-form-item>
<el-input placeholder="请输入章节名称,便于对小节归类" <el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input>
v-model="chapterName"
maxlength="50"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="chapterVisible = false">取消</el-button> <el-button @click="chapterVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="chapterSubmit">确定</el-button>
@click="chapterSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="添加小节" <el-dialog title="添加小节" :visible.sync="sectionVisible" width="540px" @close="closeSection"
:visible.sync="sectionVisible" :close-on-click-modal="false">
width="540px" <el-form ref="form" :model="sectionForm" label-width="80px" @submit.native.prevent>
@close="closeSection"
:close-on-click-modal="false">
<el-form ref="form"
:model="sectionForm"
label-width="80px"
@submit.native.prevent>
<el-form-item label="资源添加"> <el-form-item label="资源添加">
<Upload :max-size="100000" <Upload :max-size="100000" :file-list="uploadList" :on-remove="handleRemove"
:file-list="uploadList" @beforeUpload="beforeUpload" @onSuccess="uploadSuccess">
:on-remove="handleRemove"
@beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
<template slot="tip"> <template slot="tip">
<p>视频请上传MP4格式大小不超过150Moffice文件大小不要超过10M</p> <p>视频请上传MP4格式大小不超过150Moffice文件大小不要超过10M</p>
</template> </template>
</Upload> </Upload>
</el-form-item> </el-form-item>
<el-form-item label="小节名称"> <el-form-item label="小节名称">
<el-input placeholder="请输入小节名称" <el-input placeholder="请输入小节名称" v-model.trim="sectionForm.sectionName" maxlength="50"
v-model.trim="sectionForm.sectionName" @keyup.enter.native="sectionSubmit()"></el-input>
maxlength="50"
@keyup.enter.native="sectionSubmit()"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="sectionVisible = false">取消</el-button> <el-button @click="sectionVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="sectionSubmit">确定</el-button>
@click="sectionSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="更换文件" <el-dialog title="更换文件" :visible.sync="switchVisible" width="540px" :close-on-click-modal="false"
:visible.sync="switchVisible" @close="closeSwitch">
width="540px"
:close-on-click-modal="false"
@close="closeSwitch">
<div style="text-align: center"> <div style="text-align: center">
<Upload :max-size="100000" <Upload :max-size="100000" :file-list="uploadList" :on-remove="handleRemove" @beforeUpload="beforeUpload"
:file-list="uploadList" @onSuccess="uploadSuccess">
:on-remove="handleRemove"
@beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
<div slot="tip"></div> <div slot="tip"></div>
</Upload> </Upload>
</div> </div>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="switchVisible = false">取消</el-button> <el-button @click="switchVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="switchSubmit">确定</el-button>
@click="switchSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="修改小节名称" <el-dialog title="修改小节名称" :visible.sync="sectionNameVisible" width="540px" :close-on-click-modal="false">
:visible.sync="sectionNameVisible"
width="540px"
:close-on-click-modal="false">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-form-item> <el-form-item>
<el-input placeholder="请输入小节名称" <el-input placeholder="请输入小节名称" v-model="sectionForm.sectionName" maxlength="50"
v-model="sectionForm.sectionName" @keyup.enter.native="sectionNameSubmit()"></el-input>
maxlength="50"
@keyup.enter.native="sectionNameSubmit()"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="sectionNameVisible = false">取消</el-button> <el-button @click="sectionNameVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="sectionNameSubmit">确定</el-button>
@click="sectionNameSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<div v-show="previewImg" <div v-show="previewImg" class="el-image-viewer__wrapper" :class="{ active: previewImg }"
class="el-image-viewer__wrapper" style="z-index: 2000">
:class="{active: previewImg}"
style="z-index: 2000">
<div class="el-image-viewer__mask"></div> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" <span class="el-image-viewer__btn el-image-viewer__close" @click="previewImg = ''"><i
@click="previewImg = ''"><i class="el-icon-circle-close" class="el-icon-circle-close" style="color: #fff"></i></span>
style="color: #fff"></i></span>
<div class="el-image-viewer__canvas"> <div class="el-image-viewer__canvas">
<img :src="previewImg" <img :src="previewImg" class="el-image-viewer__img"
class="el-image-viewer__img" style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;">
style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;">
</div> </div>
</div> </div>
<div v-show="iframeSrc || videoSrc" <div v-show="iframeSrc || videoSrc" class="el-image-viewer__wrapper" :class="{ active: iframeSrc }"
class="el-image-viewer__wrapper" style="z-index: 2000">
:class="{active: iframeSrc}"
style="z-index: 2000">
<div class="el-image-viewer__mask"></div> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" <span class="el-image-viewer__btn el-image-viewer__close" :class="{ 'doc-close': isWord }"
:class="{'doc-close': isWord}" :style="{ top: isWord ? '50px' : '5px' }" @click="closeIframe"><i class="el-icon-circle-close"
:style="{top: isWord ? '50px' : '5px'}" style="color: #fff"></i></span>
@click="closeIframe"><i class="el-icon-circle-close"
style="color: #fff"></i></span>
<div class="el-image-viewer__canvas"> <div class="el-image-viewer__canvas">
<iframe v-if="iframeSrc" <iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe>
class="fileIframe" <video v-if="videoSrc" class="video" width="1200" height="600" autoplay controls>
id="fileIframe" <source :src="videoSrc" type="video/mp4">
:src="iframeSrc"
frameborder="0"></iframe>
<video v-if="videoSrc"
class="video"
width="1200"
height="600"
autoplay
controls>
<source :src="videoSrc"
type="video/mp4">
您的浏览器不支持 video 标签 您的浏览器不支持 video 标签
</video> </video>
<template v-if="showMask"> <template v-if="showMask">
<div class="mask" <div class="mask" style="width: 200px;height: 30px;top: 53px;right: 320px"></div>
style="width: 200px;height: 30px;top: 53px;right: 320px"></div> <div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
<div class="mask"
style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
</template> </template>
<template v-if="showMask1"> <template v-if="showMask1">
<div class="word-mask1" <div class="word-mask1" style="width: 200px;height: 50px;"></div>
style="width: 200px;height: 50px;"></div> <div class="word-mask" style="height: 40px;top: 48px;"></div>
<div class="word-mask" <div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
style="height: 40px;top: 48px;"></div>
<div class="word-mask2"
style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
</template> </template>
<template v-if="showMask2 && iframeSrc"> <template v-if="showMask2 && iframeSrc">
<div class="excel-mask1" <div class="excel-mask1" style="height: 48px;"></div>
style="height: 48px;"></div>
</template> </template>
</div> </div>
</div> </div>
<div v-show="playAuth" <div v-show="playAuth" class="el-image-viewer__wrapper" :class="{ active: playAuth }" style="z-index: 2000">
class="el-image-viewer__wrapper"
:class="{active: playAuth}"
style="z-index: 2000">
<div class="el-image-viewer__mask"></div> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" <span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i
@click="closePlayer"><i class="el-icon-circle-close" class="el-icon-circle-close" style="color: #fff"></i></span>
style="color: #fff"></i></span> <div class="player" id="player"></div>
<div class="player"
id="player"></div>
</div> </div>
<Pdf :visible.sync="pdfVisible" <Pdf :visible.sync="pdfVisible" :src.sync="pdfSrc" />
:src.sync="pdfSrc" />
</div> </div>
</div> </div>
</el-card> </el-card>
<div class="player-download" <div class="player-download" id="playerDownload"></div>
id="playerDownload"></div>
<el-dialog title="资源移动" <el-dialog title="资源移动" :visible.sync="moveVisible" :close-on-click-modal="false" width="330px">
:visible.sync="moveVisible"
:close-on-click-modal="false"
width="330px">
<el-form> <el-form>
<el-form-item label="目标章节"> <el-form-item label="目标章节">
<el-select v-model="moveForm.id" <el-select v-model="moveForm.id" placeholder="请选择目标章节" @change="chapterChange">
placeholder="请选择目标章节" <el-option v-for="(item, i) in chapters" :key="i" :label="item.name" :value="item.id"></el-option>
@change="chapterChange">
<el-option v-for="(item, i) in chapters"
:key="i"
:label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="目标排序"> <el-form-item label="目标排序">
<el-select v-model="moveForm.sort" <el-select v-model="moveForm.sort" placeholder="请选择目标排序">
placeholder="请选择目标排序"> <el-option v-for="(item, i) in sortList" :key="i" :label="item.name" :value="item.id"></el-option>
<el-option v-for="(item, i) in sortList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="moveVisible = false">取消</el-button> <el-button @click="moveVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="moveConfirm">确定</el-button>
@click="moveConfirm">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -753,7 +625,7 @@ export default {
const { fileType, fileId } = row const { fileType, fileId } = row
// ppt // ppt
if (fileType === 'pptx') { if (fileType === 'pptx') {
this.downloadFile(row.name, row.fileUrl) this.downloadFile(row.originalFileName || row.name, row.fileUrl)
} else if (fileId) { } else if (fileId) {
// //
this.$get(`${this.api.getPlayAuth}/${fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${fileId}`).then(res => {
@ -949,172 +821,177 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.page-content { .page-content {
max-height: calc(100vh - 420px); max-height: calc(100vh - 420px);
overflow: auto; overflow: auto;
} }
.action-btn { .action-btn {
color: #9076ff; color: #9076ff;
font-size: 14px; font-size: 14px;
border: #9076ff 1px solid; border: #9076ff 1px solid;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
} }
.btns { .btns {
position: absolute; position: absolute;
top: 12px; top: 12px;
right: 24px; right: 24px;
.el-button { .el-button {
font-size: 14px; font-size: 14px;
} }
} }
.sort-icon { .sort-icon {
font-size: 24px; font-size: 24px;
cursor: pointer; cursor: pointer;
&.disabled { &.disabled {
color: #ccc; color: #ccc;
cursor: not-allowed; cursor: not-allowed;
} }
} }
/deep/.el-progress-bar { /deep/.el-progress-bar {
padding-right: 70px; padding-right: 70px;
margin-right: -70px; margin-right: -70px;
} }
.el-upload__tip { .el-upload__tip {
position: absolute; position: absolute;
top: -4px; top: -4px;
right: 0; right: 0;
width: 300px; width: 300px;
line-height: 1.4; line-height: 1.4;
} }
.el-image-viewer__wrapper { .el-image-viewer__wrapper {
transform: translateY(-10px); transform: translateY(-10px);
transition: transform 0.5s; transition: transform 0.5s;
&.active { &.active {
transform: translateY(0); transform: translateY(0);
} }
} }
.el-image-viewer__close { .el-image-viewer__close {
z-index: 10000; z-index: 10000;
top: 15px; top: 15px;
right: 15px; right: 15px;
&.doc-close { &.doc-close {
i { i {
color: #000 !important; color: #000 !important;
}
} }
}
} }
.player { .player {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 1200px !important; width: 1200px !important;
height: 600px !important; height: 600px !important;
} }
.player-download { .player-download {
position: absolute; position: absolute;
top: -9999px; top: -9999px;
} }
.fileIframe { .fileIframe {
z-index: 1; z-index: 1;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.mask { .mask {
z-index: 1000; z-index: 1000;
position: fixed; position: fixed;
background-color: rgb(57, 58, 61); background-color: rgb(57, 58, 61);
} }
.word-mask { .word-mask {
z-index: 1000; z-index: 1000;
position: fixed; position: fixed;
right: 0; right: 0;
width: 100%; width: 100%;
background-color: rgb(243, 242, 241); background-color: rgb(243, 242, 241);
} }
.word-mask1 { .word-mask1 {
z-index: 1000; z-index: 1000;
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; right: 0;
background-color: #2b579a; background-color: #2b579a;
} }
.word-mask2 { .word-mask2 {
z-index: 1000; z-index: 1000;
position: fixed; position: fixed;
background-color: transparent; background-color: transparent;
} }
.excel-mask1 { .excel-mask1 {
z-index: 9; z-index: 9;
position: absolute; position: absolute;
top: 0; top: 0;
left: 20%; left: 20%;
width: 80%; width: 80%;
background-color: #107c41; background-color: #107c41;
} }
.page { .page {
position: relative; position: relative;
padding: 24px; padding: 24px;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
.tool { .tool {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 24px; margin-bottom: 24px;
.filter { .filter {
display: inline-flex; display: inline-flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
flex: 1; flex: 1;
li { li {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
margin-right: 30px; margin-right: 30px;
label { label {
margin-right: 6px; margin-right: 6px;
font-size: 14px; font-size: 14px;
line-height: 14px; line-height: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
white-space: nowrap; white-space: nowrap;
}
}
} }
}
}
&.mul { &.mul {
margin-bottom: 0; margin-bottom: 0;
.filter { .filter {
width: 1200px; width: 1200px;
li { li {
margin-bottom: 24px; margin-bottom: 24px;
}
}
} }
}
} }
}
} }
</style> </style>

@ -401,8 +401,8 @@ export default {
customerId: "", customerId: "",
customerName: '', customerName: '',
countries: '中国', countries: '中国',
industryClassId: '', industryClassId: 16,
industryId: '', industryId: 83,
provinceId: '', provinceId: '',
account: '', account: '',
name: '', name: '',
@ -677,6 +677,7 @@ export default {
this.getSchool() this.getSchool()
}).catch((res) => { }) }).catch((res) => { })
} else { } else {
this.changIndustryData()
this.getSchool() this.getSchool()
} }
}, },
@ -894,7 +895,7 @@ export default {
this.customerVisible = false this.customerVisible = false
this.$message.success('添加成功') this.$message.success('添加成功')
this.getCustomer() this.getCustomer()
this.getSchool(res.schoolId || '') this.getSchool(!this.customerId ? res.schoolId || '' : '') //
}, },
// //
getCategory () { getCategory () {

@ -1,7 +1,6 @@
<template> <template>
<div> <div>
<el-card shadow="hover" <el-card shadow="hover" class="mgb20">
class="mgb20">
<div> <div>
<div class="flex-center mgb20"> <div class="flex-center mgb20">
<p class="hr_tag"></p> <p class="hr_tag"></p>
@ -11,64 +10,42 @@
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="省份"> <el-form-item label="省份">
<el-select v-model="form.provinceId" <el-select v-model="form.provinceId" clearable placeholder="请选择省份" @change="getCity()"
clearable @clear="clearprovince()">
placeholder="请选择省份" <el-option v-for="(item, index) in provinceList" :key="index" :label="item.provinceName"
@change="getCity()" :value="item.provinceId"></el-option>
@clear="clearprovince()">
<el-option v-for="(item,index) in provinceList"
:key="index"
:label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="城市"> <el-form-item label="城市">
<el-select v-model="form.cityId" <el-select v-model="form.cityId" clearable placeholder="请选择城市"
clearable :disabled="form.provinceId ? false : true" @change="getData()">
placeholder="请选择城市" <el-option v-for="(item, index) in cityList" :key="index" :label="item.cityName"
:disabled="form.provinceId ? false : true" :value="item.cityId"></el-option>
@change="getData()">
<el-option v-for="(item,index) in cityList"
:key="index"
:label="item.cityName"
:value="item.cityId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="订单类型"> <el-form-item label="订单类型">
<el-select v-model="form.orderType" <el-select v-model="form.orderType" clearable placeholder="请选择订单类型" @change="getData()">
clearable <el-option v-for="(item, index) in orderTypeList" :key="index" :label="item.name"
placeholder="请选择订单类型" :value="item.value"></el-option>
@change="getData()">
<el-option v-for="(item,index) in orderTypeList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="订单状态"> <el-form-item label="订单状态">
<el-select v-model="form.orderStatus" <el-select v-model="form.orderStatus" clearable placeholder="请选择订单状态" @change="getData()">
clearable <el-option v-for="(item, index) in orderStatusList" :key="index" :label="item.name"
placeholder="请选择订单状态" :value="item.value"></el-option>
@change="getData()">
<el-option v-for="(item,index) in orderStatusList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入订单号/客户名称/订单名称" <el-input placeholder="请输入订单号/客户名称/订单名称" prefix-icon="el-icon-search" v-model="form.customerName"
prefix-icon="el-icon-search" clearable></el-input>
v-model="form.customerName"
clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -76,104 +53,56 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" <el-card shadow="hover" class="card">
class="card">
<div class="flex-between mgb20"> <div class="flex-between mgb20">
<div class="flex-center"> <div class="flex-center">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>订单列表</span> <span>订单列表</span>
</div> </div>
<div> <div>
<el-button type="primary" <el-button type="primary" round @click="addOrder" v-auth>新建订单</el-button>
round <el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
@click="addOrder"
v-auth>新建订单</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="orderData" <el-table :data="orderData" class="table" ref="table" stripe header-align="center"
class="table" @selection-change="handleSelectionChange" row-key="orderId">
ref="table" <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
stripe <el-table-column type="index" width="100" label="序号" align="center">
header-align="center"
@selection-change="handleSelectionChange"
row-key="orderId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderNumber" <el-table-column prop="orderNumber" label="订单编号" align="center">
label="订单编号"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="customerName" <el-table-column prop="customerName" label="客户名称" align="center">
label="客户名称"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderContent" <el-table-column prop="orderContent" label="订单内容" align="center" show-overflow-tooltip></el-table-column>
label="订单内容" <el-table-column prop="orderAmount" label="订单金额(元)" align="center">
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="orderAmount"
label="订单金额(元)"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.orderType === '试用' ? 0 : scope.row.orderAmount }} {{ scope.row.orderType === '试用' ? 0 : scope.row.orderAmount }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" <el-table-column prop="createTime" label="订单日期" align="center">
label="订单日期"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderType" <el-table-column prop="orderType" label="订单类型" align="center">
label="订单类型"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderStatus" <el-table-column prop="orderStatus" label="订单状态" align="center">
label="订单状态"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderNature" <el-table-column prop="orderNature" label="订单性质" align="center">
label="订单性质"
align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center">
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" v-if="scope.row.isDel !== 1" @click="handle('edit', scope.row)" v-auth="'/order:修改'">
v-if="scope.row.isDel!==1"
@click="handle('edit',scope.row)"
v-auth="'/order:修改'">
{{ scope.row.orderStatus === "已完成" ? "修改" : "处理" }} {{ scope.row.orderStatus === "已完成" ? "修改" : "处理" }}
</el-button> </el-button>
<el-button type="text" <el-button type="text" @click="handle('watch', scope.row)" v-auth>查看</el-button>
@click="handle('watch',scope.row)" <el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
v-auth>查看</el-button> <el-button type="text" v-if="scope.row.orderStatus === '已完成' && scope.row.isDel !== 1"
<el-button type="text" @click="handle('renew', scope.row)" v-auth>续费
@click="handleDelete(scope.row)"
v-auth>删除</el-button>
<el-button type="text"
v-if="scope.row.orderStatus==='已完成'&&scope.row.isDel!==1"
@click="handle('renew',scope.row)"
v-auth>续费
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange"
layout="total, prev, pager, next" :current-page="page" :total="totals">
@current-change="handleCurrentChange"
:current-page="page"
:total="totals">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -402,33 +331,35 @@ export default {
<style scoped> <style scoped>
.card { .card {
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
} }
.mag { .mag {
margin-right: 20px; margin-right: 20px;
} }
.cell { .cell {
white-space: pre-wrap; white-space: pre-wrap;
width: 140px; width: 140px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.tags { .tags {
border: none; border: none;
background: none; background: none;
color: #000; color: #000;
white-space: pre-wrap; white-space: pre-wrap;
width: 140px; width: 140px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
</style> </style>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save