cnhis-design-vue 3.1.40-release.2 → 3.1.40-release.3
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/README.md +123 -123
- package/es/components/scale-view/index.d.ts +1 -0
- package/es/components/scale-view/src/ScaleView.vue.d.ts +4 -0
- package/es/components/scale-view/src/ScaleView.vue.js +3 -3
- package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +1 -0
- package/es/components/scale-view/src/hooks/scaleview-computed.js +76 -31
- package/es/components/scale-view/src/hooks/use-evaluate.js +13 -13
- package/es/env.d.ts +24 -24
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
# 安装
|
|
2
|
-
|
|
3
|
-
```shell
|
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
|
5
|
-
# or
|
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## 1.全局引入
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
// main.ts
|
|
13
|
-
import { createApp } from 'vue';
|
|
14
|
-
import App from './App.vue';
|
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
-
import cui from 'cnhis-design-vue';
|
|
17
|
-
|
|
18
|
-
const app = createApp(App);
|
|
19
|
-
app.use(cui).mount('#app');
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 2. 按需引入
|
|
23
|
-
|
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
-
|
|
26
|
-
### 2.1 样式处理方式 1(按需引入样式)
|
|
27
|
-
|
|
28
|
-
```shell
|
|
29
|
-
# 安装自动导入样式的插件
|
|
30
|
-
npm i -d vite-plugin-style-import
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
// vite.config.ts
|
|
35
|
-
import { defineConfig } from 'vite';
|
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
-
|
|
38
|
-
export default defineConfig({
|
|
39
|
-
plugins: [
|
|
40
|
-
// ...otherPlugins
|
|
41
|
-
createStyleImportPlugin({
|
|
42
|
-
libs: [
|
|
43
|
-
{
|
|
44
|
-
libraryName: 'cnhis-design-vue',
|
|
45
|
-
esModule: true,
|
|
46
|
-
ensureStyleFile: true,
|
|
47
|
-
resolveStyle: name => {
|
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 2.2 样式处理方式 2(全局引入样式)
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
// main.ts
|
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## 3. 注意
|
|
65
|
-
|
|
66
|
-
由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
|
|
67
|
-
|
|
68
|
-
```typescript
|
|
69
|
-
// main.ts
|
|
70
|
-
import { createApp } from 'vue';
|
|
71
|
-
import App from './App.vue';
|
|
72
|
-
|
|
73
|
-
import { CGrid } from 'cnhis-design-vue';
|
|
74
|
-
// 或者
|
|
75
|
-
import { CBigTable } from 'cnhis-design-vue';
|
|
76
|
-
|
|
77
|
-
const app = createApp(App);
|
|
78
|
-
app.use(CGrid);
|
|
79
|
-
// 或者
|
|
80
|
-
app.use(CBigTable);
|
|
81
|
-
app.mount('#app');
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## 4.FAQ
|
|
85
|
-
|
|
86
|
-
### 4.1 项目打包后样式丢失
|
|
87
|
-
|
|
88
|
-
> 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
// vite.config.ts
|
|
92
|
-
import { defineConfig } from 'vite';
|
|
93
|
-
|
|
94
|
-
export default defineConfig({
|
|
95
|
-
rollupOptions: {
|
|
96
|
-
// ..otherOptions
|
|
97
|
-
output: {
|
|
98
|
-
dir: './dist',
|
|
99
|
-
manualChunks(id: string) {
|
|
100
|
-
if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
|
|
101
|
-
return 'vendor';
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### 4.2 找不到文件
|
|
110
|
-
|
|
111
|
-
> 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
|
|
112
|
-
|
|
113
|
-
```javascript
|
|
114
|
-
// vite.config.ts
|
|
115
|
-
const config = {
|
|
116
|
-
// ...otherOptions
|
|
117
|
-
resolve: {
|
|
118
|
-
// ...otherOptions
|
|
119
|
-
// 如果没有配置, 则不用考虑
|
|
120
|
-
extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
```
|
|
1
|
+
# 安装
|
|
2
|
+
|
|
3
|
+
```shell
|
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
|
5
|
+
# or
|
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 1.全局引入
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// main.ts
|
|
13
|
+
import { createApp } from 'vue';
|
|
14
|
+
import App from './App.vue';
|
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
+
import cui from 'cnhis-design-vue';
|
|
17
|
+
|
|
18
|
+
const app = createApp(App);
|
|
19
|
+
app.use(cui).mount('#app');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 2. 按需引入
|
|
23
|
+
|
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
+
|
|
26
|
+
### 2.1 样式处理方式 1(按需引入样式)
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
# 安装自动导入样式的插件
|
|
30
|
+
npm i -d vite-plugin-style-import
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// vite.config.ts
|
|
35
|
+
import { defineConfig } from 'vite';
|
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
+
|
|
38
|
+
export default defineConfig({
|
|
39
|
+
plugins: [
|
|
40
|
+
// ...otherPlugins
|
|
41
|
+
createStyleImportPlugin({
|
|
42
|
+
libs: [
|
|
43
|
+
{
|
|
44
|
+
libraryName: 'cnhis-design-vue',
|
|
45
|
+
esModule: true,
|
|
46
|
+
ensureStyleFile: true,
|
|
47
|
+
resolveStyle: name => {
|
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 2.2 样式处理方式 2(全局引入样式)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// main.ts
|
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 3. 注意
|
|
65
|
+
|
|
66
|
+
由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// main.ts
|
|
70
|
+
import { createApp } from 'vue';
|
|
71
|
+
import App from './App.vue';
|
|
72
|
+
|
|
73
|
+
import { CGrid } from 'cnhis-design-vue';
|
|
74
|
+
// 或者
|
|
75
|
+
import { CBigTable } from 'cnhis-design-vue';
|
|
76
|
+
|
|
77
|
+
const app = createApp(App);
|
|
78
|
+
app.use(CGrid);
|
|
79
|
+
// 或者
|
|
80
|
+
app.use(CBigTable);
|
|
81
|
+
app.mount('#app');
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 4.FAQ
|
|
85
|
+
|
|
86
|
+
### 4.1 项目打包后样式丢失
|
|
87
|
+
|
|
88
|
+
> 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// vite.config.ts
|
|
92
|
+
import { defineConfig } from 'vite';
|
|
93
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
rollupOptions: {
|
|
96
|
+
// ..otherOptions
|
|
97
|
+
output: {
|
|
98
|
+
dir: './dist',
|
|
99
|
+
manualChunks(id: string) {
|
|
100
|
+
if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
|
|
101
|
+
return 'vendor';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 4.2 找不到文件
|
|
110
|
+
|
|
111
|
+
> 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
// vite.config.ts
|
|
115
|
+
const config = {
|
|
116
|
+
// ...otherOptions
|
|
117
|
+
resolve: {
|
|
118
|
+
// ...otherOptions
|
|
119
|
+
// 如果没有配置, 则不用考虑
|
|
120
|
+
extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
```
|
|
@@ -313,6 +313,7 @@ declare const CScaleView: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
313
313
|
currentTime: any;
|
|
314
314
|
showEvaluateCountdown: any;
|
|
315
315
|
}>;
|
|
316
|
+
skipCover: import("vue").ComputedRef<any>;
|
|
316
317
|
showEvent: (formItem: any, isSubmitCallback?: any) => any;
|
|
317
318
|
formKey: (item: any) => any;
|
|
318
319
|
initForm: (data: any) => void;
|
|
@@ -312,6 +312,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
312
312
|
currentTime: any;
|
|
313
313
|
showEvaluateCountdown: any;
|
|
314
314
|
}>;
|
|
315
|
+
skipCover: import("vue").ComputedRef<any>;
|
|
315
316
|
showEvent: (formItem: any, isSubmitCallback?: any) => any;
|
|
316
317
|
formKey: (item: any) => any;
|
|
317
318
|
initForm: (data: any) => void;
|
|
@@ -495,6 +496,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
495
496
|
evaluateStartTime: any;
|
|
496
497
|
showCountdown: import("vue").ComputedRef<any>;
|
|
497
498
|
getTotalLen: () => void;
|
|
499
|
+
/**
|
|
500
|
+
* wacth
|
|
501
|
+
*/
|
|
498
502
|
countdown: (startTime: any) => void;
|
|
499
503
|
clearTimer: () => void;
|
|
500
504
|
init: () => void;
|
|
@@ -61,6 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
propsConfig,
|
|
62
62
|
evaluatePageProps,
|
|
63
63
|
evaluateCountdownProps,
|
|
64
|
+
skipCover,
|
|
64
65
|
showEvent,
|
|
65
66
|
formKey
|
|
66
67
|
} = ScaleViewComputed(props, state, { query });
|
|
@@ -73,7 +74,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
74
|
};
|
|
74
75
|
handleQuery();
|
|
75
76
|
const init = (configData) => {
|
|
76
|
-
console.log("ininin");
|
|
77
77
|
try {
|
|
78
78
|
resetNodata();
|
|
79
79
|
initForm(configData);
|
|
@@ -314,14 +314,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
314
314
|
return openBlock(), createElementBlock("div", {
|
|
315
315
|
class: normalizeClass(["c-scale", { "c-scale-nobtn": unref(showSaveBtn) }])
|
|
316
316
|
}, [
|
|
317
|
-
createCommentVNode(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="\u52A0\u8F7D\u4E2D"></n-spin>\n </template> '),
|
|
317
|
+
createCommentVNode(' <template v-if="state.spinning">\r\n <n-spin :show="state.spinning" description="\u52A0\u8F7D\u4E2D"></n-spin>\r\n </template> '),
|
|
318
318
|
!state.spinning && !state.hasFrontAddress ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
319
319
|
unref(noDataState).noData ? (openBlock(), createBlock(NoData, {
|
|
320
320
|
key: 0,
|
|
321
321
|
noDataImg: unref(noDataState).noDataImg,
|
|
322
322
|
noDataTip: unref(noDataState).noDataTip
|
|
323
323
|
}, null, 8, ["noDataImg", "noDataTip"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
324
|
-
unref(showEvaluateEntry) ? (openBlock(), createBlock(EvaluatePage, mergeProps({ key: 0 }, unref(evaluatePageProps), { onWriteGuage: writeGuage }), null, 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
324
|
+
unref(showEvaluateEntry) && !unref(skipCover) ? (openBlock(), createBlock(EvaluatePage, mergeProps({ key: 0 }, unref(evaluatePageProps), { onWriteGuage: writeGuage }), null, 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
325
325
|
unref(showEvaluateCoundownPage) ? (openBlock(), createBlock(EvaluateCountdown, mergeProps({
|
|
326
326
|
key: 0,
|
|
327
327
|
ref_key: "countdownDom",
|
|
@@ -5,7 +5,8 @@ import moment from 'moment';
|
|
|
5
5
|
import { componentMapStr } from './use-component.js';
|
|
6
6
|
|
|
7
7
|
const ScaleViewComputed = (props, state, config) => {
|
|
8
|
-
|
|
8
|
+
const { query } = config;
|
|
9
|
+
const cur = new Date().getTime();
|
|
9
10
|
const queryformBoldOpen = computed(() => {
|
|
10
11
|
return (query == null ? void 0 : query.formBoldOpen) == 1;
|
|
11
12
|
});
|
|
@@ -15,8 +16,43 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
15
16
|
return false;
|
|
16
17
|
return (query == null ? void 0 : query.evatip) == 1 || ((_a = props.params) == null ? void 0 : _a.evatip) == 1;
|
|
17
18
|
});
|
|
19
|
+
const evaluateResultSetting = computed(() => {
|
|
20
|
+
var _a;
|
|
21
|
+
return ((_a = state.config) == null ? void 0 : _a.evaluateResultSetting) || {};
|
|
22
|
+
});
|
|
23
|
+
const getEvaluateTime = computed(() => {
|
|
24
|
+
const { evaluateTime } = evaluateResultSetting.value;
|
|
25
|
+
return +evaluateTime;
|
|
26
|
+
});
|
|
27
|
+
const evaluateStartTime = computed(() => {
|
|
28
|
+
var _a;
|
|
29
|
+
return (_a = evaluateResultSetting.value) == null ? void 0 : _a.evaluateStartTime;
|
|
30
|
+
});
|
|
31
|
+
const getEvaluateStartTime = computed(() => {
|
|
32
|
+
const tempSt = new Date(evaluateStartTime.value);
|
|
33
|
+
const isValidDate = XEUtils.isValidDate(tempSt);
|
|
34
|
+
if (!isValidDate)
|
|
35
|
+
return false;
|
|
36
|
+
return tempSt;
|
|
37
|
+
});
|
|
38
|
+
const evaBanEnd = computed(() => {
|
|
39
|
+
if (!evaluateStartTime.value || !getEvaluateTime.value)
|
|
40
|
+
return false;
|
|
41
|
+
const startTime = getEvaluateStartTime.value;
|
|
42
|
+
if (!startTime)
|
|
43
|
+
return false;
|
|
44
|
+
const endTime = moment(evaluateStartTime.value).add(getEvaluateTime.value, "minutes").valueOf();
|
|
45
|
+
return cur >= endTime;
|
|
46
|
+
});
|
|
47
|
+
const evaBanStart = computed(() => {
|
|
48
|
+
const startTime = getEvaluateStartTime.value;
|
|
49
|
+
if (!startTime)
|
|
50
|
+
return false;
|
|
51
|
+
const sT = moment(startTime).valueOf();
|
|
52
|
+
return cur < sT;
|
|
53
|
+
});
|
|
18
54
|
const isFormBoldOpen = computed(() => (item) => {
|
|
19
|
-
|
|
55
|
+
const res = item.required;
|
|
20
56
|
if (!props.styleSetting || !Object.keys(props.styleSetting).length || !("formBoldOpen" in props.styleSetting)) {
|
|
21
57
|
return res && queryformBoldOpen.value;
|
|
22
58
|
}
|
|
@@ -53,15 +89,15 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
53
89
|
});
|
|
54
90
|
const handleShowQuestionNumber = computed(() => (item) => {
|
|
55
91
|
var _a;
|
|
56
|
-
|
|
57
|
-
|
|
92
|
+
const { type } = item || {};
|
|
93
|
+
const tempTile = ((_a = state.config) == null ? void 0 : _a.autoQuestionNumber) === false ? item.showTitle : `${item.softcode}\u3001${item.showTitle}`;
|
|
58
94
|
if (!isEvaluation(type))
|
|
59
95
|
return tempTile;
|
|
60
|
-
|
|
96
|
+
const score = handleEvaluationScore(item);
|
|
61
97
|
return `${tempTile} <span style="color:#2d7aff;" class="score-i">${score}</span>`;
|
|
62
98
|
});
|
|
63
99
|
const hasScore = computed(() => {
|
|
64
|
-
|
|
100
|
+
const { config: config2 } = state;
|
|
65
101
|
if (!config2 || !Object.keys(config2).length)
|
|
66
102
|
return false;
|
|
67
103
|
if ("totalScore" in config2)
|
|
@@ -70,9 +106,17 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
70
106
|
});
|
|
71
107
|
const isPreviewScale = computed(() => {
|
|
72
108
|
var _a;
|
|
73
|
-
|
|
109
|
+
const guage_id = (_a = props.ids) == null ? void 0 : _a.guage_id;
|
|
74
110
|
return guage_id && props.noBtn;
|
|
75
111
|
});
|
|
112
|
+
const skipCover = computed(() => {
|
|
113
|
+
const params = props.params || {};
|
|
114
|
+
if (!("skipCover" in params)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
const res = params.skipCover && !evaBanStart.value && !evaBanEnd.value;
|
|
118
|
+
return res;
|
|
119
|
+
});
|
|
76
120
|
const showEvaluateEntry = computed(() => {
|
|
77
121
|
return !isPreviewScale.value && state.showEvaluatePage && state.showEvaluateSettingWrap && !state.isFinished && !props.noBtn && !props.hideBtn;
|
|
78
122
|
});
|
|
@@ -80,8 +124,8 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
80
124
|
return !isPreviewScale.value && !showEvaluateEntry.value && state.showEvaluateCountdownWrap && !state.isFinished && !props.noBtn && !props.hideBtn;
|
|
81
125
|
});
|
|
82
126
|
const hasEvaluateResultSetting = computed(() => {
|
|
83
|
-
|
|
84
|
-
|
|
127
|
+
const { evaluateResultSetting: evaluateResultSetting2 = {} } = state.config;
|
|
128
|
+
const valueArr = Object.values(evaluateResultSetting2).filter((item) => {
|
|
85
129
|
if (item)
|
|
86
130
|
return true;
|
|
87
131
|
}) || [];
|
|
@@ -91,11 +135,11 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
91
135
|
return state.paramsEvaluate && Object.keys(state.paramsEvaluate).length;
|
|
92
136
|
});
|
|
93
137
|
const hasDefault = computed(() => {
|
|
94
|
-
|
|
138
|
+
const hash = window.location.search || window.location.hash;
|
|
95
139
|
if (!hash)
|
|
96
140
|
return;
|
|
97
|
-
|
|
98
|
-
|
|
141
|
+
const defaultVariable = ["evaname", "evadesc", "evast", "evadur", "evaan"];
|
|
142
|
+
const hasDefaultItem = defaultVariable.find((item) => hash.includes(item));
|
|
99
143
|
return state.paramsEvaluate || hasDefaultItem;
|
|
100
144
|
});
|
|
101
145
|
const showSaveBtn = computed(() => {
|
|
@@ -111,7 +155,7 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
111
155
|
return !!props.hideBtn || !!props.isLock || state.isFinished;
|
|
112
156
|
});
|
|
113
157
|
const showEvaluateLabel = computed(() => (item) => {
|
|
114
|
-
|
|
158
|
+
const obj = {
|
|
115
159
|
EVALUATE_RADIO_BLOCK: "\u5355\u9009\u9898",
|
|
116
160
|
EVALUATE_CHECKBOX_BLOCK: "\u591A\u9009\u9898"
|
|
117
161
|
};
|
|
@@ -119,17 +163,17 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
119
163
|
});
|
|
120
164
|
const showAnswerParse = computed(() => (item) => {
|
|
121
165
|
var _a;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (!
|
|
166
|
+
const { evaluateAnswer, checkAnswerMode, evaluateStartTime: evaluateStartTime2, evaluateTime } = ((_a = state.config) == null ? void 0 : _a.evaluateResultSetting) || {};
|
|
167
|
+
const arr = ["EVALUATE_RADIO_BLOCK", "EVALUATE_CHECKBOX_BLOCK", "EVALUATE_SELECT", "EVALUATE_INPUT"];
|
|
168
|
+
const maxScore = (item == null ? void 0 : item.scoreConfigs) || 0;
|
|
169
|
+
const isShow = evaluateAnswer && state.isFinished && arr.includes(item.type) && maxScore;
|
|
170
|
+
if (!evaluateStartTime2 || !evaluateTime || checkAnswerMode && checkAnswerMode == 1) {
|
|
127
171
|
return isShow;
|
|
128
172
|
}
|
|
129
|
-
if (!XEUtils.isValidDate(new Date(
|
|
173
|
+
if (!XEUtils.isValidDate(new Date(evaluateStartTime2)))
|
|
130
174
|
return isShow;
|
|
131
|
-
|
|
132
|
-
|
|
175
|
+
const endTime = moment(evaluateStartTime2).add(evaluateTime, "minutes");
|
|
176
|
+
const isRang = endTime.diff(moment(), "seconds", true);
|
|
133
177
|
return isShow && isRang <= 0;
|
|
134
178
|
});
|
|
135
179
|
const tipMsg = computed(() => {
|
|
@@ -184,8 +228,8 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
184
228
|
const propsConfig = computed(() => (item, index) => {
|
|
185
229
|
var _a;
|
|
186
230
|
const propType = componentMapStr[item.type];
|
|
187
|
-
|
|
188
|
-
|
|
231
|
+
const useProps = comProsMap[propType] || {};
|
|
232
|
+
const propsObj = {
|
|
189
233
|
form: state.form,
|
|
190
234
|
item,
|
|
191
235
|
index,
|
|
@@ -232,8 +276,8 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
232
276
|
const { relation_logic_is, condition, relation_logic } = relationLogicObj;
|
|
233
277
|
if (relation_logic_is) {
|
|
234
278
|
const results = condition.map((c) => {
|
|
235
|
-
|
|
236
|
-
|
|
279
|
+
const mItem = formArray.filter((f) => f.seq == c.subject_seq)[0];
|
|
280
|
+
const key = formKey(mItem);
|
|
237
281
|
if (XEUtils.isArray(form[key])) {
|
|
238
282
|
return form[key].some((v) => c.value.includes(v));
|
|
239
283
|
} else {
|
|
@@ -254,25 +298,25 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
254
298
|
return item.databaseTitle || item.title;
|
|
255
299
|
};
|
|
256
300
|
const handleEvaluationScore = (ele) => {
|
|
257
|
-
|
|
301
|
+
const { minScore = 0, maxScore = 0, scoreType } = ele.scoreConfigs || {};
|
|
258
302
|
return `(${maxScore}\u5206)`;
|
|
259
303
|
};
|
|
260
304
|
const evaluatePageProps = computed(() => {
|
|
261
|
-
var _a
|
|
305
|
+
var _a;
|
|
262
306
|
return {
|
|
263
307
|
formArray: state.formArray,
|
|
264
308
|
evaluateResultConfig: ((_a = state.config) == null ? void 0 : _a.evaluateResultConfig) || {},
|
|
265
|
-
evaluateResultSetting:
|
|
309
|
+
evaluateResultSetting: evaluateResultSetting.value,
|
|
266
310
|
isFinished: state.isFinished,
|
|
267
311
|
maxScore: state.maxScore
|
|
268
312
|
};
|
|
269
313
|
});
|
|
270
314
|
const evaluateCountdownProps = computed(() => {
|
|
271
|
-
var _a
|
|
315
|
+
var _a;
|
|
272
316
|
return {
|
|
273
317
|
formArray: state.formArray,
|
|
274
318
|
evaluateResultConfig: ((_a = state.config) == null ? void 0 : _a.evaluateResultConfig) || {},
|
|
275
|
-
evaluateResultSetting:
|
|
319
|
+
evaluateResultSetting: evaluateResultSetting.value,
|
|
276
320
|
form: state.form,
|
|
277
321
|
isFinished: state.isFinished,
|
|
278
322
|
currentTime: state.currentTime,
|
|
@@ -302,7 +346,8 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
302
346
|
showEvent,
|
|
303
347
|
formKey,
|
|
304
348
|
evaluatePageProps,
|
|
305
|
-
evaluateCountdownProps
|
|
349
|
+
evaluateCountdownProps,
|
|
350
|
+
skipCover
|
|
306
351
|
};
|
|
307
352
|
};
|
|
308
353
|
|
|
@@ -3,7 +3,7 @@ import moment from 'moment';
|
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
|
|
5
5
|
const useEvaluate = (props, state, config) => {
|
|
6
|
-
|
|
6
|
+
const { emit } = config;
|
|
7
7
|
const evaluateState = reactive({
|
|
8
8
|
totalLen: 0,
|
|
9
9
|
timer: null,
|
|
@@ -29,22 +29,22 @@ const useEvaluate = (props, state, config) => {
|
|
|
29
29
|
return (_a = props.evaluateResultSetting) == null ? void 0 : _a.evaluateStartTime;
|
|
30
30
|
});
|
|
31
31
|
const getEvaluateStartTime = computed(() => {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const tempSt = new Date(evaluateStartTime.value);
|
|
33
|
+
const isValidDate = XEUtils.isValidDate(tempSt);
|
|
34
34
|
if (!isValidDate)
|
|
35
35
|
return false;
|
|
36
36
|
return tempSt;
|
|
37
37
|
});
|
|
38
38
|
const getEvaluateTime = computed(() => {
|
|
39
|
-
|
|
39
|
+
const { evaluateTime } = props.evaluateResultSetting;
|
|
40
40
|
return +evaluateTime;
|
|
41
41
|
});
|
|
42
42
|
const getEvaluateEnd = computed(() => {
|
|
43
|
-
if (!showRange)
|
|
43
|
+
if (!showRange.value)
|
|
44
44
|
return false;
|
|
45
45
|
if (!getEvaluateTime.value)
|
|
46
46
|
return false;
|
|
47
|
-
|
|
47
|
+
const rangTime = moment(evaluateStartTime.value).add(getEvaluateTime.value, "minutes").valueOf();
|
|
48
48
|
if (state.curTime >= rangTime)
|
|
49
49
|
return true;
|
|
50
50
|
return props.isFinished;
|
|
@@ -56,7 +56,7 @@ const useEvaluate = (props, state, config) => {
|
|
|
56
56
|
return "\u5F00\u59CB\u6D4B\u8BC4";
|
|
57
57
|
});
|
|
58
58
|
const disabledEvaluate = computed(() => {
|
|
59
|
-
|
|
59
|
+
const res = getEvaluateStartTime.value && !evaluateState.isTimeOut || getEvaluateEnd.value;
|
|
60
60
|
return res;
|
|
61
61
|
});
|
|
62
62
|
const showRange = computed(() => {
|
|
@@ -71,7 +71,7 @@ const useEvaluate = (props, state, config) => {
|
|
|
71
71
|
return false;
|
|
72
72
|
if (getEvaluateStartTime.value)
|
|
73
73
|
return true;
|
|
74
|
-
|
|
74
|
+
const rangTime = moment(evaluateStartTime.value).add(getEvaluateTime.value, "minutes").valueOf();
|
|
75
75
|
return state.curTime < rangTime;
|
|
76
76
|
});
|
|
77
77
|
onMounted(() => {
|
|
@@ -83,23 +83,23 @@ const useEvaluate = (props, state, config) => {
|
|
|
83
83
|
const isBanStart = () => {
|
|
84
84
|
if (!evaluateStartTime.value || !getEvaluateTime.value)
|
|
85
85
|
return false;
|
|
86
|
-
|
|
86
|
+
const startTime = getEvaluateStartTime.value;
|
|
87
87
|
if (!startTime)
|
|
88
88
|
return false;
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const endTime = moment(evaluateStartTime.value).add(getEvaluateTime.value, "minutes").valueOf();
|
|
90
|
+
const cur = new Date().getTime();
|
|
91
91
|
return cur >= endTime;
|
|
92
92
|
};
|
|
93
93
|
const getTotalLen = () => {
|
|
94
94
|
var _a;
|
|
95
|
-
|
|
95
|
+
const arrList = (_a = props.formArray) == null ? void 0 : _a.filter((item) => !evaluateState.filterArr.includes(item.type) && !item.hide);
|
|
96
96
|
if (!arrList || !arrList.length)
|
|
97
97
|
return;
|
|
98
98
|
evaluateState.totalLen = arrList.length;
|
|
99
99
|
};
|
|
100
100
|
const countdown = (startTime) => {
|
|
101
101
|
clearTimer();
|
|
102
|
-
|
|
102
|
+
const msec = startTime - new Date().getTime();
|
|
103
103
|
if (msec <= 0) {
|
|
104
104
|
evaluateState.countdownStr = "00:00:00";
|
|
105
105
|
evaluateState.isTimeOut = true;
|
package/es/env.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
|
|
3
|
-
interface ImportMetaEnv {
|
|
4
|
-
readonly VITE_APP_TYPE: string;
|
|
5
|
-
// 更多环境变量...
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface ImportMeta {
|
|
9
|
-
readonly env: ImportMetaEnv;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare module '*.vue' {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
import type { App, defineComponent } from 'vue';
|
|
15
|
-
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
16
|
-
// // const component: DefineComponent<{}, {}, any>
|
|
17
|
-
const component: ReturnType<typeof defineComponent> & {
|
|
18
|
-
install(app: App): void;
|
|
19
|
-
};
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
export default component;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module '*.js';
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
interface ImportMetaEnv {
|
|
4
|
+
readonly VITE_APP_TYPE: string;
|
|
5
|
+
// 更多环境变量...
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface ImportMeta {
|
|
9
|
+
readonly env: ImportMetaEnv;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module '*.vue' {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
import type { App, defineComponent } from 'vue';
|
|
15
|
+
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
16
|
+
// // const component: DefineComponent<{}, {}, any>
|
|
17
|
+
const component: ReturnType<typeof defineComponent> & {
|
|
18
|
+
install(app: App): void;
|
|
19
|
+
};
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
export default component;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.js';
|