cnhis-design-vue 3.0.4 → 3.0.7

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/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.0.7](http://120.25.59.85:3000/cnhis-frontend/cnhis-design-vue/compare/v3.0.6...v3.0.7) (2022-05-25)
6
+
7
+
8
+ ### Features
9
+
10
+ * big-table 编辑增加date类型 ([fce033b](http://120.25.59.85:3000/cnhis-frontend/cnhis-design-vue/commit/fce033b338b0ea2ccd4b4496e21a27e44ef8e68b))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * 表格编辑初始化不应展示操作项 ([165217d](http://120.25.59.85:3000/cnhis-frontend/cnhis-design-vue/commit/165217d96e076b67f449483cf957b4b211545af8))
16
+
17
+ ### [3.0.6](http://120.25.59.85:3000/cnhis-frontend/cnhis-design-vue/compare/v3.0.5...v3.0.6) (2022-05-24)
18
+
19
+
20
+ ### Features
21
+
22
+ * 打印增加默认参数配置 ([b7abea5](http://120.25.59.85:3000/cnhis-frontend/cnhis-design-vue/commit/b7abea576bb8dd39d42324f8cdefb604903e131e))
23
+ * big-table 日期编辑 ([b4fc52e](http://120.25.59.85:3000/cnhis-frontend/cnhis-design-vue/commit/b4fc52e4998bbaa7f63d475bae2028406ca78c1f))
24
+
25
+ ### [3.0.5](http://120.25.59.85:3000/cnhis-frontend/cnhis-design-vue/compare/v3.0.4...v3.0.5) (2022-05-23)
26
+
5
27
  ### [3.0.4](http://120.25.59.85:3000/cnhis-frontend/cnhis-design-vue/compare/v3.0.3...v3.0.4) (2022-05-23)
6
28
 
7
29
 
@@ -1,6 +1,6 @@
1
- import { computed, watch, defineComponent, openBlock, createElementBlock, unref, createCommentVNode, createElementVNode, toDisplayString, ref, createVNode, withCtx, normalizeClass, renderSlot, createTextVNode, mergeProps, reactive, h, resolveComponent, inject, nextTick, createApp, Teleport, provide, onMounted, onUnmounted, getCurrentInstance, onBeforeUnmount, onActivated, onDeactivated, isVNode, useAttrs, normalizeStyle, withDirectives, vShow, Fragment, createBlock } from 'vue';
1
+ import { computed, watch, defineComponent, createVNode, mergeProps, reactive, openBlock, createElementBlock, unref, createCommentVNode, createElementVNode, toDisplayString, ref, withCtx, normalizeClass, renderSlot, createTextVNode, h, resolveComponent, inject, nextTick, createApp, Teleport, provide, onMounted, onUnmounted, getCurrentInstance, onBeforeUnmount, onActivated, onDeactivated, isVNode, useAttrs, normalizeStyle, withDirectives, vShow, Fragment, createBlock } from 'vue';
2
+ import { NInput, NInputNumber, NSelect, NDatePicker, NTooltip, useMessage, NIcon, NPopconfirm, NButton, NInputGroup, NCheckbox, NCheckboxGroup, NSpace, NProgress, NDropdown, NSwitch, NPopover } from 'naive-ui';
2
3
  import { SettingsSharp, CaretDown, CaretForward, CopyOutline, SyncOutline } from '@vicons/ionicons5';
3
- import { NTooltip, NInput, NInputNumber, NSelect, useMessage, NIcon, NPopconfirm, NButton, NInputGroup, NCheckbox, NCheckboxGroup, NSpace, NProgress, NDropdown, NSwitch, NPopover } from 'naive-ui';
4
4
 
5
5
  const bigTableState = {
6
6
  curAbleCheckedLen: 0,
@@ -210,7 +210,7 @@ const bigTableEmits = [
210
210
  "selectionChangeLocal",
211
211
  "switchBtnOnChange",
212
212
  "asyncTableChange",
213
- "updateInput"
213
+ "formChange"
214
214
  ];
215
215
 
216
216
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -13254,6 +13254,162 @@ const useNestTable = (props, state, emit) => {
13254
13254
  };
13255
13255
  };
13256
13256
 
13257
+ var script$6 = defineComponent({
13258
+ name: "EditInput",
13259
+ inheritAttrs: false,
13260
+ components: {
13261
+ NInput,
13262
+ NInputNumber
13263
+ },
13264
+ props: {
13265
+ type: {
13266
+ type: String,
13267
+ default: "input"
13268
+ },
13269
+ col: {
13270
+ type: Object,
13271
+ default: () => ({})
13272
+ },
13273
+ row: {
13274
+ type: Object,
13275
+ default: () => ({})
13276
+ },
13277
+ index: {
13278
+ type: [Number, Object],
13279
+ default: 0
13280
+ }
13281
+ },
13282
+ emits: ["formChange"],
13283
+ setup(props, { attrs, slots, emit }) {
13284
+ const onUpdateValue = (value) => {
13285
+ emit("formChange", {
13286
+ value,
13287
+ row: props.row,
13288
+ column: props.col,
13289
+ index: props.index
13290
+ });
13291
+ };
13292
+ return () => props.type === "input" ? createVNode(NInput, mergeProps(attrs, {
13293
+ "onUpdateValue": onUpdateValue
13294
+ }), null) : createVNode(NInputNumber, mergeProps(attrs, {
13295
+ "onUpdateValue": onUpdateValue
13296
+ }), null);
13297
+ }
13298
+ });
13299
+
13300
+ script$6.__file = "packages/big-table/src/components/edit-form/edit-input.vue";
13301
+
13302
+ var script$5 = defineComponent({
13303
+ name: "EditSelect",
13304
+ inheritAttrs: false,
13305
+ components: {
13306
+ NSelect
13307
+ },
13308
+ props: {
13309
+ col: {
13310
+ type: Object,
13311
+ default: () => ({})
13312
+ },
13313
+ row: {
13314
+ type: Object,
13315
+ default: () => ({})
13316
+ },
13317
+ index: {
13318
+ type: [Number, Object],
13319
+ default: 0
13320
+ }
13321
+ },
13322
+ emits: ["setOptions", "formChange"],
13323
+ setup(props, { attrs, slots, emit }) {
13324
+ const state = reactive({
13325
+ options: []
13326
+ });
13327
+ const setOptions = async () => {
13328
+ if (props.col.options) {
13329
+ state.options = JSON.parse(JSON.stringify(props.col.options));
13330
+ }
13331
+ else {
13332
+ const optionsName = `${props.col.columnName}_options`;
13333
+ state.options = props.row[optionsName] || await props.col.queryOptions();
13334
+ if (!props.row[optionsName]) {
13335
+ emit("setOptions", state.options);
13336
+ }
13337
+ }
13338
+ };
13339
+ setOptions();
13340
+ const onUpdateValue = (value) => {
13341
+ emit("formChange", {
13342
+ value,
13343
+ row: props.row,
13344
+ column: props.col,
13345
+ index: props.index
13346
+ });
13347
+ };
13348
+ return () => [createVNode(NSelect, mergeProps(attrs, {
13349
+ "options": state.options,
13350
+ "consistentMenuWidth": false,
13351
+ "clearable": true,
13352
+ "filterable": true,
13353
+ "to": false,
13354
+ "placeholder": "\u8BF7\u9009\u62E9",
13355
+ "onUpdateValue": onUpdateValue
13356
+ }), null)];
13357
+ }
13358
+ });
13359
+
13360
+ script$5.__file = "packages/big-table/src/components/edit-form/edit-select.vue";
13361
+
13362
+ var script$4 = defineComponent({
13363
+ name: "EditDate",
13364
+ inheritAttrs: false,
13365
+ components: {
13366
+ NDatePicker
13367
+ },
13368
+ props: {
13369
+ col: {
13370
+ type: Object,
13371
+ default: () => ({})
13372
+ },
13373
+ row: {
13374
+ type: Object,
13375
+ default: () => ({})
13376
+ },
13377
+ index: {
13378
+ type: [Number, Object],
13379
+ default: 0
13380
+ }
13381
+ },
13382
+ emits: ["formChange"],
13383
+ setup(props, { attrs, slots, emit }) {
13384
+ const onConfirm = (value) => {
13385
+ emit("formChange", {
13386
+ value,
13387
+ row: props.row,
13388
+ column: props.col,
13389
+ index: props.index
13390
+ });
13391
+ };
13392
+ const config = {
13393
+ type: props.col.type || "datetime",
13394
+ clearable: props.col.clearable || true,
13395
+ disabled: props.col.disabled || false,
13396
+ valueFormat: props.col.valueFormat || "yyyy-MM-dd HH:mm:ss",
13397
+ to: false
13398
+ };
13399
+ return () => createVNode(NDatePicker, mergeProps(attrs, config, {
13400
+ "onUpdateFormattedValue": onConfirm
13401
+ }), null);
13402
+ }
13403
+ });
13404
+
13405
+ script$4.__file = "packages/big-table/src/components/edit-form/edit-date.vue";
13406
+
13407
+ const comps = {
13408
+ "input": script$6,
13409
+ "number": script$6,
13410
+ "select": script$5,
13411
+ "date": script$4
13412
+ };
13257
13413
  const useEdit = (props, state, emit, xGrid) => {
13258
13414
  const initEditTable = async () => {
13259
13415
  const { isEdit, fieldList = [] } = props.columnConfig;
@@ -13309,8 +13465,9 @@ const useEdit = (props, state, emit, xGrid) => {
13309
13465
  await xGrid.value.insertAt(record, getInsertRecords.at(-1));
13310
13466
  xGrid.value.clearActived();
13311
13467
  };
13312
- const onUpdateInput = ({ value, row, column }) => {
13313
- emit("updateInput", { value, row, column });
13468
+ const onFormChange = ({ value, row, column }) => {
13469
+ row[column.columnName] = value;
13470
+ emit("formChange", { value, row, column });
13314
13471
  };
13315
13472
  const getDefaultValue = (params, item) => {
13316
13473
  const value = params.row[item.columnName];
@@ -13330,7 +13487,7 @@ const useEdit = (props, state, emit, xGrid) => {
13330
13487
  activeMethod,
13331
13488
  deleteRow,
13332
13489
  onClickSelectTable,
13333
- onUpdateInput,
13490
+ onFormChange,
13334
13491
  getDefaultValue
13335
13492
  };
13336
13493
  };
@@ -13346,7 +13503,7 @@ var img$3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAADKCAYAAABDnT56A
13346
13503
  const _hoisted_1$3 = { class: "no-data-tip NoData-page" };
13347
13504
  const _hoisted_2$2 = ["src"];
13348
13505
  const _hoisted_3$1 = { key: 1 };
13349
- var script$5 = /* @__PURE__ */ defineComponent({
13506
+ var script$3 = /* @__PURE__ */ defineComponent({
13350
13507
  props: {
13351
13508
  noDataTip: {
13352
13509
  type: String,
@@ -13407,14 +13564,14 @@ var script$5 = /* @__PURE__ */ defineComponent({
13407
13564
  }
13408
13565
  });
13409
13566
 
13410
- script$5.__scopeId = "data-v-4a4b0812";
13411
- script$5.__file = "packages/big-table/src/components/NoData.vue";
13567
+ script$3.__scopeId = "data-v-4a4b0812";
13568
+ script$3.__file = "packages/big-table/src/components/NoData.vue";
13412
13569
 
13413
13570
  const _hoisted_1$2 = { class: "text-over-tooltip-components" };
13414
13571
  const __default__$2 = {
13415
13572
  name: "TextOverTooltip"
13416
13573
  };
13417
- var script$4 = /* @__PURE__ */ defineComponent({
13574
+ var script$2 = /* @__PURE__ */ defineComponent({
13418
13575
  ...__default__$2,
13419
13576
  props: {
13420
13577
  content: { type: [String, Number], required: false },
@@ -13482,15 +13639,15 @@ var script$4 = /* @__PURE__ */ defineComponent({
13482
13639
  }
13483
13640
  });
13484
13641
 
13485
- script$4.__scopeId = "data-v-6633a934";
13486
- script$4.__file = "packages/big-table/src/components/TextOverTooltip.vue";
13642
+ script$2.__scopeId = "data-v-6633a934";
13643
+ script$2.__file = "packages/big-table/src/components/TextOverTooltip.vue";
13487
13644
 
13488
13645
  const _hoisted_1$1 = { key: 0 };
13489
13646
  const _hoisted_2$1 = ["xlink:href"];
13490
13647
  const __default__$1 = {
13491
13648
  name: "SvgIcon"
13492
13649
  };
13493
- var script$3 = /* @__PURE__ */ defineComponent({
13650
+ var script$1 = /* @__PURE__ */ defineComponent({
13494
13651
  ...__default__$1,
13495
13652
  props: {
13496
13653
  iconClass: { type: String, required: true, default: "" },
@@ -13520,102 +13677,8 @@ var script$3 = /* @__PURE__ */ defineComponent({
13520
13677
  }
13521
13678
  });
13522
13679
 
13523
- script$3.__scopeId = "data-v-d1ad5be8";
13524
- script$3.__file = "src/component/svg/index.vue";
13525
-
13526
- var script$2 = defineComponent({
13527
- name: "EditInput",
13528
- inheritAttrs: false,
13529
- components: {
13530
- NInput,
13531
- NInputNumber
13532
- },
13533
- props: {
13534
- type: {
13535
- type: String,
13536
- default: "input"
13537
- },
13538
- col: {
13539
- type: Object,
13540
- default: () => ({})
13541
- },
13542
- row: {
13543
- type: Object,
13544
- default: () => ({})
13545
- },
13546
- index: {
13547
- type: [Number, Object],
13548
- default: 0
13549
- }
13550
- },
13551
- emits: ["updateInput"],
13552
- setup(props, { attrs, slots, emit }) {
13553
- const onUpdateValue = (value) => {
13554
- emit("updateInput", {
13555
- value,
13556
- row: props.row,
13557
- column: props.col,
13558
- index: props.index
13559
- });
13560
- };
13561
- return () => props.type === "input" ? createVNode(NInput, mergeProps(attrs, {
13562
- "onUpdateValue": onUpdateValue
13563
- }), null) : createVNode(NInputNumber, mergeProps(attrs, {
13564
- "onUpdateValue": onUpdateValue
13565
- }), null);
13566
- }
13567
- });
13568
-
13569
- script$2.__file = "packages/big-table/src/components/edit-form/edit-input.vue";
13570
-
13571
- var script$1 = defineComponent({
13572
- name: "EditSelect",
13573
- inheritAttrs: false,
13574
- components: {
13575
- NSelect
13576
- },
13577
- props: {
13578
- col: {
13579
- type: Object,
13580
- default: () => {
13581
- }
13582
- },
13583
- row: {
13584
- type: Object,
13585
- default: () => {
13586
- }
13587
- }
13588
- },
13589
- emits: ["setOptions"],
13590
- setup(props, { attrs, slots, emit }) {
13591
- const state = reactive({
13592
- options: []
13593
- });
13594
- const setOptions = async () => {
13595
- if (props.col.options) {
13596
- state.options = JSON.parse(JSON.stringify(props.col.options));
13597
- }
13598
- else {
13599
- const optionsName = `${props.col.columnName}_options`;
13600
- state.options = props.row[optionsName] || await props.col.queryOptions();
13601
- if (!props.row[optionsName]) {
13602
- emit("setOptions", state.options);
13603
- }
13604
- }
13605
- };
13606
- setOptions();
13607
- return () => [createVNode(NSelect, mergeProps(attrs, {
13608
- "options": state.options,
13609
- "consistentMenuWidth": false,
13610
- "clearable": true,
13611
- "filterable": true,
13612
- "to": false,
13613
- "placeholder": "\u8BF7\u9009\u62E9"
13614
- }), null)];
13615
- }
13616
- });
13617
-
13618
- script$1.__file = "packages/big-table/src/components/edit-form/edit-select.vue";
13680
+ script$1.__scopeId = "data-v-d1ad5be8";
13681
+ script$1.__file = "src/component/svg/index.vue";
13619
13682
 
13620
13683
  var iconPrefix = 'vxe-icon--';
13621
13684
  var GlobalConfig = {
@@ -39450,7 +39513,7 @@ var script = /* @__PURE__ */ defineComponent({
39450
39513
  const { formatData, htmlToText, getBtnStyle } = useFormat(state);
39451
39514
  const { imgs2imgArr, parseDurationValue, parseCombinationValue, formatFieldText } = useTableParse(formatData);
39452
39515
  const { allSelectedLength, checkOperateCurrentTable, setRowStatus, resetBatchOperationRowStatus, checkListFormUnionSettingParamsList, handleClickCancelBtnByInline, setAllRowInlineStatus, hideSelectCloumns, handleEditFormLength, resetOperationRowStatus, recordClickBtnInfo, getInlineOpreateRow } = useBatchEditing(props, state, emit, xGrid);
39453
- const { initEditTable, activeMethod, deleteRow, onClickSelectTable, onUpdateInput, getDefaultValue } = useEdit(props, state, emit, xGrid);
39516
+ const { initEditTable, activeMethod, deleteRow, onClickSelectTable, onFormChange, getDefaultValue } = useEdit(props, state, emit, xGrid);
39454
39517
  const { isAboutNestTable, isExpandTable, handleRowId, toggleExpandMethod, loadExpandMethod, nestHandleClickRow } = useNestTable(props, state, emit);
39455
39518
  const attr = useAttrs();
39456
39519
  const currentCheckedKeys = computed(() => {
@@ -39542,7 +39605,7 @@ var script = /* @__PURE__ */ defineComponent({
39542
39605
  };
39543
39606
  onMounted(() => {
39544
39607
  bindDocumentClick();
39545
- state.tableHeight = handleTableHeight(state, props);
39608
+ state.tableHeight = handleTableHeight(state, props) || "auto";
39546
39609
  if (!props.isNestTable)
39547
39610
  return;
39548
39611
  loadColumn(props.columnConfig);
@@ -39784,29 +39847,31 @@ var script = /* @__PURE__ */ defineComponent({
39784
39847
  const formatterEdit = (params, col) => {
39785
39848
  let { row, column, $rowIndex, rowIndex } = params;
39786
39849
  let formType = column.formType || col.formType || "";
39850
+ if (!formType)
39851
+ return null;
39787
39852
  if (formType === "custom") {
39788
39853
  return col.slotFn(params);
39789
39854
  }
39855
+ const Comp = comps[formType] || "";
39856
+ if (!Comp)
39857
+ return null;
39790
39858
  const propsData = {
39791
39859
  col,
39792
39860
  row,
39793
- index: $rowIndex
39861
+ index: $rowIndex,
39862
+ type: formType,
39863
+ onFormChange
39794
39864
  };
39795
- if (formType === "input" || formType === "number") {
39796
- return createVNode(script$2, mergeProps(propsData, {
39797
- "type": formType,
39798
- "value": row[col.columnName],
39799
- "onUpdate:value": ($event) => row[col.columnName] = $event,
39800
- "onUpdateInput": onUpdateInput
39801
- }), null);
39865
+ if (formType === "date") {
39866
+ propsData.defaultFormattedValue = row[col.columnName];
39867
+ }
39868
+ else {
39869
+ propsData.defaultValue = row[col.columnName];
39802
39870
  }
39803
39871
  if (formType === "select") {
39804
- return createVNode(script$1, mergeProps(propsData, {
39805
- "value": row[col.columnName],
39806
- "onUpdate:value": ($event) => row[col.columnName] = $event,
39807
- "onSetOptions": (options) => row[`${col.columnName}_options`] = options
39808
- }), null);
39872
+ propsData.onSetOptions = (options) => row[`${col.columnName}_options`] = options;
39809
39873
  }
39874
+ return createVNode(Comp, propsData, null);
39810
39875
  };
39811
39876
  const getEditBtn = (row, col, index) => {
39812
39877
  return col.tileBtnList?.map((btn) => {
@@ -39902,7 +39967,7 @@ var script = /* @__PURE__ */ defineComponent({
39902
39967
  return getOrCode(row, own, attrType);
39903
39968
  }
39904
39969
  if (column.property === "operatorColumn") {
39905
- if (props.columnConfig.isEdit) {
39970
+ if (props.columnConfig.isEdit && !row.initRow) {
39906
39971
  return getEditBtn(row, col, $rowIndex);
39907
39972
  }
39908
39973
  if (state.showButtonTop != 0 || props.isBatchEditing)
@@ -40187,13 +40252,13 @@ var script = /* @__PURE__ */ defineComponent({
40187
40252
  isAlias = !!tooltipTitle;
40188
40253
  }
40189
40254
  if (type === "format")
40190
- return createVNode(script$4, {
40255
+ return createVNode(script$2, {
40191
40256
  "tooltipTitle": tooltipTitle,
40192
40257
  "content": name,
40193
40258
  "isAlias": isAlias
40194
40259
  }, null);
40195
40260
  return () => {
40196
- return [createVNode(script$4, {
40261
+ return [createVNode(script$2, {
40197
40262
  "tooltipTitle": tooltipTitle,
40198
40263
  "content": name,
40199
40264
  "isAlias": isAlias
@@ -40747,7 +40812,7 @@ var script = /* @__PURE__ */ defineComponent({
40747
40812
  return createVNode(NPopconfirm, {
40748
40813
  "onPositiveClick": () => confirmScanMulti(params)
40749
40814
  }, {
40750
- trigger: () => createVNode(script$3, {
40815
+ trigger: () => createVNode(script$1, {
40751
40816
  "class": "scan-multi-delete",
40752
40817
  "iconClass": "shanchu"
40753
40818
  }, null),
@@ -40960,7 +41025,7 @@ var script = /* @__PURE__ */ defineComponent({
40960
41025
  }, [createVNode("img", {
40961
41026
  "class": "bigTable-qr-img",
40962
41027
  "src": src
40963
- }, null), createVNode("span", null, [createVNode(script$3, {
41028
+ }, null), createVNode("span", null, [createVNode(script$1, {
40964
41029
  "iconClass": "fangda"
40965
41030
  }, null)])])];
40966
41031
  };
@@ -41044,7 +41109,7 @@ var script = /* @__PURE__ */ defineComponent({
41044
41109
  }
41045
41110
  else {
41046
41111
  icon = createVNode(NTooltip, null, {
41047
- trigger: () => createVNode(script$3, {
41112
+ trigger: () => createVNode(script$1, {
41048
41113
  "iconClass": btn.icon,
41049
41114
  "style": {
41050
41115
  marginRight: mr
@@ -41055,7 +41120,7 @@ var script = /* @__PURE__ */ defineComponent({
41055
41120
  }
41056
41121
  }
41057
41122
  else if (btn.iconSetting) {
41058
- icon = createVNode(script$3, {
41123
+ icon = createVNode(script$1, {
41059
41124
  "iconClass": JSON.parse(btn.iconSetting).icon,
41060
41125
  "style": {
41061
41126
  marginRight: mr
@@ -41484,7 +41549,7 @@ var script = /* @__PURE__ */ defineComponent({
41484
41549
  onScroll: handlerScroll,
41485
41550
  onCellMouseenter: handleCellMouseenter
41486
41551
  }, {
41487
- empty: withCtx(() => [unref(state).isShowEmpty ? (openBlock(), createElementBlock("div", _hoisted_9, [createVNode(script$5, {
41552
+ empty: withCtx(() => [unref(state).isShowEmpty ? (openBlock(), createElementBlock("div", _hoisted_9, [createVNode(script$3, {
41488
41553
  "no-data-img": props.emptyItems.noDataImg,
41489
41554
  "no-data-tip": props.emptyItems.noDataTip,
41490
41555
  "show-img": !props.isNestTable