cnhis-design-vue 3.1.26-beta.0 → 3.1.26-beta.1
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/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/components/iho-table/src/plugins/index.js +6 -6
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.js +80 -78
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +96 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +4 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/{timeRendererPlugin/index.d.ts → timeRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js +56 -0
- package/es/shared/assets/img/failure.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/nodata.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video_default_cover.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_small.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/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.d.ts +0 -31
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.d.ts +0 -31
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.js +0 -60
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +0 -39
- 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
|
+
```
|
|
@@ -394,7 +394,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
394
394
|
visible: checkVisible,
|
|
395
395
|
resizable: false,
|
|
396
396
|
width: checkMinWidth,
|
|
397
|
-
slots: selectType === "checkbox" && !((_b =
|
|
397
|
+
slots: selectType === "checkbox" && !((_b = getAttr("checkbox-config")) == null ? void 0 : _b.checkMethod) ? checkboxSlot : null,
|
|
398
398
|
showOverflow: true
|
|
399
399
|
}];
|
|
400
400
|
const seqObj = columns.find((v) => v.type == "seq");
|
|
@@ -1311,10 +1311,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1311
1311
|
$rowIndex,
|
|
1312
1312
|
triggerCheckbox
|
|
1313
1313
|
} = data;
|
|
1314
|
-
if (((_a =
|
|
1314
|
+
if (((_a = getAttr("checkbox-config")) == null ? void 0 : _a.noTriggerCellClick) && triggerCheckbox) {
|
|
1315
1315
|
return false;
|
|
1316
1316
|
}
|
|
1317
|
-
if (((_b =
|
|
1317
|
+
if (((_b = getAttr("checkbox-config")) == null ? void 0 : _b.trigger) === "default") {
|
|
1318
1318
|
emit("handlerClickRow", row, $rowIndex);
|
|
1319
1319
|
return false;
|
|
1320
1320
|
}
|
|
@@ -4,15 +4,15 @@ import * as index$2 from './rendererPlugins/editableWidgets/dateRendererPlugin/i
|
|
|
4
4
|
import * as inputRendererPlugin from './rendererPlugins/editableWidgets/inputRendererPlugin.js';
|
|
5
5
|
import * as index$3 from './rendererPlugins/editableWidgets/selectRendererPlugin/index.js';
|
|
6
6
|
import * as index$4 from './rendererPlugins/editableWidgets/separateRendererPlugin/index.js';
|
|
7
|
-
import * as
|
|
7
|
+
import * as timeRendererPlugin from './rendererPlugins/editableWidgets/timeRendererPlugin.js';
|
|
8
8
|
import * as checkRendererPlugin from './rendererPlugins/widgets/checkRendererPlugin.js';
|
|
9
9
|
import * as colorRendererPlugin from './rendererPlugins/widgets/colorRendererPlugin.js';
|
|
10
10
|
import * as defaultRendererPlugin from './rendererPlugins/widgets/defaultRendererPlugin.js';
|
|
11
11
|
import * as labelRendererPlugin from './rendererPlugins/widgets/labelRendererPlugin.js';
|
|
12
12
|
import * as pictureRendererPlugin from './rendererPlugins/widgets/pictureRendererPlugin.js';
|
|
13
13
|
import * as seqRendererPlugin from './rendererPlugins/widgets/seqRendererPlugin.js';
|
|
14
|
-
import * as index$
|
|
15
|
-
import * as index$
|
|
14
|
+
import * as index$5 from './rowGroupSettingPlugin/index.js';
|
|
15
|
+
import * as index$6 from './virtualTreePlugin/index.js';
|
|
16
16
|
import { separateMetaModule } from '../../../../shared/utils/index.js';
|
|
17
17
|
|
|
18
18
|
const modules = Object.assign({
|
|
@@ -22,15 +22,15 @@ const modules = Object.assign({
|
|
|
22
22
|
"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx": inputRendererPlugin,
|
|
23
23
|
"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx": index$3,
|
|
24
24
|
"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx": index$4,
|
|
25
|
-
"./rendererPlugins/editableWidgets/timeRendererPlugin
|
|
25
|
+
"./rendererPlugins/editableWidgets/timeRendererPlugin.tsx": timeRendererPlugin,
|
|
26
26
|
"./rendererPlugins/widgets/checkRendererPlugin.tsx": checkRendererPlugin,
|
|
27
27
|
"./rendererPlugins/widgets/colorRendererPlugin.tsx": colorRendererPlugin,
|
|
28
28
|
"./rendererPlugins/widgets/defaultRendererPlugin.tsx": defaultRendererPlugin,
|
|
29
29
|
"./rendererPlugins/widgets/labelRendererPlugin.tsx": labelRendererPlugin,
|
|
30
30
|
"./rendererPlugins/widgets/pictureRendererPlugin.tsx": pictureRendererPlugin,
|
|
31
31
|
"./rendererPlugins/widgets/seqRendererPlugin.tsx": seqRendererPlugin,
|
|
32
|
-
"./rowGroupSettingPlugin/index.ts": index$
|
|
33
|
-
"./virtualTreePlugin/index.ts": index$
|
|
32
|
+
"./rowGroupSettingPlugin/index.ts": index$5,
|
|
33
|
+
"./virtualTreePlugin/index.ts": index$6
|
|
34
34
|
});
|
|
35
35
|
var PluginPresets = separateMetaModule(modules);
|
|
36
36
|
|
|
@@ -1,41 +1,28 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, computed, watch,
|
|
1
|
+
import { defineComponent, useAttrs, inject, ref, computed, watch, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, isRef } from 'vue';
|
|
2
2
|
import { generateTimeFormat } from '../../../../../../../shared/utils/index.js';
|
|
3
3
|
import { isFunction, isNaN } from 'lodash-es';
|
|
4
|
-
import {
|
|
4
|
+
import { NPopover, NInput, NDatePicker } from 'naive-ui';
|
|
5
5
|
import { InjectionIhoTableEmits } from '../../../../constants/index.js';
|
|
6
6
|
import { useCommon } from '../hooks/useCommon.js';
|
|
7
|
+
import _export_sfc from '../../../../../../../_virtual/plugin-vue_export-helper.js';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
inheritAttrs: false,
|
|
11
|
-
components: {
|
|
12
|
-
NDatePicker
|
|
13
|
-
},
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "editDate",
|
|
14
11
|
props: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
row: {
|
|
20
|
-
type: Object,
|
|
21
|
-
required: true
|
|
22
|
-
},
|
|
23
|
-
index: {
|
|
24
|
-
type: Number,
|
|
25
|
-
required: true
|
|
26
|
-
}
|
|
12
|
+
value: { type: String, default: void 0 },
|
|
13
|
+
column: { type: Object, required: true },
|
|
14
|
+
row: { type: Object, required: true },
|
|
15
|
+
index: { type: Number, required: true }
|
|
27
16
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
emits: ["update:value"],
|
|
18
|
+
setup(__props, { emit }) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const attr = useAttrs();
|
|
32
21
|
const globEmit = inject(InjectionIhoTableEmits);
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
isShow
|
|
36
|
-
} = useCommon();
|
|
37
|
-
const __value = ref(props.row[props.column.field]);
|
|
22
|
+
const { formRef, isShow } = useCommon();
|
|
23
|
+
const formattedValue = ref();
|
|
38
24
|
const onConfirm = (value) => {
|
|
25
|
+
emit("update:value", value);
|
|
39
26
|
globEmit("formChange", {
|
|
40
27
|
value,
|
|
41
28
|
row: props.row,
|
|
@@ -43,11 +30,8 @@ var EditDate = defineComponent({
|
|
|
43
30
|
index: props.index
|
|
44
31
|
});
|
|
45
32
|
};
|
|
46
|
-
const {
|
|
47
|
-
|
|
48
|
-
isEndDate = false
|
|
49
|
-
} = attrs;
|
|
50
|
-
const connectField = attrs.connectField || "";
|
|
33
|
+
const { isStartDate = false, isEndDate = false } = attr;
|
|
34
|
+
const connectField = attr.connectField || "";
|
|
51
35
|
const setDateDisabled = (cur, date) => {
|
|
52
36
|
if (isStartDate && connectField) {
|
|
53
37
|
return cur > date;
|
|
@@ -60,7 +44,10 @@ var EditDate = defineComponent({
|
|
|
60
44
|
const isDateDisabled = (ts) => {
|
|
61
45
|
if (!props.row[connectField])
|
|
62
46
|
return false;
|
|
63
|
-
return setDateDisabled(
|
|
47
|
+
return setDateDisabled(
|
|
48
|
+
ts,
|
|
49
|
+
isEndDate ? new Date(`${props.row[connectField].split(" ")[0]} 00:00:00`).getTime() : new Date(props.row[connectField]).getTime()
|
|
50
|
+
);
|
|
64
51
|
};
|
|
65
52
|
const isTimeDisabled = (ts) => {
|
|
66
53
|
const date = new Date(props.row[connectField]);
|
|
@@ -126,7 +113,7 @@ var EditDate = defineComponent({
|
|
|
126
113
|
return date;
|
|
127
114
|
}
|
|
128
115
|
function onBlur() {
|
|
129
|
-
let date =
|
|
116
|
+
let date = formattedValue.value;
|
|
130
117
|
if (isNaN(new Date(date).getTime())) {
|
|
131
118
|
if (/^\d{8}$/.test(date)) {
|
|
132
119
|
const dateNew = `${date.slice(0, 4)} ${date.slice(4, 6)} ${date.slice(6)}`;
|
|
@@ -140,11 +127,11 @@ var EditDate = defineComponent({
|
|
|
140
127
|
} else {
|
|
141
128
|
date = getFormatDate(date);
|
|
142
129
|
}
|
|
143
|
-
|
|
144
|
-
onConfirm(
|
|
130
|
+
formattedValue.value = date || void 0;
|
|
131
|
+
onConfirm(formattedValue.value);
|
|
145
132
|
}
|
|
146
133
|
const formatConfig = computed(() => {
|
|
147
|
-
const valueFormat =
|
|
134
|
+
const valueFormat = attr.valueFormat || "yyyy-MM-dd HH:mm:ss";
|
|
148
135
|
return {
|
|
149
136
|
valueFormat,
|
|
150
137
|
format: valueFormat,
|
|
@@ -154,52 +141,67 @@ var EditDate = defineComponent({
|
|
|
154
141
|
};
|
|
155
142
|
});
|
|
156
143
|
const dateConfig = {
|
|
157
|
-
type:
|
|
144
|
+
type: attr.type || "datetime",
|
|
158
145
|
clearable: true,
|
|
159
|
-
placeholder:
|
|
160
|
-
...
|
|
146
|
+
placeholder: attr.placeholder || "\u8BF7\u9009\u62E9",
|
|
147
|
+
...attr,
|
|
161
148
|
...formatConfig.value,
|
|
162
|
-
isDateDisabled: customDateDisabledDecorator(
|
|
149
|
+
isDateDisabled: customDateDisabledDecorator(attr.isDateDisabled) || isDateDisabled,
|
|
163
150
|
onUpdateFormattedValue: onConfirm
|
|
164
151
|
};
|
|
165
152
|
if (dateConfig.type.includes("time")) {
|
|
166
|
-
dateConfig.isTimeDisabled = customDateDisabledDecorator(
|
|
153
|
+
dateConfig.isTimeDisabled = customDateDisabledDecorator(attr.isTimeDisabled) || isTimeDisabled;
|
|
167
154
|
}
|
|
168
|
-
watch(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
155
|
+
watch(
|
|
156
|
+
() => props.value,
|
|
157
|
+
(value) => {
|
|
158
|
+
formattedValue.value = value;
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
return (_ctx, _cache) => {
|
|
162
|
+
return _ctx.$attrs.isPopover ? (openBlock(), createBlock(unref(NPopover), mergeProps({
|
|
163
|
+
key: 0,
|
|
164
|
+
show: unref(isShow),
|
|
165
|
+
trigger: "click",
|
|
166
|
+
showArrow: false,
|
|
167
|
+
placement: "bottom-start",
|
|
168
|
+
style: { "padding": "0" }
|
|
169
|
+
}, _ctx.$attrs, {
|
|
170
|
+
onClickoutside: _cache[4] || (_cache[4] = () => isShow.value = false)
|
|
171
|
+
}), {
|
|
172
|
+
trigger: withCtx(() => [
|
|
173
|
+
createVNode(unref(NInput), {
|
|
174
|
+
ref_key: "formRef",
|
|
175
|
+
ref: formRef,
|
|
176
|
+
clearable: "",
|
|
177
|
+
value: formattedValue.value,
|
|
178
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => formattedValue.value = $event),
|
|
179
|
+
onBlur,
|
|
180
|
+
onClick: _cache[1] || (_cache[1] = () => isShow.value = true)
|
|
181
|
+
}, null, 8, ["value"])
|
|
182
|
+
]),
|
|
183
|
+
default: withCtx(() => [
|
|
184
|
+
createVNode(unref(NDatePicker), mergeProps({
|
|
185
|
+
panel: "",
|
|
186
|
+
show: unref(isShow),
|
|
187
|
+
"onUpdate:show": _cache[2] || (_cache[2] = ($event) => isRef(isShow) ? isShow.value = $event : null),
|
|
188
|
+
"formatted-value": formattedValue.value,
|
|
189
|
+
"onUpdate:formatted-value": _cache[3] || (_cache[3] = ($event) => formattedValue.value = $event)
|
|
190
|
+
}, unref(dateConfig)), null, 16, ["show", "formatted-value"])
|
|
191
|
+
]),
|
|
192
|
+
_: 1
|
|
193
|
+
}, 16, ["show"])) : (openBlock(), createBlock(unref(NDatePicker), mergeProps({
|
|
194
|
+
key: 1,
|
|
195
|
+
ref_key: "formRef",
|
|
196
|
+
ref: formRef,
|
|
197
|
+
show: unref(isShow),
|
|
198
|
+
"onUpdate:show": _cache[5] || (_cache[5] = ($event) => isRef(isShow) ? isShow.value = $event : null),
|
|
199
|
+
"formatted-value": formattedValue.value,
|
|
200
|
+
"onUpdate:formatted-value": _cache[6] || (_cache[6] = ($event) => formattedValue.value = $event)
|
|
201
|
+
}, unref(dateConfig)), null, 16, ["show", "formatted-value"]));
|
|
202
|
+
};
|
|
202
203
|
}
|
|
203
204
|
});
|
|
205
|
+
var EditDate = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "editDate.vue"]]);
|
|
204
206
|
|
|
205
207
|
export { EditDate as default };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Func } from '../../../../../../../../es/shared/types';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { IhoTableFieldItem } from '../../../../../../../../es/components/iho-table';
|
|
4
|
+
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
5
|
+
declare const _default: import("vue").DefineComponent<{
|
|
6
|
+
value: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: undefined;
|
|
9
|
+
};
|
|
10
|
+
column: {
|
|
11
|
+
type: PropType<IhoTableFieldItem>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
row: {
|
|
15
|
+
type: PropType<AnyObject>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
index: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
attr: AnyObject;
|
|
24
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
value: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
29
|
+
column: {
|
|
30
|
+
type: PropType<IhoTableFieldItem>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
row: {
|
|
34
|
+
type: PropType<AnyObject>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
index: {
|
|
38
|
+
type: NumberConstructor;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
}>> & {
|
|
42
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
43
|
+
}>>;
|
|
44
|
+
emit: (event: "update:value", ...args: any[]) => void;
|
|
45
|
+
globEmit: (event: string, ...args: unknown[]) => void;
|
|
46
|
+
formRef: import("vue").Ref<HTMLElement | null>;
|
|
47
|
+
isShow: import("vue").Ref<boolean>;
|
|
48
|
+
formattedValue: import("vue").Ref<string | undefined>;
|
|
49
|
+
onConfirm: (value: string | null | undefined) => void;
|
|
50
|
+
isStartDate: any;
|
|
51
|
+
isEndDate: any;
|
|
52
|
+
connectField: string;
|
|
53
|
+
setDateDisabled: (cur: number, date: number) => boolean;
|
|
54
|
+
isDateDisabled: (ts: number) => boolean;
|
|
55
|
+
isTimeDisabled: (ts: number) => {
|
|
56
|
+
isHourDisabled: (hour: number) => boolean;
|
|
57
|
+
isMinuteDisabled: (minute: number) => boolean;
|
|
58
|
+
isSecondDisabled: (second: number) => boolean;
|
|
59
|
+
};
|
|
60
|
+
customDateDisabledDecorator: (customDateDisabled?: Func) => ((ts: number) => any) | null;
|
|
61
|
+
getFormatDate: (str: string) => string;
|
|
62
|
+
onBlur: () => void;
|
|
63
|
+
formatConfig: import("vue").ComputedRef<{
|
|
64
|
+
valueFormat: string;
|
|
65
|
+
format: string;
|
|
66
|
+
timePickerProps: {
|
|
67
|
+
format: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
}>;
|
|
70
|
+
dateConfig: AnyObject;
|
|
71
|
+
NDatePicker: any;
|
|
72
|
+
NInput: any;
|
|
73
|
+
NPopover: any;
|
|
74
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
75
|
+
value: {
|
|
76
|
+
type: StringConstructor;
|
|
77
|
+
default: undefined;
|
|
78
|
+
};
|
|
79
|
+
column: {
|
|
80
|
+
type: PropType<IhoTableFieldItem>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
row: {
|
|
84
|
+
type: PropType<AnyObject>;
|
|
85
|
+
required: true;
|
|
86
|
+
};
|
|
87
|
+
index: {
|
|
88
|
+
type: NumberConstructor;
|
|
89
|
+
required: true;
|
|
90
|
+
};
|
|
91
|
+
}>> & {
|
|
92
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
value: string;
|
|
95
|
+
}>;
|
|
96
|
+
export default _default;
|
|
@@ -25,7 +25,10 @@ function dateRendererPlugin() {
|
|
|
25
25
|
column,
|
|
26
26
|
$rowIndex
|
|
27
27
|
}) {
|
|
28
|
-
return [createVNode(EditDate, mergeProps(
|
|
28
|
+
return [createVNode(EditDate, mergeProps({
|
|
29
|
+
"value": row[column.field],
|
|
30
|
+
"onUpdate:value": ($event) => row[column.field] = $event
|
|
31
|
+
}, (props == null ? void 0 : props.componentProps) || {}, {
|
|
29
32
|
"column": column,
|
|
30
33
|
"row": row,
|
|
31
34
|
"index": $rowIndex
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function timeRendererPlugin(): import("
|
|
1
|
+
export declare function timeRendererPlugin(): import("../../../../../../../es/components/iho-table").TablePlugin;
|