cnhis-design-vue 3.1.14-beta.7 → 3.1.14-beta.9
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +23 -23
- package/es/packages/big-table/index.d.ts +1 -0
- package/es/packages/big-table/src/BigTable.vue.d.ts +30 -20
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +38 -17
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +25 -8
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue_vue_type_script_setup_true_lang.js +29 -9
- package/es/packages/big-table/src/components/separate.vue.d.ts +3 -4
- package/es/packages/big-table/src/components/separate.vue_vue_type_script_setup_true_lang.js +7 -3
- package/es/packages/big-table/src/hooks/useEdit.d.ts +25 -7
- package/es/packages/big-table/src/hooks/useSeparateRow.d.ts +1 -1
- package/es/packages/big-table/src/hooks/useSeparateRow.js +14 -10
- package/es/packages/big-table/src/utils.js +1 -1
- package/es/packages/big-table/style/index.css +12 -2
- package/es/packages/fabric-chart/index.d.ts +2 -0
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +2 -0
- package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +16 -6
- package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
- package/es/packages/fabric-chart/src/hooks/useLeft.js +14 -14
- package/es/packages/fabric-chart/src/hooks/useRight.js +2 -13
- package/es/packages/fabric-chart/src/hooks/useTop.js +9 -10
- package/es/packages/fabric-chart/src/interface.d.ts +4 -0
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +1 -1
- package/es/packages/form-render/src/components/renderer/cascader.js +4 -8
- package/es/packages/form-render/src/components/renderer/input.js +5 -16
- package/es/packages/form-render/src/components/renderer/inputNumber.d.ts +12 -0
- package/es/packages/form-render/src/components/renderer/inputNumber.js +11 -4
- package/es/packages/form-render/src/components/renderer/select.js +9 -2
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +3 -1
- package/es/packages/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/packages/form-render/src/utils/index.d.ts +8 -2
- package/es/packages/form-render/src/utils/index.js +40 -14
- package/es/packages/index.css +12 -2
- package/es/packages/info-header/index.d.ts +2 -2
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +2 -2
- package/es/src/components/SlotRender/SlotRender.d.ts +3 -3
- package/es/src/components/SlotRender/SlotRender.js +4 -4
- package/global.d.ts +8 -8
- package/package.json +2 -2
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");
|
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");
|
23
|
+
```
|
@@ -2928,6 +2928,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
2928
2928
|
handleFilterSearchChange: (value: any, columnName: any, field: any) => void;
|
2929
2929
|
handleFilterClearAll: (field: any) => void;
|
2930
2930
|
handleCancelFilter: () => void;
|
2931
|
+
mergeQuickSearchConfig: (filterFields: any, props: any) => void;
|
2931
2932
|
handleFilter: (field: any) => void;
|
2932
2933
|
onmousedownFunc: (e: any) => void;
|
2933
2934
|
maskInsert: () => void;
|
@@ -1151,7 +1151,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
1151
1151
|
borderDisabledError: string;
|
1152
1152
|
rippleColorError: string;
|
1153
1153
|
waveOpacity: string;
|
1154
|
-
fontWeight: string;
|
1154
|
+
fontWeight: string; /**
|
1155
|
+
* 初始化props
|
1156
|
+
* @param {*} unionItem
|
1157
|
+
* @param {*} row
|
1158
|
+
* @param {*} column
|
1159
|
+
* @param {*} $rowIndex
|
1160
|
+
* @returns
|
1161
|
+
*/
|
1155
1162
|
fontWeightStrong: string;
|
1156
1163
|
paddingTiny: string;
|
1157
1164
|
paddingSmall: string;
|
@@ -1244,7 +1251,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1244
1251
|
textColorGhostPressedPrimary: string;
|
1245
1252
|
textColorGhostFocusPrimary: string;
|
1246
1253
|
textColorGhostDisabledPrimary: string;
|
1247
|
-
borderPrimary: string;
|
1254
|
+
borderPrimary: string; /**
|
1255
|
+
* tsx渲染表格
|
1256
|
+
*/
|
1248
1257
|
borderHoverPrimary: string;
|
1249
1258
|
borderPressedPrimary: string;
|
1250
1259
|
borderFocusPrimary: string;
|
@@ -1305,7 +1314,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1305
1314
|
colorWarning: string;
|
1306
1315
|
colorHoverWarning: string;
|
1307
1316
|
colorPressedWarning: string;
|
1308
|
-
colorFocusWarning: string;
|
1317
|
+
colorFocusWarning: string;
|
1309
1318
|
colorDisabledWarning: string;
|
1310
1319
|
textColorWarning: string;
|
1311
1320
|
textColorHoverWarning: string;
|
@@ -1668,22 +1677,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1668
1677
|
onBlur: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: FocusEvent) => void>>;
|
1669
1678
|
onClick: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
|
1670
1679
|
onChange: import("vue").PropType<import("naive-ui/es/input/src/interface").OnUpdateValue>;
|
1671
|
-
onClear: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
|
1672
|
-
* 针对 bigTable 的设置列
|
1673
|
-
* type: 列的类型
|
1674
|
-
* field: 列字段名(注:属性层级越深,渲染性能将直线下降)
|
1675
|
-
* title: 列标题(支持开启国际化)
|
1676
|
-
* width: 列宽度(如果为空则均匀分配剩余宽度,如果全部列固定了,可能会存在宽屏下不会铺满,可以配合 "%" 或者 "min-width" 布局)
|
1677
|
-
* minWidth: 最小列宽度;会自动将剩余空间按比例分配
|
1678
|
-
* resizable: 列是否允许拖动列宽调整大小
|
1679
|
-
* visible: 列是否显示
|
1680
|
-
* fixed: 将列固定在左侧或者右侧(注意:固定列应该放在左右两侧的位置)
|
1681
|
-
* align: 列对齐方式
|
1682
|
-
* headerAlign: 表头列的对齐方式
|
1683
|
-
* footerAlign: 表尾列的对齐方式
|
1684
|
-
* formatter: 格式化显示内容 Function({cellValue, row, column})
|
1685
|
-
* sortable: 是否允许列排序
|
1686
|
-
*/
|
1680
|
+
onClear: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
|
1687
1681
|
status: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
1688
1682
|
'onUpdate:value': import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<import("naive-ui/es/input/src/interface").OnUpdateValue>>;
|
1689
1683
|
onUpdateValue: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<import("naive-ui/es/input/src/interface").OnUpdateValue>>;
|
@@ -2941,6 +2935,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2941
2935
|
handleFilterSearchChange: (value: any, columnName: any, field: any) => void;
|
2942
2936
|
handleFilterClearAll: (field: any) => void;
|
2943
2937
|
handleCancelFilter: () => void;
|
2938
|
+
mergeQuickSearchConfig: (filterFields: any, props: any) => void;
|
2944
2939
|
handleFilter: (field: any) => void;
|
2945
2940
|
onmousedownFunc: (e: any) => void;
|
2946
2941
|
maskInsert: () => void;
|
@@ -3296,7 +3291,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
3296
3291
|
buttonColor2: string;
|
3297
3292
|
buttonColor2Hover: string;
|
3298
3293
|
buttonColor2Pressed: string;
|
3299
|
-
boxShadow1: string;
|
3294
|
+
boxShadow1: string; /**
|
3295
|
+
* 针对 bigTable 的设置列
|
3296
|
+
* type: 列的类型
|
3297
|
+
* field: 列字段名(注:属性层级越深,渲染性能将直线下降)
|
3298
|
+
* title: 列标题(支持开启国际化)
|
3299
|
+
* width: 列宽度(如果为空则均匀分配剩余宽度,如果全部列固定了,可能会存在宽屏下不会铺满,可以配合 "%" 或者 "min-width" 布局)
|
3300
|
+
* minWidth: 最小列宽度;会自动将剩余空间按比例分配
|
3301
|
+
* resizable: 列是否允许拖动列宽调整大小
|
3302
|
+
* visible: 列是否显示
|
3303
|
+
* fixed: 将列固定在左侧或者右侧(注意:固定列应该放在左右两侧的位置)
|
3304
|
+
* align: 列对齐方式
|
3305
|
+
* headerAlign: 表头列的对齐方式
|
3306
|
+
* footerAlign: 表尾列的对齐方式
|
3307
|
+
* formatter: 格式化显示内容 Function({cellValue, row, column})
|
3308
|
+
* sortable: 是否允许列排序
|
3309
|
+
*/
|
3300
3310
|
boxShadow2: string;
|
3301
3311
|
boxShadow3: string;
|
3302
3312
|
fontFamily: string;
|
@@ -1,5 +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
|
+
import { isArray, isFunction } from 'lodash-es';
|
3
3
|
import { useSeparateRow } from '../../../packages/big-table/src/hooks/useSeparateRow';
|
4
4
|
import bigTableState from './bigTableState.js';
|
5
5
|
import bigTableProps from './bigTableProps.js';
|
@@ -14,10 +14,10 @@ import { SettingsSharp, CaretDown, CaretForward, CopyOutline, SyncOutline } from
|
|
14
14
|
import './components/NoData.js';
|
15
15
|
import TextOverTooltip from '../../../src/components/TextOverTooltip';
|
16
16
|
import SvgIcon from '../../../src/components/SvgIcon';
|
17
|
-
import { useMessage, NIcon, NTooltip, NCheckbox, NCheckboxGroup, NSpace, NButton, NPopconfirm, NProgress, NDropdown, NSwitch, NPopover } from 'naive-ui';
|
17
|
+
import { useMessage, NIcon, NTooltip, NCheckbox, NCheckboxGroup, NGrid, NGi, NSpace, NButton, NPopconfirm, NProgress, NDropdown, NSwitch, NPopover } from 'naive-ui';
|
18
18
|
import CGrid from '../../../packages/grid';
|
19
19
|
import vexutils from '../../../src/utils/vexutils';
|
20
|
-
import { handleTableHeight, setTableConfig, handleGroupColums, treeToList, checkMethod, setTreeGroupTitle, handleName, generateEditRender, handlerInitSearchItem, getEvaluate, getMapVal, getCandidateComponents, getageShowType, isLink, showFilter, reScrollFilterWrap, hideFilterWrap, mergeConObjFn, setDefaultFormData, handleImgArr, handleImgSrc, modalDetailImage, handleQrCodeContent, getInlineEditBtn, isCopy, setVisibleCheckAllWrap,
|
20
|
+
import { handleTableHeight, setTableConfig, handleGroupColums, treeToList, checkMethod, setTreeGroupTitle, handleName, generateEditRender, handlerInitSearchItem, getEvaluate, getMapVal, getCandidateComponents, getageShowType, isLink, showFilter, reScrollFilterWrap, hideFilterWrap, mergeConObjFn, setDefaultFormData, handleImgArr, handleImgSrc, modalDetailImage, handleQrCodeContent, getInlineEditBtn, isCopy, setVisibleCheckAllWrap, handleTableImageSize, visibleMethod, getRowStyle, getFooterGroup, flattenRow, intersectRow, removeCheckedDisabledRows } from './utils.js';
|
21
21
|
import './components/input-button.js';
|
22
22
|
import './components/separate.js';
|
23
23
|
import xb_big from '../../../src/assets/img/xb_big';
|
@@ -252,6 +252,9 @@ var script = /* @__PURE__ */ defineComponent({
|
|
252
252
|
} = useSeparateRow(() => {
|
253
253
|
var _a, _b;
|
254
254
|
return (_b = (_a = props.columnConfig) == null ? void 0 : _a.fieldList) != null ? _b : [];
|
255
|
+
}, (columnName) => {
|
256
|
+
var _a, _b;
|
257
|
+
return (_b = (_a = props.columnConfig) == null ? void 0 : _a.fieldList) == null ? void 0 : _b.find((field) => field.columnName === columnName);
|
255
258
|
}, xGrid);
|
256
259
|
const onResizableChange = (payload) => {
|
257
260
|
onColumnResize(payload);
|
@@ -769,7 +772,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
769
772
|
height: state.filterHeight + state.distance + "px"
|
770
773
|
}
|
771
774
|
}, [!field.searchFilterText ? createVNode("div", {
|
772
|
-
"class": "
|
775
|
+
"class": "sort-item"
|
773
776
|
}, [createVNode(NCheckbox, {
|
774
777
|
"indeterminate": field.indeterminate,
|
775
778
|
"checked": field.checkAll,
|
@@ -782,13 +785,17 @@ var script = /* @__PURE__ */ defineComponent({
|
|
782
785
|
"value": field.CONVERT,
|
783
786
|
"onUpdate:value": (val) => handleFilterChange(val, item.columnName, field)
|
784
787
|
}, {
|
785
|
-
default: () => [createVNode(
|
786
|
-
"
|
788
|
+
default: () => [createVNode(NGrid, {
|
789
|
+
"cols": 1
|
787
790
|
}, _isSlot(_slot = field.filterItems.map((item2) => {
|
788
|
-
return createVNode(
|
789
|
-
"
|
790
|
-
|
791
|
-
|
791
|
+
return createVNode(NGi, {
|
792
|
+
"class": "sort-item"
|
793
|
+
}, {
|
794
|
+
default: () => [createVNode(NCheckbox, {
|
795
|
+
"value": item2.value,
|
796
|
+
"label": item2.key
|
797
|
+
}, null)]
|
798
|
+
});
|
792
799
|
})) ? _slot : {
|
793
800
|
default: () => [_slot]
|
794
801
|
})]
|
@@ -825,11 +832,13 @@ var script = /* @__PURE__ */ defineComponent({
|
|
825
832
|
}, {
|
826
833
|
default: () => [createTextVNode("\u6E05\u7A7A")]
|
827
834
|
})]) : null, createVNode("div", null, [createVNode(NButton, {
|
835
|
+
"size": "small",
|
828
836
|
"class": "checkbox-btn",
|
829
837
|
"onClick": () => handleCancelFilter()
|
830
838
|
}, {
|
831
839
|
default: () => [createTextVNode("\u53D6\u6D88")]
|
832
840
|
}), createVNode(NButton, {
|
841
|
+
"size": "small",
|
833
842
|
"class": "checkbox-btn",
|
834
843
|
"type": "primary",
|
835
844
|
"onClick": () => handleFilter(field)
|
@@ -876,7 +885,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
876
885
|
};
|
877
886
|
const handleFilterChange = (value, name, field) => {
|
878
887
|
reScrollFilterWrap();
|
879
|
-
|
888
|
+
field.CONVERT = value;
|
880
889
|
field.checkAll = value.length === field.filterItems.length;
|
881
890
|
field.indeterminate = !!value.length && value.length !== field.filterItems.length;
|
882
891
|
};
|
@@ -911,8 +920,20 @@ var script = /* @__PURE__ */ defineComponent({
|
|
911
920
|
const handleCancelFilter = () => {
|
912
921
|
hideFilterWrap(state, props);
|
913
922
|
};
|
923
|
+
function mergeQuickSearchConfig(filterFields, props2) {
|
924
|
+
if (!isArray(props2.quickSearchConfig))
|
925
|
+
return;
|
926
|
+
props2.quickSearchConfig.length = 0;
|
927
|
+
Object.entries(filterFields).forEach(([field_key, filterField]) => {
|
928
|
+
props2.quickSearchConfig.push({
|
929
|
+
field_key,
|
930
|
+
value: filterField.CONVERT || []
|
931
|
+
});
|
932
|
+
});
|
933
|
+
}
|
914
934
|
const handleFilter = (field) => {
|
915
935
|
let conObj = mergeConObjFn(state, props);
|
936
|
+
mergeQuickSearchConfig(state.filterFields, props);
|
916
937
|
emit("onSave", conObj, false, [], [], {
|
917
938
|
isBigTable: true
|
918
939
|
});
|
@@ -1293,6 +1314,9 @@ var script = /* @__PURE__ */ defineComponent({
|
|
1293
1314
|
updateAddCheckedRows(row);
|
1294
1315
|
};
|
1295
1316
|
const handlerClickRow = (data) => {
|
1317
|
+
var _a;
|
1318
|
+
if (((_a = attr.checkboxConfig) == null ? void 0 : _a.trigger) === "default")
|
1319
|
+
return false;
|
1296
1320
|
if (isScanMultiTable.value || props.isInlineOperating)
|
1297
1321
|
return false;
|
1298
1322
|
if (vexutils.has(data == null ? void 0 : data.row, GROUP_TITLE_KEY))
|
@@ -2131,11 +2155,6 @@ var script = /* @__PURE__ */ defineComponent({
|
|
2131
2155
|
watch(() => currentCheckedKeys, (val) => {
|
2132
2156
|
setVisibleCheckAllWrap(state, props, currentCheckedKeys.value);
|
2133
2157
|
});
|
2134
|
-
watch(() => props.quickSearchConfig, (val) => {
|
2135
|
-
setFilterStatus(state, props);
|
2136
|
-
}, {
|
2137
|
-
deep: true
|
2138
|
-
});
|
2139
2158
|
watch(() => props.tableDataCache, (val) => {
|
2140
2159
|
setAllCheckedRows(val);
|
2141
2160
|
}, {
|
@@ -2245,7 +2264,9 @@ var script = /* @__PURE__ */ defineComponent({
|
|
2245
2264
|
const handleMenuClickEvent = (payload) => emit("menuClick", payload);
|
2246
2265
|
expose({
|
2247
2266
|
formatData,
|
2248
|
-
xGrid
|
2267
|
+
xGrid,
|
2268
|
+
loadColumn,
|
2269
|
+
loadData
|
2249
2270
|
});
|
2250
2271
|
return (_ctx, _cache) => {
|
2251
2272
|
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(` <div
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { AnyObject } from '../../../../../../es/src/types';
|
2
2
|
import { CSSProperties, PropType } from 'vue';
|
3
|
-
import { VxeTableDefines } from 'vxe-table';
|
4
3
|
declare const _default: import("vue").DefineComponent<{
|
5
4
|
col: {
|
6
|
-
type: PropType<
|
5
|
+
type: PropType<AnyObject>;
|
7
6
|
required: true;
|
8
7
|
};
|
9
8
|
row: {
|
@@ -17,7 +16,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
17
16
|
}, {
|
18
17
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
19
18
|
col: {
|
20
|
-
type: PropType<
|
19
|
+
type: PropType<AnyObject>;
|
21
20
|
required: true;
|
22
21
|
};
|
23
22
|
row: {
|
@@ -31,16 +30,34 @@ declare const _default: import("vue").DefineComponent<{
|
|
31
30
|
}>> & {
|
32
31
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
33
32
|
}>>;
|
33
|
+
popoverRef: import("vue").Ref<any>;
|
34
34
|
emit: (event: "formChange", ...args: any[]) => void;
|
35
|
+
editContent: import("vue").Ref<any>;
|
35
36
|
getRowData: (row: AnyObject) => {
|
36
37
|
separateData: Record<string, string>;
|
37
38
|
index: number;
|
38
39
|
rawRow: AnyObject;
|
39
40
|
row: AnyObject;
|
40
41
|
} | undefined;
|
41
|
-
editContent: import("vue").Ref<string>;
|
42
42
|
updateShow: (show: boolean) => void;
|
43
43
|
style: CSSProperties;
|
44
|
+
SlotRender: import("vue").DefineComponent<{
|
45
|
+
renderer: {
|
46
|
+
type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/src/types").Func<any[], any>>;
|
47
|
+
required: true;
|
48
|
+
};
|
49
|
+
rootSlots: {
|
50
|
+
type: PropType<Record<string, import("../../../../../../es/src/types").Func<any[], any>>>;
|
51
|
+
};
|
52
|
+
}, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
53
|
+
renderer: {
|
54
|
+
type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/src/types").Func<any[], any>>;
|
55
|
+
required: true;
|
56
|
+
};
|
57
|
+
rootSlots: {
|
58
|
+
type: PropType<Record<string, import("../../../../../../es/src/types").Func<any[], any>>>;
|
59
|
+
};
|
60
|
+
}>>, {}>;
|
44
61
|
NPopover: import("vue").DefineComponent<{
|
45
62
|
internalOnAfterLeave: PropType<() => void>;
|
46
63
|
internalRenderBody: PropType<import("naive-ui/es/popover/src/interface").InternalRenderBody>;
|
@@ -1191,7 +1208,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1191
1208
|
}>;
|
1192
1209
|
Separate: import("vue").DefineComponent<{
|
1193
1210
|
col: {
|
1194
|
-
type: PropType<
|
1211
|
+
type: PropType<AnyObject>;
|
1195
1212
|
required: true;
|
1196
1213
|
};
|
1197
1214
|
row: {
|
@@ -1201,7 +1218,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1201
1218
|
}, {
|
1202
1219
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1203
1220
|
col: {
|
1204
|
-
type: PropType<
|
1221
|
+
type: PropType<AnyObject>;
|
1205
1222
|
required: true;
|
1206
1223
|
};
|
1207
1224
|
row: {
|
@@ -1220,7 +1237,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1220
1237
|
displayContent: import("vue").ComputedRef<string>;
|
1221
1238
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1222
1239
|
col: {
|
1223
|
-
type: PropType<
|
1240
|
+
type: PropType<AnyObject>;
|
1224
1241
|
required: true;
|
1225
1242
|
};
|
1226
1243
|
row: {
|
@@ -1230,7 +1247,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1230
1247
|
}>>, {}>;
|
1231
1248
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formChange"[], "formChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1232
1249
|
col: {
|
1233
|
-
type: PropType<
|
1250
|
+
type: PropType<AnyObject>;
|
1234
1251
|
required: true;
|
1235
1252
|
};
|
1236
1253
|
row: {
|
@@ -1,4 +1,6 @@
|
|
1
|
-
import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode } from 'vue';
|
1
|
+
import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, withModifiers } from 'vue';
|
2
|
+
import SlotRender from '../../../../../src/components/SlotRender';
|
3
|
+
import { cloneDeep, isObject, isArray } from 'lodash-es';
|
2
4
|
import { NPopover, NInput } from 'naive-ui';
|
3
5
|
import { useSeparateMap } from '../../../../../packages/big-table/src/hooks/useSeparateRow';
|
4
6
|
import '../separate.js';
|
@@ -14,19 +16,24 @@ var script = /* @__PURE__ */ defineComponent({
|
|
14
16
|
emits: ["formChange"],
|
15
17
|
setup(__props, { emit }) {
|
16
18
|
const props = __props;
|
19
|
+
const popoverRef = ref();
|
20
|
+
const editContent = ref();
|
17
21
|
const { getRowData } = useSeparateMap();
|
18
|
-
const editContent = ref("");
|
19
22
|
function updateShow(show) {
|
20
23
|
const target = getRowData(props.row);
|
21
24
|
if (!target)
|
22
25
|
return;
|
23
26
|
if (show) {
|
24
|
-
editContent.value = target.row[props.col.field];
|
27
|
+
editContent.value = cloneDeep(target.row[props.col.field]);
|
25
28
|
return;
|
26
29
|
}
|
27
30
|
const old = target.row[props.col.field];
|
28
|
-
if (
|
31
|
+
if (!target)
|
29
32
|
return;
|
33
|
+
if (!isObject(editContent.value) && !isArray(editContent.value)) {
|
34
|
+
if (old === editContent.value)
|
35
|
+
return;
|
36
|
+
}
|
30
37
|
target.rawRow[props.col.field] = editContent.value;
|
31
38
|
emit("formChange", {
|
32
39
|
value: editContent.value,
|
@@ -37,31 +44,44 @@ var script = /* @__PURE__ */ defineComponent({
|
|
37
44
|
}
|
38
45
|
const style = {
|
39
46
|
border: "1px solid #f5f5f5",
|
40
|
-
padding: "4px 0",
|
47
|
+
padding: "4px 0 4px 4px",
|
41
48
|
background: "white",
|
42
49
|
"border-radius": "4px"
|
43
50
|
};
|
44
51
|
return (_ctx, _cache) => {
|
45
52
|
return openBlock(), createBlock(unref(NPopover), {
|
53
|
+
ref_key: "popoverRef",
|
54
|
+
ref: popoverRef,
|
55
|
+
trigger: "click",
|
46
56
|
"show-arrow": false,
|
47
57
|
"onUpdate:show": updateShow
|
48
58
|
}, {
|
49
59
|
trigger: withCtx(() => [
|
50
60
|
createVNode(script$1, {
|
61
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
62
|
+
}, ["stop"])),
|
51
63
|
style,
|
52
64
|
col: __props.col,
|
53
65
|
row: __props.row
|
54
66
|
}, null, 8, ["col", "row"])
|
55
67
|
]),
|
56
68
|
default: withCtx(() => [
|
57
|
-
|
69
|
+
__props.col.separateSlot ? (openBlock(), createBlock(unref(SlotRender), {
|
70
|
+
key: 0,
|
71
|
+
renderer: __props.col.separateSlot,
|
72
|
+
value: editContent.value,
|
73
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => editContent.value = $event),
|
74
|
+
col: __props.col,
|
75
|
+
row: __props.row
|
76
|
+
}, null, 8, ["renderer", "value", "col", "row"])) : (openBlock(), createBlock(unref(NInput), {
|
77
|
+
key: 1,
|
58
78
|
value: editContent.value,
|
59
|
-
"onUpdate:value": _cache[
|
79
|
+
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => editContent.value = $event),
|
60
80
|
type: "textarea"
|
61
|
-
}, null, 8, ["value"])
|
81
|
+
}, null, 8, ["value"]))
|
62
82
|
]),
|
63
83
|
_: 1
|
64
|
-
});
|
84
|
+
}, 512);
|
65
85
|
};
|
66
86
|
}
|
67
87
|
});
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { AnyObject } from '../../../../../es/src/types';
|
2
2
|
import { PropType } from 'vue';
|
3
|
-
import { VxeTableDefines } from 'vxe-table';
|
4
3
|
declare const _default: import("vue").DefineComponent<{
|
5
4
|
col: {
|
6
|
-
type: PropType<
|
5
|
+
type: PropType<AnyObject>;
|
7
6
|
required: true;
|
8
7
|
};
|
9
8
|
row: {
|
@@ -13,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
13
12
|
}, {
|
14
13
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
15
14
|
col: {
|
16
|
-
type: PropType<
|
15
|
+
type: PropType<AnyObject>;
|
17
16
|
required: true;
|
18
17
|
};
|
19
18
|
row: {
|
@@ -32,7 +31,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
32
31
|
displayContent: import("vue").ComputedRef<string>;
|
33
32
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
34
33
|
col: {
|
35
|
-
type: PropType<
|
34
|
+
type: PropType<AnyObject>;
|
36
35
|
required: true;
|
37
36
|
};
|
38
37
|
row: {
|
package/es/packages/big-table/src/components/separate.vue_vue_type_script_setup_true_lang.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, toDisplayString, unref } from 'vue';
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createTextVNode, toDisplayString, unref, createElementVNode } from 'vue';
|
2
2
|
import { useSeparateMap } from '../../../../packages/big-table/src/hooks/useSeparateRow';
|
3
3
|
|
4
|
-
const _hoisted_1 = {
|
4
|
+
const _hoisted_1 = { class: "big-table__separate" };
|
5
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "big-table__separatePlaceholder" }, "p", -1);
|
5
6
|
var script = /* @__PURE__ */ defineComponent({
|
6
7
|
__name: "separate",
|
7
8
|
props: {
|
@@ -16,7 +17,10 @@ var script = /* @__PURE__ */ defineComponent({
|
|
16
17
|
return target ? target.separateData[props.col.field] : "";
|
17
18
|
});
|
18
19
|
return (_ctx, _cache) => {
|
19
|
-
return openBlock(), createElementBlock("div", _hoisted_1,
|
20
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
21
|
+
createTextVNode(toDisplayString(unref(displayContent)) + " ", 1),
|
22
|
+
_hoisted_2
|
23
|
+
]);
|
20
24
|
};
|
21
25
|
}
|
22
26
|
});
|
@@ -152,7 +152,7 @@ export declare const comps: {
|
|
152
152
|
}>;
|
153
153
|
separate: import("vue").DefineComponent<{
|
154
154
|
col: {
|
155
|
-
type: import("vue").PropType<import("
|
155
|
+
type: import("vue").PropType<import("../../../../src/types").AnyObject>;
|
156
156
|
required: true;
|
157
157
|
};
|
158
158
|
row: {
|
@@ -166,7 +166,7 @@ export declare const comps: {
|
|
166
166
|
}, {
|
167
167
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
168
168
|
col: {
|
169
|
-
type: import("vue").PropType<import("
|
169
|
+
type: import("vue").PropType<import("../../../../src/types").AnyObject>;
|
170
170
|
required: true;
|
171
171
|
};
|
172
172
|
row: {
|
@@ -180,16 +180,34 @@ export declare const comps: {
|
|
180
180
|
}>> & {
|
181
181
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
182
182
|
}>>;
|
183
|
+
popoverRef: import("vue").Ref<any>;
|
183
184
|
emit: (event: "formChange", ...args: any[]) => void;
|
185
|
+
editContent: import("vue").Ref<any>;
|
184
186
|
getRowData: (row: import("../../../../src/types").AnyObject) => {
|
185
187
|
separateData: Record<string, string>;
|
186
188
|
index: number;
|
187
189
|
rawRow: import("../../../../src/types").AnyObject;
|
188
190
|
row: import("../../../../src/types").AnyObject;
|
189
191
|
} | undefined;
|
190
|
-
editContent: import("vue").Ref<string>;
|
191
192
|
updateShow: (show: boolean) => void;
|
192
193
|
style: import("vue").CSSProperties;
|
194
|
+
SlotRender: import("vue").DefineComponent<{
|
195
|
+
renderer: {
|
196
|
+
type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../src/types").Func<any[], any>>;
|
197
|
+
required: true;
|
198
|
+
};
|
199
|
+
rootSlots: {
|
200
|
+
type: import("vue").PropType<Record<string, import("../../../../src/types").Func<any[], any>>>;
|
201
|
+
};
|
202
|
+
}, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
203
|
+
renderer: {
|
204
|
+
type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../src/types").Func<any[], any>>;
|
205
|
+
required: true;
|
206
|
+
};
|
207
|
+
rootSlots: {
|
208
|
+
type: import("vue").PropType<Record<string, import("../../../../src/types").Func<any[], any>>>;
|
209
|
+
};
|
210
|
+
}>>, {}>;
|
193
211
|
NPopover: import("vue").DefineComponent<{
|
194
212
|
internalOnAfterLeave: import("vue").PropType<() => void>;
|
195
213
|
internalRenderBody: import("vue").PropType<import("naive-ui/es/popover/src/interface").InternalRenderBody>;
|
@@ -1340,7 +1358,7 @@ export declare const comps: {
|
|
1340
1358
|
}>;
|
1341
1359
|
Separate: import("vue").DefineComponent<{
|
1342
1360
|
col: {
|
1343
|
-
type: import("vue").PropType<import("
|
1361
|
+
type: import("vue").PropType<import("../../../../src/types").AnyObject>;
|
1344
1362
|
required: true;
|
1345
1363
|
};
|
1346
1364
|
row: {
|
@@ -1350,7 +1368,7 @@ export declare const comps: {
|
|
1350
1368
|
}, {
|
1351
1369
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1352
1370
|
col: {
|
1353
|
-
type: import("vue").PropType<import("
|
1371
|
+
type: import("vue").PropType<import("../../../../src/types").AnyObject>;
|
1354
1372
|
required: true;
|
1355
1373
|
};
|
1356
1374
|
row: {
|
@@ -1369,7 +1387,7 @@ export declare const comps: {
|
|
1369
1387
|
displayContent: import("vue").ComputedRef<string>;
|
1370
1388
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1371
1389
|
col: {
|
1372
|
-
type: import("vue").PropType<import("
|
1390
|
+
type: import("vue").PropType<import("../../../../src/types").AnyObject>;
|
1373
1391
|
required: true;
|
1374
1392
|
};
|
1375
1393
|
row: {
|
@@ -1379,7 +1397,7 @@ export declare const comps: {
|
|
1379
1397
|
}>>, {}>;
|
1380
1398
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formChange"[], "formChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1381
1399
|
col: {
|
1382
|
-
type: import("vue").PropType<import("
|
1400
|
+
type: import("vue").PropType<import("../../../../src/types").AnyObject>;
|
1383
1401
|
required: true;
|
1384
1402
|
};
|
1385
1403
|
row: {
|
@@ -22,7 +22,7 @@ export declare function useSeparateMap(): {
|
|
22
22
|
row: AnyObject;
|
23
23
|
} | undefined;
|
24
24
|
};
|
25
|
-
export declare function useSeparateRow(getColumnConfig: () => AnyObject[], $VXETable: Ref<undefined | VxeTableInstance>): {
|
25
|
+
export declare function useSeparateRow(getColumnConfig: () => AnyObject[], getFieldItem: (columnName: string) => AnyObject, $VXETable: Ref<undefined | VxeTableInstance>): {
|
26
26
|
onColumnResize: VxeTableEvents.ResizableChange;
|
27
27
|
needSeparateColumn: import("vue").ComputedRef<AnyObject[]>;
|
28
28
|
separate: (data: AnyObject[], rawData: AnyObject[]) => Promise<AnyObject[]>;
|