12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import { switchSerialNumber, computedQuestionNumber } from '../../../data/common';
- import { snGenerationMethodList, checkString } from '@/views/book/courseware/data/common';
- import SerialNumberPosition from '@/views/book/courseware/create/components/common/SerialNumberPosition.vue';
- import SelectSerialNumberStyle from '@/views/book/courseware/create/components/base/common/SelectSerialNumberStyle.vue';
- const mixin = {
- data() {
- return {
- switchSerialNumber,
- computedQuestionNumber,
- snGenerationMethodList,
- checkString,
- };
- },
- components: { SerialNumberPosition, SelectSerialNumberStyle },
- watch: {
- 'property.serial_number': {
- handler(val) {
- this.property.sn_type = checkString(val); // 序号与序号类型需保持匹配
- },
- },
- },
- methods: {
- /**
- * @description 设置属性
- * @param {object} property 属性
- */
- setSetting(property) {
- this.property = property;
- },
- /**
- * @description 改变序号位置
- * @param {String} sn_position
- */
- changeNumberPosition(sn_position) {
- this.property.sn_position = sn_position;
- },
- /**
- * @description 改变序号样式
- * @param {String} sn_style,sn_background_color
- */
- changeSerialNumberStyle(sn_style, sn_background_color) {
- this.property.sn_style = sn_style;
- this.property.sn_background_color = sn_background_color;
- },
- },
- };
- export default mixin;
|