mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-12 05:32:48 +00:00
优化
This commit is contained in:
parent
90a4c8e69f
commit
94d9e7d716
@ -13,7 +13,7 @@
|
|||||||
"format": "prettier --write src/"
|
"format": "prettier --write src/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cool-vue/crud": "^8.0.2",
|
"@cool-vue/crud": "^8.0.3",
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"@vueuse/core": "^12.5.0",
|
"@vueuse/core": "^12.5.0",
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cool-vue/crud",
|
"name": "@cool-vue/crud",
|
||||||
"version": "8.0.2",
|
"version": "8.0.3",
|
||||||
"private": false,
|
"private": false,
|
||||||
"main": "./dist/index.umd.js",
|
"main": "./dist/index.umd.js",
|
||||||
"module": "./dist/index.es.js",
|
"module": "./dist/index.es.js",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { debounce, last } from "lodash-es";
|
import { debounce, last } from "lodash-es";
|
||||||
import { nextTick, onActivated, onMounted, ref } from "vue";
|
import { nextTick, onActivated, onMounted, ref } from "vue";
|
||||||
import { addClass } from "../../../utils";
|
import { addClass, removeClass } from "../../../utils";
|
||||||
import { mitt } from "../../../utils/mitt";
|
import { mitt } from "../../../utils/mitt";
|
||||||
|
|
||||||
// 表格高度
|
// 表格高度
|
||||||
@ -54,6 +54,11 @@ export function useHeight({ config, Table }: { Table: Vue.Ref<any>; config: ClTa
|
|||||||
n = n.nextSibling;
|
n = n.nextSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 移除 cl-row--last
|
||||||
|
arr.forEach((e) => {
|
||||||
|
removeClass(e, "cl-row--last");
|
||||||
|
});
|
||||||
|
|
||||||
// 最后一个可视元素
|
// 最后一个可视元素
|
||||||
const z = last(arr);
|
const z = last(arr);
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|||||||
}>, {
|
}>, {
|
||||||
type: "default" | "card";
|
type: "default" | "card";
|
||||||
labels: unknown[];
|
labels: unknown[];
|
||||||
justify: "center" | "left" | "right" | "justify" | "start" | "end" | "match-parent";
|
justify: "left" | "center" | "right" | "justify" | "start" | "end" | "match-parent";
|
||||||
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|||||||
@ -3,5 +3,5 @@ export declare function useHeight({ config, Table }: {
|
|||||||
config: ClTable.Config;
|
config: ClTable.Config;
|
||||||
}): {
|
}): {
|
||||||
maxHeight: import('vue').Ref<number, number>;
|
maxHeight: import('vue').Ref<number, number>;
|
||||||
calcMaxHeight: import('lodash-es').DebouncedFunc<() => Promise<void>>;
|
calcMaxHeight: import('lodash').DebouncedFunc<() => Promise<void>>;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -87,6 +87,10 @@ export declare function useTable(props: any): {
|
|||||||
type: BooleanConstructor;
|
type: BooleanConstructor;
|
||||||
default: boolean;
|
default: boolean;
|
||||||
};
|
};
|
||||||
|
preserveExpandedContent: {
|
||||||
|
type: BooleanConstructor;
|
||||||
|
default: boolean;
|
||||||
|
};
|
||||||
}>> & {
|
}>> & {
|
||||||
onScroll?: ((...args: any[]) => any) | undefined;
|
onScroll?: ((...args: any[]) => any) | undefined;
|
||||||
onSelect?: ((...args: any[]) => any) | undefined;
|
onSelect?: ((...args: any[]) => any) | undefined;
|
||||||
@ -151,7 +155,7 @@ export declare function useTable(props: any): {
|
|||||||
width: string;
|
width: string;
|
||||||
height: string;
|
height: string;
|
||||||
} | null>;
|
} | null>;
|
||||||
debouncedUpdateLayout: import('lodash-es').DebouncedFunc<() => void>;
|
debouncedUpdateLayout: import('lodash').DebouncedFunc<() => void>;
|
||||||
handleFixedMousewheel: (event: any, data: any) => void;
|
handleFixedMousewheel: (event: any, data: any) => void;
|
||||||
setCurrentRow: (row: any) => void;
|
setCurrentRow: (row: any) => void;
|
||||||
getSelectionRows: () => any;
|
getSelectionRows: () => any;
|
||||||
@ -209,6 +213,7 @@ export declare function useTable(props: any): {
|
|||||||
indent: number;
|
indent: number;
|
||||||
flexible: boolean;
|
flexible: boolean;
|
||||||
scrollbarTabindex: string | number;
|
scrollbarTabindex: string | number;
|
||||||
|
preserveExpandedContent: boolean;
|
||||||
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
||||||
P: {};
|
P: {};
|
||||||
B: {};
|
B: {};
|
||||||
@ -304,6 +309,10 @@ export declare function useTable(props: any): {
|
|||||||
type: BooleanConstructor;
|
type: BooleanConstructor;
|
||||||
default: boolean;
|
default: boolean;
|
||||||
};
|
};
|
||||||
|
preserveExpandedContent: {
|
||||||
|
type: BooleanConstructor;
|
||||||
|
default: boolean;
|
||||||
|
};
|
||||||
}>> & {
|
}>> & {
|
||||||
onScroll?: ((...args: any[]) => any) | undefined;
|
onScroll?: ((...args: any[]) => any) | undefined;
|
||||||
onSelect?: ((...args: any[]) => any) | undefined;
|
onSelect?: ((...args: any[]) => any) | undefined;
|
||||||
@ -368,7 +377,7 @@ export declare function useTable(props: any): {
|
|||||||
width: string;
|
width: string;
|
||||||
height: string;
|
height: string;
|
||||||
} | null>;
|
} | null>;
|
||||||
debouncedUpdateLayout: import('lodash-es').DebouncedFunc<() => void>;
|
debouncedUpdateLayout: import('lodash').DebouncedFunc<() => void>;
|
||||||
handleFixedMousewheel: (event: any, data: any) => void;
|
handleFixedMousewheel: (event: any, data: any) => void;
|
||||||
setCurrentRow: (row: any) => void;
|
setCurrentRow: (row: any) => void;
|
||||||
getSelectionRows: () => any;
|
getSelectionRows: () => any;
|
||||||
@ -426,6 +435,7 @@ export declare function useTable(props: any): {
|
|||||||
indent: number;
|
indent: number;
|
||||||
flexible: boolean;
|
flexible: boolean;
|
||||||
scrollbarTabindex: string | number;
|
scrollbarTabindex: string | number;
|
||||||
|
preserveExpandedContent: boolean;
|
||||||
}>, import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
}>, import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
||||||
data: {
|
data: {
|
||||||
type: import('vue').PropType<import('element-plus/es/components/table/src/table/defaults.mjs').DefaultRow[]>;
|
type: import('vue').PropType<import('element-plus/es/components/table/src/table/defaults.mjs').DefaultRow[]>;
|
||||||
@ -514,6 +524,10 @@ export declare function useTable(props: any): {
|
|||||||
type: BooleanConstructor;
|
type: BooleanConstructor;
|
||||||
default: boolean;
|
default: boolean;
|
||||||
};
|
};
|
||||||
|
preserveExpandedContent: {
|
||||||
|
type: BooleanConstructor;
|
||||||
|
default: boolean;
|
||||||
|
};
|
||||||
}>> & {
|
}>> & {
|
||||||
onScroll?: ((...args: any[]) => any) | undefined;
|
onScroll?: ((...args: any[]) => any) | undefined;
|
||||||
onSelect?: ((...args: any[]) => any) | undefined;
|
onSelect?: ((...args: any[]) => any) | undefined;
|
||||||
@ -578,7 +592,7 @@ export declare function useTable(props: any): {
|
|||||||
width: string;
|
width: string;
|
||||||
height: string;
|
height: string;
|
||||||
} | null>;
|
} | null>;
|
||||||
debouncedUpdateLayout: import('lodash-es').DebouncedFunc<() => void>;
|
debouncedUpdateLayout: import('lodash').DebouncedFunc<() => void>;
|
||||||
handleFixedMousewheel: (event: any, data: any) => void;
|
handleFixedMousewheel: (event: any, data: any) => void;
|
||||||
setCurrentRow: (row: any) => void;
|
setCurrentRow: (row: any) => void;
|
||||||
getSelectionRows: () => any;
|
getSelectionRows: () => any;
|
||||||
@ -636,6 +650,7 @@ export declare function useTable(props: any): {
|
|||||||
indent: number;
|
indent: number;
|
||||||
flexible: boolean;
|
flexible: boolean;
|
||||||
scrollbarTabindex: string | number;
|
scrollbarTabindex: string | number;
|
||||||
|
preserveExpandedContent: boolean;
|
||||||
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
||||||
P: {};
|
P: {};
|
||||||
B: {};
|
B: {};
|
||||||
@ -731,6 +746,10 @@ export declare function useTable(props: any): {
|
|||||||
type: BooleanConstructor;
|
type: BooleanConstructor;
|
||||||
default: boolean;
|
default: boolean;
|
||||||
};
|
};
|
||||||
|
preserveExpandedContent: {
|
||||||
|
type: BooleanConstructor;
|
||||||
|
default: boolean;
|
||||||
|
};
|
||||||
}>> & {
|
}>> & {
|
||||||
onScroll?: ((...args: any[]) => any) | undefined;
|
onScroll?: ((...args: any[]) => any) | undefined;
|
||||||
onSelect?: ((...args: any[]) => any) | undefined;
|
onSelect?: ((...args: any[]) => any) | undefined;
|
||||||
@ -795,7 +814,7 @@ export declare function useTable(props: any): {
|
|||||||
width: string;
|
width: string;
|
||||||
height: string;
|
height: string;
|
||||||
} | null>;
|
} | null>;
|
||||||
debouncedUpdateLayout: import('lodash-es').DebouncedFunc<() => void>;
|
debouncedUpdateLayout: import('lodash').DebouncedFunc<() => void>;
|
||||||
handleFixedMousewheel: (event: any, data: any) => void;
|
handleFixedMousewheel: (event: any, data: any) => void;
|
||||||
setCurrentRow: (row: any) => void;
|
setCurrentRow: (row: any) => void;
|
||||||
getSelectionRows: () => any;
|
getSelectionRows: () => any;
|
||||||
@ -853,6 +872,7 @@ export declare function useTable(props: any): {
|
|||||||
indent: number;
|
indent: number;
|
||||||
flexible: boolean;
|
flexible: boolean;
|
||||||
scrollbarTabindex: string | number;
|
scrollbarTabindex: string | number;
|
||||||
|
preserveExpandedContent: boolean;
|
||||||
}>>;
|
}>>;
|
||||||
config: {
|
config: {
|
||||||
columns: {
|
columns: {
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 文件名 -->
|
<!-- 文件名 -->
|
||||||
<div class="cl-upload-item__name">
|
<div class="cl-upload-item__name">
|
||||||
<span>{{ fileName(item.name || url) }}</span>
|
<span>{{ item.name || url }}</span>
|
||||||
<span v-show="item.error" class="error">{{ item.error }}</span>
|
<span v-show="item.error" class="error">{{ item.error }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -123,7 +123,7 @@ import { ZoomIn, Delete, VideoPause, VideoPlay } from '@element-plus/icons-vue';
|
|||||||
import { ContextMenu } from '@cool-vue/crud';
|
import { ContextMenu } from '@cool-vue/crud';
|
||||||
import { useCool } from '/@/cool';
|
import { useCool } from '/@/cool';
|
||||||
import { extname } from '/@/cool/utils';
|
import { extname } from '/@/cool/utils';
|
||||||
import { fileName, getRule } from '../../utils';
|
import { getRule } from '../../utils';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { useClipboard } from '@vueuse/core';
|
import { useClipboard } from '@vueuse/core';
|
||||||
import Viewer from './viewer.vue';
|
import Viewer from './viewer.vue';
|
||||||
@ -280,7 +280,7 @@ onMounted(() => {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 6px;
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: var(--el-fill-color-light);
|
background-color: var(--el-fill-color-light);
|
||||||
border: 1px solid var(--el-fill-color-light);
|
border: 1px solid var(--el-fill-color-light);
|
||||||
@ -349,7 +349,7 @@ onMounted(() => {
|
|||||||
top: 0;
|
top: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
transition: opacity 0.3s;
|
transition: opacity 0.3s;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@ -388,7 +388,7 @@ onMounted(() => {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 2px 4px;
|
padding: 2px 4px;
|
||||||
border-radius: 2px;
|
border-radius: 4px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
max-width: 65px;
|
max-width: 65px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { module, service } from '/@/cool';
|
import { module, service } from '/@/cool';
|
||||||
import { uuid } from '/@/cool/utils';
|
import { extname, filename, uuid } from '/@/cool/utils';
|
||||||
import { pathJoin } from '../utils';
|
import { pathJoin } from '../utils';
|
||||||
import { useBase } from '/$/base';
|
import { useBase } from '/$/base';
|
||||||
import { type AxiosProgressEvent } from 'axios';
|
import { type AxiosProgressEvent } from 'axios';
|
||||||
@ -29,11 +29,14 @@ export function useUpload() {
|
|||||||
// 本地上传
|
// 本地上传
|
||||||
const isLocal = mode == 'local';
|
const isLocal = mode == 'local';
|
||||||
|
|
||||||
|
// 文件扩展名
|
||||||
|
const ext = extname(file.name);
|
||||||
|
|
||||||
// 文件名
|
// 文件名
|
||||||
const fileName = fileId + '_' + file.name;
|
const name = filename(file.name) + '_' + fileId + ext;
|
||||||
|
|
||||||
// Key
|
// Key
|
||||||
let key = isLocal ? fileName : pathJoin(prefixPath!, fileName);
|
let key = isLocal ? name : pathJoin(prefixPath!, name);
|
||||||
|
|
||||||
// 多种上传请求
|
// 多种上传请求
|
||||||
const next = async ({ host, preview, data }: Upload.Request) => {
|
const next = async ({ host, preview, data }: Upload.Request) => {
|
||||||
|
|||||||
@ -19,11 +19,6 @@ export function fileSize(size = 0): string {
|
|||||||
return (size / Math.pow(num, 4)).toFixed(2) + 'T';
|
return (size / Math.pow(num, 4)).toFixed(2) + 'T';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 文件名
|
|
||||||
export function fileName(url: string) {
|
|
||||||
return filename(url.substring(url.indexOf('_') + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 文件规则
|
// 文件规则
|
||||||
export function fileRule(path?: string) {
|
export function fileRule(path?: string) {
|
||||||
const d = rules.find(e => {
|
const d = rules.find(e => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user