|
@@ -1,15 +1,15 @@
|
|
|
-// 序号生成方式
|
|
|
-export const snGenerationMethodList = [
|
|
|
- { value: 'recalculate', label: '重新计算' },
|
|
|
- { value: 'follow', label: '跟随上题' },
|
|
|
-];
|
|
|
-
|
|
|
// 查看方式
|
|
|
export const viewMethodList = [
|
|
|
{ value: 'independent', label: '独立排放' },
|
|
|
{ value: 'list', label: '播放列表' },
|
|
|
];
|
|
|
|
|
|
+// 序号显示方式
|
|
|
+export const displayList = [
|
|
|
+ { value: 'true', label: '显示' },
|
|
|
+ { value: 'false', label: '隐藏' },
|
|
|
+];
|
|
|
+
|
|
|
// 序号类型
|
|
|
export const serialNumberTypeList = [
|
|
|
{ value: 'number', label: '数字' },
|
|
@@ -34,6 +34,15 @@ export const serialNumberPositionList = [
|
|
|
{ value: 'bottom-end', justifyContent: 'flex-end' },
|
|
|
];
|
|
|
|
|
|
+// 序号样式
|
|
|
+export const serialNumberStyleList = [
|
|
|
+ { value: 'solidBlockStyle' }, // 实心方块
|
|
|
+ { value: 'solidCircleStyle' }, // 实心圆
|
|
|
+ { value: 'hollowBlockStyle' }, // 空心方块
|
|
|
+ { value: 'hollowCircleStyle' }, // 空心圆
|
|
|
+ { value: 'defaultStyle' }, // 默认无
|
|
|
+];
|
|
|
+
|
|
|
// 拼音位置
|
|
|
export const pinyinPositionList = [
|
|
|
{ value: 'top', label: '上' },
|
|
@@ -167,36 +176,3 @@ export const reversedComputeOptionMethods = {
|
|
|
[serialNumberTypeList[2].value]: (i) => i.charCodeAt(0) - 97 + 1, // 小写
|
|
|
[serialNumberTypeList[3].value]: (i) => i.charCodeAt(0) - 65 + 1,
|
|
|
};
|
|
|
-
|
|
|
-/**
|
|
|
- * 改变选项序号
|
|
|
- * @param {object} property 选项属性
|
|
|
- */
|
|
|
-export function switchSerialNumber(property) {
|
|
|
- let relNum = 1;
|
|
|
- const reversedComputationMethod = reversedComputeOptionMethods[property.sn_type];
|
|
|
- if (reversedComputationMethod) {
|
|
|
- relNum = reversedComputationMethod(property.serial_number);
|
|
|
- }
|
|
|
-
|
|
|
- let index = serialNumberTypeList.findIndex((p) => p.value === property.sn_type);
|
|
|
- property.sn_type = serialNumberTypeList[index + 1]?.value || serialNumberTypeList[0].value;
|
|
|
- const computationMethod = computeOptionMethods[property.sn_type];
|
|
|
- if (computationMethod) {
|
|
|
- property.serial_number = computationMethod(relNum - 1);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 计算选项序号
|
|
|
- * @param {Number} i 序号
|
|
|
- * @param {String} sn_type 选项类型
|
|
|
- * @returns String 题号
|
|
|
- */
|
|
|
-export function computedSerialNumber(i, sn_type) {
|
|
|
- const computationMethod = computeOptionMethods[sn_type];
|
|
|
- if (computationMethod) {
|
|
|
- return computationMethod(i);
|
|
|
- }
|
|
|
- return '';
|
|
|
-}
|