cnhis-design-vue 3.0.0 → 3.0.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +27 -4
  2. package/env.d.ts +2 -0
  3. package/es/big-table/index.css +0 -4
  4. package/es/big-table/index.js +300 -474
  5. package/es/button-print/index.css +1 -5
  6. package/es/button-print/index.js +4920 -18073
  7. package/es/drag-layout/index.css +1 -5
  8. package/es/grid/index.css +0 -4
  9. package/es/grid/index.js +3 -4
  10. package/es/index.css +0 -4
  11. package/es/index.js +257 -7227
  12. package/package.json +2 -8
  13. package/packages/big-table/src/BigTable.vue +40 -41
  14. package/packages/big-table/src/bigTableEmits.ts +3 -1
  15. package/packages/big-table/src/components/edit-form/edit-input.vue +27 -7
  16. package/packages/big-table/src/components/edit-form/edit-select-table.vue +2 -2
  17. package/packages/big-table/src/components/edit-form/edit-select.vue +1 -1
  18. package/packages/big-table/src/hooks/useBatchEditing.ts +123 -123
  19. package/packages/big-table/src/hooks/useEdit.ts +45 -18
  20. package/packages/button-print/src/ButtonPrint.vue +11 -144
  21. package/packages/button-print/src/components/IdentityVerification.vue +14 -43
  22. package/packages/grid/index.ts +5 -2
  23. package/packages/grid/src/Grid.tsx +1 -5
  24. package/packages/grid/src/hooks.ts +1 -2
  25. package/packages/index.ts +13 -14
  26. package/tsconfig.node.json +1 -1
  27. package/packages/big-table/src/components/edit-form3/EditForm.vue +0 -426
  28. package/packages/big-table/src/components/edit-form3/edit-component/edit-date-picker/edit-date-picker.vue +0 -66
  29. package/packages/big-table/src/components/edit-form3/edit-component/edit-digital/edit-digital.vue +0 -60
  30. package/packages/big-table/src/components/edit-form3/edit-component/edit-input/edit-input.vue +0 -38
  31. package/packages/big-table/src/components/edit-form3/edit-component/edit-input-password/edit-input-password.vue +0 -89
  32. package/packages/big-table/src/components/edit-form3/edit-component/edit-month-picker/edit-month-picker.vue +0 -38
  33. package/packages/big-table/src/components/edit-form3/edit-component/edit-search/edit-search.vue +0 -63
  34. package/packages/big-table/src/components/edit-form3/edit-component/edit-search-more/edit-search-more.vue +0 -69
  35. package/packages/big-table/src/components/edit-form3/edit-component/edit-select/edit-select.vue +0 -51
  36. package/packages/big-table/src/components/edit-form3/edit-component/edit-select-multiple/edit-select-multiple.vue +0 -60
  37. package/packages/big-table/src/components/edit-form3/edit-component/edit-textarea/edit-textarea.vue +0 -34
  38. package/packages/big-table/src/components/edit-form3/edit-component/edit-time-picker/edit-time-picker.vue +0 -42
  39. package/packages/big-table/src/components/edit-form3/edit-component/editFormProps.ts +0 -91
  40. package/packages/big-table/src/components/edit-form3/edit-component/register-com.ts +0 -18
  41. package/packages/big-table/src/components/edit-form3/hooks/useConfigData.ts +0 -79
  42. package/packages/big-table/src/components/edit-form3/hooks/useDateType.ts +0 -184
  43. package/packages/big-table/src/components/edit-form3/hooks/useFormCommon.ts +0 -373
  44. package/packages/big-table/src/components/edit-form3/hooks/useItemDefault.ts +0 -638
  45. package/packages/big-table/src/components/edit-form3/hooks/useSearch.ts +0 -910
  46. package/packages/big-table/src/components/edit-form3/hooks/useValidateRules.ts +0 -387
  47. package/packages/big-table/src/components/edit-form3/interface.ts +0 -53
  48. package/packages/big-table/src/components/edit-form3/types.ts +0 -3
  49. package/packages/big-table/src/components/edit-form3/utils.ts +0 -247
@@ -1,38 +0,0 @@
1
- <template>
2
- <NDatePicker
3
- type="month"
4
- v-model:value="item.useFormValue"
5
- :ref="'monthPicker-' + item.val_key"
6
- :placeholder="item.placeholder || ''"
7
- :clearable="item.is_empty == 0"
8
- :disabled="item.is_edit == 0"
9
- :disabledDate="(current: number) => disabledDatePicker(current, item)"
10
- />
11
- </template>
12
-
13
- <script lang="ts">
14
- import { defineComponent, ref } from 'vue'
15
- import { NDatePicker } from 'naive-ui'
16
- import editFormProps from '../editFormProps'
17
- import { useItemDefault } from '../../hooks/useItemDefault'
18
- import { useDateType } from '../../hooks/useDateType'
19
-
20
- export default defineComponent({
21
- name: 'editMonthPicker',
22
- components: {
23
- NDatePicker
24
- },
25
- props: {
26
- ...editFormProps
27
- },
28
- emits: ['hanldeFromBlur'],
29
- setup (props, { attrs, slots, emit }) {
30
- const { open } = useItemDefault(props, emit)
31
-
32
- return {
33
- ...useDateType(open)
34
- }
35
- }
36
- })
37
- </script>
38
- <style lang="less" scoped></style>
@@ -1,63 +0,0 @@
1
- <template>
2
- <div class="select-content">
3
- <NSelect
4
- v-model:value="item.useFormValue"
5
- :ref="'search-' + item.val_key"
6
- :consistent-menu-width="(item.elem_width || 6) > 11"
7
- class="formItem-select editItem-search"
8
- :placeholder="item.placeholder || '请选择'"
9
- :clearable="item.is_empty == 0"
10
- :disabled="item.is_edit == 0"
11
- :filterable="selectIsOpen"
12
- @search="(value: string) => handleMultipleSearch(value, item)"
13
- @update:show="(show: boolean) => handlerDropdownVisibleChange(show, item)"
14
- @update:value="(value: string | number | null) => handleSearchSelect(value, item, 'select')"
15
- :loading="state.fetching"
16
- :options="state.curOptions"
17
- :render-option="renderOption"
18
- >
19
- </NSelect>
20
- </div>
21
- </template>
22
-
23
- <script lang="tsx">
24
- import { defineComponent, ref, VNode } from 'vue'
25
- import { NSelect, SelectOption } from 'naive-ui'
26
- import editFormProps from '../editFormProps'
27
- import { useItemDefault } from '../../hooks/useItemDefault'
28
- import { useSearch } from '../../hooks/useSearch'
29
-
30
- export default defineComponent({
31
- name: 'editSearch',
32
- components: {
33
- NSelect
34
- },
35
- props: {
36
- ...editFormProps
37
- },
38
- emits: ['hanldeFromBlur', 'opentableSelect', 'valueOnChange'],
39
- setup (props, { attrs, slots, emit }) {
40
- const { handlerInputBlur } = useItemDefault(props, emit)
41
-
42
- const renderOption = ({ node, option }: { node: VNode, option: any }) => {
43
- if (!option['showLabel']) return option[props.item.wordbook.value_key]
44
- return [
45
- <div
46
- class={{'title-line': option.index === 0 && props.item.wordbook.render_key && props.item.wordbook.render_key.length > 1}}
47
- style="display: flex;justify-content: space-around;"
48
- >
49
- {
50
- option['showLabel'].split('≌').map((v: any) => <span key={v} style="flex: 1;">{v}</span>)
51
- }
52
- </div>
53
- ]
54
- }
55
-
56
- return {
57
- renderOption,
58
- ...useSearch(props, emit, handlerInputBlur)
59
- }
60
- }
61
- })
62
- </script>
63
- <style lang="less" scoped></style>
@@ -1,69 +0,0 @@
1
- <template>
2
- <div class="select-content">
3
- <NSelect
4
- multiple
5
- v-model:value="item.useFormValue"
6
- ref="form_a_select"
7
- :consistent-menu-width="(item.elem_width || 6) > 11"
8
- class="formItem-select formItem-select-multiple formItem-search-more"
9
- :placeholder="item.placeholder || '请选择'"
10
- :clearable="item.is_empty == 0"
11
- :disabled="item.is_edit == 0"
12
- :filterable="selectIsOpen"
13
- :max-tag-count="10"
14
- @search="(value: string) => handleMultipleSearch(value, item)"
15
- @update:show="(show: boolean) => handlerDropdownVisibleChange(show, item)"
16
- @update:value="(value: string | number | Array<string> | null) => searchMoreOnChange(value, item)"
17
- :loading="state.fetching"
18
- :options="state.curOptions"
19
- :render-option="renderOption"
20
- >
21
- </NSelect>
22
- </div>
23
- </template>
24
-
25
- <script lang="tsx">
26
- import { defineComponent, ref } from 'vue'
27
- import { NSelect, SelectOption } from 'naive-ui'
28
- import editFormProps from '../editFormProps'
29
- import { useItemDefault } from '../../hooks/useItemDefault'
30
- import { useSearch } from '../../hooks/useSearch'
31
-
32
- export default defineComponent({
33
- name: 'editSearchMore',
34
- components: {
35
- NSelect
36
- },
37
- props: {
38
- ...editFormProps
39
- },
40
- emits: ['hanldeFromBlur', 'opentableSelect', 'valueOnChange'],
41
- setup (props, { attrs, slots, emit }) {
42
- const { handlerInputBlur } = useItemDefault(props, emit)
43
-
44
- const renderOption = (option: any) => {
45
- if (!option['showLabel']) return option[props.item.wordbook.value_key]
46
- return [
47
- <div
48
- class={{'title-line': option.index === 0 && props.item.wordbook.render_key && props.item.wordbook.render_key.length > 1}}
49
- style="display: flex;justify-content: space-around;"
50
- >
51
- {
52
- option['showLabel'].split('≌').map((v: any) => <span key={v} style="flex: 1;">{v}</span>)
53
- }
54
- </div>
55
- ]
56
- }
57
-
58
- return {
59
- renderOption,
60
- ...useSearch(props, emit, handlerInputBlur)
61
- }
62
- }
63
- })
64
- </script>
65
- <style lang="less" scoped>
66
- .formItem-select-multiple {
67
- padding: 4px 0;
68
- }
69
- </style>
@@ -1,51 +0,0 @@
1
- <template>
2
- <div class="select-content">
3
- <NSelect
4
- v-model:value="item.useFormValue"
5
- :ref="item.val_key"
6
- :consistent-menu-width="true"
7
- class="formItem-select editItem-search"
8
- :placeholder="item.placeholder || '请选择'"
9
- :clearable="item.is_empty == 0"
10
- :disabled="item.is_edit == 0"
11
- @update:show="(show: boolean) => dropdownVisibleChange(show)"
12
- :options="options"
13
- >
14
- </NSelect>
15
- </div>
16
- </template>
17
-
18
- <script lang="tsx">
19
- import { defineComponent, ref, VNode } from 'vue'
20
- import { NSelect, SelectOption } from 'naive-ui'
21
- import editFormProps from '../editFormProps'
22
- import { useItemDefault } from '../../hooks/useItemDefault'
23
-
24
- export default defineComponent({
25
- name: 'editSearch',
26
- components: {
27
- NSelect
28
- },
29
- props: {
30
- ...editFormProps
31
- },
32
- emits: ['hanldeFromBlur'],
33
- setup (props, { attrs, slots, emit }) {
34
- const { dropdownVisibleChange } = useItemDefault(props, emit)
35
-
36
- let options = ref([] as any[])
37
- options = props.item.option.map((v: any) => {
38
- return {
39
- ...v,
40
- label: v.text
41
- }
42
- })
43
-
44
- return {
45
- options,
46
- dropdownVisibleChange
47
- }
48
- }
49
- })
50
- </script>
51
- <style lang="less" scoped></style>
@@ -1,60 +0,0 @@
1
- <template>
2
- <div class="select-content">
3
- <NSelect
4
- v-model:value="item.useFormValue"
5
- :ref="item.val_key"
6
- :consistent-menu-width="true"
7
- class="formItem-select formItem-select-multiple"
8
- :placeholder="item.placeholder || '请选择'"
9
- :clearable="item.is_empty == 0"
10
- :disabled="item.is_edit == 0"
11
- @update:show="(show: boolean) => dropdownVisibleChange(show)"
12
- :options="options"
13
- :filter="filter"
14
- >
15
- </NSelect>
16
- </div>
17
- </template>
18
-
19
- <script lang="tsx">
20
- import { defineComponent, ref } from 'vue'
21
- import { NSelect, SelectOption } from 'naive-ui'
22
- import editFormProps from '../editFormProps'
23
- import { useItemDefault } from '../../hooks/useItemDefault'
24
- import vexutils from '@/utils/vexutils'
25
-
26
- export default defineComponent({
27
- name: 'editSelectMultiple',
28
- components: {
29
- NSelect
30
- },
31
- props: {
32
- ...editFormProps
33
- },
34
- emits: ['hanldeFromBlur'],
35
- setup (props, { attrs, slots, emit }) {
36
- const { dropdownVisibleChange } = useItemDefault(props, emit)
37
-
38
- let options = ref([] as any[])
39
- options = props.item.option.map((v: any) => {
40
- return {
41
- ...v,
42
- label: v.text
43
- }
44
- })
45
-
46
- const filter = (pattern: string, option: object) => vexutils.filterOption(pattern, option)
47
-
48
- return {
49
- options,
50
- filter,
51
- dropdownVisibleChange
52
- }
53
- }
54
- })
55
- </script>
56
- <style lang="less" scoped>
57
- .formItem-select-multiple {
58
- padding: 4px 0;
59
- }
60
- </style>
@@ -1,34 +0,0 @@
1
- <template>
2
- <NInput
3
- type="textarea"
4
- v-model:value="item.useFormValue"
5
- :ref="`textarea-${item.val_key}`"
6
- autocomplete="off"
7
- :disabled="item.is_edit == 0"
8
- :clearable="item.is_empty == 0"
9
- :placeholder="item.placeholder || ''"
10
- :maxlength="item.validate && item.validate.max_length ? +item.validate.max_length : 500"
11
- :rows="item.initialize_high || 3"
12
- >
13
- </NInput>
14
- </template>
15
-
16
- <script lang="ts">
17
- import { defineComponent, ref } from 'vue'
18
- import { NInput } from 'naive-ui'
19
- import editFormProps from '../editFormProps'
20
-
21
- export default defineComponent({
22
- name: 'editTextarea',
23
- components: {
24
- NInput,
25
- },
26
- props: {
27
- ...editFormProps
28
- },
29
- setup (props, { attrs, slots, emit }) {
30
-
31
- }
32
- })
33
- </script>
34
- <style lang="less" scoped></style>
@@ -1,42 +0,0 @@
1
- <template>
2
- <NTimePicker
3
- v-model:value="item.useFormValue"
4
- :ref="'timePicker-' + item.val_key"
5
- :placeholder="item.placeholder || ''"
6
- :disabled="item.is_edit == 0"
7
- :is-hour-disabled="(hour: number) => disabledHours(item, 'h')"
8
- :is-minute-disabled="(minute: number) => disabledHours(item, 'm')"
9
- :is-second-disabled="(second: number) => disabledHours(item, 's')"
10
- :clearable="item.is_empty == 0"
11
- :format="handlerGetDateType(item)"
12
- />
13
- </template>
14
-
15
- <script lang="ts">
16
- import { defineComponent, ref } from 'vue'
17
- import { NTimePicker } from 'naive-ui'
18
- import editFormProps from '../editFormProps'
19
- import { handlerGetDateType } from '../../utils'
20
- import { useItemDefault } from '../../hooks/useItemDefault'
21
- import { useDateType } from '../../hooks/useDateType'
22
-
23
-
24
- export default defineComponent({
25
- name: 'editDatePicker',
26
- components: {
27
- NTimePicker
28
- },
29
- props: {
30
- ...editFormProps
31
- },
32
- emits: ['hanldeFromBlur'],
33
- setup (props, { attrs, slots, emit }) {
34
- const { open } = useItemDefault(props, emit)
35
-
36
- return {
37
- handlerGetDateType,
38
- ...useDateType(open)
39
- }
40
- }
41
- })
42
- </script>
@@ -1,91 +0,0 @@
1
- const editFormProps = {
2
- defaultValue: {
3
- type: Object,
4
- default: () => {
5
- return {};
6
- }
7
- },
8
-
9
- // 表单排列方式 'horizontal' / 水平|'vertical'|'inline'
10
- propsFormLayout: {
11
- type: String,
12
- default: 'vertical'
13
- },
14
-
15
- item: {
16
- type: Object,
17
- default: () => {
18
- return {};
19
- }
20
- },
21
-
22
- formFieldList: {
23
- type: Array,
24
- default: () => []
25
- },
26
-
27
- form: {
28
- type: Object,
29
- default: () => {
30
- return {};
31
- }
32
- },
33
-
34
- cacheForm: {
35
- type: Object,
36
- default: () => {
37
- return {};
38
- }
39
- },
40
-
41
- formStyle: {
42
- type: Object,
43
- default: () => ({})
44
- },
45
-
46
- showLable: {
47
- type: Boolean,
48
- default: true
49
- },
50
-
51
- handleFormatSubmit: Function,
52
-
53
- formFieldObj: {
54
- type: Object,
55
- default: () => {
56
- return {};
57
- }
58
- },
59
-
60
- defaultFieldList: {
61
- type: Array,
62
- default: () => []
63
- },
64
-
65
- shortcutFieldsList: {
66
- type: Array,
67
- default: () => []
68
- },
69
- isOpenShortcut: {
70
- type: Boolean,
71
- default: false
72
- },
73
- layoutForm: {
74
- type: Boolean,
75
- default: false
76
- },
77
-
78
- dbParams: {
79
- type: Object
80
- },
81
- styleSetting: {
82
- type: Object,
83
- default: () => {}
84
- },
85
- cacheUniqueKey: {
86
- type: Object,
87
- default: () => ({})
88
- }
89
- };
90
-
91
- export default editFormProps;
@@ -1,18 +0,0 @@
1
- // const requireComponent = import.meta.globEager("./edit.*?\.(vue|ts)$/");
2
-
3
- // let cmps: any= {};
4
- // Object.values(requireComponent).forEach(cmp => {
5
- // cmps[cmp.name] = cmp;
6
- // })
7
-
8
- // console.log(cmps, "cmps");
9
- export default {
10
- data() {
11
- return {};
12
- },
13
- computed: {},
14
- methods: {
15
- },
16
- // components: cmps
17
- };
18
-
@@ -1,79 +0,0 @@
1
- import type { CmpElement } from '../interface'
2
-
3
- const configData = {
4
- comTypeMap: {
5
- "INPUT": "editInput",
6
- "DIGITAL": "editDigital",
7
- "TEXTAREA": "editTextarea",
8
- "RADIO": "editSelect",
9
- "RADIO_BLOCK": "editSelect",
10
- "CHECKBOX_BLOCK": "editSelectMultiple",
11
- "CHECKBOX": "editSelectMultiple",
12
- "SEARCH": "editSearch",
13
- "SEARCH_MORE": "editSearchMore",
14
- "DATE": "editDatePicker",
15
- "DATE-INPUT": "editDatePicker", // 旧版兼容字段
16
- "TIME-INPUT": "editDatePicker",
17
- "DATETIME-INPUT": "editDatePicker", // 旧版兼容字段
18
- "SELECT": "editSelect",
19
- "PHONE_TYPE": "editSelect",
20
- "IDCARD_TYPE": "editSelect",
21
- "editMonthPicker": "editMonthPicker",
22
- "editTimePicker": "editTimePicker",
23
- "editDatePicker": "editDatePicker", // 旧版兼容字段
24
- "editSelect": "editSelect",
25
- "editInputPassword": "editInputPassword",
26
- "editSelectMultiple": "editSelectMultiple",
27
- "MAP": "editInput",
28
- "ICON": "editInput",
29
- "UPPICTURE": "editInput",
30
- "LEVEL_SEARCH_CASCADE2": "editInput",
31
- "LABEL": "editInput",
32
- "GUAGE": "editInput",
33
- "SLIDER_COMPONENT": "editInput",
34
- "SWITCH_COMPONENT": "editInput",
35
- "AGE_JSON": "editInput",
36
- "AGE": "editInput"
37
- },
38
- getComName(v: CmpElement) {
39
- const { isMonthPicker_com, isDate_com, isTimePicker_com, isSelect_com, isPassword_com, comTypeMap } = this;
40
-
41
- if (isDate_com(v.html_type)) {
42
- if (isMonthPicker_com(v)) return "editMonthPicker";
43
- if (isTimePicker_com(v)) return "editTimePicker";
44
- return "editDatePicker";
45
- }
46
-
47
- if (isSelect_com(v)) return "editSelect";
48
- if (isPassword_com(v)) return "editInputPassword";
49
-
50
- const res = comTypeMap[v.html_type];
51
- if (res) {
52
- return res;
53
- }
54
-
55
- return "editInput";
56
- },
57
-
58
- isMonthPicker_com(v: CmpElement) {
59
- return v.date_format && v.date_format.replace(/yyyy-MM/gi, "YYYY-MM") == "YYYY-MM";
60
- },
61
-
62
- isDate_com(key: string) {
63
- return key === "DATE" || key === "DATE-INPUT" || key === "DATETIME-INPUT";
64
- },
65
-
66
- isTimePicker_com(v: CmpElement) {
67
- return String(v.html_type) == "TIME-INPUT" || v.date_format == "HH:mm:ss" || v.date_format == "HH:mm";
68
- },
69
-
70
- isSelect_com(v: CmpElement) {
71
- return ["SELECT", "PHONE_TYPE", "IDCARD_TYPE"].includes(v.html_type);
72
- },
73
-
74
- isPassword_com(v: CmpElement) {
75
- return (v?.validate?.obj_type || "") === "password";
76
- }
77
- };
78
-
79
- export default configData;