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>
<div id="app">
<router-view></router-view>
</div>
<div id="app">
<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>
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App',
created () {
//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))
})
}
import Setting from '@/setting'
export default {
name: 'App',
data () {
return {
Setting,
ip: localStorage.getItem('nakadaiIp') ? +localStorage.getItem('nakadaiIp') : 0,
};
},
created () {
//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>
<style>
@import "./assets/css/main.css";
/* @import "./assets/css/color-dark.css"; */
/*深色主题*/
@import "./assets/css/theme-green/color-green.css";
/* 浅绿色主题 */
@import "./assets/css/main.css";
/* @import "./assets/css/color-dark.css"; */
/*深色主题*/
@import "./assets/css/theme-green/color-green.css";
/* 浅绿色主题 */
</style>

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

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

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

@ -3,12 +3,12 @@ import { Loading } from 'element-ui'
export default {
//skin:'oxide-dark',
language:'zh_CN',
language: 'zh_CN',
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',
toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
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 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 | \
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: [
//新增 首行缩进与行高 配置
{
@ -21,40 +21,40 @@ export default {
{
title: '行高',
items: [{
title: '1',
styles: {
'line-height': '1'
},
inline: 'span'
title: '1',
styles: {
'line-height': '1'
},
{
title: '1.5',
styles: {
'line-height': '1.5'
},
inline: 'span'
inline: 'span'
},
{
title: '1.5',
styles: {
'line-height': '1.5'
},
{
title: '2',
styles: {
'line-height': '2'
},
inline: 'span'
inline: 'span'
},
{
title: '2',
styles: {
'line-height': '2'
},
{
title: '2.5',
styles: {
'line-height': '2.5'
},
inline: 'span'
inline: 'span'
},
{
title: '2.5',
styles: {
'line-height': '2.5'
},
{
title: '3',
styles: {
'line-height': '3'
},
inline: 'span'
}
inline: 'span'
},
{
title: '3',
styles: {
'line-height': '3'
},
inline: 'span'
}
]
},
//默认的配置
@ -187,16 +187,16 @@ export default {
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',
link_list: [
{ title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
{ title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
],
image_list: [
{ title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' },
{ title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' }
{ title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' },
{ title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' }
],
image_class_list: [
{ title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' }
{ title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' }
],
//为内容模板插件提供预置模板
templates: [],
@ -206,7 +206,7 @@ export default {
// template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]',
// template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]',
// autosave_ask_before_unload: false,
toolbar_mode : 'wrap',
toolbar_mode: 'wrap',
// automatic_uploads: true,
// images_upload_base_path: '/demo',
// images_upload_url: 'http://10.10.11.7:10000/iasf/sysFiles/upload',
@ -214,25 +214,25 @@ export default {
powerpaste_allow_local_images: true,
powerpaste_word_import: 'clean',
powerpaste_html_import: 'clean',
urlconverter_callback: (url, node, onSave, name) => {
if (node === 'img' && url.startsWith('blob:')) {
// Do some custom URL conversion
tinymce.activeEditor && tinymce.activeEditor.uploadImages()
}
// Return new URL
return url
},
urlconverter_callback: (url, node, onSave, name) => {
if (node === 'img' && url.startsWith('blob:')) {
// Do some custom URL conversion
tinymce.activeEditor && tinymce.activeEditor.uploadImages()
}
// Return new URL
return url
},
// 自定义上传
images_upload_handler: function (blobInfo, succFun, failFun) {
const blob = blobInfo.blob()
// blob转换为file
const file = new File([blob], blobInfo.filename(), {
type: 'application/json',
lastModified: Date.now()
});
Oss.upload(file).then(res => {
succFun(res.url)
})
const blob = blobInfo.blob()
// blob转换为file
const file = new File([blob], blobInfo.filename(), {
type: 'application/json',
lastModified: Date.now()
});
Oss.upload(file).then(res => {
succFun(res.url)
})
},
//自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发
file_picker_callback: function (callback, value, meta) {
@ -248,23 +248,23 @@ export default {
let input = document.createElement('input');//创建一个隐藏的input
input.setAttribute('type', 'file');
input.setAttribute("accept", ".mp4");
input.onchange = function(){
input.onchange = function () {
let file = this.files[0];
const load = Loading.service()
Oss.upload(file).then(res => {
load.close()
callback(res.url)
}).catch(e => {
load.close()
})
Oss.upload(file).then(res => {
load.close()
callback(res.url)
}).catch(e => {
load.close()
})
}
//触发点击
input.click();
}
},
// 初始化事件
setup: function(editor) {
editor.on('init', function(ed) {
setup: function (editor) {
editor.on('init', function (ed) {
// 设置默认字体
ed.target.editorCommands.execCommand("fontName", false, "PingFang SC")
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 => {
let token = sessionStorage.getItem('token')
if(token){
config.headers.token = token
}
let schoolId = store.state.schoolId
if(schoolId) config.headers.schoolId = store.state.schoolId
return config;
let token = sessionStorage.getItem('token')
if (token) {
config.headers.token = token
}
let schoolId = store.state.schoolId
if (schoolId) config.headers.schoolId = store.state.schoolId
return config;
}, err => {
Message.error({
message: '退出登陆',
onClose: function () {
router.push({name: 'login'});
}
})
return Promise.reject(err);
Message.error({
message: '退出登陆',
onClose: function () {
router.push({ name: 'login' });
}
})
return Promise.reject(err);
})
let logouted = 0;
// 响应拦截器
axios.interceptors.response.use(
response => {
if (response.status === 200) {
const { status } = response.data
if (status) {
// 接口定义的非正常返回的时候,应当处于报错状态
if (status === 10020) {
// 该状态为用户列表启用用户的接口返回的状态,特殊处理
return Promise.reject(response)
} else if (status !== 200) {
Message.error(response.data.message)
return Promise.reject(response)
} else {
return Promise.resolve(response)
}
} else {
return Promise.resolve(response)
}
response => {
if (response.status === 200) {
const { status, code, msg } = response.data
if (status) {
// 接口定义的非正常返回的时候,应当处于报错状态
if (status === 10020) {
// 该状态为用户列表启用用户的接口返回的状态,特殊处理
return Promise.reject(response)
} else if (status !== 200) {
Message.error(response.data.message)
return Promise.reject(response)
} else {
Message.error(response.message,'res');
return Promise.reject(response);
return Promise.resolve(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);
} else if (code === 401) {
// 账号互踢
if (!logouted) {
sessionStorage.removeItem('token')
Message.error(msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
})
logouted = 0
}, 1500)
logouted = 1
}
} 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(){
store.replaceState({})
localStorage.clear()
sessionStorage.clear()
location.reload()
function logouts () {
store.replaceState({})
localStorage.clear()
sessionStorage.clear()
location.reload()
}
let tokenStatus = {
0: '用户未登录,请登录后操作!',
1: 'token错误,请重新登录!'
0: '用户未登录,请登录后操作!',
1: 'token错误,请重新登录!'
}
/**
* get方法对应get请求
*/
export function get(url, params){
return new Promise((resolve, reject) =>{
axios.get(url, {
params: params
})
.then(res => {
resolve(res.data)
})
.catch(err => {
reject(err.data)
})
});
export function get (url, params) {
return new Promise((resolve, reject) => {
axios.get(url, {
params: params
})
.then(res => {
resolve(res.data)
})
.catch(err => {
reject(err.data)
})
});
}
/**
* post方法对应post请求
*/
export function post(url, params, config) {
return new Promise((resolve, reject) => {
axios.post(url,params, config)
.then(res => {
return resolve(res.data);
})
.catch(err => {
return reject(err.data)
})
});
export function post (url, params, config) {
return new Promise((resolve, reject) => {
axios.post(url, params, config)
.then(res => {
return resolve(res.data);
})
.catch(err => {
return reject(err.data)
})
});
}
/**
* delete方法对应delete请求
*/
export function del(url, params){
return new Promise((resolve, reject) =>{
axios.delete(url, {
params: params
})
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data)
})
});
export function del (url, params) {
return new Promise((resolve, reject) => {
axios.delete(url, {
params: params
})
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data)
})
});
}
/**
@ -180,14 +196,14 @@ export function post(url, params, config) {
* @param {} url
* @param {*} params
*/
export function put(url, params){
return new Promise((resolve, reject) =>{
axios.put(url, params)
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data)
})
});
export function put (url, params) {
return new Promise((resolve, reject) => {
axios.put(url, params)
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data)
})
});
}

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

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

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

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