cnhis-design-vue 3.1.23-beta.0 → 3.1.23-beta.11
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/index.d.ts +0 -3
- package/es/components/big-table/src/BigTable.vue.d.ts +0 -3
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +9 -20
- package/es/components/big-table/src/utils.d.ts +1 -1
- package/es/components/big-table/src/utils2.js +11 -37
- package/es/components/fabric-chart/src/components/PopupMenu.js +7 -2
- package/es/components/fabric-chart/src/hooks/useCenter2.js +9 -5
- package/es/components/fabric-chart/src/hooks/useEvent2.js +40 -8
- package/es/components/field-set/index.d.ts +1 -0
- package/es/components/field-set/src/FieldSet.js +16 -10
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -0
- package/es/components/form-config/index.d.ts +6 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +6 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -0
- package/es/components/form-render/index2.js +2 -1
- package/es/components/form-render/src/components/renderer/index.d.ts +2 -1
- package/es/components/form-render/src/components/renderer/index.js +2 -1
- package/es/components/form-render/src/components/renderer/index2.js +2 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascade.d.ts +86 -0
- package/es/components/form-render/src/components/renderer/levelSearchCascade.js +229 -0
- package/es/components/form-render/src/components/renderer/search.d.ts +13 -1
- package/es/components/form-render/src/components/renderer/search.js +2 -1
- package/es/components/form-render/src/components/renderer/{cascader.d.ts → searchCascade.d.ts} +0 -0
- package/es/components/form-render/src/components/renderer/{cascader.js → searchCascade.js} +1 -0
- package/es/components/form-render/src/components/renderer/select.js +2 -1
- package/es/components/form-render/src/hooks/useAsyncQueue2.js +4 -4
- package/es/components/form-render/src/hooks/useFieldListAdaptor2.js +11 -4
- package/es/components/form-render/src/hooks/useFormRequest.d.ts +2 -0
- package/es/components/form-render/src/hooks/useFormRequest2.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +6 -0
- package/es/components/form-render/src/utils/schema2.js +1 -4
- package/es/components/iho-table/index.d.ts +270 -101
- package/es/components/iho-table/src/IhoTable.vue.d.ts +270 -101
- package/es/components/iho-table/src/constants/index.d.ts +5 -3
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/constants/index2.js +9 -7
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -2
- package/es/components/iho-table/src/plugins/index.js +4 -1
- package/es/components/iho-table/src/plugins/index2.js +4 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +11 -8
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.d.ts +31 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.js +205 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +39 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon2.js +17 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.d.ts +4 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.js +4 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/{inputRendererPlugins.js → inputRendererPlugin.js} +4 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +31 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +60 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +40 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils2.js +20 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{edit-separate.js → editSeparate.js} +20 -22
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{edit-separate.vue.d.ts → editSeparate.vue.d.ts} +1 -17
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +13 -9
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils.d.ts → separateUtils.d.ts} +0 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils.js → separateUtils.js} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils2.js → separateUtils2.js} +4 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.d.ts +31 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.js +60 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +39 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/index.js +4 -1
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index2.js +1 -46
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.d.ts +11 -0
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +1 -0
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils2.js +50 -0
- package/es/components/iho-table/src/types/index.d.ts +0 -3
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -0
- package/es/components/search-cascader/index.d.ts +196 -0
- package/es/components/search-cascader/index.js +1 -0
- package/es/components/search-cascader/index2.js +10 -0
- package/es/components/search-cascader/src/SearchCascader.js +168 -0
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +198 -0
- package/es/components/search-cascader/src/components/SearchMenu.d.ts +45 -0
- package/es/components/search-cascader/src/components/SearchMenu.js +134 -0
- package/es/components/search-cascader/src/components/index.d.ts +1 -0
- package/es/components/search-cascader/src/components/index.js +1 -0
- package/es/components/search-cascader/src/constants/index.d.ts +3 -0
- package/es/components/search-cascader/src/constants/index.js +1 -0
- package/es/components/search-cascader/src/constants/index2.js +3 -0
- package/es/components/search-cascader/src/hooks/index.d.ts +1 -0
- package/es/components/search-cascader/src/hooks/index.js +1 -0
- package/es/components/search-cascader/src/hooks/useCssVariable.d.ts +3 -0
- package/es/components/search-cascader/src/hooks/useCssVariable.js +1 -0
- package/es/components/search-cascader/src/hooks/useCssVariable2.js +7 -0
- package/es/components/search-cascader/src/utils/index.d.ts +2 -0
- package/es/components/search-cascader/src/utils/index.js +1 -0
- package/es/components/search-cascader/src/utils/index2.js +11 -0
- package/es/components/search-cascader/style/index.css +1 -0
- package/es/components/select-label/index.d.ts +1 -0
- package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -0
- package/es/components/select-label/src/SelectLabel.vue_vue_type_script_setup_true_lang.js +16 -4
- package/es/components/select-person/index.d.ts +41 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +41 -0
- package/es/components/select-person/src/SelectPerson.vue_vue_type_script_setup_true_lang.js +45 -10
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.js +2 -1
- package/es/components/shortcut-setter/index.d.ts +6 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -0
- package/es/shared/components/no-data/NoData.js +74 -0
- package/es/shared/components/no-data/NoData.vue.d.ts +51 -0
- package/es/shared/components/no-data/index.d.ts +2 -0
- package/es/shared/components/no-data/index.js +1 -0
- package/es/shared/components/no-data/index2.js +2 -0
- package/es/shared/utils/index.d.ts +1 -1
- package/es/shared/utils/index2.js +14 -5
- package/package.json +2 -2
- package/es/components/big-table/src/components/edit-form/useCommon.d.ts +0 -4
- 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/inputRendererPlugins.d.ts +0 -1
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -6,6 +6,9 @@ export { colorRendererPlugin } from './rendererPlugins/widgets/colorRendererPlug
|
|
|
6
6
|
export { seqRendererPlugin } from './rendererPlugins/widgets/seqRendererPlugin.js';
|
|
7
7
|
export { checkRendererPlugin } from './rendererPlugins/widgets/checkRendererPlugin.js';
|
|
8
8
|
export { pictureRendererPlugin } from './rendererPlugins/widgets/pictureRendererPlugin.js';
|
|
9
|
-
export {
|
|
9
|
+
export { inputRendererPlugin } from './rendererPlugins/editableWidgets/inputRendererPlugin.js';
|
|
10
10
|
export { separateRendererPlugins } from './rendererPlugins/editableWidgets/separateRendererPlugin/index.js';
|
|
11
|
+
export { selectRendererPlugin } from './rendererPlugins/editableWidgets/selectRendererPlugin/index.js';
|
|
12
|
+
export { dateRendererPlugin } from './rendererPlugins/editableWidgets/dateRendererPlugin/index.js';
|
|
13
|
+
export { timeRendererPlugin } from './rendererPlugins/editableWidgets/timeRendererPlugin/index.js';
|
|
11
14
|
export { rowGroupSettingPlugin } from './rowGroupSettingPlugin/index2.js';
|
|
@@ -6,6 +6,9 @@ export { colorRendererPlugin } from './rendererPlugins/widgets/colorRendererPlug
|
|
|
6
6
|
export { seqRendererPlugin } from './rendererPlugins/widgets/seqRendererPlugin.js';
|
|
7
7
|
export { checkRendererPlugin } from './rendererPlugins/widgets/checkRendererPlugin.js';
|
|
8
8
|
export { pictureRendererPlugin } from './rendererPlugins/widgets/pictureRendererPlugin.js';
|
|
9
|
-
export {
|
|
9
|
+
export { inputRendererPlugin } from './rendererPlugins/editableWidgets/inputRendererPlugin.js';
|
|
10
10
|
export { separateRendererPlugins } from './rendererPlugins/editableWidgets/separateRendererPlugin/index.js';
|
|
11
|
+
export { selectRendererPlugin } from './rendererPlugins/editableWidgets/selectRendererPlugin/index.js';
|
|
12
|
+
export { dateRendererPlugin } from './rendererPlugins/editableWidgets/dateRendererPlugin/index.js';
|
|
13
|
+
export { timeRendererPlugin } from './rendererPlugins/editableWidgets/timeRendererPlugin/index.js';
|
|
11
14
|
export { rowGroupSettingPlugin } from './rowGroupSettingPlugin/index2.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { pick } from 'lodash-es';
|
|
1
|
+
import { pick, cloneDeep } from 'lodash-es';
|
|
2
|
+
import { toRaw } from 'vue';
|
|
2
3
|
import { HIGHEST_PRIORITY, WIDGET_TYPE } from '../../constants/index2.js';
|
|
3
4
|
import { defineTablePlugin } from '../../hooks/useTablePlugin2.js';
|
|
4
5
|
|
|
@@ -13,21 +14,23 @@ function lowCodeFieldAdaptorPlugin() {
|
|
|
13
14
|
field: _field.columnName,
|
|
14
15
|
width: _field.colWidth,
|
|
15
16
|
showOverflow: "tooltip",
|
|
16
|
-
...pick(_field, ["title"])
|
|
17
|
-
context: _field.context || {}
|
|
17
|
+
...pick(_field, ["title"])
|
|
18
18
|
};
|
|
19
|
-
settingObjAdaptor(
|
|
19
|
+
settingObjAdaptor(result, _field);
|
|
20
20
|
return result;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function settingObjAdaptor(
|
|
26
|
-
if (!settingObj)
|
|
25
|
+
function settingObjAdaptor(fieldItem, lowCodeField) {
|
|
26
|
+
if (!lowCodeField.settingObj)
|
|
27
27
|
return;
|
|
28
|
-
fieldItem.editRender = {
|
|
28
|
+
fieldItem.editRender = {
|
|
29
|
+
name: lowCodeField.settingObj.attr || "DEFAULT",
|
|
30
|
+
props: cloneDeep(toRaw(lowCodeField))
|
|
31
|
+
};
|
|
29
32
|
fieldItem.editRender.enabled = !Reflect.get(WIDGET_TYPE, fieldItem.editRender.name);
|
|
30
|
-
fieldItem.visible = settingObj.isHide !== "1";
|
|
33
|
+
fieldItem.visible = lowCodeField.settingObj.isHide !== "1";
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export { lowCodeFieldAdaptorPlugin };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IhoTableFieldItem } from '../../../../../../../../es/components/iho-table';
|
|
3
|
+
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{
|
|
5
|
+
column: {
|
|
6
|
+
type: PropType<IhoTableFieldItem>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
row: {
|
|
10
|
+
type: PropType<AnyObject>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
index: {
|
|
14
|
+
type: NumberConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
column: {
|
|
19
|
+
type: PropType<IhoTableFieldItem>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
row: {
|
|
23
|
+
type: PropType<AnyObject>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
index: {
|
|
27
|
+
type: NumberConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
}>>, {}>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { defineComponent, inject, ref, computed, watch, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { generateTimeFormat } from '../../../../../../../shared/utils/index2.js';
|
|
3
|
+
import { isFunction, isNaN } from 'lodash-es';
|
|
4
|
+
import { NDatePicker, NPopover, NInput } from 'naive-ui';
|
|
5
|
+
import { InjectionIhoTableEmits } from '../../../../constants/index2.js';
|
|
6
|
+
import { useCommon } from '../hooks/useCommon2.js';
|
|
7
|
+
|
|
8
|
+
var EditDate = defineComponent({
|
|
9
|
+
name: "EditDate",
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
components: {
|
|
12
|
+
NDatePicker
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
column: {
|
|
16
|
+
type: Object,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
row: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
index: {
|
|
24
|
+
type: Number,
|
|
25
|
+
required: true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup(props, {
|
|
29
|
+
attrs,
|
|
30
|
+
emit
|
|
31
|
+
}) {
|
|
32
|
+
const globEmit = inject(InjectionIhoTableEmits);
|
|
33
|
+
const {
|
|
34
|
+
formRef,
|
|
35
|
+
isShow
|
|
36
|
+
} = useCommon();
|
|
37
|
+
const __value = ref(props.row[props.column.field]);
|
|
38
|
+
const onConfirm = (value) => {
|
|
39
|
+
globEmit("formChange", {
|
|
40
|
+
value,
|
|
41
|
+
row: props.row,
|
|
42
|
+
column: props.column,
|
|
43
|
+
index: props.index
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const {
|
|
47
|
+
isStartDate = false,
|
|
48
|
+
isEndDate = false
|
|
49
|
+
} = attrs;
|
|
50
|
+
const connectField = attrs.connectField || "";
|
|
51
|
+
const setDateDisabled = (cur, date) => {
|
|
52
|
+
if (isStartDate && connectField) {
|
|
53
|
+
return cur > date;
|
|
54
|
+
}
|
|
55
|
+
if (isEndDate && connectField) {
|
|
56
|
+
return cur < date;
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
};
|
|
60
|
+
const isDateDisabled = (ts) => {
|
|
61
|
+
if (!props.row[connectField])
|
|
62
|
+
return false;
|
|
63
|
+
return setDateDisabled(ts, isEndDate ? new Date(`${props.row[connectField].split(" ")[0]} 00:00:00`).getTime() : new Date(props.row[connectField]).getTime());
|
|
64
|
+
};
|
|
65
|
+
const isTimeDisabled = (ts) => {
|
|
66
|
+
const date = new Date(props.row[connectField]);
|
|
67
|
+
const d = new Date(ts);
|
|
68
|
+
const h = date.getHours();
|
|
69
|
+
const m = date.getMinutes();
|
|
70
|
+
const s = date.getSeconds();
|
|
71
|
+
const setDisabled = (t1, t2, d1, d2) => {
|
|
72
|
+
if (isEndDate && d1 > d2)
|
|
73
|
+
return false;
|
|
74
|
+
if (isStartDate && d1 < d2)
|
|
75
|
+
return false;
|
|
76
|
+
return setDateDisabled(t1, t2);
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
isHourDisabled: (hour) => {
|
|
80
|
+
if (!props.row[connectField])
|
|
81
|
+
return false;
|
|
82
|
+
const d2 = new Date(`${props.row[connectField].split(" ")[0]} 00:00:00`).getTime();
|
|
83
|
+
const minute = d.getMinutes();
|
|
84
|
+
const second = d.getSeconds();
|
|
85
|
+
const d1 = ts - hour * 60 * 60 * 1e3 - minute * 60 * 1e3 - second * 1e3;
|
|
86
|
+
return setDisabled(hour, h, d1, d2);
|
|
87
|
+
},
|
|
88
|
+
isMinuteDisabled: (minute) => {
|
|
89
|
+
if (!props.row[connectField])
|
|
90
|
+
return false;
|
|
91
|
+
const d2 = new Date(`${props.row[connectField].split(" ")[0]} ${h}:00:00`).getTime();
|
|
92
|
+
const second = d.getSeconds();
|
|
93
|
+
const d1 = ts - minute * 60 * 1e3 - second * 1e3;
|
|
94
|
+
return setDisabled(minute, m, d1, d2);
|
|
95
|
+
},
|
|
96
|
+
isSecondDisabled: (second) => {
|
|
97
|
+
if (!props.row[connectField])
|
|
98
|
+
return false;
|
|
99
|
+
const d2 = new Date(`${props.row[connectField].split(" ")[0]} ${h}:${m}:00`).getTime();
|
|
100
|
+
const d1 = ts - second * 1e3;
|
|
101
|
+
return setDisabled(second, s, d1, d2);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
function customDateDisabledDecorator(customDateDisabled) {
|
|
106
|
+
if (!isFunction(customDateDisabled))
|
|
107
|
+
return null;
|
|
108
|
+
return (ts) => {
|
|
109
|
+
return customDateDisabled(ts, props.row);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function getFormatDate(str) {
|
|
113
|
+
if (!str)
|
|
114
|
+
return "";
|
|
115
|
+
const d = new Date(str);
|
|
116
|
+
const month = `00${d.getMonth() + 1}`.slice(-2);
|
|
117
|
+
const day = `00${d.getDate()}`.slice(-2);
|
|
118
|
+
const valueFormat = formatConfig.value.valueFormat;
|
|
119
|
+
const format = valueFormat.includes("/") ? "/" : valueFormat.includes(".") ? "." : "-";
|
|
120
|
+
let date = `${d.getFullYear()}${format}${month}${format}${day}`;
|
|
121
|
+
const dTime = d.getTime();
|
|
122
|
+
const connectFieldTime = new Date(props.row[connectField]).getTime();
|
|
123
|
+
if (props.row[connectField] && (isStartDate && dTime > connectFieldTime || isEndDate && dTime < connectFieldTime)) {
|
|
124
|
+
date = "";
|
|
125
|
+
}
|
|
126
|
+
return date;
|
|
127
|
+
}
|
|
128
|
+
function onBlur() {
|
|
129
|
+
let date = __value.value;
|
|
130
|
+
if (isNaN(new Date(date).getTime())) {
|
|
131
|
+
if (/^\d{8}$/.test(date)) {
|
|
132
|
+
const dateNew = `${date.slice(0, 4)} ${date.slice(4, 6)} ${date.slice(6)}`;
|
|
133
|
+
date = "";
|
|
134
|
+
if (!isNaN(new Date(dateNew).getTime())) {
|
|
135
|
+
date = getFormatDate(dateNew);
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
date = "";
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
date = getFormatDate(date);
|
|
142
|
+
}
|
|
143
|
+
props.row[props.column.field] = __value.value = date || void 0;
|
|
144
|
+
onConfirm(__value.value);
|
|
145
|
+
}
|
|
146
|
+
const formatConfig = computed(() => {
|
|
147
|
+
const valueFormat = attrs.valueFormat || "yyyy-MM-dd HH:mm:ss";
|
|
148
|
+
return {
|
|
149
|
+
valueFormat,
|
|
150
|
+
format: valueFormat,
|
|
151
|
+
timePickerProps: {
|
|
152
|
+
format: generateTimeFormat(valueFormat)
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
const dateConfig = {
|
|
157
|
+
type: attrs.type || "datetime",
|
|
158
|
+
clearable: true,
|
|
159
|
+
placeholder: attrs.placeholder || "\u8BF7\u9009\u62E9",
|
|
160
|
+
...attrs,
|
|
161
|
+
...formatConfig.value,
|
|
162
|
+
isDateDisabled: customDateDisabledDecorator(attrs.isDateDisabled) || isDateDisabled,
|
|
163
|
+
onUpdateFormattedValue: onConfirm
|
|
164
|
+
};
|
|
165
|
+
if (dateConfig.type.includes("time")) {
|
|
166
|
+
dateConfig.isTimeDisabled = customDateDisabledDecorator(attrs.isTimeDisabled) || isTimeDisabled;
|
|
167
|
+
}
|
|
168
|
+
watch(() => props.row[props.column.field], (value) => {
|
|
169
|
+
__value.value = value;
|
|
170
|
+
});
|
|
171
|
+
return () => (attrs == null ? void 0 : attrs.isPopover) ? createVNode(NPopover, mergeProps({
|
|
172
|
+
"show": isShow.value,
|
|
173
|
+
"trigger": "click",
|
|
174
|
+
"showArrow": false,
|
|
175
|
+
"placement": "bottom-start",
|
|
176
|
+
"style": "padding: 0"
|
|
177
|
+
}, attrs, {
|
|
178
|
+
"onClickoutside": () => isShow.value = false
|
|
179
|
+
}), {
|
|
180
|
+
trigger: () => createVNode(NInput, {
|
|
181
|
+
"ref": formRef,
|
|
182
|
+
"clearable": true,
|
|
183
|
+
"value": __value.value,
|
|
184
|
+
"onUpdate:value": ($event) => __value.value = $event,
|
|
185
|
+
"onBlur": onBlur,
|
|
186
|
+
"onClick": () => isShow.value = true
|
|
187
|
+
}, null),
|
|
188
|
+
default: () => createVNode(NDatePicker, mergeProps({
|
|
189
|
+
"panel": true,
|
|
190
|
+
"show": isShow.value,
|
|
191
|
+
"onUpdate:show": ($event) => isShow.value = $event,
|
|
192
|
+
"formattedValue": props.row[props.column.field],
|
|
193
|
+
"onUpdate:formattedValue": ($event) => props.row[props.column.field] = $event
|
|
194
|
+
}, dateConfig), null)
|
|
195
|
+
}) : createVNode(NDatePicker, mergeProps({
|
|
196
|
+
"ref": formRef,
|
|
197
|
+
"show": isShow.value,
|
|
198
|
+
"onUpdate:show": ($event) => isShow.value = $event,
|
|
199
|
+
"formattedValue": props.row[props.column.field],
|
|
200
|
+
"onUpdate:formattedValue": ($event) => props.row[props.column.field] = $event
|
|
201
|
+
}, dateConfig), null);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
export { EditDate as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dateRendererPlugin(): import("../../../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createVNode, mergeProps } from 'vue';
|
|
2
|
+
import '../../../../../index2.js';
|
|
3
|
+
import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index2.js';
|
|
4
|
+
import EditDate from './editDate.js';
|
|
5
|
+
import { defineTablePlugin } from '../../../../hooks/useTablePlugin2.js';
|
|
6
|
+
|
|
7
|
+
function dateRendererPlugin() {
|
|
8
|
+
const pluginName = "dateRendererPlugin";
|
|
9
|
+
return defineTablePlugin({
|
|
10
|
+
name: pluginName,
|
|
11
|
+
vxe(instance) {
|
|
12
|
+
instance.renderer.add(EDITABLE_WIDGET_TYPE.DATE, {
|
|
13
|
+
renderCell({
|
|
14
|
+
props
|
|
15
|
+
}, {
|
|
16
|
+
row,
|
|
17
|
+
column
|
|
18
|
+
}) {
|
|
19
|
+
return [createVNode("span", null, [row[column.field]])];
|
|
20
|
+
},
|
|
21
|
+
renderEdit({
|
|
22
|
+
props
|
|
23
|
+
}, {
|
|
24
|
+
row,
|
|
25
|
+
column,
|
|
26
|
+
$rowIndex
|
|
27
|
+
}) {
|
|
28
|
+
return [createVNode(EditDate, mergeProps((props == null ? void 0 : props.componentProps) || {}, {
|
|
29
|
+
"column": column,
|
|
30
|
+
"row": row,
|
|
31
|
+
"index": $rowIndex
|
|
32
|
+
}), null)];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { dateRendererPlugin };
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useCommon } from './useCommon2.js';
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon2.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ref, onMounted } from 'vue';
|
|
2
|
+
|
|
3
|
+
const useCommon = () => {
|
|
4
|
+
const formRef = ref(null);
|
|
5
|
+
const isShow = ref(false);
|
|
6
|
+
onMounted(() => {
|
|
7
|
+
var _a;
|
|
8
|
+
(_a = formRef.value) == null ? void 0 : _a.focus();
|
|
9
|
+
isShow.value = true;
|
|
10
|
+
});
|
|
11
|
+
return {
|
|
12
|
+
formRef,
|
|
13
|
+
isShow
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { useCommon };
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { inputRendererPlugin } from './inputRendererPlugin.js';
|
|
2
2
|
export { separateRendererPlugins } from './separateRendererPlugin/index.js';
|
|
3
|
+
export { selectRendererPlugin } from './selectRendererPlugin/index.js';
|
|
4
|
+
export { dateRendererPlugin } from './dateRendererPlugin/index.js';
|
|
5
|
+
export { timeRendererPlugin } from './timeRendererPlugin/index.js';
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function inputRendererPlugin(): import("../../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createVNode, inject } from 'vue';
|
|
2
2
|
import { NInput } from 'naive-ui';
|
|
3
3
|
import '../../../../index2.js';
|
|
4
|
-
import {
|
|
4
|
+
import { EDITABLE_WIDGET_TYPE, InjectionIhoTableEmits } from '../../../constants/index2.js';
|
|
5
5
|
import { defineTablePlugin } from '../../../hooks/useTablePlugin2.js';
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function inputRendererPlugin() {
|
|
8
8
|
const pluginName = "inputRendererPlugins";
|
|
9
9
|
return defineTablePlugin({
|
|
10
10
|
name: pluginName,
|
|
11
11
|
vxe(instance) {
|
|
12
|
-
instance.renderer.add(
|
|
12
|
+
instance.renderer.add(EDITABLE_WIDGET_TYPE.INPUT, {
|
|
13
13
|
renderCell(renderOpts, {
|
|
14
14
|
row,
|
|
15
15
|
column
|
|
@@ -41,4 +41,4 @@ function inputRendererPlugins() {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export {
|
|
44
|
+
export { inputRendererPlugin };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IhoTableFieldItem } from '../../../../../../../../es/components/iho-table';
|
|
3
|
+
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{
|
|
5
|
+
column: {
|
|
6
|
+
type: PropType<IhoTableFieldItem>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
row: {
|
|
10
|
+
type: PropType<AnyObject>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
index: {
|
|
14
|
+
type: NumberConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
column: {
|
|
19
|
+
type: PropType<IhoTableFieldItem>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
row: {
|
|
23
|
+
type: PropType<AnyObject>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
index: {
|
|
27
|
+
type: NumberConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
}>>, {}>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent, inject, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { NSelect } from 'naive-ui';
|
|
3
|
+
import { InjectionIhoTableEmits } from '../../../../constants/index2.js';
|
|
4
|
+
import { useCommon } from '../hooks/useCommon2.js';
|
|
5
|
+
|
|
6
|
+
var EditSelect = defineComponent({
|
|
7
|
+
name: "EditSelect",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
components: {
|
|
10
|
+
NSelect
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
column: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
row: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
index: {
|
|
22
|
+
type: Number,
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(props, {
|
|
27
|
+
attrs,
|
|
28
|
+
slots,
|
|
29
|
+
emit
|
|
30
|
+
}) {
|
|
31
|
+
const globEmit = inject(InjectionIhoTableEmits);
|
|
32
|
+
const {
|
|
33
|
+
formRef,
|
|
34
|
+
isShow
|
|
35
|
+
} = useCommon();
|
|
36
|
+
function onUpdateValue(value) {
|
|
37
|
+
globEmit("formChange", {
|
|
38
|
+
value,
|
|
39
|
+
row: props.row,
|
|
40
|
+
column: props.column,
|
|
41
|
+
index: props.index
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return () => createVNode(NSelect, mergeProps({
|
|
45
|
+
"ref": formRef,
|
|
46
|
+
"show": isShow.value,
|
|
47
|
+
"onUpdate:show": ($event) => isShow.value = $event
|
|
48
|
+
}, attrs, {
|
|
49
|
+
"value": props.row[props.column.field],
|
|
50
|
+
"onUpdate:value": ($event) => props.row[props.column.field] = $event,
|
|
51
|
+
"consistentMenuWidth": false,
|
|
52
|
+
"clearable": true,
|
|
53
|
+
"filterable": true,
|
|
54
|
+
"placeholder": attrs.placeholder || "\u8BF7\u9009\u62E9",
|
|
55
|
+
"onUpdateValue": onUpdateValue
|
|
56
|
+
}), null);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export { EditSelect as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function selectRendererPlugin(): import("../../../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createVNode, mergeProps } from 'vue';
|
|
2
|
+
import '../../../../../index2.js';
|
|
3
|
+
import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index2.js';
|
|
4
|
+
import EditSelect from './editSelect.js';
|
|
5
|
+
import { getDefaultValue } from './selectUtils2.js';
|
|
6
|
+
import { defineTablePlugin } from '../../../../hooks/useTablePlugin2.js';
|
|
7
|
+
|
|
8
|
+
function selectRendererPlugin() {
|
|
9
|
+
const pluginName = "selectRendererPlugin";
|
|
10
|
+
return defineTablePlugin({
|
|
11
|
+
name: pluginName,
|
|
12
|
+
vxe(instance) {
|
|
13
|
+
instance.renderer.add(EDITABLE_WIDGET_TYPE.SELECT, {
|
|
14
|
+
renderCell({
|
|
15
|
+
props
|
|
16
|
+
}, {
|
|
17
|
+
row,
|
|
18
|
+
column
|
|
19
|
+
}) {
|
|
20
|
+
return [createVNode("span", null, [getDefaultValue(row, props)])];
|
|
21
|
+
},
|
|
22
|
+
renderEdit({
|
|
23
|
+
props
|
|
24
|
+
}, {
|
|
25
|
+
row,
|
|
26
|
+
column,
|
|
27
|
+
$rowIndex
|
|
28
|
+
}) {
|
|
29
|
+
return [createVNode(EditSelect, mergeProps((props == null ? void 0 : props.componentProps) || {}, {
|
|
30
|
+
"column": column,
|
|
31
|
+
"row": row,
|
|
32
|
+
"index": $rowIndex
|
|
33
|
+
}), null)];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { selectRendererPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultValue } from './selectUtils2.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function getDefaultValue(row, item) {
|
|
2
|
+
var _a;
|
|
3
|
+
const value = row[item.columnName];
|
|
4
|
+
if (Array.isArray(value))
|
|
5
|
+
return (_a = value.map((v) => getValue(v))) == null ? void 0 : _a.join(",");
|
|
6
|
+
return getValue(value);
|
|
7
|
+
function getValue(value2) {
|
|
8
|
+
var _a2, _b;
|
|
9
|
+
const findValue = (options) => {
|
|
10
|
+
var _a3;
|
|
11
|
+
return ((_a3 = options == null ? void 0 : options.find((v) => v.value == value2)) == null ? void 0 : _a3.label) || value2 || "";
|
|
12
|
+
};
|
|
13
|
+
if (item.formatMap) {
|
|
14
|
+
return row[(_a2 = item.formatMap) == null ? void 0 : _a2.label];
|
|
15
|
+
}
|
|
16
|
+
return findValue(((_b = item.componentProps) == null ? void 0 : _b.options) || []);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { getDefaultValue };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, watch, computed, onMounted, onDeactivated, openBlock, createBlock, unref, withCtx, createElementVNode, withModifiers, normalizeStyle, toDisplayString } from 'vue';
|
|
2
|
-
import script from '../../../../../../../shared/components/SlotRender/SlotRender.js';
|
|
1
|
+
import { defineComponent, inject, ref, watch, computed, onMounted, onDeactivated, openBlock, createBlock, unref, withCtx, createElementVNode, withModifiers, normalizeStyle, toDisplayString, renderSlot, createVNode } from 'vue';
|
|
3
2
|
import { cloneDeep, isObject, isArray } from 'lodash-es';
|
|
4
3
|
import { NPopover, NInput } from 'naive-ui';
|
|
5
4
|
import { InjectionIhoTableEmits, InjectionIhoTableHandler } from '../../../../constants/index2.js';
|
|
6
5
|
import _export_sfc from '../../../../../../../_virtual/plugin-vue_export-helper.js';
|
|
7
6
|
|
|
8
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
__name: "
|
|
8
|
+
__name: "editSeparate",
|
|
10
9
|
props: {
|
|
11
10
|
value: {},
|
|
12
11
|
height: { type: Number },
|
|
@@ -22,6 +21,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
21
|
const tableHandler = inject(InjectionIhoTableHandler);
|
|
23
22
|
const popoverRef = ref();
|
|
24
23
|
const editContent = ref();
|
|
24
|
+
function setEditContent(value) {
|
|
25
|
+
editContent.value = value;
|
|
26
|
+
}
|
|
25
27
|
const show = ref(false);
|
|
26
28
|
function setShow(v) {
|
|
27
29
|
show.value = v;
|
|
@@ -70,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
70
72
|
ref: popoverRef,
|
|
71
73
|
trigger: "manual",
|
|
72
74
|
show: show.value,
|
|
73
|
-
"onUpdate:show": _cache[
|
|
75
|
+
"onUpdate:show": _cache[2] || (_cache[2] = ($event) => show.value = $event),
|
|
74
76
|
"show-arrow": false
|
|
75
77
|
}, {
|
|
76
78
|
trigger: withCtx(() => [
|
|
@@ -81,30 +83,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
81
83
|
style: normalizeStyle(unref(style))
|
|
82
84
|
}, toDisplayString(__props.displayContent || " "), 5)
|
|
83
85
|
]),
|
|
84
|
-
default: withCtx(() =>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
default: withCtx(() => [
|
|
87
|
+
renderSlot(_ctx.$slots, "menu", {
|
|
88
|
+
value: editContent.value,
|
|
89
|
+
"onUpdate:value": setEditContent,
|
|
90
|
+
"onUpdate:show": setShow,
|
|
91
|
+
col: __props.column,
|
|
92
|
+
row: __props.row
|
|
93
|
+
}, () => [
|
|
94
|
+
createVNode(unref(NInput), {
|
|
90
95
|
value: editContent.value,
|
|
91
96
|
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => editContent.value = $event),
|
|
92
|
-
"onUpdate:show": setShow,
|
|
93
|
-
col: __props.column,
|
|
94
|
-
row: __props.row
|
|
95
|
-
}, null, 8, ["renderer", "value", "col", "row"])) : (openBlock(), createBlock(unref(NInput), {
|
|
96
|
-
key: 1,
|
|
97
|
-
value: editContent.value,
|
|
98
|
-
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => editContent.value = $event),
|
|
99
97
|
type: "textarea"
|
|
100
|
-
}, null, 8, ["value"])
|
|
101
|
-
]
|
|
102
|
-
|
|
103
|
-
_:
|
|
98
|
+
}, null, 8, ["value"])
|
|
99
|
+
])
|
|
100
|
+
]),
|
|
101
|
+
_: 3
|
|
104
102
|
}, 8, ["show"]);
|
|
105
103
|
};
|
|
106
104
|
}
|
|
107
105
|
});
|
|
108
|
-
var EditSeparate = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "
|
|
106
|
+
var EditSeparate = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "editSeparate.vue"]]);
|
|
109
107
|
|
|
110
108
|
export { EditSeparate as default };
|