Commit ac0b9a4c authored by liujiangnan's avatar liujiangnan

feat

parent e83ebf3a
......@@ -22,6 +22,7 @@ body{
height: calc(100vh - 30px);
display: flex;
gap: 15px;
position: relative;
}
.split > .el-col{
......@@ -45,6 +46,30 @@ body{
font-weight: 600;
margin-bottom: 16px;
color: #303133;
display: flex;
align-items: center;
justify-content: space-between;
}
.panel-side-toggle{
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 5;
}
.panel-side-toggle.left{
left: -6px;
}
.panel-side-toggle.right{
right: -6px;
}
.panel-side-toggle .el-button{
writing-mode: vertical-rl;
text-orientation: mixed;
padding: 6px 4px;
}
.panel-actions{
......
......@@ -19,8 +19,21 @@
<body>
<div id="app" v-cloak class="page">
<el-row :gutter="0" class="split">
<el-col :span="12" class="panel">
<div class="panel-title">内容录入区</div>
<div class="panel-side-toggle left" v-if="!leftPanelVisible">
<el-button
size="mini"
type="primary"
plain
@click="toggleLeftPanel">展开内容录入区</el-button>
</div>
<el-col
:span="leftPanelSpan"
class="panel"
v-show="leftPanelVisible">
<div class="panel-title">
<span>内容录入区</span>
<el-button type="text" size="mini" @click="toggleLeftPanel">收起</el-button>
</div>
<el-form label-width="90px" size="small">
<el-form-item label="上传图片">
<el-upload
......@@ -278,8 +291,14 @@
</span>
</el-dialog>
<el-col :span="12" class="panel">
<div class="panel-title">AI 编排脚本区</div>
<el-col
:span="rightPanelSpan"
class="panel"
v-show="rightPanelVisible">
<div class="panel-title">
<span>AI 编排脚本区</span>
<el-button type="text" size="mini" @click="toggleRightPanel">收起</el-button>
</div>
<el-input
type="textarea"
:rows="16"
......@@ -298,6 +317,13 @@
class="json-alert"
title="JSON 格式正确"></el-alert>
</el-col>
<div class="panel-side-toggle right" v-if="!rightPanelVisible">
<el-button
size="mini"
type="primary"
plain
@click="toggleRightPanel">展开AI编排脚本区</el-button>
</div>
</el-row>
</div>
</body>
......
......@@ -37,6 +37,8 @@ new Vue({
quizList: [],
quizDialogVisible: false,
dragIndex: -1,
leftPanelVisible: true,
rightPanelVisible: true,
uploading: false,
uploadProgress: 0,
currentUploadId: 0,
......@@ -54,6 +56,26 @@ new Vue({
this.saveData();
}
},
computed: {
leftPanelSpan: function () {
if (this.leftPanelVisible && this.rightPanelVisible) {
return 12;
}
if (this.leftPanelVisible && !this.rightPanelVisible) {
return 24;
}
return 0;
},
rightPanelSpan: function () {
if (this.leftPanelVisible && this.rightPanelVisible) {
return 12;
}
if (!this.leftPanelVisible && this.rightPanelVisible) {
return 24;
}
return 0;
}
},
mounted: function () {
var _this = this;
if (window.courseware && window.courseware.getData) {
......@@ -88,6 +110,18 @@ new Vue({
}
},
methods: {
toggleLeftPanel: function () {
this.leftPanelVisible = !this.leftPanelVisible;
if (!this.leftPanelVisible && !this.rightPanelVisible) {
this.rightPanelVisible = true;
}
},
toggleRightPanel: function () {
this.rightPanelVisible = !this.rightPanelVisible;
if (!this.leftPanelVisible && !this.rightPanelVisible) {
this.leftPanelVisible = true;
}
},
// 环境基地址
getApiBase() {
const host = (window.location && window.location.hostname || '').toLowerCase();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment