cnhis-design-vue 3.1.22-beta.0 → 3.1.22-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,123 +1,123 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式 1(按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式 2(全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3. 注意
65
-
66
- 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
-
68
- ```typescript
69
- // main.ts
70
- import { createApp } from 'vue';
71
- import App from './App.vue';
72
-
73
- import { CGrid } from 'cnhis-design-vue';
74
- // 或者
75
- import { CBigTable } from 'cnhis-design-vue';
76
-
77
- const app = createApp(App);
78
- app.use(CGrid);
79
- // 或者
80
- app.use(CBigTable);
81
- app.mount('#app');
82
- ```
83
-
84
- ## 4.FAQ
85
-
86
- ### 4.1 项目打包后样式丢失
87
-
88
- > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
-
90
- ```typescript
91
- // vite.config.ts
92
- import { defineConfig } from 'vite';
93
-
94
- export default defineConfig({
95
- rollupOptions: {
96
- // ..otherOptions
97
- output: {
98
- dir: './dist',
99
- manualChunks(id: string) {
100
- if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
- return 'vendor';
102
- }
103
- }
104
- }
105
- }
106
- });
107
- ```
108
-
109
- ### 4.2 找不到文件
110
-
111
- > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
-
113
- ```javascript
114
- // vite.config.ts
115
- const config = {
116
- // ...otherOptions
117
- resolve: {
118
- // ...otherOptions
119
- // 如果没有配置, 则不用考虑
120
- extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
- }
122
- };
123
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式 1(按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式 2(全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3. 注意
65
+
66
+ 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
+
68
+ ```typescript
69
+ // main.ts
70
+ import { createApp } from 'vue';
71
+ import App from './App.vue';
72
+
73
+ import { CGrid } from 'cnhis-design-vue';
74
+ // 或者
75
+ import { CBigTable } from 'cnhis-design-vue';
76
+
77
+ const app = createApp(App);
78
+ app.use(CGrid);
79
+ // 或者
80
+ app.use(CBigTable);
81
+ app.mount('#app');
82
+ ```
83
+
84
+ ## 4.FAQ
85
+
86
+ ### 4.1 项目打包后样式丢失
87
+
88
+ > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
+
90
+ ```typescript
91
+ // vite.config.ts
92
+ import { defineConfig } from 'vite';
93
+
94
+ export default defineConfig({
95
+ rollupOptions: {
96
+ // ..otherOptions
97
+ output: {
98
+ dir: './dist',
99
+ manualChunks(id: string) {
100
+ if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
+ return 'vendor';
102
+ }
103
+ }
104
+ }
105
+ }
106
+ });
107
+ ```
108
+
109
+ ### 4.2 找不到文件
110
+
111
+ > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
+
113
+ ```javascript
114
+ // vite.config.ts
115
+ const config = {
116
+ // ...otherOptions
117
+ resolve: {
118
+ // ...otherOptions
119
+ // 如果没有配置, 则不用考虑
120
+ extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
+ }
122
+ };
123
+ ```
@@ -329,6 +329,14 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
329
329
  showInsertStatus?: boolean | undefined;
330
330
  showAsterisk?: boolean | undefined;
331
331
  autoClear?: boolean | undefined;
332
+ beforeEditMethod?: ((params: {
333
+ row: any;
334
+ rowIndex: number;
335
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
336
+ columnIndex: number;
337
+ $table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
338
+ $grid: import("vxe-table").VxeGridConstructor | null | undefined;
339
+ }) => boolean) | undefined;
332
340
  activeMethod?: ((params: {
333
341
  row: any;
334
342
  rowIndex: number;
@@ -327,6 +327,14 @@ declare const _default: import("vue").DefineComponent<{
327
327
  showInsertStatus?: boolean | undefined;
328
328
  showAsterisk?: boolean | undefined;
329
329
  autoClear?: boolean | undefined;
330
+ beforeEditMethod?: ((params: {
331
+ row: any;
332
+ rowIndex: number;
333
+ column: import("vxe-table").VxeTableDefines.ColumnInfo;
334
+ columnIndex: number;
335
+ $table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
336
+ $grid: import("vxe-table").VxeGridConstructor | null | undefined;
337
+ }) => boolean) | undefined;
330
338
  activeMethod?: ((params: {
331
339
  row: any;
332
340
  rowIndex: number;
@@ -430,7 +430,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
430
430
  };
431
431
  }
432
432
  const currentColumns = fieldList.map((item, index) => {
433
- var _a2, _b2, _c2, _d, _e, _f, _g;
433
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h;
434
434
  let filterField = false;
435
435
  let filterItems = [];
436
436
  try {
@@ -445,6 +445,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
445
445
  let sortable = props.isNestTable ? false : !filterField && item.isSort == 1 && notParticipatingSort != 1 && item.isMerge != 1;
446
446
  let treeNode = props.isNestTable ? false : state.isTree != 0 ? index === 0 : false;
447
447
  let type = index === 0 && props.showNestTable ? "expand" : "";
448
+ const isShow = item.isShow == 1 && ((_e = item == null ? void 0 : item.settingObj) == null ? void 0 : _e.isHide) != 1;
448
449
  if (isScanMultiTable2) {
449
450
  fixed = "";
450
451
  sortable = false;
@@ -452,15 +453,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
452
453
  type = "";
453
454
  }
454
455
  const col = Object.assign(item, {
455
- visible: item.columnName == "operatorColumn" ? showButtonTop == 0 : item.isShow == 1,
456
+ visible: item.columnName == "operatorColumn" ? showButtonTop == 0 : isShow,
456
457
  field: item.columnName,
457
458
  title: handleName(item, "title"),
458
459
  minWidth: item.colWidth,
459
460
  fixed,
460
461
  sortable,
461
462
  headerClassName: "mycolumn",
462
- resizable: (_e = item.resizable) != null ? _e : true,
463
- showOverflow: (_f = item.showOverflow) != null ? _f : "title",
463
+ resizable: (_f = item.resizable) != null ? _f : true,
464
+ showOverflow: (_g = item.showOverflow) != null ? _g : "title",
464
465
  treeNode,
465
466
  type,
466
467
  slots: {
@@ -475,7 +476,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
475
476
  if (filterField && !props.isNestTable && !isScanMultiTable2) {
476
477
  state.filterFields[item.columnName] = Object.assign({}, XEUtils.clone({
477
478
  ...item,
478
- setting: item.settingObj
479
+ setting: item.settingObj || {}
479
480
  }, true), {
480
481
  visible: false,
481
482
  left: "initial",
@@ -497,7 +498,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
497
498
  if (!isScanMultiTable2 && !isFunction(attr.footerMethod) && !isFunction(attr["footer-method"])) {
498
499
  col.slots.footer = "tooltip_footer";
499
500
  }
500
- if (props.showNestTable && state.isTree == 0 && ((_g = props.curNestColumnConfig) == null ? void 0 : _g.isTree) == 0) {
501
+ if (props.showNestTable && state.isTree == 0 && ((_h = props.curNestColumnConfig) == null ? void 0 : _h.isTree) == 0) {
501
502
  col.slots.content = "nest_table_content";
502
503
  }
503
504
  return col;
@@ -19,7 +19,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
19
19
  }, {
20
20
  fieldsMapping: Record<string, string>;
21
21
  selectOptions: Record<string, string>[];
22
- emit: (event: "onSave" | "onClose", ...args: any[]) => void;
22
+ emit: (event: "onSave" | "onClose" | "reset", ...args: any[]) => void;
23
23
  settingView: any;
24
24
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
25
25
  fields: {
@@ -39,11 +39,11 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
39
39
  default: boolean;
40
40
  };
41
41
  }>> & {
42
+ onReset?: ((...args: any[]) => any) | undefined;
42
43
  onOnSave?: ((...args: any[]) => any) | undefined;
43
44
  onOnClose?: ((...args: any[]) => any) | undefined;
44
45
  }>>;
45
46
  initFields: () => any[];
46
- realityFields: import("vue").ComputedRef<any[]>;
47
47
  state: {
48
48
  spinning: boolean;
49
49
  isCustomSearch: boolean;
@@ -212,7 +212,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
212
212
  modelValue: unknown[];
213
213
  componentData: Record<string, any>;
214
214
  }>;
215
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onSave" | "onClose")[], "onSave" | "onClose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
215
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onSave" | "onClose" | "reset")[], "onSave" | "onClose" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
216
216
  fields: {
217
217
  type: import("vue").PropType<any[]>;
218
218
  default: () => never[];
@@ -230,6 +230,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
230
230
  default: boolean;
231
231
  };
232
232
  }>> & {
233
+ onReset?: ((...args: any[]) => any) | undefined;
233
234
  onOnSave?: ((...args: any[]) => any) | undefined;
234
235
  onOnClose?: ((...args: any[]) => any) | undefined;
235
236
  }, {
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, computed, reactive, onMounted, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, createElementVNode, normalizeClass, createCommentVNode, createBlock, toDisplayString, withDirectives, vShow, renderSlot, createTextVNode } from 'vue';
1
+ import { defineComponent, ref, reactive, watch, onMounted, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, createElementVNode, normalizeClass, createCommentVNode, createBlock, toDisplayString, withDirectives, vShow, renderSlot, createTextVNode } from 'vue';
2
2
  import { NSpin, NCheckbox, NTooltip, NSelect, NInput, NInputNumber, NButton } from 'naive-ui';
3
3
  import Draggable from 'vuedraggable';
4
4
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
@@ -78,7 +78,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
78
  default: false
79
79
  }
80
80
  },
81
- emits: ["onSave", "onClose"],
81
+ emits: ["onSave", "onClose", "reset"],
82
82
  setup(__props, { expose, emit }) {
83
83
  const props = __props;
84
84
  const fieldsMapping = {
@@ -126,12 +126,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
126
126
  });
127
127
  return result;
128
128
  }
129
- const realityFields = computed(initFields);
130
129
  const state = reactive({
131
130
  spinning: false,
132
131
  isCustomSearch: true,
133
132
  clickItem: {},
134
- fields: realityFields.value,
133
+ fields: [],
135
134
  widthShow: "10%",
136
135
  widthLarge: "20%"
137
136
  });
@@ -181,6 +180,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
181
180
  };
182
181
  function reset() {
183
182
  state.fields = initFields();
183
+ emit("reset");
184
184
  }
185
185
  const calculateCheck = (key) => {
186
186
  if (!state.fields.length)
@@ -213,6 +213,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
213
213
  state.widthLarge = "15%";
214
214
  }
215
215
  }
216
+ watch(() => props.fields, (value) => {
217
+ if ((value == null ? void 0 : value.length) > 0) {
218
+ state.fields = initFields();
219
+ }
220
+ }, { immediate: true, deep: true });
216
221
  onMounted(() => {
217
222
  hideTab();
218
223
  setWidth();
@@ -46,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{
46
46
  }, {
47
47
  fieldsMapping: Record<string, string>;
48
48
  selectOptions: Record<string, string>[];
49
- emit: (event: "onSave" | "onClose", ...args: any[]) => void;
49
+ emit: (event: "onSave" | "onClose" | "reset", ...args: any[]) => void;
50
50
  settingView: any;
51
51
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
52
52
  fields: {
@@ -66,11 +66,11 @@ declare const _default: import("vue").DefineComponent<{
66
66
  default: boolean;
67
67
  };
68
68
  }>> & {
69
+ onReset?: ((...args: any[]) => any) | undefined;
69
70
  onOnSave?: ((...args: any[]) => any) | undefined;
70
71
  onOnClose?: ((...args: any[]) => any) | undefined;
71
72
  }>>;
72
73
  initFields: () => any[];
73
- realityFields: import("vue").ComputedRef<any[]>;
74
74
  state: Istate;
75
75
  leftStyle: (ele: Ifields) => {
76
76
  background: string | undefined;
@@ -166,7 +166,7 @@ declare const _default: import("vue").DefineComponent<{
166
166
  modelValue: unknown[];
167
167
  componentData: Record<string, any>;
168
168
  }>;
169
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onSave" | "onClose")[], "onSave" | "onClose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
169
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onSave" | "onClose" | "reset")[], "onSave" | "onClose" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
170
170
  fields: {
171
171
  type: PropType<any[]>;
172
172
  default: () => never[];
@@ -184,6 +184,7 @@ declare const _default: import("vue").DefineComponent<{
184
184
  default: boolean;
185
185
  };
186
186
  }>> & {
187
+ onReset?: ((...args: any[]) => any) | undefined;
187
188
  onOnSave?: ((...args: any[]) => any) | undefined;
188
189
  onOnClose?: ((...args: any[]) => any) | undefined;
189
190
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.22-beta.0",
3
+ "version": "3.1.22-beta.1",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -66,5 +66,5 @@
66
66
  "iOS 7",
67
67
  "last 3 iOS versions"
68
68
  ],
69
- "gitHead": "b705df583d21df6eb4b249b98dc6640283e80317"
69
+ "gitHead": "0df5a178c3cfc0cd8ff8dc298937c7e00423c2b7"
70
70
  }
@@ -1,4 +0,0 @@
1
- export declare const useCommon: (props: any, attrs: any) => {
2
- formRef: import("vue").Ref<HTMLElement | null>;
3
- isShow: import("vue").Ref<boolean>;
4
- };
File without changes
@@ -1 +0,0 @@
1
- declare module 'bpmn-js/lib/Viewer';
@@ -1 +0,0 @@
1
- declare module 'bpmn-js/lib/features/modeling';
@@ -1 +0,0 @@
1
- declare module 'diagram-js/lib/navigation/movecanvas';