|
@@ -1,17 +1,89 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <el-form :model="setting" :label-position="labelPosition" label-width="72px">
|
|
|
|
|
|
+ <el-form :model="property" :label-position="labelPosition" label-width="72px">
|
|
<el-form-item label="序号" class="serial-number">
|
|
<el-form-item label="序号" class="serial-number">
|
|
- <el-input v-model="setting.question_number" />
|
|
|
|
- <SvgIcon icon-class="switch" size="14" />
|
|
|
|
|
|
+ <el-input v-model="property.serial_number" />
|
|
|
|
+ <SvgIcon icon-class="switch" size="14" @click="switchSerialNumber(property.serial_number)" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<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 snGenerationMethodList"
|
|
|
|
+ :key="value"
|
|
|
|
+ v-model="property.sn_generation_method"
|
|
|
|
+ :label="value"
|
|
|
|
+ >
|
|
{{ label }}
|
|
{{ label }}
|
|
</el-radio>
|
|
</el-radio>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="序号位置">
|
|
<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' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('top-start')"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['top', { active: 'top' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('top')"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['top-end', { active: 'top-end' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('top-end')"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="left">
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['left-start', { active: 'left-start' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('left-start')"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['left', { active: 'left' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('left')"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['left-end', { active: 'left-end' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('left-end')"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="main"></div>
|
|
|
|
+ <div class="right">
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['right-start', { active: 'right-start' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('right-start')"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['right', { active: 'right' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('right')"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['right-end', { active: 'right-end' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('right-end')"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="bottom">
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['bottom-start', { active: 'bottom-start' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('bottom-start')"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['bottom', { active: 'bottom' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('bottom')"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ :class="['bottom-end', { active: 'bottom-end' === property.sn_position }]"
|
|
|
|
+ @click="changeNumberPosition('bottom-end')"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-divider />
|
|
|
|
+ <el-form-item label="查看方式">
|
|
|
|
+ <el-radio
|
|
|
|
+ v-for="{ value, label } in audioViewMethodList"
|
|
|
|
+ :key="value"
|
|
|
|
+ v-model="property.view_method"
|
|
|
|
+ :label="value"
|
|
|
|
+ >
|
|
{{ label }}
|
|
{{ label }}
|
|
</el-radio>
|
|
</el-radio>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -21,20 +93,53 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import SettingMixin from '@/views/book/courseware/create/components/common/SettingMixin';
|
|
import SettingMixin from '@/views/book/courseware/create/components/common/SettingMixin';
|
|
|
|
+import { snGenerationMethodList, audioViewMethodList, switchSerialNumber } from '@/views/book/courseware/data/common';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'AudioSetting',
|
|
name: 'AudioSetting',
|
|
mixins: [SettingMixin],
|
|
mixins: [SettingMixin],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ switchSerialNumber,
|
|
|
|
+ snGenerationMethodList,
|
|
|
|
+ audioViewMethodList,
|
|
labelPosition: 'left',
|
|
labelPosition: 'left',
|
|
- setting: {
|
|
|
|
- height: 100,
|
|
|
|
- type: 'solid',
|
|
|
|
|
|
+ property: {
|
|
|
|
+ serial_number: 1, // 序号
|
|
|
|
+ sn_position: 'top-start', // 序号位置:top-start top top-end 等
|
|
|
|
+ sn_generation_method: snGenerationMethodList[0].value, // 序号生成方式:recalculate 重新计算follow 跟随
|
|
|
|
+ view_method: audioViewMethodList[0].value, // 查看方式:independent 独立 list 列表icon 图标
|
|
},
|
|
},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- methods: {},
|
|
|
|
|
|
+ watch: {
|
|
|
|
+ setting: {
|
|
|
|
+ handler(val) {
|
|
|
|
+ if (this.isSet) {
|
|
|
|
+ this.$emit('updateSetting', val);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ deep: true,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ /**
|
|
|
|
+ * @description 设置属性
|
|
|
|
+ * @param {Object} property 属性
|
|
|
|
+ */
|
|
|
|
+ setSetting(property) {
|
|
|
|
+ this.isSet = true;
|
|
|
|
+ this.property = property;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @description 改变序号位置
|
|
|
|
+ * @param {String} sn_position
|
|
|
|
+ */
|
|
|
|
+ changeNumberPosition(sn_position) {
|
|
|
|
+ this.property.sn_position = sn_position;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -43,14 +148,86 @@ export default {
|
|
.serial-number {
|
|
.serial-number {
|
|
:deep .el-form-item__content {
|
|
:deep .el-form-item__content {
|
|
display: flex;
|
|
display: flex;
|
|
- column-gap: 16px;
|
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
.el-input {
|
|
.el-input {
|
|
- width: 100px;
|
|
|
|
margin-right: 16px;
|
|
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>
|
|
</style>
|