mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 14:13:40 +08:00
fix: file upload key loss #120
This commit is contained in:
@@ -31,6 +31,7 @@ export function jsonToSheetXlsx<T = any>({
|
||||
writeFile(workbook, filename, write2excelOpts);
|
||||
/* at this point, out.xlsb will have been downloaded */
|
||||
}
|
||||
|
||||
export function aoaToSheetXlsx<T = any>({
|
||||
data,
|
||||
header,
|
||||
|
@@ -17,7 +17,7 @@
|
||||
import type { ExcelData } from './types';
|
||||
export default defineComponent({
|
||||
name: 'ImportExcel',
|
||||
emits: ['success'],
|
||||
emits: ['success', 'error'],
|
||||
setup(_, { emit }) {
|
||||
const inputRef = ref<HTMLInputElement | null>(null);
|
||||
const loadingRef = ref<Boolean>(false);
|
||||
@@ -82,6 +82,7 @@
|
||||
resolve('');
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
emit('error');
|
||||
} finally {
|
||||
loadingRef.value = false;
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@ export interface JsonToSheet<T = any> {
|
||||
json2sheetOpts?: JSON2SheetOpts;
|
||||
write2excelOpts?: WritingOptions;
|
||||
}
|
||||
|
||||
export interface AoAToSheet<T = any> {
|
||||
data: T[][];
|
||||
header?: T[];
|
||||
|
@@ -93,7 +93,6 @@ export type ComponentType =
|
||||
| 'SelectOption'
|
||||
| 'TreeSelect'
|
||||
| 'Transfer'
|
||||
// | 'Radio'
|
||||
| 'RadioButtonGroup'
|
||||
| 'RadioGroup'
|
||||
| 'Checkbox'
|
||||
|
@@ -190,6 +190,7 @@ export default defineComponent({
|
||||
const { appendClass } = props;
|
||||
const isAppendActiveCls =
|
||||
appendClass && level === 1 && menu.path === unref(currentParentPath);
|
||||
|
||||
const levelCls = [
|
||||
`${prefixCls}-item__level${level}`,
|
||||
` ${menuState.theme} `,
|
||||
|
@@ -38,9 +38,9 @@ export default defineComponent({
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{dataSource.map((record = {}) => {
|
||||
{dataSource.map((record = {}, index) => {
|
||||
return (
|
||||
<tr class="file-table-tr" key={record.uuid}>
|
||||
<tr class="file-table-tr" key={`${index + record.name || ''}`}>
|
||||
{columnList.map((item) => {
|
||||
const { dataIndex = '', customRender, align = 'center' } = item;
|
||||
const render = customRender && isFunction(customRender);
|
||||
|
Reference in New Issue
Block a user