|
@@ -2,16 +2,88 @@
|
|
|
<div>
|
|
|
<el-form :model="setting" :label-position="labelPosition" label-width="72px">
|
|
|
<el-form-item label="序号" class="serial-number">
|
|
|
- <el-input v-model="setting.question_number" />
|
|
|
+ <el-input v-model="setting.serialNumber" />
|
|
|
<SvgIcon icon-class="switch" size="14" />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-radio v-for="{ value, label } in questionNumberTypeList" :key="value" :label="value">
|
|
|
+ <el-radio
|
|
|
+ v-for="{ value, label } in serialNumberTypeList"
|
|
|
+ :key="value"
|
|
|
+ v-model="setting.other.serial_number_type"
|
|
|
+ :label="value"
|
|
|
+ >
|
|
|
{{ label }}
|
|
|
</el-radio>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="序号位置">
|
|
|
- <el-radio v-for="{ value, label } in questionNumberTypeList" :key="value" :label="value">
|
|
|
+ <div class="grid-container">
|
|
|
+ <div class="top">
|
|
|
+ <el-button
|
|
|
+ :class="['top-start', { active: 'top-start' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('top-start')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ :class="['top', { active: 'top' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('top')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ :class="['top-end', { active: 'top-end' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('top-end')"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="left">
|
|
|
+ <el-button
|
|
|
+ :class="['left-start', { active: 'left-start' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('left-start')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ :class="['left', { active: 'left' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('left')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ :class="['left-end', { active: 'left-end' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('left-end')"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="main"></div>
|
|
|
+ <div class="right">
|
|
|
+ <el-button
|
|
|
+ :class="['right-start', { active: 'right-start' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('right-start')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ :class="['right', { active: 'right' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('right')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ :class="['right-end', { active: 'right-end' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('right-end')"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="bottom">
|
|
|
+ <el-button
|
|
|
+ :class="['bottom-start', { active: 'bottom-start' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('bottom-start')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ :class="['bottom', { active: 'bottom' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('bottom')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ :class="['bottom-end', { active: 'bottom-end' === setting.numberPosition }]"
|
|
|
+ @click="changeNumberPosition('bottom-end')"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-divider />
|
|
|
+ <el-form-item label="查看方式">
|
|
|
+ <el-radio
|
|
|
+ v-for="{ value, label } in audioViewingMethodsList"
|
|
|
+ :key="value"
|
|
|
+ v-model="setting.audioViewingMethods"
|
|
|
+ :label="value"
|
|
|
+ >
|
|
|
{{ label }}
|
|
|
</el-radio>
|
|
|
</el-form-item>
|
|
@@ -20,18 +92,24 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import ModuleMixin from '../../common/ModuleMixin';
|
|
|
+import { serialNumberTypeList, audioViewingMethodsList } from '@/views/book/courseware/data/common';
|
|
|
|
|
|
export default {
|
|
|
- name: 'DividerSetting',
|
|
|
- mixins: [ModuleMixin],
|
|
|
+ name: 'AudioSetting',
|
|
|
data() {
|
|
|
return {
|
|
|
+ serialNumberTypeList,
|
|
|
+ audioViewingMethodsList,
|
|
|
labelPosition: 'left',
|
|
|
isSet: false, // 父组件是否已设置
|
|
|
setting: {
|
|
|
- height: 100,
|
|
|
- type: 'solid',
|
|
|
+ serialNumber: 1, // 序号
|
|
|
+ numberPosition: 'top-start', // 序号位置
|
|
|
+ audioViewingMethods: audioViewingMethodsList[0].value, // 查看方式
|
|
|
+ // 其他属性
|
|
|
+ other: {
|
|
|
+ serial_number_type: serialNumberTypeList[0].value, // 题号类型
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
},
|
|
@@ -54,6 +132,14 @@ export default {
|
|
|
this.isSet = true;
|
|
|
this.setting = setting;
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 改变序号位置
|
|
|
+ * @param {String} numberPosition
|
|
|
+ */
|
|
|
+ changeNumberPosition(numberPosition) {
|
|
|
+ this.setting.numberPosition = numberPosition;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -63,14 +149,86 @@ export default {
|
|
|
.serial-number {
|
|
|
:deep .el-form-item__content {
|
|
|
display: flex;
|
|
|
- column-gap: 16px;
|
|
|
align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.el-input {
|
|
|
- width: 100px;
|
|
|
margin-right: 16px;
|
|
|
}
|
|
|
+
|
|
|
+ .top {
|
|
|
+ grid-area: top;
|
|
|
+ column-gap: 8px;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .left {
|
|
|
+ flex-direction: column;
|
|
|
+ grid-area: left;
|
|
|
+ row-gap: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .main {
|
|
|
+ grid-area: main;
|
|
|
+ }
|
|
|
+
|
|
|
+ .right {
|
|
|
+ flex-direction: column;
|
|
|
+ grid-area: right;
|
|
|
+ row-gap: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom {
|
|
|
+ grid-area: bottom;
|
|
|
+ column-gap: 8px;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .grid-container {
|
|
|
+ display: grid;
|
|
|
+ grid:
|
|
|
+ 'top top top top top top'
|
|
|
+ 'left main main main main right'
|
|
|
+ 'bottom bottom bottom bottom bottom bottom';
|
|
|
+ width: 134px;
|
|
|
+ height: 80px;
|
|
|
+ padding: 8px 8px 0;
|
|
|
+ line-height: 10px;
|
|
|
+ border: 1px solid #ebebeb;
|
|
|
+
|
|
|
+ div {
|
|
|
+ display: flex;
|
|
|
+ margin: 0 auto;
|
|
|
+ text-align: center;
|
|
|
+ background-color: rgba(255, 255, 255, 8%);
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ width: 16px;
|
|
|
+ height: 8px;
|
|
|
+ padding: 0;
|
|
|
+ margin: 0;
|
|
|
+ border: 1px solid #e4e4e4;
|
|
|
+ border-radius: 2px;
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ background-color: $setting-active-color;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .main {
|
|
|
+ width: 64px;
|
|
|
+ height: 32px;
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ border: 1px solid #e4e4e4;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-divider {
|
|
|
+ margin: 16px 0;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|