Skip to content

Commit 1e60cc4

Browse files
committed
fix🐞(upload): 上传组件回显idbug
1 parent f6a45bc commit 1e60cc4

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

components.d.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ declare module 'vue' {
1111
ABreadcrumbItem: typeof import('ant-design-vue/es')['BreadcrumbItem']
1212
AButton: typeof import('ant-design-vue/es')['Button']
1313
ACard: typeof import('ant-design-vue/es')['Card']
14-
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
1514
ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup']
1615
ACol: typeof import('ant-design-vue/es')['Col']
1716
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
@@ -45,13 +44,9 @@ declare module 'vue' {
4544
Breadcrumb: typeof import('./src/components/Layout/header/modules/breadcrumb.vue')['default']
4645
Buoy: typeof import('./src/components/widget/Buoy.vue')['default']
4746
Content: typeof import('./src/components/Layout/content/index.vue')['default']
48-
copy: typeof import('./src/components/sysDict/dictSelect copy.vue')['default']
49-
Dict: typeof import('./src/components/sysDict/dict.vue')['default']
5047
DictCheckbox: typeof import('./src/components/sysDict/modules/dictCheckbox.vue')['default']
51-
DictForm: typeof import('./src/components/sysDict/dictForm.vue')['default']
5248
DictRadio: typeof import('./src/components/sysDict/modules/dictRadio.vue')['default']
5349
DictSelect: typeof import('./src/components/sysDict/modules/dictSelect.vue')['default']
54-
DictSelectByForm: typeof import('./src/components/sysDict/dictSelectByForm.vue')['default']
5550
DictText: typeof import('./src/components/sysDict/modules/dictText.vue')['default']
5651
Footer: typeof import('./src/components/Layout/footer/index.vue')['default']
5752
FullScreem: typeof import('./src/components/Layout/header/modules/sysTools/utils/fullScreem.vue')['default']
@@ -64,16 +59,13 @@ declare module 'vue' {
6459
RouterView: typeof import('vue-router')['RouterView']
6560
SysDict: typeof import('./src/components/sysDict/sysDict.vue')['default']
6661
SysMenu: typeof import('./src/components/Layout/sysMenu/index.vue')['default']
67-
SysModal: typeof import('./src/components/sysModal/index.vue')['default']
62+
SysModal: typeof import('./src/components/SysModal/index.vue')['default']
6863
SysRemoveBtn: typeof import('./src/components/sysRemoveBtn/index.vue')['default']
6964
SysSearch: typeof import('./src/components/sysSearch/index.vue')['default']
70-
SysSelect: typeof import('./src/components/sysDict/sysSelect.vue')['default']
7165
SysTable: typeof import('./src/components/sysTable/index.vue')['default']
7266
SysTools: typeof import('./src/components/Layout/header/modules/sysTools/index.vue')['default']
7367
SysUpload: typeof import('./src/components/sysUpload/index.vue')['default']
7468
Tabs: typeof import('./src/components/Layout/header/modules/tabs.vue')['default']
75-
Upload: typeof import('./src/components/Upload/index.vue')['default']
76-
UploadBtn: typeof import('./src/components/Upload/uploadBtn.vue')['default']
7769
UserTools: typeof import('./src/components/Layout/header/modules/userTools.vue')['default']
7870
}
7971
}

src/components/sysUpload/index.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<template>
2-
<a-upload :headers="headers" name="file_img" v-model:file-list="fileList" action="/v1/sys/base/uploadFileImg" :list-type="listType" :multiple="true" @change="handleChange" @preview="handlePreview">
2+
<a-upload
3+
:headers="headers"
4+
name="file_img"
5+
v-model:file-list="fileList"
6+
action="/v1/sys/base/uploadFileImg"
7+
:list-type="listType"
8+
:multiple="true"
9+
@change="handleChange"
10+
@preview="handlePreview"
11+
>
312
<a-button v-if="listType != 'picture-card' && fileList && fileList.length < fileNumber">
413
<upload-outlined></upload-outlined>
514
{{ btnText }}
@@ -36,12 +45,13 @@ onMounted(() => {
3645
if (props.value) {
3746
// // 判断value的类型
3847
if (Array.isArray(props.value)) {
39-
fileList.value = props.value.map(item => {
48+
fileList.value = props.value.map((item, index) => {
4049
return {
41-
uid: new Date().getTime() + '',
50+
uid: new Date() + '' + index,
4251
name: item,
4352
status: 'done',
4453
response: {
54+
id: 'xxxx1',
4555
code: 200,
4656
result: { fileImgUrl: item },
4757
},

src/views/test/index.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
<span class="text-[blue]">{{ option }}</span>
4444
</template>
4545
</SysDict>
46-
<Upload :file-number="1" v-model:value="data" list-type="picture-card"></Upload>
46+
{{ data }}
47+
<Upload :file-number="5" v-model:value="data" list-type="picture-card"></Upload>
4748
</template>
4849

4950
<script setup lang="ts">
@@ -55,7 +56,10 @@ const checkboxVal = ref();
5556
const radioVal = ref('');
5657
5758
import Upload from '@/components/sysUpload/index.vue';
58-
const data = ref('');
59+
const data = ref<string[]>([
60+
'https://go-zero-admin.oss-cn-beijing.aliyuncs.com/go-zero-admin/1705911992460_49814642.jfif',
61+
'https://go-zero-admin.oss-cn-beijing.aliyuncs.com/go-zero-admin/1705912025787_4d5477fec18994d0adb839d47fa30937_1.jpg',
62+
]);
5963
</script>
6064

6165
<style scoped></style>

yarn-error.log

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Arguments:
2-
C:\Program Files\nodejs\node.exe C:\Users\admin\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js add formily-json-schema
2+
C:\Program Files\nodejs\node.exe C:\Users\admin\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js add @types/uuid
33

44
PATH:
5-
D:\ZenTao\bin\git\cmd;D:\ZenTao\bin\sliksvn;D:\ZenTao\zbox\nssm\win32;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\admin\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\admin\AppData\Local\Programs\Python\Python311\;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;C:\Users\admin\AppData\Roaming\npm;D:\vsCode\Microsoft VS Code\bin;D:\WebStorm\WebStorm 2023.2\bin;D:\IDEA\IntelliJ IDEA 2023.1.2\bin;D:\微信web开发者工具\dll;C:\Program Files\Go\bin;D:\nc\netcat-win32-1.11\netcat-1.11;F:\GoProject;F:\GoProject\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;D:\IntelliJ IDEA 2021.1\bin;D:\GoLand\GoLand 2023.2.2\bin;C:\Users\admin\go\bin;D:\PHP;F:\GoProject\run;C:\Program Files\python;C:\Program Files\python\Scripts;;D:\BtSoft\panel\script;G:\redis\Redis-x64-5.0.14;F:\GoProject\bin\etcd;C:\Program Files\Docker\Docker\resources\bin;C:\Users\admin\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\admin\AppData\Local\Programs\Python\Python311\;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;C:\Users\admin\AppData\Roaming\npm;D:\vsCode\Microsoft VS Code\bin;D:\WebStorm\WebStorm 2023.2\bin;;D:\IntelliJ IDEA 2021.1\bin;;D:\GoLand\GoLand 2023.2.2\bin;;C:\Users\admin\go\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;D:\PHP;F:\GoProject\run;G:\redis\Redis-x64-5.0.14;F:\GoProject\bin\etcd;
5+
D:\ZenTao\bin\git\cmd;D:\ZenTao\bin\sliksvn;D:\ZenTao\zbox\nssm\win32;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\admin\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\admin\AppData\Local\Programs\Python\Python311\;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;C:\Users\admin\AppData\Roaming\npm;D:\vsCode\Microsoft VS Code\bin;D:\WebStorm\WebStorm 2023.2\bin;D:\IDEA\IntelliJ IDEA 2023.1.2\bin;D:\微信web开发者工具\dll;C:\Program Files\Go\bin;D:\nc\netcat-win32-1.11\netcat-1.11;F:\GoProject;F:\GoProject\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;D:\IntelliJ IDEA 2021.1\bin;D:\GoLand\GoLand 2023.2.2\bin;C:\Users\admin\go\bin;D:\PHP;F:\GoProject\run;C:\Program Files\python;C:\Program Files\python\Scripts;;D:\BtSoft\panel\script;G:\redis\Redis-x64-5.0.14;F:\GoProject\bin\etcd;C:\Program Files\Docker\Docker\resources\bin;C:\Users\admin\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\admin\AppData\Local\Programs\Python\Python311\;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;C:\Users\admin\AppData\Roaming\npm;D:\vsCode\Microsoft VS Code\bin;D:\WebStorm\WebStorm 2023.2\bin;;D:\IntelliJ IDEA 2021.1\bin;;D:\GoLand\GoLand 2023.2.2\bin;;C:\Users\admin\go\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;D:\PHP;F:\GoProject\run;G:\redis\Redis-x64-5.0.14;F:\GoProject\bin\etcd;;D:\DevEco Studio\bin;
66

77
Yarn version:
88
1.22.19
@@ -14,17 +14,11 @@ Platform:
1414
win32 x64
1515

1616
Trace:
17-
Error: https://registry.npm.taobao.org/formily-json-schema: Not found
18-
at Request.params.callback [as _callback] (C:\Users\admin\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:66145:18)
19-
at Request.self.callback (C:\Users\admin\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:140890:22)
20-
at Request.emit (node:events:390:28)
21-
at Request.<anonymous> (C:\Users\admin\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:141862:10)
22-
at Request.emit (node:events:390:28)
23-
at IncomingMessage.<anonymous> (C:\Users\admin\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:141784:12)
24-
at Object.onceWrapper (node:events:509:28)
25-
at IncomingMessage.emit (node:events:402:35)
26-
at endReadableNT (node:internal/streams/readable:1343:12)
27-
at processTicksAndRejections (node:internal/process/task_queues:83:21)
17+
Error: certificate has expired
18+
at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
19+
at TLSSocket.emit (node:events:390:28)
20+
at TLSSocket._finishInit (node:_tls_wrap:944:8)
21+
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)
2822

2923
npm manifest:
3024
{

0 commit comments

Comments
 (0)