cnhis-design-vue 3.1.14-beta.0 → 3.1.14-beta.3

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,23 +1,23 @@
1
- # Vue 3 + Typescript + Vite
2
-
3
- This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
-
5
- ## Recommended IDE Setup
6
-
7
- - [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
8
-
9
- ## Type Support For `.vue` Imports in TS
10
-
11
- Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.
12
-
13
- ## 使用
14
- ```JavaScript
15
- import { createApp } from "vue";
16
- import App from "./App.vue";
17
- import cui from "cnhis-design-vue";
18
- import "cnhis-design-vue/es/index.css";
19
-
20
- const app = createApp(App);
21
- app.use(cui);
22
- app.mount("#app");
1
+ # Vue 3 + Typescript + Vite
2
+
3
+ This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ - [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
8
+
9
+ ## Type Support For `.vue` Imports in TS
10
+
11
+ Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.
12
+
13
+ ## 使用
14
+ ```JavaScript
15
+ import { createApp } from "vue";
16
+ import App from "./App.vue";
17
+ import cui from "cnhis-design-vue";
18
+ import "cnhis-design-vue/es/index.css";
19
+
20
+ const app = createApp(App);
21
+ app.use(cui);
22
+ app.mount("#app");
23
23
  ```
@@ -2952,15 +2952,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
2952
2952
  }) => Promise<any>;
2953
2953
  getAsyncTableData: (params: any) => Promise<void>;
2954
2954
  setChecklist: (list: any) => any;
2955
- colspanMethod: ({ row, column, _rowIndex, _columnIndex }: {
2956
- row: any;
2957
- column: any;
2958
- _rowIndex: any;
2959
- _columnIndex: any;
2960
- }) => {
2961
- rowspan: number;
2962
- colspan: number;
2963
- } | undefined;
2955
+ colspanMethod: (payload: any) => any;
2964
2956
  footerRowspanMethod: (obj: any) => {
2965
2957
  rowspan: number;
2966
2958
  colspan: number;
@@ -1084,9 +1084,7 @@ declare const _default: import("vue").DefineComponent<{
1084
1084
  textColorDisabledSuccess: string;
1085
1085
  textColorTextSuccess: string;
1086
1086
  textColorTextHoverSuccess: string;
1087
- textColorTextPressedSuccess: string; /**
1088
- * 删除选中scan数据
1089
- */
1087
+ textColorTextPressedSuccess: string;
1090
1088
  textColorTextFocusSuccess: string;
1091
1089
  textColorTextDisabledSuccess: string;
1092
1090
  textColorGhostSuccess: string;
@@ -1095,7 +1093,9 @@ declare const _default: import("vue").DefineComponent<{
1095
1093
  textColorGhostFocusSuccess: string;
1096
1094
  textColorGhostDisabledSuccess: string;
1097
1095
  borderSuccess: string;
1098
- borderHoverSuccess: string;
1096
+ borderHoverSuccess: string; /**
1097
+ * 删除选中scan数据
1098
+ */
1099
1099
  borderPressedSuccess: string;
1100
1100
  borderFocusSuccess: string;
1101
1101
  borderDisabledSuccess: string;
@@ -1210,7 +1210,10 @@ declare const _default: import("vue").DefineComponent<{
1210
1210
  textColorPressed: string;
1211
1211
  textColorFocus: string;
1212
1212
  textColorDisabled: string;
1213
- textColorText: string;
1213
+ textColorText: string; /**
1214
+ * 避免每次点击都查询
1215
+ * 初始化查一次 行编辑 表单search用
1216
+ */
1214
1217
  textColorTextHover: string;
1215
1218
  textColorTextPressed: string;
1216
1219
  textColorTextFocus: string;
@@ -1670,7 +1673,22 @@ declare const _default: import("vue").DefineComponent<{
1670
1673
  onBlur: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: FocusEvent) => void>>;
1671
1674
  onClick: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
1672
1675
  onChange: import("vue").PropType<import("naive-ui/es/input/src/interface").OnUpdateValue>;
1673
- onClear: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
1676
+ onClear: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>; /**
1677
+ * 针对 bigTable 的设置列
1678
+ * type: 列的类型
1679
+ * field: 列字段名(注:属性层级越深,渲染性能将直线下降)
1680
+ * title: 列标题(支持开启国际化)
1681
+ * width: 列宽度(如果为空则均匀分配剩余宽度,如果全部列固定了,可能会存在宽屏下不会铺满,可以配合 "%" 或者 "min-width" 布局)
1682
+ * minWidth: 最小列宽度;会自动将剩余空间按比例分配
1683
+ * resizable: 列是否允许拖动列宽调整大小
1684
+ * visible: 列是否显示
1685
+ * fixed: 将列固定在左侧或者右侧(注意:固定列应该放在左右两侧的位置)
1686
+ * align: 列对齐方式
1687
+ * headerAlign: 表头列的对齐方式
1688
+ * footerAlign: 表尾列的对齐方式
1689
+ * formatter: 格式化显示内容 Function({cellValue, row, column})
1690
+ * sortable: 是否允许列排序
1691
+ */
1674
1692
  status: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
1675
1693
  'onUpdate:value': import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<import("naive-ui/es/input/src/interface").OnUpdateValue>>;
1676
1694
  onUpdateValue: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<import("naive-ui/es/input/src/interface").OnUpdateValue>>;
@@ -2952,15 +2970,7 @@ declare const _default: import("vue").DefineComponent<{
2952
2970
  }) => Promise<any>;
2953
2971
  getAsyncTableData: (params: any) => Promise<void>;
2954
2972
  setChecklist: (list: any) => any;
2955
- colspanMethod: ({ row, column, _rowIndex, _columnIndex }: {
2956
- row: any;
2957
- column: any;
2958
- _rowIndex: any;
2959
- _columnIndex: any;
2960
- }) => {
2961
- rowspan: number;
2962
- colspan: number;
2963
- } | undefined;
2973
+ colspanMethod: (payload: any) => any;
2964
2974
  footerRowspanMethod: (obj: any) => {
2965
2975
  rowspan: number;
2966
2976
  colspan: number;
@@ -4042,9 +4052,6 @@ declare const _default: import("vue").DefineComponent<{
4042
4052
  readonly color: StringConstructor;
4043
4053
  readonly component: import("vue").PropType<import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
4044
4054
  readonly theme: import("vue").PropType<import("naive-ui/es/_mixins").Theme<"Icon", {
4045
- /**
4046
- * computed
4047
- */
4048
4055
  color: string;
4049
4056
  opacity1Depth: string;
4050
4057
  opacity2Depth: string;
@@ -1,4 +1,5 @@
1
1
  import { defineComponent, ref, reactive, useAttrs, computed, onMounted, onUnmounted, onActivated, createVNode, h, resolveComponent, Teleport, createTextVNode, nextTick, watch, openBlock, createElementBlock, Fragment, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, unref, mergeProps, withCtx, renderSlot, createBlock, toDisplayString, withDirectives, vShow, isVNode } from 'vue';
2
+ import { isFunction } from 'lodash-es';
2
3
  import { useSeparateRow } from '../../../packages/big-table/src/hooks/useSeparateRow';
3
4
  import bigTableState from './bigTableState.js';
4
5
  import bigTableProps from './bigTableProps.js';
@@ -1121,13 +1122,18 @@ var script = /* @__PURE__ */ defineComponent({
1121
1122
  };
1122
1123
  });
1123
1124
  };
1124
- const colspanMethod = ({
1125
- row,
1126
- column,
1127
- _rowIndex,
1128
- _columnIndex
1129
- }) => {
1125
+ const colspanMethod = (payload) => {
1130
1126
  var _a;
1127
+ const {
1128
+ row,
1129
+ column,
1130
+ _rowIndex,
1131
+ _columnIndex
1132
+ } = payload;
1133
+ if (isFunction(attr.spanMethod))
1134
+ return attr.spanMethod(payload);
1135
+ if (isFunction(attr["span-method"]))
1136
+ return attr["span-method"](payload);
1131
1137
  if (state.isTree != 3) {
1132
1138
  return {
1133
1139
  rowspan: 1,
@@ -1332,7 +1338,8 @@ var script = /* @__PURE__ */ defineComponent({
1332
1338
  emit("checkboxChange", {
1333
1339
  checked: checked2,
1334
1340
  row,
1335
- index: $rowIndex
1341
+ index: $rowIndex,
1342
+ records: [row]
1336
1343
  });
1337
1344
  return;
1338
1345
  }
@@ -1405,7 +1412,8 @@ var script = /* @__PURE__ */ defineComponent({
1405
1412
  emit("checkboxChange", {
1406
1413
  checked: setChecked,
1407
1414
  row,
1408
- index: $rowIndex
1415
+ index: $rowIndex,
1416
+ records: checkedRow
1409
1417
  });
1410
1418
  setChecked && emit("handlerClickRow", row, $rowIndex);
1411
1419
  return;
@@ -1422,7 +1430,8 @@ var script = /* @__PURE__ */ defineComponent({
1422
1430
  emit("checkboxChange", {
1423
1431
  checked: setChecked,
1424
1432
  row,
1425
- index: $rowIndex
1433
+ index: $rowIndex,
1434
+ records: checkedRow
1426
1435
  });
1427
1436
  setChecked && emit("handlerClickRow", row, $rowIndex);
1428
1437
  };
@@ -1442,6 +1451,7 @@ var script = /* @__PURE__ */ defineComponent({
1442
1451
  };
1443
1452
  const treeTableSelectionChange = (records) => {
1444
1453
  if (state.isTree == 0) {
1454
+ emit("selectionChange", records);
1445
1455
  return false;
1446
1456
  }
1447
1457
  pubCheckChange(records);
@@ -1462,7 +1472,8 @@ var script = /* @__PURE__ */ defineComponent({
1462
1472
  emit("checkboxChange", {
1463
1473
  checked,
1464
1474
  row,
1465
- index: $rowIndex
1475
+ index: $rowIndex,
1476
+ records
1466
1477
  });
1467
1478
  if (treeTableSelectionChange(records))
1468
1479
  return;
@@ -2270,8 +2281,7 @@ var script = /* @__PURE__ */ defineComponent({
2270
2281
  "show-header-overflow": "",
2271
2282
  "show-footer-overflow": "title",
2272
2283
  "keep-source": "",
2273
- "auto-resize": "",
2274
- height: props.height ? "auto" : void 0
2284
+ "auto-resize": ""
2275
2285
  }, _ctx.$attrs, {
2276
2286
  "seq-config": unref(handleSeqConfig),
2277
2287
  "tree-config": unref(treeConfig),
@@ -2385,7 +2395,7 @@ var script = /* @__PURE__ */ defineComponent({
2385
2395
  }
2386
2396
  })]),
2387
2397
  _: 3
2388
- }, 16, ["height", "seq-config", "tree-config", "cell-class-name", "row-config", "show-footer", "checkbox-config", "row-style", "edit-config", "expand-config", "keyboard-config", "edit-rules", "menu-config", "onScroll", "onKeydown"]), createCommentVNode(" `${refreshRow}\u6761\u66F4\u65B0` "), withDirectives(createElementVNode("div", {
2398
+ }, 16, ["seq-config", "tree-config", "cell-class-name", "row-config", "show-footer", "checkbox-config", "row-style", "edit-config", "expand-config", "keyboard-config", "edit-rules", "menu-config", "onScroll", "onKeydown"]), createCommentVNode(" `${refreshRow}\u6761\u66F4\u65B0` "), withDirectives(createElementVNode("div", {
2389
2399
  class: "refresh",
2390
2400
  onClick: hanldeClickRefresh
2391
2401
  }, [createVNode(unref(NIcon), {
@@ -22,12 +22,16 @@ function useColumnConfigAdaptor() {
22
22
  ["0", 0],
23
23
  ["1", 1]
24
24
  ]);
25
- const htmlTypeValueMap = new Map(["RADIO", "RADIO_BLOCK", "CHECKBOX", "CHECKBOX_BLOCK", "SELECT"].map((type) => [type, "select"]));
25
+ const htmlTypeValueMap = new Map([
26
+ ...["RADIO", "RADIO_BLOCK", "CHECKBOX", "CHECKBOX_BLOCK", "SELECT"].map((type) => [type, "select"]),
27
+ ...["INPUT"].map((type) => [type, "input"]),
28
+ ...["DIGITAL"].map((type) => [type, "number"])
29
+ ]);
26
30
  const settingMap = /* @__PURE__ */ new Map([
27
31
  ["multi_select_value", { property: "multiple", valueMap: multipleValueMap }],
28
32
  [
29
33
  "is_null",
30
- (value, _fieldItem, _editRules) => {
34
+ (value, result, _fieldItem, _editRules) => {
31
35
  if (value === "0")
32
36
  return;
33
37
  if (value === "1")
@@ -36,7 +40,7 @@ function useColumnConfigAdaptor() {
36
40
  ],
37
41
  ["is_edit", { property: "isEdit", valueMap: isEditValueMap }],
38
42
  ["html_type", { property: "formType", valueMap: htmlTypeValueMap }],
39
- ["option", { fieldMap: /* @__PURE__ */ new Map([["text", "label"]]) }]
43
+ ["option", { property: "options", fieldMap: /* @__PURE__ */ new Map([["text", "label"]]) }]
40
44
  ]);
41
45
  const fieldMap = /* @__PURE__ */ new Map([
42
46
  ["sum", "isSum"],
@@ -61,7 +65,7 @@ function useColumnConfigAdaptor() {
61
65
  if (isString(rule))
62
66
  return result[rule] = value;
63
67
  if (isFunction(rule))
64
- return rule(value, fieldItem, _editRules);
68
+ return rule(value, result, fieldItem, _editRules);
65
69
  if (isObject(rule)) {
66
70
  if (rule.assign) {
67
71
  Object.assign(result, valueTransfer(value, rule));
@@ -139,6 +139,9 @@ body > .vxe-table--tooltip-wrapper {
139
139
  /* 行内表单样式 */
140
140
  /* 行内表单样式 */
141
141
  }
142
+ .custom-big-table .n-input {
143
+ width: fit-content;
144
+ }
142
145
  .custom-big-table .img-wrap {
143
146
  padding: 2px 0;
144
147
  line-height: 1;
@@ -139,6 +139,9 @@ body > .vxe-table--tooltip-wrapper {
139
139
  /* 行内表单样式 */
140
140
  /* 行内表单样式 */
141
141
  }
142
+ .custom-big-table .n-input {
143
+ width: fit-content;
144
+ }
142
145
  .custom-big-table .img-wrap {
143
146
  padding: 2px 0;
144
147
  line-height: 1;
package/global.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import * as NaiveUI from 'naive-ui';
2
-
3
- declare module 'naive-ui' {
4
- // @ts-ignore
5
- export const NTree: any;
6
- }
7
-
8
- export {};
1
+ import * as NaiveUI from 'naive-ui';
2
+
3
+ declare module 'naive-ui' {
4
+ // @ts-ignore
5
+ export const NTree: any;
6
+ }
7
+
8
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
3
  "private": false,
4
- "version": "3.1.14-beta.0",
4
+ "version": "3.1.14-beta.3",
5
5
  "license": "ISC",
6
6
  "module": "es/packages/index.js",
7
7
  "main": "es/packages/index.js",