cnhis-design-vue 3.0.1 → 3.0.2

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 (47) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es/big-table/index.css +1 -6
  3. package/es/big-table/index.js +5603 -36408
  4. package/es/button-print/index.css +17 -22
  5. package/es/button-print/index.js +4920 -18073
  6. package/es/drag-layout/index.css +17 -22
  7. package/es/drag-layout/index.js +75 -5733
  8. package/es/grid/index.css +58 -64
  9. package/es/grid/index.js +3 -30623
  10. package/es/index.css +1 -6
  11. package/es/index.js +267 -37863
  12. package/package.json +2 -6
  13. package/packages/big-table/src/BigTable.vue +30 -45
  14. package/packages/big-table/src/bigTableEmits.ts +2 -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.vue +1 -1
  17. package/packages/big-table/src/hooks/useBatchEditing.ts +123 -123
  18. package/packages/big-table/src/hooks/useEdit.ts +42 -23
  19. package/packages/button-print/src/ButtonPrint.vue +11 -144
  20. package/packages/button-print/src/components/IdentityVerification.vue +14 -43
  21. package/packages/grid/index.ts +3 -2
  22. package/packages/grid/src/Grid.tsx +4 -3
  23. package/packages/index.ts +5 -6
  24. package/packages/big-table/src/components/edit-form3/EditForm.vue +0 -426
  25. package/packages/big-table/src/components/edit-form3/edit-component/edit-date-picker/edit-date-picker.vue +0 -66
  26. package/packages/big-table/src/components/edit-form3/edit-component/edit-digital/edit-digital.vue +0 -60
  27. package/packages/big-table/src/components/edit-form3/edit-component/edit-input/edit-input.vue +0 -38
  28. package/packages/big-table/src/components/edit-form3/edit-component/edit-input-password/edit-input-password.vue +0 -89
  29. package/packages/big-table/src/components/edit-form3/edit-component/edit-month-picker/edit-month-picker.vue +0 -38
  30. package/packages/big-table/src/components/edit-form3/edit-component/edit-search/edit-search.vue +0 -63
  31. package/packages/big-table/src/components/edit-form3/edit-component/edit-search-more/edit-search-more.vue +0 -69
  32. package/packages/big-table/src/components/edit-form3/edit-component/edit-select/edit-select.vue +0 -51
  33. package/packages/big-table/src/components/edit-form3/edit-component/edit-select-multiple/edit-select-multiple.vue +0 -60
  34. package/packages/big-table/src/components/edit-form3/edit-component/edit-textarea/edit-textarea.vue +0 -34
  35. package/packages/big-table/src/components/edit-form3/edit-component/edit-time-picker/edit-time-picker.vue +0 -42
  36. package/packages/big-table/src/components/edit-form3/edit-component/editFormProps.ts +0 -91
  37. package/packages/big-table/src/components/edit-form3/edit-component/register-com.ts +0 -18
  38. package/packages/big-table/src/components/edit-form3/hooks/useConfigData.ts +0 -79
  39. package/packages/big-table/src/components/edit-form3/hooks/useDateType.ts +0 -184
  40. package/packages/big-table/src/components/edit-form3/hooks/useFormCommon.ts +0 -373
  41. package/packages/big-table/src/components/edit-form3/hooks/useItemDefault.ts +0 -638
  42. package/packages/big-table/src/components/edit-form3/hooks/useSearch.ts +0 -910
  43. package/packages/big-table/src/components/edit-form3/hooks/useValidateRules.ts +0 -387
  44. package/packages/big-table/src/components/edit-form3/interface.ts +0 -53
  45. package/packages/big-table/src/components/edit-form3/types.ts +0 -3
  46. package/packages/big-table/src/components/edit-form3/utils.ts +0 -247
  47. package/packages/big-table/src/components/svg/index.vue +0 -49
@@ -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));
@@ -1,14 +1,15 @@
1
1
  import type { App } from "vue";
2
2
 
3
3
  // 导入组件
4
- import Grid, { VXETable } from "./src/Grid"
4
+ // import Grid, { VXETable } from "./src/Grid"
5
+ import Grid from "./src/Grid"
5
6
 
6
7
  // type SFCWithInstall<T> = T & { install(app: App): void }; // vue 安装
7
8
 
8
9
  // 为组件提供 install 安装方法,供按需引入
9
10
  Grid.install = function(app: App) {
11
+ // app.use(VXETable);
10
12
  app.component(Grid.name, Grid);
11
- app.use(VXETable);
12
13
  };
13
14
 
14
15
  // const CGrid: SFCWithInstall<typeof Grid> = Grid; // 增加类型
@@ -1,11 +1,12 @@
1
1
  import { defineComponent } from "vue"
2
2
  import 'xe-utils'
3
- import VXETable, { Grid } from 'vxe-table'
4
- import 'vxe-table/lib/style.css'
3
+ // import VXETable, { Grid } from 'vxe-table'
4
+ import { Grid } from 'vxe-table'
5
+ // import 'vxe-table/lib/style.css'
5
6
  import create from '@/core/create.js';
6
7
  import { useMethods } from './hooks'
7
8
 
8
- export { VXETable }
9
+ // export { VXETable }
9
10
 
10
11
  export default defineComponent(create({
11
12
  name: "Grid",
package/packages/index.ts CHANGED
@@ -12,7 +12,6 @@ const components: any[] = [
12
12
  DragLayout,
13
13
  ButtonPrint
14
14
  ];
15
-
16
15
  // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
17
16
  const install = function(app: App) {
18
17
  // 遍历注册全局组件
@@ -22,11 +21,11 @@ const install = function(app: App) {
22
21
  };
23
22
 
24
23
  export {
25
- Grid,
26
- BigTable,
27
- DragLayout,
28
- ButtonPrint
29
- };
24
+ Grid as CGrid,
25
+ BigTable as CBigTable,
26
+ DragLayout as CDragLayout,
27
+ ButtonPrint as CButtonPrint
28
+ }
30
29
 
31
30
  export default {
32
31
  // 导出的对象必须具有 install,才能被 Vue.use() 方法安装