feat: 文件处理工具类
This commit is contained in:
parent
eb587c750f
commit
430634b49e
@ -109,6 +109,7 @@ export default {
|
||||
["virtual-list"]: "virtual-list",
|
||||
["common-tools"]: "common tools",
|
||||
["tree-tools"]: "tree-tools",
|
||||
["file-tools"]: "file-tools",
|
||||
["test"]: "test"
|
||||
}
|
||||
};
|
||||
|
||||
@ -109,6 +109,7 @@ export default {
|
||||
["virtual-list"]: "虚拟列表",
|
||||
["common-tools"]: "常用工具类",
|
||||
["tree-tools"]: "树处理工具类",
|
||||
["file-tools"]: "文件工具类",
|
||||
["test"]: "测试"
|
||||
}
|
||||
};
|
||||
|
||||
@ -884,6 +884,27 @@ export const systemMenu = [
|
||||
},
|
||||
children: null
|
||||
},
|
||||
{
|
||||
id: "0904",
|
||||
parentId: "09",
|
||||
path: "/functions/file-tools",
|
||||
name: "file-tools",
|
||||
component: "functions/file-tools/file-tools",
|
||||
meta: {
|
||||
title: "file-tools",
|
||||
hide: false,
|
||||
disable: false,
|
||||
keepAlive: true,
|
||||
affix: false,
|
||||
link: "",
|
||||
iframe: false,
|
||||
roles: ["admin"],
|
||||
icon: "icon-menu",
|
||||
sort: 4,
|
||||
type: 2
|
||||
},
|
||||
children: null
|
||||
},
|
||||
{
|
||||
id: "10",
|
||||
parentId: "0",
|
||||
|
||||
61
src/views/functions/file-tools/file-tools.vue
Normal file
61
src/views/functions/file-tools/file-tools.vue
Normal file
@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div class="snow-page">
|
||||
<div class="snow-inner">
|
||||
<a-alert type="success">工具类位置: src/utils/file-tools.ts</a-alert>
|
||||
<a-divider />
|
||||
<a-space direction="vertical" fill>
|
||||
<div>获取麦克风权限: getMicPower</div>
|
||||
<div>返回Promis的boolean,示例: getMicPower()</div>
|
||||
<div>
|
||||
使用方式:
|
||||
<a-typography-text code>getMicPower()</a-typography-text>
|
||||
</div>
|
||||
</a-space>
|
||||
<a-divider />
|
||||
<a-space direction="vertical" fill>
|
||||
<div>十六进制字符串转换为字节数组: hexStringToByteArray</div>
|
||||
<div>返回Uint8Array,示例: hexStringToByteArray(hexString)</div>
|
||||
<div>
|
||||
使用方式:
|
||||
<a-typography-text code>hexStringToByteArray(十六进制字符串)</a-typography-text>
|
||||
</div>
|
||||
</a-space>
|
||||
<a-divider />
|
||||
<a-space direction="vertical" fill>
|
||||
<div>Uint8Array转换为ArrayBuffer: byteArrayToArrayBuffer</div>
|
||||
<div>返回ArrayBuffer,示例: byteArrayToArrayBuffer(Uint8Array)</div>
|
||||
<div>
|
||||
使用方式:
|
||||
<a-typography-text code>byteArrayToArrayBuffer(你的Uint8Array数据)</a-typography-text>
|
||||
</div>
|
||||
</a-space>
|
||||
<a-divider />
|
||||
<a-space direction="vertical" fill>
|
||||
<div>base64转blob: base64ToBlob</div>
|
||||
<div>返回处理后的blob,示例: base64ToBlob(base64)</div>
|
||||
<div>
|
||||
使用方式:
|
||||
<a-typography-text code>base64ToBlob(base64字符串, MIME类型-可不传, 分片大小-可不传)</a-typography-text>
|
||||
</div>
|
||||
</a-space>
|
||||
<a-divider />
|
||||
<a-space direction="vertical" fill>
|
||||
<div>base64转ArrayBuffer: base64ToArrayBuffer</div>
|
||||
<div>返回处理后的ArrayBuffer,示例: base64ToArrayBuffer(base64)</div>
|
||||
<div>
|
||||
使用方式:
|
||||
<a-typography-text code>base64ToArrayBuffer(base64字符串)</a-typography-text>
|
||||
</div>
|
||||
</a-space>
|
||||
<a-divider />
|
||||
<a-space direction="vertical" fill>
|
||||
<div>blob转Uint8Array: blobToUint8Array</div>
|
||||
<div>返回处理后的Uint8Array,示例: blobToUint8Array(base64)</div>
|
||||
<div>
|
||||
使用方式:
|
||||
<a-typography-text code>blobToUint8Array(你的blob数据)</a-typography-text>
|
||||
</div>
|
||||
</a-space>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -5,7 +5,7 @@
|
||||
<a-divider />
|
||||
<a-space direction="vertical" fill>
|
||||
<div>判断code在树形数据中是否存在: treeCodeExist</div>
|
||||
<div>返回true / false,示例: treeCodeExist(treeData, "ABC123", { key: "value", childrenKey: "nodes" })</div>
|
||||
<div>返回true / false,示例: treeCodeExist(treeData, "ABC123", { key: 'id', childrenKey: "children" })</div>
|
||||
<div>
|
||||
使用方式:
|
||||
<a-typography-text code
|
||||
@ -16,7 +16,7 @@
|
||||
<a-divider />
|
||||
<a-space direction="vertical" fill>
|
||||
<div>返回指定名称的所有父节点: findParentsTailRecursive</div>
|
||||
<div>示例: findParentsTailRecursive(treeData.value, 'KeyValue')</div>
|
||||
<div>示例: findParentsTailRecursive(treeData, KeyValue)</div>
|
||||
<div>
|
||||
使用方式:
|
||||
<a-typography-text code>findParentsTailRecursive(树数据, 指定key绑定的值)</a-typography-text>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user