diff --git a/src/components/Container/src/collapse/CollapseContainer.vue b/src/components/Container/src/collapse/CollapseContainer.vue
index a49be6636605b54b07cc800e9433c9710d3b344a..6f3ff31366015c75fce5d609a155c540bee7ce63 100644
--- a/src/components/Container/src/collapse/CollapseContainer.vue
+++ b/src/components/Container/src/collapse/CollapseContainer.vue
@@ -73,7 +73,7 @@
{props.loading ? (
) : (
- show.value &&
{slots.default?.()}
+ {slots.default?.()}
)}
diff --git a/src/components/Container/src/collapse/CollapseHeader.vue b/src/components/Container/src/collapse/CollapseHeader.vue
index ffc170c6899f832ddc2b42efedb0cd708fb7d925..6bfdcc0a4ee8eec25d150a382bcc121bde307b51 100644
--- a/src/components/Container/src/collapse/CollapseHeader.vue
+++ b/src/components/Container/src/collapse/CollapseHeader.vue
@@ -31,7 +31,11 @@
- {props.canExpan && emit('expand')} />}
+ {slots.action
+ ? slots.action({ expand: props.show, onClick: () => emit('expand') })
+ : props.canExpan && (
+ emit('expand')} />
+ )}
);
diff --git a/src/components/Excel/src/ImportExcel.vue b/src/components/Excel/src/ImportExcel.vue
index 065968bc8f0bffe6bd6c5b98fce6254afbd178d2..59d7f578b123f72108a21fbbedda3a468cb8a30c 100644
--- a/src/components/Excel/src/ImportExcel.vue
+++ b/src/components/Excel/src/ImportExcel.vue
@@ -37,10 +37,45 @@
default: false,
},
},
- emits: ['success', 'error'],
+ emits: ['success', 'error', 'cancel'],
setup(props, { emit }) {
const inputRef = ref(null);
const loadingRef = ref(false);
+ const cancelRef = ref(true);
+
+ function shapeWorkSheel(sheet: XLSX.WorkSheet, range: XLSX.Range) {
+ let str = ' ',
+ char = 65,
+ customWorkSheet = {
+ t: 's',
+ v: str,
+ r: ' ',
+ h: str,
+ w: str,
+ };
+ if (!sheet || !sheet['!ref']) return [];
+ let c = 0,
+ r = 1;
+ while (c < range.e.c + 1) {
+ while (r < range.e.r + 1) {
+ if (!sheet[String.fromCharCode(char) + r]) {
+ sheet[String.fromCharCode(char) + r] = customWorkSheet;
+ }
+ r++;
+ }
+ r = 1;
+ str += ' ';
+ customWorkSheet = {
+ t: 's',
+ v: str,
+ r: ' ',
+ h: str,
+ w: str,
+ };
+ c++;
+ char++;
+ }
+ }
/**
* @description: 第一行作为头部
@@ -49,8 +84,8 @@
if (!sheet || !sheet['!ref']) return [];
const headers: string[] = [];
// A3:B7=>{s:{c:0, r:2}, e:{c:1, r:6}}
- const range = XLSX.utils.decode_range(sheet['!ref']);
-
+ const range: XLSX.Range = XLSX.utils.decode_range(sheet['!ref']);
+ shapeWorkSheel(sheet, range);
const R = range.s.r;
/* start in the first row */
for (let C = range.s.c; C <= range.e.c; ++C) {
@@ -150,6 +185,7 @@
if (!rawFile) return;
+ cancelRef.value = false;
if (props.isReturnFile) {
emit('success', rawFile);
return;
@@ -157,12 +193,29 @@
upload(rawFile);
}
+ /**
+ * @description 文件选择器关闭后,判断取消状态
+ */
+ function handleFocusChange() {
+ const timeId = setInterval(() => {
+ if (cancelRef.value === true) {
+ emit('cancel');
+ }
+ clearInterval(timeId);
+ window.removeEventListener('focus', handleFocusChange);
+ }, 1000);
+ }
+
/**
* @description: 点击上传按钮
*/
function handleUpload() {
const inputRefDom = unref(inputRef);
- inputRefDom && inputRefDom.click();
+ if (inputRefDom) {
+ cancelRef.value = true;
+ inputRefDom.click();
+ window.addEventListener('focus', handleFocusChange);
+ }
}
return { handleUpload, handleInputClick, inputRef };
diff --git a/src/components/Form/src/components/FormItem.vue b/src/components/Form/src/components/FormItem.vue
index 8ce579ab912684ef47f21b6a5e0a1c6ff3389c34..2142364cd3136d8a43cda7e0ee757ea00e4aec33 100644
--- a/src/components/Form/src/components/FormItem.vue
+++ b/src/components/Form/src/components/FormItem.vue
@@ -80,10 +80,14 @@
componentProps = componentProps({ schema, tableAction, formModel, formActionType }) ?? {};
}
if (schema.component === 'Divider') {
- componentProps = Object.assign({ type: 'horizontal' }, componentProps, {
- orientation: 'left',
- plain: true,
- });
+ componentProps = Object.assign(
+ { type: 'horizontal' },
+ {
+ orientation: 'left',
+ plain: true,
+ },
+ componentProps,
+ );
}
return componentProps as Recordable;
});
diff --git a/src/components/Icon/src/IconPicker.vue b/src/components/Icon/src/IconPicker.vue
index 40cfe7d173ca4758202b2974e1fd70a64030c1ea..14194017775c57dab3879f35ff7ecf20321c9b1d 100644
--- a/src/components/Icon/src/IconPicker.vue
+++ b/src/components/Icon/src/IconPicker.vue
@@ -124,7 +124,16 @@
const { prefixCls } = useDesign('icon-picker');
const debounceHandleSearchChange = useDebounceFn(handleSearchChange, 100);
- const { clipboardRef, isSuccessRef } = useCopyToClipboard(props.value);
+
+ let clipboardRef;
+ let isSuccessRef;
+
+ if (props.copy) {
+ const clipboard = useCopyToClipboard(props.value);
+ clipboardRef = clipboard?.clipboardRef;
+ isSuccessRef = clipboard?.isSuccessRef;
+ }
+
const { createMessage } = useMessage();
const { getPaginationList, getTotal, setCurrentPage } = usePagination(
diff --git a/src/components/Modal/src/BasicModal.vue b/src/components/Modal/src/BasicModal.vue
index 89bc8798c4ac54e68cd8fc8397313d9732f8daa7..959e6db621d3b601e71af5ffdd86ce32271bc5b3 100644
--- a/src/components/Modal/src/BasicModal.vue
+++ b/src/components/Modal/src/BasicModal.vue
@@ -139,8 +139,9 @@
...attrs,
...unref(getMergeProps),
visible: unref(visibleRef),
- wrapClassName: unref(getWrapClassName),
};
+ attr['wrapClassName'] = `${attr?.['wrapClassName'] || ''} ${unref(getWrapClassName)}`;
+
if (unref(fullScreenRef)) {
return omit(attr, ['height', 'title']);
}
diff --git a/src/components/Table/src/BasicTable.vue b/src/components/Table/src/BasicTable.vue
index 2e600dabd6e48ad3bc6a98d5aeeb8bf93aa123d1..964addbad0f1594f67b636c394c8d4381aad53b0 100644
--- a/src/components/Table/src/BasicTable.vue
+++ b/src/components/Table/src/BasicTable.vue
@@ -75,7 +75,7 @@
import { warn } from '/@/utils/log';
export default defineComponent({
- name:'BasicTable',
+ name: 'BasicTable',
components: {
Table,
BasicForm,
diff --git a/src/components/Table/src/components/settings/ColumnSetting.vue b/src/components/Table/src/components/settings/ColumnSetting.vue
index c9f17a52105f6db9690bd2053b0a1f7a00253be0..5c578014d362b0427dacbd0a7b42a78157bd9a50 100644
--- a/src/components/Table/src/components/settings/ColumnSetting.vue
+++ b/src/components/Table/src/components/settings/ColumnSetting.vue
@@ -183,8 +183,8 @@
});
watchEffect(() => {
+ const columns = table.getColumns();
setTimeout(() => {
- const columns = table.getColumns();
if (columns.length && !state.isInit) {
init();
}
diff --git a/src/hooks/web/useMessage.tsx b/src/hooks/web/useMessage.tsx
index 91112f34a09d9e836a39bddafd3e5125baeb8921..94ddab30a4b1dd819808a1a864a9393709a7896e 100644
--- a/src/hooks/web/useMessage.tsx
+++ b/src/hooks/web/useMessage.tsx
@@ -91,7 +91,7 @@ function createSuccessModal(options: ModalOptionsPartial) {
}
function createErrorModal(options: ModalOptionsPartial) {
- return Modal.error(createModalOptions(options, 'close'));
+ return Modal.error(createModalOptions(options, 'error'));
}
function createInfoModal(options: ModalOptionsPartial) {
diff --git a/src/utils/http/axios/Axios.ts b/src/utils/http/axios/Axios.ts
index f683a8871d8bc64ee7e9a227f5917f8a2e21e6f0..2a1b48ba16e2e467baf4f638dfb3a600fe760753 100644
--- a/src/utils/http/axios/Axios.ts
+++ b/src/utils/http/axios/Axios.ts
@@ -193,6 +193,11 @@ export class VAxios {
request(config: AxiosRequestConfig, options?: RequestOptions): Promise {
let conf: CreateAxiosOptions = cloneDeep(config);
+ // cancelToken 如果被深拷贝,会导致最外层无法使用cancel方法来取消请求
+ if(config.cancelToken){
+ conf.cancelToken = config.cancelToken
+ }
+
const transform = this.getTransform();
const { requestOptions } = this.options;
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 37526aa55ed78a1829270b1c8e4f35c8c9cb8529..0e9b23fc49e4fa844569a188604c2ca6ab9677aa 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -38,7 +38,7 @@ export function deepMerge(src: any = {}, target: any = {}): T {
let key: string;
const res: any = cloneDeep(src);
for (key in target) {
- res[key] = isObject(res[key]) ? deepMerge(res[key], target[key]) : (res[key] = target[key]);
+ res[key] = isObject(res[key]) ? deepMerge(res[key], target[key]) : target[key];
}
return res;
}
diff --git a/src/views/demo/form/UseForm.vue b/src/views/demo/form/UseForm.vue
index 95e8fb9c02e7a10b13d9fe278c07cd75daae8923..f03eac032c99cc6672ce124a6654aa33ee12cfe2 100644
--- a/src/views/demo/form/UseForm.vue
+++ b/src/views/demo/form/UseForm.vue
@@ -1,80 +1,60 @@
-
-
更改labelWidth
-
还原labelWidth
-
更改Size
-
还原Size
-
禁用表单
-
解除禁用
-
紧凑表单
-
还原正常间距
-
- 操作按钮位置
-
-
-
-
- 隐藏操作按钮
-
-
- 显示操作按钮
-
-
隐藏重置按钮
-
显示重置按钮
-
- 隐藏查询按钮
-
-
显示查询按钮
-
- 修改重置按钮
-
-
- 修改查询按钮
-
-
联动回显
-
+ 更改设置
+
+
+
+
+
+ withClose({ resetButtonOptions: { disabled: true, text: '重置New' } })"
+ >
+ 修改重置按钮
+
+ withClose({ submitButtonOptions: { disabled: true, loading: true } })"
+ >
+ 修改查询按钮
+
+ 联动回显
+
+
+
+
+
+ 重置设置
+ 应用
+
+
+
+
+