parsec-libs 0.0.62 → 0.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -361,12 +361,13 @@ var QuestionType;
|
|
|
361
361
|
|
|
362
362
|
(function (QuestionType) {
|
|
363
363
|
QuestionType["\u586B\u7A7A"] = "FILL";
|
|
364
|
+
QuestionType["\u7EC4"] = "GROUP";
|
|
364
365
|
QuestionType["\u5355\u9009"] = "SINGLE_CHOOSE";
|
|
365
366
|
QuestionType["\u591A\u9009"] = "MULT_CHOOSE";
|
|
366
367
|
QuestionType["\u6253\u5206"] = "SCORE";
|
|
367
368
|
})(QuestionType || (QuestionType = {}));
|
|
368
369
|
|
|
369
|
-
var QuestionTypeObj = (_QuestionTypeObj = {}, _defineProperty(_QuestionTypeObj, QuestionType.填空, '填空'), _defineProperty(_QuestionTypeObj, QuestionType.单选, '单选'), _defineProperty(_QuestionTypeObj, QuestionType.多选, '多选'), _defineProperty(_QuestionTypeObj, QuestionType.打分, '打分'), _QuestionTypeObj);
|
|
370
|
+
var QuestionTypeObj = (_QuestionTypeObj = {}, _defineProperty(_QuestionTypeObj, QuestionType.填空, '填空'), _defineProperty(_QuestionTypeObj, QuestionType.单选, '单选'), _defineProperty(_QuestionTypeObj, QuestionType.组, '组'), _defineProperty(_QuestionTypeObj, QuestionType.多选, '多选'), _defineProperty(_QuestionTypeObj, QuestionType.打分, '打分'), _QuestionTypeObj);
|
|
370
371
|
var PersonalInfoObj = {
|
|
371
372
|
name: '姓名',
|
|
372
373
|
gender: '性别',
|
|
@@ -1412,6 +1413,14 @@ var LeftPart = (function () {
|
|
|
1412
1413
|
return switchQuestionBankModalVisible();
|
|
1413
1414
|
}
|
|
1414
1415
|
}, "\u4ECE\u9898\u5E93\u5F15\u7528"), /*#__PURE__*/React__default['default'].createElement(_Button__default['default'], {
|
|
1416
|
+
icon: /*#__PURE__*/React__default['default'].createElement(icons.PlusOutlined, null),
|
|
1417
|
+
onClick: function onClick() {
|
|
1418
|
+
return handleAdd({
|
|
1419
|
+
questionType: QuestionType.组,
|
|
1420
|
+
groupSize: 1
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
}, "\u6DFB\u52A0\u9898\u5206\u7EC4"), /*#__PURE__*/React__default['default'].createElement(_Button__default['default'], {
|
|
1415
1424
|
icon: /*#__PURE__*/React__default['default'].createElement(icons.PlusOutlined, null),
|
|
1416
1425
|
onClick: function onClick() {
|
|
1417
1426
|
return handleAdd(QuestionType.单选);
|
|
@@ -1590,7 +1599,7 @@ var LinkTable = (function (_ref) {
|
|
|
1590
1599
|
title: '显示/隐藏',
|
|
1591
1600
|
dataIndex: 'isShow',
|
|
1592
1601
|
render: function render(v) {
|
|
1593
|
-
return v ? '
|
|
1602
|
+
return v ? '显示' : '隐藏';
|
|
1594
1603
|
}
|
|
1595
1604
|
}, {
|
|
1596
1605
|
title: '操作',
|
|
@@ -1832,6 +1841,14 @@ var SettingDrawer = (function () {
|
|
|
1832
1841
|
disabled: surveyType === SurveyType.测评
|
|
1833
1842
|
})
|
|
1834
1843
|
}
|
|
1844
|
+
}, {
|
|
1845
|
+
label: '是否显示',
|
|
1846
|
+
name: 'isShow',
|
|
1847
|
+
formItemProps: {
|
|
1848
|
+
valuePropName: 'checked',
|
|
1849
|
+
initialValue: true,
|
|
1850
|
+
render: /*#__PURE__*/React__default['default'].createElement(_Switch__default['default'], null)
|
|
1851
|
+
}
|
|
1835
1852
|
}, {
|
|
1836
1853
|
label: '多选/单选',
|
|
1837
1854
|
name: 'questionType',
|
|
@@ -2068,6 +2085,7 @@ var QuestionFormItem = parsecHooks.ContainerUseWrap(QuestionSettingStore, functi
|
|
|
2068
2085
|
onChange = _ref4.onChange,
|
|
2069
2086
|
onMoveDown = _ref4.onMoveDown,
|
|
2070
2087
|
onMoveUp = _ref4.onMoveUp,
|
|
2088
|
+
list = _ref4.list,
|
|
2071
2089
|
moveUpDisabled = _ref4.moveUpDisabled,
|
|
2072
2090
|
moveDownDisabled = _ref4.moveDownDisabled;
|
|
2073
2091
|
|
|
@@ -2086,11 +2104,11 @@ var QuestionFormItem = parsecHooks.ContainerUseWrap(QuestionSettingStore, functi
|
|
|
2086
2104
|
}, [form, value]);
|
|
2087
2105
|
|
|
2088
2106
|
var _useThrottleFn = ahooks.useThrottleFn(function (values) {
|
|
2089
|
-
return onChange && onChange(_objectSpread2(_objectSpread2({}, values), {}, {
|
|
2107
|
+
return onChange && onChange(_objectSpread2(_objectSpread2(_objectSpread2({}, value), values), {}, {
|
|
2090
2108
|
sortNo: index
|
|
2091
2109
|
}));
|
|
2092
2110
|
}, {
|
|
2093
|
-
wait:
|
|
2111
|
+
wait: 1000
|
|
2094
2112
|
}),
|
|
2095
2113
|
run = _useThrottleFn.run;
|
|
2096
2114
|
|
|
@@ -2134,7 +2152,33 @@ var QuestionFormItem = parsecHooks.ContainerUseWrap(QuestionSettingStore, functi
|
|
|
2134
2152
|
var getFieldValue = _ref8.getFieldValue;
|
|
2135
2153
|
var questionType = getFieldValue('questionType');
|
|
2136
2154
|
var score = getFieldValue('score');
|
|
2137
|
-
|
|
2155
|
+
var parentGroupsSize = list.filter(function (_, i) {
|
|
2156
|
+
return i <= index;
|
|
2157
|
+
}).map(function (_ref9) {
|
|
2158
|
+
var _ref9$groupSize = _ref9.groupSize,
|
|
2159
|
+
groupSize = _ref9$groupSize === void 0 ? 0 : _ref9$groupSize;
|
|
2160
|
+
return groupSize;
|
|
2161
|
+
}).reduce(function (a, b) {
|
|
2162
|
+
return a + b;
|
|
2163
|
+
}, 0);
|
|
2164
|
+
|
|
2165
|
+
var _ref10 = list.map(function (item, index) {
|
|
2166
|
+
return _objectSpread2({
|
|
2167
|
+
index: index
|
|
2168
|
+
}, item);
|
|
2169
|
+
}).filter(function (_ref11) {
|
|
2170
|
+
var questionType = _ref11.questionType;
|
|
2171
|
+
return questionType === QuestionType.组;
|
|
2172
|
+
}).reverse().find(function (_ref12) {
|
|
2173
|
+
var itemIndex = _ref12.index,
|
|
2174
|
+
groupSize = _ref12.groupSize;
|
|
2175
|
+
return itemIndex < index && itemIndex + groupSize >= index;
|
|
2176
|
+
}) || {},
|
|
2177
|
+
groupIndex = _ref10.index,
|
|
2178
|
+
groupSize = _ref10.groupSize;
|
|
2179
|
+
|
|
2180
|
+
var count = groupSize && questionType !== QuestionType.组 ? "".concat(groupIndex + 1 - parentGroupsSize + groupSize, ".").concat(index - groupIndex) : index + 1 - parentGroupsSize + (value.groupSize || 0);
|
|
2181
|
+
return "".concat(getFieldValue('isMustAnswer') ? '* ' : '', "\u9898\u76EE").concat(count, " \uFF08").concat(questionType === QuestionType.组 ? '题目分组' : questionType ? "".concat(QuestionTypeObj[questionType], "\u9898") : '', "\uFF09").concat(score ? "\uFF08".concat(score, "\u5206\uFF09") : '');
|
|
2138
2182
|
}),
|
|
2139
2183
|
type: "inner",
|
|
2140
2184
|
extra: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
|
|
@@ -2180,20 +2224,37 @@ var QuestionFormItem = parsecHooks.ContainerUseWrap(QuestionSettingStore, functi
|
|
|
2180
2224
|
hidden: true
|
|
2181
2225
|
}, {
|
|
2182
2226
|
required: true,
|
|
2183
|
-
label: '题目描述',
|
|
2227
|
+
label: questionType === QuestionType.组 ? '分组标题' : '题目描述',
|
|
2184
2228
|
formItemProps: {
|
|
2185
2229
|
style: {
|
|
2186
2230
|
padding: 0
|
|
2187
2231
|
},
|
|
2188
2232
|
render: /*#__PURE__*/React__default['default'].createElement(_Input__default['default'], {
|
|
2189
2233
|
disabled: formItemsDisabled,
|
|
2190
|
-
placeholder: '
|
|
2234
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(questionType === QuestionType.组 ? '分组标题' : '题目描述')
|
|
2191
2235
|
})
|
|
2192
2236
|
},
|
|
2193
2237
|
name: 'questionDesc'
|
|
2238
|
+
}, {
|
|
2239
|
+
required: false,
|
|
2240
|
+
label: '包含题目数',
|
|
2241
|
+
hidden: questionType !== QuestionType.组,
|
|
2242
|
+
formItemProps: {
|
|
2243
|
+
style: {
|
|
2244
|
+
padding: 0
|
|
2245
|
+
},
|
|
2246
|
+
render: /*#__PURE__*/React__default['default'].createElement(_InputNumber__default['default'], {
|
|
2247
|
+
disabled: formItemsDisabled,
|
|
2248
|
+
min: 1,
|
|
2249
|
+
precision: 0,
|
|
2250
|
+
placeholder: '输入题目数'
|
|
2251
|
+
})
|
|
2252
|
+
},
|
|
2253
|
+
name: 'groupSize'
|
|
2194
2254
|
}, {
|
|
2195
2255
|
required: false,
|
|
2196
2256
|
label: '题目编码',
|
|
2257
|
+
hidden: questionType === QuestionType.组,
|
|
2197
2258
|
formItemProps: {
|
|
2198
2259
|
style: {
|
|
2199
2260
|
padding: 0
|
|
@@ -2224,11 +2285,11 @@ var QuestionFormItem = parsecHooks.ContainerUseWrap(QuestionSettingStore, functi
|
|
|
2224
2285
|
disabled: formItemsDisabled
|
|
2225
2286
|
})));
|
|
2226
2287
|
});
|
|
2227
|
-
var QuestionFormItem$1 = styled__default['default'](parsecAdmin.OldForm)(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n cursor: pointer;\n > .", "-card {\n ", "\n }\n"])), function (
|
|
2228
|
-
var prefixCls =
|
|
2288
|
+
var QuestionFormItem$1 = styled__default['default'](parsecAdmin.OldForm)(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n cursor: pointer;\n > .", "-card {\n ", "\n }\n"])), function (_ref13) {
|
|
2289
|
+
var prefixCls = _ref13.theme.prefixCls;
|
|
2229
2290
|
return prefixCls;
|
|
2230
|
-
}, function (
|
|
2231
|
-
var selected =
|
|
2291
|
+
}, function (_ref14) {
|
|
2292
|
+
var selected = _ref14.selected;
|
|
2232
2293
|
return selected && styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-color: #4e9fe6;\n box-shadow: 0 0 0 2px rgba(39, 128, 218, 0.2);\n "])));
|
|
2233
2294
|
});
|
|
2234
2295
|
|
|
@@ -2268,6 +2329,7 @@ var QuestionList = (function (_ref) {
|
|
|
2268
2329
|
noStyle: true
|
|
2269
2330
|
}), /*#__PURE__*/React__default['default'].createElement(QuestionFormItem, {
|
|
2270
2331
|
index: index,
|
|
2332
|
+
list: value,
|
|
2271
2333
|
onRemove: function onRemove() {
|
|
2272
2334
|
return remove(index);
|
|
2273
2335
|
},
|
|
@@ -21,6 +21,7 @@ export declare enum CityWidgetDetailLevel {
|
|
|
21
21
|
}
|
|
22
22
|
export declare enum QuestionType {
|
|
23
23
|
填空 = "FILL",
|
|
24
|
+
组 = "GROUP",
|
|
24
25
|
单选 = "SINGLE_CHOOSE",
|
|
25
26
|
多选 = "MULT_CHOOSE",
|
|
26
27
|
打分 = "SCORE"
|
|
@@ -28,10 +29,11 @@ export declare enum QuestionType {
|
|
|
28
29
|
export declare const QuestionTypeObj: {
|
|
29
30
|
FILL: string;
|
|
30
31
|
SINGLE_CHOOSE: string;
|
|
32
|
+
GROUP: string;
|
|
31
33
|
MULT_CHOOSE: string;
|
|
32
34
|
SCORE: string;
|
|
33
35
|
};
|
|
34
|
-
export declare type QuestionItem = BaseQuestionItem | SingleChooseQuestionType | ScoreQuestionType;
|
|
36
|
+
export declare type QuestionItem = BaseQuestionItem | SingleChooseQuestionType | GroupQuestionItem | ScoreQuestionType;
|
|
35
37
|
export declare type BaseQuestionItem = {
|
|
36
38
|
id: number;
|
|
37
39
|
widgetType: WidgetType;
|
|
@@ -40,6 +42,10 @@ export declare type BaseQuestionItem = {
|
|
|
40
42
|
questionPicUrl?: string;
|
|
41
43
|
questionDesc: string;
|
|
42
44
|
};
|
|
45
|
+
export declare type GroupQuestionItem = Omit<BaseQuestionItem, 'questionType'> & {
|
|
46
|
+
groupSize: number;
|
|
47
|
+
questionType: QuestionType.组;
|
|
48
|
+
};
|
|
43
49
|
export declare type SingleChooseQuestionType = BaseQuestionItem & {
|
|
44
50
|
questionType: QuestionType.单选 | QuestionType.多选;
|
|
45
51
|
options: {
|
|
@@ -18,7 +18,7 @@ export interface Props {
|
|
|
18
18
|
}
|
|
19
19
|
declare const Store: import("parsec-hooks/lib/createContainer").Container<{
|
|
20
20
|
form: FormInstance<any>;
|
|
21
|
-
addQuestion: (questionType?: QuestionType | QuestionData) => void;
|
|
21
|
+
addQuestion: (questionType?: QuestionType | Partial<QuestionData>) => void;
|
|
22
22
|
delQuestion: (item: BaseQuestionItem) => void;
|
|
23
23
|
surveyType: SurveyType;
|
|
24
24
|
setSurveyType: import("react").Dispatch<import("react").SetStateAction<SurveyType>>;
|