添加markdown等

dev_review
yujialong 1 year ago
parent b4765b92fb
commit 1b9a21d642
  1. 31
      package-lock.json
  2. 2
      package.json
  3. BIN
      src/assets/img/mini.jpg
  4. 139
      src/components/quill/index.vue
  5. 2
      src/setting.js
  6. 437
      src/views/course/contentSettings.vue
  7. 2
      src/views/shop/addProduct/index.vue

31
package-lock.json generated

@ -3474,6 +3474,11 @@
"integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==", "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==",
"dev": true "dev": true
}, },
"cssfilter": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz",
"integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw=="
},
"cssnano": { "cssnano": {
"version": "4.1.10", "version": "4.1.10",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz",
@ -6680,12 +6685,8 @@
"highlight.js": { "highlight.js": {
"version": "9.16.2", "version": "9.16.2",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.16.2.tgz", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.16.2.tgz",
"integrity": "sha512-feMUrVLZvjy0oC7FVJQcSQRqbBq9kwqnYE4+Kj9ZjbHh3g+BisiPgF49NyQbVLNdrL/qqZr3Ca9yOKwgn2i/tw==" "integrity": "sha512-feMUrVLZvjy0oC7FVJQcSQRqbBq9kwqnYE4+Kj9ZjbHh3g+BisiPgF49NyQbVLNdrL/qqZr3Ca9yOKwgn2i/tw==",
}, "dev": true
"highlight.js-async-webpack": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/highlight.js-async-webpack/-/highlight.js-async-webpack-1.0.4.tgz",
"integrity": "sha1-wGtnv5nwSQRdYrdW5YVbCRLsYWw="
}, },
"hmac-drbg": { "hmac-drbg": {
"version": "1.0.1", "version": "1.0.1",
@ -8086,12 +8087,11 @@
} }
}, },
"mavon-editor": { "mavon-editor": {
"version": "2.7.7", "version": "2.10.4",
"resolved": "https://registry.npmjs.org/mavon-editor/-/mavon-editor-2.7.7.tgz", "resolved": "https://registry.npmjs.org/mavon-editor/-/mavon-editor-2.10.4.tgz",
"integrity": "sha512-lXnYe+dztKepbv8bi2nedRqG/AwyUDF8gmkv9lHD3fpVJ1+pzAS6YILRIryKCvO9qPIOPEThHsda2DxtlzRsZA==", "integrity": "sha512-CFsBLkgt/KZBDg+SJYe2fyYv4zClY149PiwpH0rDAiiP4ae1XNs0GC8nBsoTeipsHcebDLN1QMkt3bUsnMDjQw==",
"requires": { "requires": {
"highlight.js": "^9.11.0", "xss": "^1.0.6"
"highlight.js-async-webpack": "^1.0.4"
} }
}, },
"md5.js": { "md5.js": {
@ -13455,6 +13455,15 @@
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
} }
}, },
"xss": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz",
"integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==",
"requires": {
"commander": "^2.20.3",
"cssfilter": "0.0.10"
}
},
"xtend": { "xtend": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",

@ -19,7 +19,7 @@
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"image-conversion": "^2.1.1", "image-conversion": "^2.1.1",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"mavon-editor": "^2.6.17", "mavon-editor": "^2.10.4",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"px2rem-loader": "^0.1.9", "px2rem-loader": "^0.1.9",
"qs": "^6.11.2", "qs": "^6.11.2",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 81 KiB

@ -1,26 +1,53 @@
<template> <template>
<div class="quill" ref="quill" :class="classes"> <div>
<div ref="editor" :style="styles" v-loading="loading"></div> <el-radio-group class="type-radio"
<el-upload v-model="type"
:headers="headers" @change="typeChange">
<el-radio :label="0">富文本</el-radio>
<el-radio :label="1">markdown</el-radio>
</el-radio-group>
<div v-show="!type"
class="quill"
ref="quill"
:class="classes">
<div ref="editor"
:style="styles"
v-loading="loading"></div>
<el-upload :headers="headers"
:action="this.api.fileupload" :action="this.api.fileupload"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:on-success="editorUploadSuccess" :on-success="editorUploadSuccess"
style="display: none"> style="display: none">
<el-button class="editorUpload" type="primary">点击上传</el-button> <el-button class="editorUpload"
type="primary">点击上传</el-button>
</el-upload> </el-upload>
</div> </div>
<mavon-editor class="md"
v-model="mdVal"
v-show="type"
ref="md"
:ishljs="true"
@change="mdChange"
@imgAdd="imgAdd" />
</div>
</template> </template>
<script> <script>
import Quill from 'quill'; import Quill from 'quill';
import 'quill/dist/quill.core.css'; import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css'; import 'quill/dist/quill.bubble.css';
import toolbarOptions from './options' import toolbarOptions from './options'
import axios from 'axios'
import { mavonEditor } from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
export default { export default {
name: 'quill', name: 'quill',
components: {
mavonEditor
},
props: { props: {
value: { value: {
type: String, type: String,
@ -28,15 +55,15 @@
}, },
readonly: { readonly: {
type: Boolean, type: Boolean,
default:false default: false
}, },
toTop: { toTop: {
type: Boolean, type: Boolean,
default:true default: true
}, },
border: { border: {
type: Boolean, type: Boolean,
default:false default: false
}, },
height: { height: {
type: Number type: Number
@ -48,8 +75,8 @@
* 原本的readOnly失效,对比其他项目发现是quill版本不同导致 * 原本的readOnly失效,对比其他项目发现是quill版本不同导致
* 使用props传入elseRead = 'true'手动隐藏工具栏 * 使用props传入elseRead = 'true'手动隐藏工具栏
*/ */
elseRead:{ elseRead: {
type:String,default:'false' type: String, default: 'false'
} }
}, },
data () { data () {
@ -57,6 +84,8 @@
headers: { headers: {
token: sessionStorage.getItem('token') token: sessionStorage.getItem('token')
}, },
type: 0,
mdVal: '',
Quill: null, Quill: null,
currentValue: '', currentValue: '',
options: { options: {
@ -107,22 +136,23 @@
watch: { watch: {
value: { value: {
handler (val) { handler (val) {
if (!this.type) {
if (val !== this.currentValue) { if (val !== this.currentValue) {
this.currentValue = val; this.currentValue = val;
if (this.Quill) { if (this.Quill) {
this.Quill.pasteHTML(this.value); this.Quill.pasteHTML(this.value);
} }
} }
if (!this.mdVal) this.mdVal = val
}
}, },
immediate: true immediate: true
} }
}, },
created(){
},
mounted () { mounted () {
this.init(); this.init();
// //
if(this.elseRead==='true'){ if (this.elseRead === 'true') {
let children = this.$refs.quill.children[0].style let children = this.$refs.quill.children[0].style
children.padding = '0' children.padding = '0'
children.overflow = 'hidden' children.overflow = 'hidden'
@ -135,6 +165,11 @@
this.Quill = null; this.Quill = null;
}, },
methods: { methods: {
//
typeChange (val) {
if (!this.mdVal) this.mdVal = this.value
},
init () { init () {
const editor = this.$refs.editor; const editor = this.$refs.editor;
// //
@ -142,9 +177,9 @@
const ins = this.Quill const ins = this.Quill
// //
ins.pasteHTML(this.currentValue); ins.pasteHTML(this.currentValue);
if(this.toTop){ if (this.toTop) {
this.$nextTick(() => { this.$nextTick(() => {
window.scrollTo(0,0) window.scrollTo(0, 0)
}) })
} }
// //
@ -191,14 +226,15 @@
// //
ins.setSelection(range.index + 1) ins.setSelection(range.index + 1)
} }
}).catch(res => {}) }).catch(res => { })
}); });
} }
}, false) }, false)
}, },
beforeUpload(file){ beforeUpload (file) {
this.loading = true this.loading = true
}, },
// quill
editorUploadSuccess (res) { editorUploadSuccess (res) {
// //
let quill = this.Quill let quill = this.Quill
@ -206,9 +242,9 @@
if (res.data.filesResult.fileUrl) { if (res.data.filesResult.fileUrl) {
// //
let lengths; let lengths;
if ( quill.getSelection() == null){ if (quill.getSelection() == null) {
lengths = 1 lengths = 1
}else{ } else {
lengths = quill.getSelection().index; lengths = quill.getSelection().index;
} }
// res // res
@ -220,28 +256,55 @@
} }
this.loading = false this.loading = false
}, },
//
mdChange (val) {
this.$emit('input', val)
},
// markdown
imgAdd (pos, $file) {
let $vm = this.$refs.md
// ..
const formData = new FormData();
formData.append('file', $file);
axios({
url: this.api.fileupload,
method: 'post',
data: formData,
headers: {
token: this.token,
'Content-Type': 'multipart/form-data'
},
}).then((res) => {
$vm.$img2Url(pos, res.data.data.filesResult.fileUrl);
})
},
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.quill-no-border{ .type-radio {
.ql-toolbar.ql-snow{ margin-bottom: 20px;
}
.quill-no-border {
.ql-toolbar.ql-snow {
border: none; border: none;
border-bottom: 1px solid #e8eaec; border-bottom: 1px solid #e8eaec;
} }
.ql-container.ql-snow{ .ql-container.ql-snow {
border: none; 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 { .ql-tooltip {
position: absolute !important; position: absolute !important;
@ -249,5 +312,11 @@
left: -100px !important; left: -100px !important;
transform: translateY(10px); transform: translateY(10px);
} }
} }
.md {
max-height: 300px;
}
/deep/.v-note-wrapper .v-note-panel {
min-height: 200px;
}
</style> </style>

@ -11,7 +11,7 @@ if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = 'http://192.168.31.217:9000/'// 榕 // host = 'http://192.168.31.217:9000/'// 榕
// host = 'http://192.168.31.51:9000/'// 赓 // host = 'http://192.168.31.51:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'

@ -1,94 +1,167 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
class="mgb20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" :content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header> <el-page-header @back="goBack"
:content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header>
</div> </div>
</el-card> </el-card>
<!--内容设置--> <!--内容设置-->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
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" round @click="addChapter" v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button> <el-button type="primary"
<el-button type="primary" round @click="sort" v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button> round
@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" round @click="move">批量移动</el-button> <el-button type="primary"
<el-button type="primary" round @click="cancelSort">取消</el-button> round
<el-button type="primary" round @click="saveSort">保存</el-button> @click="move">批量移动</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" 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 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" plain @click="editChapter(chapter)" v-auth="'/curriculum:内容设置:修改章节名称'">修改章节名称</el-button> <el-button class="action-btn"
<el-button class="action-btn" plain @click="addSection(chapter.id)" v-auth="'/curriculum:内容设置:添加小节'">添加小节</el-button> plain
<el-button class="action-btn" plain @click="delChapter(chapter.id)" v-auth="'/curriculum:内容设置:删除章节'">删除</el-button> @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>
<template v-else> <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-top sort-icon"
<i class="el-icon-bottom sort-icon" :class="{disabled: index == chapters.length-1}" @click="sortChapter(chapter,'down',index == chapter.length-1,index)"></i> :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> </template>
</div> </div>
</div> </div>
<el-table :data="chapter.subsectionList" class="table" stripe header-align="center" row-key="id"> <el-table :data="chapter.subsectionList"
<el-table-column v-if="sorting" width="55" align="center"> class="table"
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" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index"
<el-table-column prop="name" label="资源名称"> width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="name"
label="资源名称">
</el-table-column> </el-table-column>
<el-table-column prop="fileType" label="资源类型" align="center"> <el-table-column prop="fileType"
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="操作" align="center" width="300"> <el-table-column label="操作"
align="center"
width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="!sorting"> <template v-if="!sorting">
<el-button type="text" @click="download(scope.row)" v-auth="'/curriculum:内容设置:下载'">下载</el-button> <el-button type="text"
<el-button type="text" @click="preview(scope.row)" v-auth="'/curriculum:内容设置:查看'">查看</el-button> @click="download(scope.row)"
<el-button type="text" @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"
<el-button type="text" @click="switchFile(scope.row,chapter.id)" v-auth="'/curriculum:内容设置:更换文件'">更换文件</el-button> @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>
<template v-else> <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"
<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 == 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>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </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>
<el-form-item> <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-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="chapterVisible = false">取消</el-button> <el-button @click="chapterVisible = false">取消</el-button>
<el-button type="primary" @click="chapterSubmit">确定</el-button> <el-button type="primary"
@click="chapterSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="添加小节" :visible.sync="sectionVisible" width="540px" @close="closeSection" :close-on-click-modal="false"> <el-dialog title="添加小节1"
<el-form label-width="80px"> :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="资源添加"> <el-form-item label="资源添加">
<el-upload <el-upload :before-upload="beforeUpload"
:before-upload="beforeUpload"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-error="uploadError" :on-error="uploadError"
:before-remove="beforeRemove" :before-remove="beforeRemove"
@ -98,27 +171,38 @@
:file-list="uploadList" :file-list="uploadList"
:headers="headers" :headers="headers"
:http-request="handleRequest" :http-request="handleRequest"
name="file" name="file">
> <el-button size="small"><img src="@/assets/img/upload.png"
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> alt=""> 上传资源</el-button>
<div slot="tip" class="el-upload__tip">视频请上传MP4格式大小不超过30Moffice文件大小不要超过10M</div> <div slot="tip"
class="el-upload__tip">视频请上传MP4格式大小不超过30Moffice文件大小不要超过10M</div>
</el-upload> </el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress> <el-progress v-if="showProgress"
:stroke-width="3"
:percentage="progressPercent"></el-progress>
</el-form-item> </el-form-item>
<el-form-item label="小节名称"> <el-form-item label="小节名称">
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> <el-input placeholder="请输入小节名称"
v-model.trim="sectionForm.sectionName"
maxlength="50"
@keyup.enter.native="sectionSubmit()"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="sectionVisible = false">取消</el-button> <el-button @click="sectionVisible = false">取消</el-button>
<el-button type="primary" @click="sectionSubmit">确定</el-button> <el-button type="primary"
@click="sectionSubmit">确定</el-button>
</span> </span>
</el-dialog> </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"> <div style="text-align: center">
<el-upload <el-upload :before-upload="beforeUpload"
:before-upload="beforeUpload"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-error="uploadError" :on-error="uploadError"
:before-remove="beforeRemove" :before-remove="beforeRemove"
@ -128,84 +212,142 @@
:file-list="uploadList" :file-list="uploadList"
:headers="headers" :headers="headers"
:http-request="handleRequest" :http-request="handleRequest"
name="file" name="file">
> <el-button size="small"><img src="@/assets/img/upload.png"
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> alt=""> 上传资源</el-button>
</el-upload> </el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress> <el-progress v-if="showProgress"
:stroke-width="3"
:percentage="progressPercent"></el-progress>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="switchVisible = false">取消</el-button> <el-button @click="switchVisible = false">取消</el-button>
<el-button type="primary" @click="switchSubmit">确定</el-button> <el-button type="primary"
@click="switchSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="修改小节名称" :visible.sync="sectionNameVisible" width="540px" :close-on-click-modal="false"> <el-dialog title="修改小节名称"
<el-form> :visible.sync="sectionNameVisible"
width="540px"
:close-on-click-modal="false">
<el-form @submit.native.prevent>
<el-form-item> <el-form-item>
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> <el-input placeholder="请输入小节名称"
v-model="sectionForm.sectionName"
maxlength="50"
@keyup.enter.native="sectionNameSubmit()"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="sectionNameVisible = false">取消</el-button> <el-button @click="sectionNameVisible = false">取消</el-button>
<el-button type="primary" @click="sectionNameSubmit">确定</el-button> <el-button type="primary"
@click="sectionNameSubmit">确定</el-button>
</span> </span>
</el-dialog> </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> <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"> <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> </div>
<div v-show="iframeSrc" class="el-image-viewer__wrapper" :class="{active: iframeSrc}" style="z-index: 2000"> <div v-show="iframeSrc"
class="el-image-viewer__wrapper"
: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" :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"> <div class="el-image-viewer__canvas">
<iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> <iframe v-if="iframeSrc"
class="fileIframe"
id="fileIframe"
:src="iframeSrc"
frameborder="0"></iframe>
<template v-if="showMask"> <template v-if="showMask">
<div class="mask" style="width: 200px;height: 30px;top: 53px;right: 320px"></div> <div class="mask"
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div> 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>
<template v-if="showMask1"> <template v-if="showMask1">
<div class="word-mask1" style="width: 200px;height: 50px;"></div> <div class="word-mask1"
<div class="word-mask" style="height: 40px;top: 48px;"></div> style="width: 200px;height: 50px;"></div>
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></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>
<template v-if="showMask2 && iframeSrc"> <template v-if="showMask2 && iframeSrc">
<div class="excel-mask1" style="height: 48px;"></div> <div class="excel-mask1"
style="height: 48px;"></div>
</template> </template>
</div> </div>
</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> <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> <span class="el-image-viewer__btn el-image-viewer__close"
<div class="player" id="player"></div> @click="closePlayer"><i class="el-icon-circle-close"
style="color: #fff"></i></span>
<div class="player"
id="player"></div>
</div> </div>
<pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf> <pdf :visible.sync="pdfVisible"
:src.sync="pdfSrc"></pdf>
</div> </div>
</div> </div>
</el-card> </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>
<el-form-item label="目标章节"> <el-form-item label="目标章节">
<el-select v-model="moveForm.id" placeholder="请选择目标章节" @change="chapterChange"> <el-select v-model="moveForm.id"
<el-option v-for="(item, i) in chapters" :key="i" :label="item.name" :value="item.id"></el-option> placeholder="请选择目标章节"
@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" placeholder="请选择目标排序"> <el-select v-model="moveForm.sort"
<el-option v-for="(item, i) in sortList" :key="i" :label="item.name" :value="item.id"></el-option> placeholder="请选择目标排序">
<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" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="moveVisible = false">取消</el-button> <el-button @click="moveVisible = false">取消</el-button>
<el-button type="primary" @click="moveConfirm">确定</el-button> <el-button type="primary"
@click="moveConfirm">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -217,7 +359,7 @@ import pdf from "@/components/pdf";
import axios from 'axios' import axios from 'axios'
export default { export default {
name: "contentSettings", name: "contentSettings",
data() { data () {
return { return {
name: this.$route.query.name, name: this.$route.query.name,
headers: { headers: {
@ -238,6 +380,15 @@ export default {
sectionId: "", sectionId: "",
switchVisible: false, switchVisible: false,
sectionNameVisible: false, sectionNameVisible: false,
rules: {
sectionName: [
{ required: true, message: "请输入小节名称", trigger: "blur" }
],
},
sectionForm: {
sectionName: ''
},
fileId: "", fileId: "",
fileName: "", fileName: "",
fileUrl: "", fileUrl: "",
@ -281,7 +432,7 @@ export default {
}; };
}, },
components: { pdf }, components: { pdf },
mounted() { mounted () {
this.insertScript(); this.insertScript();
this.id && this.getData(); this.id && this.getData();
// //
@ -290,11 +441,11 @@ export default {
window.addEventListener("popstate", this.goBack, false); window.addEventListener("popstate", this.goBack, false);
} }
}, },
destroyed() { destroyed () {
window.removeEventListener("popstate", this.goBack, false); window.removeEventListener("popstate", this.goBack, false);
}, },
methods: { methods: {
getData() { getData () {
this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`) this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`)
.then(res => { .then(res => {
this.chapters = res.chapterList; this.chapters = res.chapterList;
@ -304,10 +455,10 @@ export default {
}); });
}, },
// //
handleSelectionChange(val) { handleSelectionChange (val) {
this.multipleSelection = val this.multipleSelection = val
}, },
goBack() { goBack () {
// //
if (this.previewing) { if (this.previewing) {
this.closeIframe(); this.closeIframe();
@ -333,7 +484,7 @@ export default {
} }
} }
}, },
iframeOnload() { iframeOnload () {
document.querySelector("#fileIframe").onload = e => { document.querySelector("#fileIframe").onload = e => {
if (this.isPPT) { if (this.isPPT) {
this.showMask = true; this.showMask = true;
@ -353,7 +504,7 @@ export default {
this.loadIns.close(); this.loadIns.close();
}; };
}, },
insertScript() { insertScript () {
const linkTag = document.createElement("link"); const linkTag = document.createElement("link");
linkTag.rel = "stylesheet"; linkTag.rel = "stylesheet";
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css";
@ -365,7 +516,7 @@ export default {
document.body.appendChild(scriptTag); document.body.appendChild(scriptTag);
}, },
// //
beforeUpload(file) { beforeUpload (file) {
let type = this.transferType(file.name.substring(file.name.lastIndexOf(".") + 1)); let type = this.transferType(file.name.substring(file.name.lastIndexOf(".") + 1));
// if (type != "" && type != "" && type != "pdf" && (file.size / 1024 / 1024) > 10) { // if (type != "" && type != "" && type != "pdf" && (file.size / 1024 / 1024) > 10) {
// this.$message.error("10M"); // this.$message.error("10M");
@ -377,17 +528,17 @@ export default {
// } // }
this.uploading = true; this.uploading = true;
this.originalFileName = file.name; this.originalFileName = file.name;
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf(".")); if (this.isAddSection) this.sectionForm.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1); this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
this.showProgress = true this.showProgress = true
}, },
handleExceed(files, fileList) { handleExceed (files, fileList) {
this.$message.warning( this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
// //
handleRequest(data) { handleRequest (data) {
const param = new FormData() const param = new FormData()
param.append('file', data.file) param.append('file', data.file)
const config = { const config = {
@ -414,44 +565,44 @@ export default {
this.fileName = ossFileName this.fileName = ossFileName
}) })
}, },
uploadError(err, file, fileList) { uploadError (err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}); });
}, },
beforeRemove(file, fileList) { beforeRemove (file, fileList) {
if ((file.size / 1024 / 1024) < 10) { if ((file.size / 1024 / 1024) < 10) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
} }
}, },
handleRemove(file, fileList) { handleRemove (file, fileList) {
this.uploadList = fileList; this.uploadList = fileList;
}, },
uploadSure() { uploadSure () {
this.importVisible = false; this.importVisible = false;
this.pageNo = 1; this.pageNo = 1;
this.staffGradeId = ""; this.staffGradeId = "";
this.keyword = ""; this.keyword = "";
this.getTeacher(); this.getTeacher();
}, },
transferType(ext) { transferType (ext) {
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片"; if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片";
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";
return ext; return ext;
}, },
addChapter() { addChapter () {
this.chapterName = ""; this.chapterName = "";
this.chapterId = ""; this.chapterId = "";
this.chapterVisible = true; this.chapterVisible = true;
}, },
sort() { sort () {
this.originChapters = JSON.parse(JSON.stringify(this.chapters)) this.originChapters = JSON.parse(JSON.stringify(this.chapters))
this.sorting = true; this.sorting = true;
}, },
// //
move() { move () {
const list = this.chapters const list = this.chapters
const checkList = [] const checkList = []
list.map(e => { list.map(e => {
@ -481,13 +632,13 @@ export default {
} }
}, },
// //
chapterChange(id) { chapterChange (id) {
const list = [] const list = []
// //
this.chapters.find(e => e.id === id).subsectionList.map((e, i) => { this.chapters.find(e => e.id === id).subsectionList.map((e, i) => {
list.push({ list.push({
id: i, id: i,
name: i+1 name: i + 1
}) })
}) })
// //
@ -504,7 +655,7 @@ export default {
] ]
}, },
// //
moveConfirm() { moveConfirm () {
let { id, sort } = this.moveForm let { id, sort } = this.moveForm
if (!id) return this.$message.warning('请选择目标章节') if (!id) return this.$message.warning('请选择目标章节')
if (sort === '') return this.$message.warning('请选择目标排序') if (sort === '') return this.$message.warning('请选择目标排序')
@ -527,11 +678,11 @@ export default {
}) })
this.moved = true this.moved = true
}, },
cancelSort() { cancelSort () {
this.chapters = JSON.parse(JSON.stringify(this.originChapters)) this.chapters = JSON.parse(JSON.stringify(this.originChapters))
this.sorting = false; this.sorting = false;
}, },
saveSort() { saveSort () {
this.chapters.forEach((n, k) => { this.chapters.forEach((n, k) => {
n.sort = k + 1; n.sort = k + 1;
n.subsectionList.forEach((j, i) => { n.subsectionList.forEach((j, i) => {
@ -544,14 +695,14 @@ export default {
}; };
this.$post(this.api.reorder, data).then(res => { this.$post(this.api.reorder, data).then(res => {
this.sorting = false; this.sorting = false;
}).catch(res => {}) }).catch(res => { })
}, },
editChapter(item) { editChapter (item) {
this.chapterId = item.id; this.chapterId = item.id;
this.chapterName = item.name; this.chapterName = item.name;
this.chapterVisible = true; this.chapterVisible = true;
}, },
delChapter(id) { delChapter (id) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) })
@ -565,20 +716,20 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
closeSection() { closeSection () {
this.isAddSection = false; this.isAddSection = false;
this.progressPercent = 0 this.progressPercent = 0
}, },
addSection(id) { addSection (id) {
this.chapterId = id; this.chapterId = id;
this.sectionName = ""; this.sectionForm.sectionName = "";
this.fileUrl = ""; this.fileUrl = "";
this.uploadList = []; this.uploadList = [];
this.sectionId = ""; this.sectionId = "";
this.isAddSection = true; this.isAddSection = true;
this.sectionVisible = true; this.sectionVisible = true;
}, },
chapterSubmit() { chapterSubmit () {
if (!this.chapterName) return this.$message.warning("请填写章节名称"); if (!this.chapterName) return this.$message.warning("请填写章节名称");
let data = { let data = {
cid: this.id, cid: this.id,
@ -603,15 +754,15 @@ export default {
}); });
} }
}, },
sectionSubmit() { sectionSubmit (e) {
if (!this.sectionName) return this.$message.warning("请填写小节名称"); if (!this.sectionForm.sectionName) return this.$message.warning("请填写小节名称");
if (this.uploading) return this.$message.warning("资源正在上传中,请稍候"); if (this.uploading) return this.$message.warning("资源正在上传中,请稍候");
if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源"); if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源");
let data = { let data = {
id: this.sectionId, id: this.sectionId,
cid: this.id, cid: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionName, name: this.sectionForm.sectionName,
fileId: this.fileId, fileId: this.fileId,
fileUrl: this.fileUrl, fileUrl: this.fileUrl,
fileName: this.fileName, fileName: this.fileName,
@ -624,9 +775,9 @@ export default {
this.getData(); this.getData();
}) })
.catch(err => { .catch(err => {
}); })
}, },
closeSwitch() { closeSwitch () {
this.fileId = ""; this.fileId = "";
this.fileName = ""; this.fileName = "";
this.fileType = ""; this.fileType = "";
@ -635,7 +786,7 @@ export default {
this.progressPercent = 0 this.progressPercent = 0
}, },
// //
download(row) { download (row) {
const { fileType } = row const { fileType } = row
// ppt // ppt
if (fileType === 'pptx') { if (fileType === 'pptx') {
@ -653,12 +804,12 @@ export default {
}, player => { }, player => {
this.downloadFile(row.name, player._urls[0].Url) this.downloadFile(row.name, player._urls[0].Url)
}) })
}).catch(res => {}) }).catch(res => { })
} else { } else {
this.downloadFile(row.name + '.' + row.fileType, row.fileUrl) this.downloadFile(row.name + '.' + row.fileType, row.fileUrl)
} }
}, },
preview(row) { preview (row) {
if (this.transferType(row.fileType) == "视频") { if (this.transferType(row.fileType) == "视频") {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth; this.playAuth = res.data.playAuth;
@ -712,13 +863,13 @@ export default {
}); });
} }
}, },
editSectionName(row, chapterId) { editSectionName (row, chapterId) {
this.chapterId = chapterId; this.chapterId = chapterId;
this.sectionId = row.id; this.sectionId = row.id;
this.sectionName = row.name; this.sectionForm.sectionName = row.name;
this.sectionNameVisible = true; this.sectionNameVisible = true;
}, },
switchFile(row, chapterId, sectionId) { switchFile (row, chapterId, sectionId) {
this.uploadList = []; this.uploadList = [];
this.curFile = { this.curFile = {
fileId: row.fileId, fileId: row.fileId,
@ -728,16 +879,16 @@ export default {
}; };
this.chapterId = chapterId; this.chapterId = chapterId;
this.sectionId = row.id; this.sectionId = row.id;
this.sectionName = row.sectionName; this.sectionForm.sectionName = row.sectionName;
this.switchVisible = true; this.switchVisible = true;
}, },
switchSubmitFile() { switchSubmitFile () {
let data = { let data = {
id: this.sectionId, id: this.sectionId,
cid: this.id, cid: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionName, name: this.sectionForm.sectionName,
fileId: this.fileId, fileId: this.fileId,
fileName: this.fileName, fileName: this.fileName,
fileType: this.fileType, fileType: this.fileType,
@ -752,7 +903,7 @@ export default {
.catch(err => { .catch(err => {
}); });
}, },
switchSubmit() { switchSubmit () {
if (this.uploading) return this.$message.warning("资源正在上传中,请稍候"); if (this.uploading) return this.$message.warning("资源正在上传中,请稍候");
if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源"); if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源");
if (this.transferType(this.curFile.fileType) == "视频") { if (this.transferType(this.curFile.fileType) == "视频") {
@ -770,7 +921,7 @@ export default {
}); });
} }
}, },
delSection(row) { delSection (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) })
@ -784,7 +935,7 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
sortChapter(row, type, disabled, index) { sortChapter (row, type, disabled, index) {
if (!disabled) { if (!disabled) {
if (type == "up") { if (type == "up") {
let tempItem = this.chapters.splice(index - 1, 1)[0]; let tempItem = this.chapters.splice(index - 1, 1)[0];
@ -795,7 +946,7 @@ export default {
} }
} }
}, },
sortSection(chapterIndex, type, disabled, index) { sortSection (chapterIndex, type, disabled, index) {
if (!disabled) { if (!disabled) {
this.moved = true this.moved = true
let list = this.chapters[chapterIndex].subsectionList; let list = this.chapters[chapterIndex].subsectionList;
@ -809,13 +960,13 @@ export default {
this.chapters[chapterIndex].subsectionList = list; this.chapters[chapterIndex].subsectionList = list;
} }
}, },
sectionNameSubmit() { sectionNameSubmit () {
if (!this.sectionName) return this.$message.warning("请填写小节名称"); if (!this.sectionForm.sectionName) return this.$message.warning("请填写小节名称");
let data = { let data = {
id: this.sectionId, id: this.sectionId,
cid: this.id, cid: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionName name: this.sectionForm.sectionName
}; };
this.$put(this.api.editSubsection, data).then(res => { this.$put(this.api.editSubsection, data).then(res => {
this.$message.success("修改成功"); this.$message.success("修改成功");
@ -825,11 +976,11 @@ export default {
.catch(err => { .catch(err => {
}); });
}, },
closePlayer() { closePlayer () {
this.playAuth = ""; this.playAuth = "";
this.player.pause(); this.player.pause();
}, },
closeIframe() { closeIframe () {
this.iframeSrc = ""; this.iframeSrc = "";
this.showMask = false; this.showMask = false;
this.showMask1 = false; this.showMask1 = false;
@ -845,10 +996,10 @@ export default {
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;
} }
@ -869,7 +1020,7 @@ export default {
&.disabled { &.disabled {
color: #ccc; color: #ccc;
cursor: not-allowed cursor: not-allowed;
} }
} }
/deep/.el-progress-bar { /deep/.el-progress-bar {
@ -885,10 +1036,10 @@ export default {
} }
.el-image-viewer__wrapper { .el-image-viewer__wrapper {
transform: translateY(-10px); transform: translateY(-10px);
transition: transform .5s; transition: transform 0.5s;
&.active { &.active {
transform: translateY(0) transform: translateY(0);
} }
} }
@ -991,7 +1142,7 @@ export default {
margin-right: 6px; margin-right: 6px;
font-size: 14px; font-size: 14px;
line-height: 14px; line-height: 14px;
color: rgba(0, 0, 0, .65); color: rgba(0, 0, 0, 0.65);
white-space: nowrap; white-space: nowrap;
} }
} }

@ -889,6 +889,8 @@ export default {
if (e.typeIds && e.typeIds.length) e.typeIds = e.typeIds[0] if (e.typeIds && e.typeIds.length) e.typeIds = e.typeIds[0]
e.mall.interfaceDiagrams = e.mall.interfaceDiagram ? e.mall.interfaceDiagram.split(',') : [] e.mall.interfaceDiagrams = e.mall.interfaceDiagram ? e.mall.interfaceDiagram.split(',') : []
e.mallAnnex.forEach(e => e.name = e.fileName) e.mallAnnex.forEach(e => e.name = e.fileName)
if (e.systemId && e.systemId.split(',').filter(e => e != 12 && e != 13).length) this.isPython = true // python
if (!e.mall.themeId) e.mall.themeId = ''
if (e.mall.appletIcon) this.appletList = [ if (e.mall.appletIcon) this.appletList = [
{ {
name: e.mall.appletIcon, name: e.mall.appletIcon,

Loading…
Cancel
Save