cnhis-design-vue 3.0.1 → 3.0.4

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 (56) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/env.d.ts +0 -2
  3. package/es/big-table/index.css +13 -211
  4. package/es/big-table/index.js +216 -839
  5. package/es/button-print/index.css +45 -243
  6. package/es/button-print/index.js +4920 -18073
  7. package/es/drag-layout/index.css +45 -243
  8. package/es/field-set/index.css +1044 -0
  9. package/es/field-set/index.js +351 -0
  10. package/es/grid/index.css +242 -242
  11. package/es/grid/index.js +3 -4
  12. package/es/index.css +41 -41
  13. package/es/index.js +138 -7211
  14. package/package.json +2 -6
  15. package/packages/big-table/index.ts +0 -5
  16. package/packages/big-table/src/BigTable.vue +31 -46
  17. package/packages/big-table/src/assets/iconfont/iconfont.less +3 -2
  18. package/packages/big-table/src/assets/style/table-global.less +4 -0
  19. package/packages/big-table/src/bigTableEmits.ts +2 -1
  20. package/packages/big-table/src/components/edit-form/edit-input.vue +27 -7
  21. package/packages/big-table/src/components/edit-form/edit-select.vue +1 -1
  22. package/packages/big-table/src/hooks/useBatchEditing.ts +123 -123
  23. package/packages/big-table/src/hooks/useEdit.ts +42 -23
  24. package/packages/button-print/src/ButtonPrint.vue +11 -144
  25. package/packages/button-print/src/components/IdentityVerification.vue +14 -43
  26. package/packages/field-set/index.ts +15 -0
  27. package/packages/{big-table → field-set}/src/FieldSet.vue +0 -6
  28. package/packages/grid/index.ts +5 -2
  29. package/packages/grid/src/Grid.tsx +1 -5
  30. package/packages/grid/src/hooks.ts +1 -2
  31. package/packages/index.ts +16 -14
  32. package/tsconfig.node.json +1 -1
  33. package/packages/big-table/src/components/edit-form3/EditForm.vue +0 -426
  34. package/packages/big-table/src/components/edit-form3/edit-component/edit-date-picker/edit-date-picker.vue +0 -66
  35. package/packages/big-table/src/components/edit-form3/edit-component/edit-digital/edit-digital.vue +0 -60
  36. package/packages/big-table/src/components/edit-form3/edit-component/edit-input/edit-input.vue +0 -38
  37. package/packages/big-table/src/components/edit-form3/edit-component/edit-input-password/edit-input-password.vue +0 -89
  38. package/packages/big-table/src/components/edit-form3/edit-component/edit-month-picker/edit-month-picker.vue +0 -38
  39. package/packages/big-table/src/components/edit-form3/edit-component/edit-search/edit-search.vue +0 -63
  40. package/packages/big-table/src/components/edit-form3/edit-component/edit-search-more/edit-search-more.vue +0 -69
  41. package/packages/big-table/src/components/edit-form3/edit-component/edit-select/edit-select.vue +0 -51
  42. package/packages/big-table/src/components/edit-form3/edit-component/edit-select-multiple/edit-select-multiple.vue +0 -60
  43. package/packages/big-table/src/components/edit-form3/edit-component/edit-textarea/edit-textarea.vue +0 -34
  44. package/packages/big-table/src/components/edit-form3/edit-component/edit-time-picker/edit-time-picker.vue +0 -42
  45. package/packages/big-table/src/components/edit-form3/edit-component/editFormProps.ts +0 -91
  46. package/packages/big-table/src/components/edit-form3/edit-component/register-com.ts +0 -18
  47. package/packages/big-table/src/components/edit-form3/hooks/useConfigData.ts +0 -79
  48. package/packages/big-table/src/components/edit-form3/hooks/useDateType.ts +0 -184
  49. package/packages/big-table/src/components/edit-form3/hooks/useFormCommon.ts +0 -373
  50. package/packages/big-table/src/components/edit-form3/hooks/useItemDefault.ts +0 -638
  51. package/packages/big-table/src/components/edit-form3/hooks/useSearch.ts +0 -910
  52. package/packages/big-table/src/components/edit-form3/hooks/useValidateRules.ts +0 -387
  53. package/packages/big-table/src/components/edit-form3/interface.ts +0 -53
  54. package/packages/big-table/src/components/edit-form3/types.ts +0 -3
  55. package/packages/big-table/src/components/edit-form3/utils.ts +0 -247
  56. package/packages/big-table/src/components/svg/index.vue +0 -49
@@ -1,6 +1,7 @@
1
1
  import { computed, ref, reactive, watch, onMounted } from 'vue'
2
2
 
3
3
  export const useEdit = (props: any, state: any, emit: any, xGrid: any) => {
4
+
4
5
  const initEditTable = async () => {
5
6
  const { isEdit, fieldList = [] } = props.columnConfig
6
7
  if (!isEdit) return
@@ -17,29 +18,34 @@ export const useEdit = (props: any, state: any, emit: any, xGrid: any) => {
17
18
  await xGrid.value.insertAt(record, -1)
18
19
  }
19
20
 
20
- const deleteRow = (row: any) => {
21
+ const deleteRow = (row: any, col: any, index: number) => {
21
22
  xGrid.value.remove(row)
23
+ emit('clickBtn', { row, column: col, index })
22
24
  }
23
25
 
24
26
  const activeMethod = ({ row, rowIndex, column, columnIndex }: { row: any, rowIndex: number, column: any, columnIndex: number }) => {
25
27
  const { isEdit, fieldList } = props.columnConfig
26
- // console.log('activeMethod->', row, column)
27
28
  if (isEdit) {
28
- const selectTableObj = fieldList.find((v: any) => v.formType === 'selectTable')
29
+ // const selectTableObj = fieldList.find((v: any) => v.formType === 'selectTable')
29
30
  const isEditCol = fieldList.find((v: any) => v.columnName === column.field)?.isEdit || false
30
- if (selectTableObj) {
31
- // const isOtherEditCol = Object.keys(row).some(v => v !== selectTableObj.columnName && v !== 'checked' && !!row[v])
32
- if (isEditCol && ((column.field === selectTableObj.columnName && !row[column.field]) || (column.field !== selectTableObj.columnName && !row.initRow))) {
33
- return true
34
- } else {
35
- return false
36
- }
31
+ // if (selectTableObj) {
32
+ // // const isOtherEditCol = Object.keys(row).some(v => v !== selectTableObj.columnName && v !== 'checked' && !!row[v])
33
+ // if (isEditCol && ((column.field === selectTableObj.columnName && !row[column.field]) || (column.field !== selectTableObj.columnName && !row.initRow))) {
34
+ // return true
35
+ // } else {
36
+ // return false
37
+ // }
38
+ // } else {
39
+ // if (isEditCol) {
40
+ // return true
41
+ // } else {
42
+ // return false
43
+ // }
44
+ // }
45
+ if (isEditCol) {
46
+ return true
37
47
  } else {
38
- if (isEditCol) {
39
- return true
40
- } else {
41
- return false
42
- }
48
+ return false
43
49
  }
44
50
  } else {
45
51
  return false
@@ -63,19 +69,32 @@ export const useEdit = (props: any, state: any, emit: any, xGrid: any) => {
63
69
  const getInsertRecords = xGrid.value.getInsertRecords()
64
70
  const { row: newRow } = await xGrid.value.insertAt(record, getInsertRecords.at(-1))
65
71
  xGrid.value.clearActived()
66
- // xGrid.value.setActiveRow(newRow)
67
- // props.columnConfig.fieldList.forEach((col: any) => {
68
- // console.log('--------------2', col.columnName, col.columnName !== 'operatorColumn' && col.isShow && col.isEdit && col.formType !== 'selectTable')
69
- // if (col.columnName !== 'operatorColumn' && col.isShow && col.isEdit && col.formType !== 'selectTable') {
70
- // xGrid.value.setActiveRow(newRow)
71
- // }
72
- // })
72
+ }
73
+
74
+ const onUpdateInput = ({ value, row, column }: {value: number | string | null, row: any, column: any}) => {
75
+ emit('updateInput', { value, row, column })
76
+ }
77
+
78
+ const getDefaultValue = (params: any, item: any) => {
79
+ const value = params.row[item.columnName]
80
+ if (item.formType === 'select') {
81
+ if (item.options) {
82
+ return item.options.find((v: any) => v.value === value)?.label || ''
83
+ }
84
+ if (item.queryOptions) {
85
+ return (params.row[`${item.columnName}_options`]?.find((v: any) => v.value === value)?.label) || ''
86
+ }
87
+ return value
88
+ }
89
+ return value
73
90
  }
74
91
 
75
92
  return {
76
93
  initEditTable,
77
94
  activeMethod,
78
95
  deleteRow,
79
- onClickSelectTable
96
+ onClickSelectTable,
97
+ onUpdateInput,
98
+ getDefaultValue
80
99
  }
81
100
  }
@@ -23,11 +23,8 @@
23
23
  </NDropdown>
24
24
 
25
25
  <IdentityVerification
26
- :visible.sync="state.identityVerification.visible"
27
- :printConfig="printConfig"
28
- :baseUrl="baseUrl"
29
- :verifyUserUrl="verifyUserUrl"
30
- :identityVerificationTitle="identityVerificationTitle"
26
+ v-model="state.identityVerification.visible"
27
+ v-bind="$attrs"
31
28
  @success="verifiySuccess"
32
29
  ></IdentityVerification>
33
30
  </span>
@@ -47,51 +44,41 @@ import { ChevronDown, Reload } from "@vicons/ionicons5";
47
44
  import { useMessage } from 'naive-ui'
48
45
  import type { DropdownOption } from 'naive-ui'
49
46
  import Print from './utils/print.es.min.js';
50
- // import vClickoutside from '@/utils/clickoutside';
51
- import vexutils from '@/utils/vexutils.js';
52
- // import type { Props } from './interfaces'
53
47
  import IdentityVerification from './components/IdentityVerification.vue';
54
- import axios from 'axios'
55
48
  import moment from 'moment';
56
49
  // const Print:any = import.meta.globEager('./utils/print.es.min.js')['./utils/print.es.min.js'].default;
57
50
 
58
51
  (window as any).$message = useMessage()
59
52
  let printInstance: any = null;
60
- let httpFn: any = null;
61
53
 
62
54
  // 在.vue文件中使用导入的interface会报错,提示要使用字面量类型,当前在github上vue的issue已经有这个问题了,目前还没解决
63
55
  interface Props {
64
- baseUrl: string
65
56
  btnText?: string
66
57
  printText?: string
67
58
  previewText?: string
68
59
  formatEditText?: string
69
60
  identityVerificationTitle?: string
70
- authorizationKey: string
71
- templateNumber: number | string
72
61
  params: any[],
73
62
  hisParams: any
74
63
  prevFn?: Function
75
- verifyUserUrl?: string
76
- getPrintFormatByNumberUrl?: string
77
- getTemplateParamsUrl?: string
64
+ verifyUser?: Function
65
+ queryPrintFormatByNumber: Function
66
+ queryTemplateParams?: Function
78
67
  strategy?: string
79
- printConfig?: any
80
68
  versionType?: number | string
81
69
  }
82
70
  const props = withDefaults(defineProps<Props>(), {
83
- baseUrl: '',
71
+ // baseUrl: '',
84
72
  btnText: '打印',
85
73
  printText: '直接打印',
86
74
  previewText: '打印预览',
87
75
  formatEditText: '格式编辑',
88
76
  identityVerificationTitle: '打印服务身份校验',
89
77
  prevFn: () => Promise.resolve(),
90
- verifyUserUrl: '/verifyUser',
91
- getPrintFormatByNumberUrl: '/getPrintFormatByNumber',
92
- getTemplateParamsUrl: '/getTemplateParams',
78
+ verifyUser: () => Promise.resolve(),
79
+ queryPrintFormatByNumber: () => Promise.resolve({}),
80
+ queryTemplateParams: () => Promise.resolve({}),
93
81
  strategy: 'MULTI',
94
- printConfig: () => {},
95
82
  versionType: '2'
96
83
  });
97
84
  const emit = defineEmits(['success', 'error']);
@@ -378,23 +365,6 @@ const instantiatePrintSDK = () => {
378
365
  if (printInstance) return false;
379
366
  printInstance = new Print();
380
367
  }
381
- const queryFormatList = () => {
382
- const { templateNumber, authorizationKey, baseUrl, getPrintFormatByNumberUrl, versionType } = props;
383
- const suffix = [1, 3].includes(+versionType) ? `jsessionids=${vexutils.cookie.get('jsessionids') || '31e5fc0e-955f-4c89-9679-39c43d0171321636163291241'}` : `authorizationKey=${authorizationKey}`;
384
- const url = `${baseUrl}${getPrintFormatByNumberUrl}?number=${templateNumber}&${suffix}`;
385
- return httpFn
386
- .get(url)
387
- .then(async ({ data = {} }) => {
388
- if ((data as any).result !== 'SUCCESS') {
389
- (window as any).$message.error((data as any).resultMsg || '参数异常,请联系管理员');
390
- return false;
391
- }
392
- return data;
393
- })
394
- .catch((e: any) => {
395
- return false;
396
- });
397
- }
398
368
  const getDefaultFormatId = (list: any[], key: string | number) => {
399
369
  if (!list?.length) return '';
400
370
  let findDefault = list.find(item => item[key] == 1);
@@ -444,24 +414,6 @@ const requestError = () => {
444
414
 
445
415
  return false;
446
416
  }
447
- const queryTemplateParams = () => {
448
- const { templateNumber, authorizationKey, baseUrl, getTemplateParamsUrl } = props;
449
- const { templateId } = state.formatList[0] || {};
450
- const url = `${baseUrl}${getTemplateParamsUrl}?number=${templateNumber}&templateId=${templateId}&authorizationKey=${authorizationKey}`;
451
-
452
- return httpFn
453
- .get(url)
454
- .then(async ({ data = {} }) => {
455
- if ((data as any).result !== 'SUCCESS') {
456
- (window as any).$message.error((data as any).resultMsg || '参数异常,请联系管理员');
457
- return false;
458
- }
459
- return (data as any)?.obj || {};
460
- })
461
- .catch((e: any) => {
462
- return false;
463
- });
464
- }
465
417
  const formatDefaultVal = (i: any, tableVal?: any) => {
466
418
  let val = i.defaultValue || '';
467
419
  let tVal = tableVal;
@@ -518,43 +470,7 @@ const initCRM = async (formatListResult: any) => {
518
470
  requestError();
519
471
  return;
520
472
  }
521
- let templateParamsResult = await queryTemplateParams();
522
- // let templateParamsResult = {
523
- // "param": [],
524
- // "customizeDataset": [
525
- // {
526
- // "dataSetting": [
527
- // {
528
- // "selectFieldList": [
529
- // {
530
- // "fieldName": "name",
531
- // "type": "TEXT"
532
- // },
533
- // {
534
- // "fieldName": "age",
535
- // "type": "NUMBER"
536
- // },
537
- // {
538
- // "fieldName": "money",
539
- // "type": "NUMBER"
540
- // }
541
- // ],
542
- // "jsonType": "jsonObject",
543
- // "required": false,
544
- // "downloadFields": ""
545
- // }
546
- // ],
547
- // "name": "结果集1",
548
- // "defaultJson": {
549
- // "money": 0,
550
- // "name": "",
551
- // "age": 0
552
- // },
553
- // "customize": true,
554
- // "key": 1
555
- // }
556
- // ]
557
- // }
473
+ let templateParamsResult = (await props.queryTemplateParams())?.obj || {};
558
474
 
559
475
  if (templateParamsResult) {
560
476
  state.templateParams = templateParamsResult;
@@ -571,56 +487,7 @@ const init = async () => {
571
487
  setTimeoutSpin();
572
488
 
573
489
  instantiatePrintSDK();
574
- let config: any = {
575
- withCredentials: false,
576
- timeout: 5000
577
- };
578
- let printUrlPrefix = props?.printConfig?.printUrlPrefix;
579
- if (printUrlPrefix) {
580
- config.baseURL = printUrlPrefix;
581
- }
582
- httpFn = axios.create({
583
- ...config
584
- });
585
- const formatListResult = await queryFormatList();
586
- // const formatListResult = {
587
- // "result": "SUCCESS",
588
- // "code": 0,
589
- // "resultMsg": "",
590
- // "list": [],
591
- // "obj": [
592
- // {
593
- // "number": "170testtemp",
594
- // "name": "170公有模板",
595
- // "format": [
596
- // {
597
- // "number": "170testtemp",
598
- // "defaultFlag": 0,
599
- // "printType": "1",
600
- // "rowNum": 1,
601
- // "name": "170公有格式1",
602
- // "id": "1420212788840570880",
603
- // "templateId": "1420212316842958848",
604
- // "privateValue": 1
605
- // },
606
- // {
607
- // "number": "170testtemp",
608
- // "defaultFlag": 0,
609
- // "printType": "1",
610
- // "rowNum": 2,
611
- // "name": "测试格式名称",
612
- // "id": "1420242022380281856",
613
- // "templateId": "1420212316842958848",
614
- // "privateValue": 1
615
- // }
616
- // ],
617
- // "id": "1420212316842958848"
618
- // }
619
- // ],
620
- // "total": 0,
621
- // "recordsTotal": 0,
622
- // "recordsFiltered": 0
623
- // }
490
+ const formatListResult = await props.queryPrintFormatByNumber()
624
491
  if (props.versionType == 1 || props.versionType == 3) {
625
492
  initHIS(formatListResult);
626
493
  } else {
@@ -3,7 +3,7 @@
3
3
  preset="dialog"
4
4
  :title="identityVerificationTitle"
5
5
  class="standard-modal standard-modal-white authentication-modal"
6
- :show="visible"
6
+ :show="modelValue"
7
7
  :close-on-esc="false"
8
8
  :show-icon="false"
9
9
  :style="{ width: style.width, maxHeight: style.height, overflowY: 'auto' }"
@@ -35,30 +35,24 @@ export default {
35
35
  import { ref, reactive, computed, watch, onMounted, nextTick } from 'vue'
36
36
  import { NButton, NModal, NForm, NFormItem, NInput, FormRules, FormInst } from 'naive-ui'
37
37
  import { useMessage } from 'naive-ui'
38
- import axios from 'axios';
39
- import crypto from '@/utils/crypto.js';
40
38
  // const crypto:any = import.meta.globEager('./utils/crypto.js');
41
39
 
42
40
  (window as any).$message = useMessage()
43
41
 
44
- let httpFn: any = null;
45
42
  const DEFAULT_FORM = {
46
43
  account: '',
47
44
  password: ''
48
45
  };
49
46
 
50
47
  const props = withDefaults(defineProps<{
51
- visible: boolean
52
- baseUrl: string
53
- verifyUserUrl?: string
48
+ verifyUser?: Function
54
49
  identityVerificationTitle?: string
55
- printConfig?: any
50
+ modelValue: boolean
56
51
  }>(), {
57
- verifyUserUrl: '/verifyUser',
58
- printConfig: () => {}
52
+ verifyUser: () => Promise.resolve(),
59
53
  })
60
54
 
61
- const emit = defineEmits(['update:visible', 'success']);
55
+ const emit = defineEmits(['update:modelValue', 'success']);
62
56
 
63
57
  let form = reactive(JSON.parse(JSON.stringify(DEFAULT_FORM)))
64
58
  const rules: FormRules = {
@@ -72,27 +66,15 @@ const style = {
72
66
  const formRef = ref<FormInst | null>(null)
73
67
 
74
68
  const handleClickClose = () => {
75
- emit('update:visible', false);
69
+ emit('update:modelValue', false);
76
70
  }
77
- const submit = () => {
78
- const url = `${props.baseUrl}${props.verifyUserUrl}`;
79
-
80
- return httpFn({
81
- method: 'POST',
82
- url,
83
- data: `loginName=${form.account}&password=${crypto.encrypt(form.password)}`
84
- })
85
- .then(async ({ data = {} }) => {
86
- if ((data as any).result !== 'SUCCESS') {
87
- (window as any).$message.error((data as any).resultMsg);
88
- return false;
89
- }
90
- emit('success', (data as any).map?.token);
91
- return data;
92
- })
93
- .catch((e: any) => {
94
- return false;
95
- });
71
+ const submit = async () => {
72
+ const { data = {} } = await props.verifyUser(form)
73
+ if (data.result !== 'SUCCESS') {
74
+ (window as any).$message.error(data.resultMsg)
75
+ return false
76
+ }
77
+ emit('success', data.map?.token)
96
78
  }
97
79
  const handleClickSubmit = () => {
98
80
  formRef.value?.validate((errors) => {
@@ -106,20 +88,9 @@ const handleClickSubmit = () => {
106
88
  }
107
89
 
108
90
  onMounted(() => {
109
- let config: any = {
110
- withCredentials: false,
111
- timeout: 5000
112
- };
113
- let printUrlPrefix = props?.printConfig?.printUrlPrefix;
114
- if (printUrlPrefix) {
115
- config.baseURL = printUrlPrefix;
116
- }
117
- httpFn = axios.create({
118
- ...config
119
- });
120
91
  })
121
92
 
122
- watch(() => props.visible,
93
+ watch(() => props.modelValue,
123
94
  (val: any) => {
124
95
  if (val) return;
125
96
  form = JSON.parse(JSON.stringify(DEFAULT_FORM));
@@ -0,0 +1,15 @@
1
+ import type { App } from "vue";
2
+ // 导入组件
3
+ import FieldSet from './src/FieldSet.vue'
4
+
5
+ // type SFCWithInstall<T> = T & { install(app: App): void }; // vue 安装
6
+
7
+ // 为组件提供 install 安装方法,供按需引入
8
+ FieldSet.install = function(app: App) {
9
+ app.component(FieldSet.name, FieldSet);
10
+ };
11
+
12
+ // const CBigTable: SFCWithInstall<typeof BigTable> = BigTable; // 增加类型
13
+
14
+ // 默认导出组件
15
+ export default FieldSet;
@@ -128,7 +128,6 @@ export default create({
128
128
  </script>
129
129
  <script lang="ts" setup>
130
130
  import { reactive, onMounted, computed, ref, toRefs } from "vue";
131
- import { useRoute, useRouter } from "vue-router";
132
131
  import draggable from "vuedraggable";
133
132
  import { NButton, NCheckbox, NSpin, NTooltip } from "naive-ui";
134
133
 
@@ -170,7 +169,6 @@ type Istate = {
170
169
  };
171
170
  fields: Ifields[];
172
171
  };
173
- const route = useRoute();
174
172
 
175
173
  const emit = defineEmits(["onSave", "onClose"]);
176
174
 
@@ -216,10 +214,6 @@ const leftStyle = (ele: Ifields) => {
216
214
 
217
215
  const isMiddleAndAdmin = computed(() => props.menuSource == "middle");
218
216
 
219
- const isMenuSource = computed(() => {
220
- return route.fullPath.includes("middleListDetail");
221
- });
222
-
223
217
  const showCheckBox = (key: string) => {
224
218
  return state.fields.some((i: Ifields) => Object.prototype.hasOwnProperty.call(i, key));
225
219
  };
@@ -1,14 +1,17 @@
1
1
  import type { App } from "vue";
2
2
 
3
3
  // 导入组件
4
- import Grid, { VXETable } from "./src/Grid"
4
+ import 'vxe-table/lib/style.css'
5
+ import 'xe-utils'
6
+ import VXETable from 'vxe-table'
7
+ import Grid from "./src/Grid"
5
8
 
6
9
  // type SFCWithInstall<T> = T & { install(app: App): void }; // vue 安装
7
10
 
8
11
  // 为组件提供 install 安装方法,供按需引入
9
12
  Grid.install = function(app: App) {
10
- app.component(Grid.name, Grid);
11
13
  app.use(VXETable);
14
+ app.component(Grid.name, Grid);
12
15
  };
13
16
 
14
17
  // const CGrid: SFCWithInstall<typeof Grid> = Grid; // 增加类型
@@ -1,16 +1,12 @@
1
1
  import { defineComponent } from "vue"
2
- import 'xe-utils'
3
- import VXETable, { Grid } from 'vxe-table'
4
- import 'vxe-table/lib/style.css'
5
2
  import create from '@/core/create.js';
6
3
  import { useMethods } from './hooks'
7
4
 
8
- export { VXETable }
9
5
 
10
6
  export default defineComponent(create({
11
7
  name: "Grid",
12
8
  setup(props: any, { attrs, slots }: any) {
13
- const renderVN = () => <Grid ref="xGrid" { ...attrs }>{slots}</Grid>
9
+ const renderVN = () => <vxe-grid ref="xGrid" { ...attrs }>{slots}</vxe-grid>
14
10
  return {
15
11
  ...useMethods(),
16
12
  renderVN
@@ -156,8 +156,7 @@ export const useMethods = () => {
156
156
  const funcs: any = {}
157
157
  methodKeys.forEach(name => {
158
158
  funcs[name] = (...args: any[]) => {
159
- const $xGrid: any = xGrid.value
160
- return $xGrid && $xGrid[name](...args)
159
+ return xGrid.value && xGrid.value[name](...args)
161
160
  }
162
161
  })
163
162
 
package/packages/index.ts CHANGED
@@ -1,18 +1,19 @@
1
1
  import type { App } from "vue";
2
2
  // 导入组件
3
- import { default as Grid } from './grid';
4
- import { default as BigTable } from './big-table';
5
- import { default as DragLayout } from './drag-layout';
6
- import { default as ButtonPrint } from './button-print';
3
+ import { default as CGrid } from './grid';
4
+ import { default as CBigTable } from './big-table';
5
+ import { default as CFieldSet } from './field-set';
6
+ import { default as CDragLayout } from './drag-layout';
7
+ import { default as CButtonPrint } from './button-print';
7
8
 
8
9
  // 存储组件列表
9
10
  const components: any[] = [
10
- Grid,
11
- BigTable,
12
- DragLayout,
13
- ButtonPrint
11
+ CGrid,
12
+ CBigTable,
13
+ CFieldSet,
14
+ CDragLayout,
15
+ CButtonPrint
14
16
  ];
15
-
16
17
  // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
17
18
  const install = function(app: App) {
18
19
  // 遍历注册全局组件
@@ -22,11 +23,12 @@ const install = function(app: App) {
22
23
  };
23
24
 
24
25
  export {
25
- Grid,
26
- BigTable,
27
- DragLayout,
28
- ButtonPrint
29
- };
26
+ CGrid,
27
+ CBigTable,
28
+ CFieldSet,
29
+ CDragLayout,
30
+ CButtonPrint
31
+ }
30
32
 
31
33
  export default {
32
34
  // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
@@ -4,5 +4,5 @@
4
4
  "module": "esnext",
5
5
  "moduleResolution": "node"
6
6
  },
7
- "include": ["vite.config.ts"]
7
+ "include": ["vite.config.ts", "build/*.ts"]
8
8
  }