meixioacomponent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/babel.config.js +5 -0
- package/lib/demo.html +10 -0
- package/lib/meixicomponent.common.js +40065 -0
- package/lib/meixicomponent.common.js.map +1 -0
- package/lib/meixicomponent.css +1 -0
- package/lib/meixicomponent.umd.js +40075 -0
- package/lib/meixicomponent.umd.js.map +1 -0
- package/lib/meixicomponent.umd.min.js +20 -0
- package/lib/meixicomponent.umd.min.js.map +1 -0
- package/package.json +37 -0
- package/packages/components/base/baseAnchor/baseAnchor.vue +156 -0
- package/packages/components/base/baseAnchor/index.js +6 -0
- package/packages/components/base/baseAppendix/baseAppendix.vue +78 -0
- package/packages/components/base/baseAppendix/index.js +7 -0
- package/packages/components/base/baseArea/area.js +14978 -0
- package/packages/components/base/baseArea/areaConfig.js +6 -0
- package/packages/components/base/baseArea/baseArea.vue +531 -0
- package/packages/components/base/baseArea/index.js +7 -0
- package/packages/components/base/baseAvatar/baseAvatar.vue +101 -0
- package/packages/components/base/baseAvatar/index.js +6 -0
- package/packages/components/base/baseButtonHandle/baseButtonHandle.vue +64 -0
- package/packages/components/base/baseButtonHandle/index.js +6 -0
- package/packages/components/base/baseDefaultSvg/baseDefaultSvg.vue +52 -0
- package/packages/components/base/baseDefaultSvg/index.js +7 -0
- package/packages/components/base/baseDialog/index.js +7 -0
- package/packages/components/base/baseDialog/index.vue +146 -0
- package/packages/components/base/baseDialogTable/dialogTable.vue +186 -0
- package/packages/components/base/baseDialogTable/index.js +7 -0
- package/packages/components/base/baseDrawer/index.js +8 -0
- package/packages/components/base/baseDrawer/index.vue +196 -0
- package/packages/components/base/baseEdito/baseEdito.vue +202 -0
- package/packages/components/base/baseEdito/index.js +6 -0
- package/packages/components/base/baseFixedHeader/baseFixedHeader.vue +168 -0
- package/packages/components/base/baseFixedHeader/index.js +6 -0
- package/packages/components/base/baseIcon/index.js +6 -0
- package/packages/components/base/baseIcon/index.vue +146 -0
- package/packages/components/base/baseImageViewer/image-viewer.vue +348 -0
- package/packages/components/base/baseImageViewer/index.js +7 -0
- package/packages/components/base/baseImg/baseImg.vue +160 -0
- package/packages/components/base/baseImg/index.js +6 -0
- package/packages/components/base/baseInforWrap/baseInforWrap.vue +66 -0
- package/packages/components/base/baseInforWrap/index.js +6 -0
- package/packages/components/base/baseLineInfoGroup/baseLineInfoGroup.vue +93 -0
- package/packages/components/base/baseLineInfoGroup/index.js +6 -0
- package/packages/components/base/baseLineInfoItem/baseLineInfoItem.vue +173 -0
- package/packages/components/base/baseLineInfoItem/index.js +6 -0
- package/packages/components/base/basePageHeader/basePageHeader.vue +55 -0
- package/packages/components/base/basePageHeader/index.js +6 -0
- package/packages/components/base/basePagination/index.js +6 -0
- package/packages/components/base/basePagination/index.vue +75 -0
- package/packages/components/base/basePlainTable/basePlainTable.vue +90 -0
- package/packages/components/base/basePlainTable/index.js +6 -0
- package/packages/components/base/baseSection/baseSection.vue +121 -0
- package/packages/components/base/baseSection/index.js +6 -0
- package/packages/components/base/baseSkeleton/baseSkeleton.vue +147 -0
- package/packages/components/base/baseSkeleton/index.js +6 -0
- package/packages/components/base/baseSvg/index.js +7 -0
- package/packages/components/base/baseSvg/index.vue +66 -0
- package/packages/components/base/baseTimeTypeSelect/base_time_type_select.vue +293 -0
- package/packages/components/base/baseTimeTypeSelect/config.js +47 -0
- package/packages/components/base/baseTimeTypeSelect/index.js +6 -0
- package/packages/components/base/baseToggle/index.js +7 -0
- package/packages/components/base/baseToggle/toggle.vue +131 -0
- package/packages/components/base/baseUpload/baseUpload.js +6 -0
- package/packages/components/base/baseUpload/baseUpload.vue +111 -0
- package/packages/components/base/baseUpload/baseUploadItem.js +6 -0
- package/packages/components/base/baseUpload/baseUploadItem.vue +205 -0
- package/packages/components/base/baseUpload/mixins.js +46 -0
- package/packages/components/base/brieflyItem.vue +198 -0
- package/packages/components/base/upload/index.js +6 -0
- package/packages/components/base/upload/upload.vue +245 -0
- package/packages/components/base/upload/uploadItem.vue +157 -0
- package/packages/components/dynamicmount/DynamicMount.js +55 -0
- package/packages/components/dynamicmount/dynamicMount.vue +95 -0
- package/packages/components/dynamicmount/index.js +46 -0
- package/packages/components/index.js +114 -0
- package/packages/components/proForm/dialogForm/baseDialogForm.vue +163 -0
- package/packages/components/proForm/dialogForm/dialogFormIndex.js +6 -0
- package/packages/components/proForm/proForm/index.js +6 -0
- package/packages/components/proForm/proForm/pro_form.vue +279 -0
- package/packages/components/proForm/proForm/pro_form_item.vue +459 -0
- package/packages/components/proForm/proFormWrap/index.js +6 -0
- package/packages/components/proForm/proFormWrap/pro_form_wrap.vue +83 -0
- package/packages/components/proPageTable/index.js +6 -0
- package/packages/components/proPageTable/oa_pro-table-search.vue +190 -0
- package/packages/components/proPageTable/oa_pro_colum_config.vue +219 -0
- package/packages/components/proPageTable/oa_pro_footer.vue +104 -0
- package/packages/components/proPageTable/oa_pro_header.vue +31 -0
- package/packages/components/proPageTable/oa_pro_screen.vue +81 -0
- package/packages/components/proPageTable/oa_pro_screen_item.vue +174 -0
- package/packages/components/proPageTable/oa_pro_table-header.vue +150 -0
- package/packages/components/proPageTable/oa_pro_table.vue +804 -0
- package/packages/components/proPageTable/oa_pro_table_skeleton.vue +33 -0
- package/packages/components/searchHeader/searchHeader.vue +118 -0
- package/packages/config/selectStore/SelectStore.js +24 -0
- package/packages/config/selectStore/UseSelectStoreClass.js +27 -0
- package/packages/config/selectStore/testSelectStore.js +40 -0
- package/packages/config/uploadRequest.js +66 -0
- package/packages/config/use/UseImg.js +39 -0
- package/packages/config/use/UseSelectStore.js +2 -0
- package/packages/config/use/UseUpload.js +47 -0
- package/packages/config/use/useFixedHeader.js +36 -0
- package/packages/utils/upload.js +35 -0
- package/packages/utils/uploadRequest.js +66 -0
- package/packages/utils/utils.js +186 -0
- package/public/favicon.ico +0 -0
- package/public/img/icons/android-chrome-192x192.png +0 -0
- package/public/img/icons/android-chrome-512x512.png +0 -0
- package/public/img/icons/android-chrome-maskable-192x192.png +0 -0
- package/public/img/icons/android-chrome-maskable-512x512.png +0 -0
- package/public/img/icons/apple-touch-icon-120x120.png +0 -0
- package/public/img/icons/apple-touch-icon-152x152.png +0 -0
- package/public/img/icons/apple-touch-icon-180x180.png +0 -0
- package/public/img/icons/apple-touch-icon-60x60.png +0 -0
- package/public/img/icons/apple-touch-icon-76x76.png +0 -0
- package/public/img/icons/apple-touch-icon.png +0 -0
- package/public/img/icons/favicon-16x16.png +0 -0
- package/public/img/icons/favicon-32x32.png +0 -0
- package/public/img/icons/msapplication-icon-144x144.png +0 -0
- package/public/img/icons/mstile-150x150.png +0 -0
- package/public/img/icons/safari-pinned-tab.svg +3 -0
- package/public/index.html +17 -0
- package/public/robots.txt +2 -0
- package/src/assets/logo.png +0 -0
- package/src/main.js +9 -0
- package/src/router/index.js +29 -0
- package/src/store/index.js +15 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="base-upload-item-wrap" :class="[`${shape}`]">
|
|
3
|
+
<div class="type-upload" v-if="type == 'upload'">
|
|
4
|
+
<input
|
|
5
|
+
type="file"
|
|
6
|
+
ref="inputFile"
|
|
7
|
+
:accept="accept"
|
|
8
|
+
@change="valueChange"
|
|
9
|
+
style="display: none"
|
|
10
|
+
v-if="type == 'upload'"
|
|
11
|
+
:multiple="uploadType == 'single' ? false : true"
|
|
12
|
+
/>
|
|
13
|
+
<base-icon
|
|
14
|
+
:color="`s`"
|
|
15
|
+
:event="true"
|
|
16
|
+
:size="`l`"
|
|
17
|
+
:name="`icon-plus`"
|
|
18
|
+
class="upload-icon"
|
|
19
|
+
@iconClick="clickFile"
|
|
20
|
+
></base-icon>
|
|
21
|
+
</div>
|
|
22
|
+
<div v-else-if="type == 'img'" class="type-pre-views">
|
|
23
|
+
<div class="handleUploadItem">
|
|
24
|
+
<base-icon
|
|
25
|
+
:size="`l`"
|
|
26
|
+
:color="`d`"
|
|
27
|
+
:event="true"
|
|
28
|
+
:name="`icon-close`"
|
|
29
|
+
@iconClick="handleDeleteUploadItem"
|
|
30
|
+
></base-icon>
|
|
31
|
+
</div>
|
|
32
|
+
<baseImgVue :src="imgSrc" :event="true"></baseImgVue>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import baseImgVue from "../baseImg/baseImg.vue";
|
|
39
|
+
//
|
|
40
|
+
import { baseUploadMixins } from "./mixins";
|
|
41
|
+
export default {
|
|
42
|
+
name: "baseUploadItem",
|
|
43
|
+
data() {
|
|
44
|
+
return {};
|
|
45
|
+
},
|
|
46
|
+
mixins: [baseUploadMixins],
|
|
47
|
+
components: {
|
|
48
|
+
baseImgVue,
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
type: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "upload",
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
uploadType: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "single",
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
fileType: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: "other",
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
uploadItem: {},
|
|
67
|
+
|
|
68
|
+
shape: {
|
|
69
|
+
// square rect cir
|
|
70
|
+
type: String,
|
|
71
|
+
default: "rect",
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
value: {
|
|
75
|
+
type: Array,
|
|
76
|
+
},
|
|
77
|
+
max: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: 99,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
module: {
|
|
84
|
+
get() {
|
|
85
|
+
return this.$props.value;
|
|
86
|
+
},
|
|
87
|
+
set(val) {},
|
|
88
|
+
},
|
|
89
|
+
imgSrc() {
|
|
90
|
+
if (!this.uploadItem.url) {
|
|
91
|
+
return "";
|
|
92
|
+
}
|
|
93
|
+
return this.uploadItem.url;
|
|
94
|
+
},
|
|
95
|
+
accept() {
|
|
96
|
+
let accept = "";
|
|
97
|
+
let fileType = this.$props.fileType;
|
|
98
|
+
switch (fileType) {
|
|
99
|
+
case "img":
|
|
100
|
+
accept = "image/*";
|
|
101
|
+
break;
|
|
102
|
+
case "other":
|
|
103
|
+
accept = "";
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
return accept;
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
methods: {
|
|
112
|
+
clickFile() {
|
|
113
|
+
this.$refs.inputFile.click();
|
|
114
|
+
},
|
|
115
|
+
async returnFiles(files) {
|
|
116
|
+
let list = [];
|
|
117
|
+
for (let i = 0; i < files.length; i++) {
|
|
118
|
+
let obj = {
|
|
119
|
+
url: null,
|
|
120
|
+
process: 0,
|
|
121
|
+
file: files[i],
|
|
122
|
+
};
|
|
123
|
+
list.push(obj);
|
|
124
|
+
}
|
|
125
|
+
return list;
|
|
126
|
+
},
|
|
127
|
+
async valueChange(e) {
|
|
128
|
+
let files = e.target.files;
|
|
129
|
+
let list = await this.returnFiles(files);
|
|
130
|
+
if (this.$parent.$options.name == "baseUpload") {
|
|
131
|
+
this.$emit("inputChange", list);
|
|
132
|
+
} else {
|
|
133
|
+
this.inputChange(list);
|
|
134
|
+
}
|
|
135
|
+
this.$refs.inputFile.value = "";
|
|
136
|
+
},
|
|
137
|
+
handleDeleteUploadItem() {
|
|
138
|
+
this.$emit("handleDeleteUploadItem");
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
<style lang="less" scoped>
|
|
145
|
+
.base-upload-item-wrap {
|
|
146
|
+
margin: var(--margin-4);
|
|
147
|
+
margin-left: 0px;
|
|
148
|
+
border-radius: calc(var(--radius) * 2);
|
|
149
|
+
border: 1px dashed var(--color-border-d);
|
|
150
|
+
.type-upload {
|
|
151
|
+
width: 100%;
|
|
152
|
+
height: 100%;
|
|
153
|
+
display: flex;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
align-items: center;
|
|
156
|
+
flex-flow: row nowrap;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
.upload-icon {
|
|
159
|
+
width: 60px;
|
|
160
|
+
height: 60px;
|
|
161
|
+
/deep/ i {
|
|
162
|
+
font-size: 42px !important;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.type-pre-views {
|
|
167
|
+
width: 100%;
|
|
168
|
+
height: 100%;
|
|
169
|
+
position: relative;
|
|
170
|
+
&:hover {
|
|
171
|
+
.handleUploadItem {
|
|
172
|
+
display: block;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
img {
|
|
176
|
+
width: 100%;
|
|
177
|
+
height: 100%;
|
|
178
|
+
object-fit: cover;
|
|
179
|
+
}
|
|
180
|
+
.handleUploadItem {
|
|
181
|
+
top: 0px;
|
|
182
|
+
right: 0px;
|
|
183
|
+
z-index: 2;
|
|
184
|
+
width: auto;
|
|
185
|
+
height: auto;
|
|
186
|
+
display: none;
|
|
187
|
+
position: absolute;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
.rect {
|
|
192
|
+
width: 140px;
|
|
193
|
+
height: 80px;
|
|
194
|
+
}
|
|
195
|
+
.cir {
|
|
196
|
+
width: 80px;
|
|
197
|
+
height: 80px;
|
|
198
|
+
overflow: hidden;
|
|
199
|
+
border-radius: 50%;
|
|
200
|
+
}
|
|
201
|
+
.square {
|
|
202
|
+
width: 100px;
|
|
203
|
+
height: 100px;
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import useUpload from "../../../config/use/UseUpload";
|
|
2
|
+
export const baseUploadMixins = {
|
|
3
|
+
data() {
|
|
4
|
+
return {
|
|
5
|
+
dynamicmount: null,
|
|
6
|
+
};
|
|
7
|
+
},
|
|
8
|
+
mounted() {},
|
|
9
|
+
beforeDestroy() {},
|
|
10
|
+
|
|
11
|
+
computed: {
|
|
12
|
+
isMax() {
|
|
13
|
+
if (this.module.length >= this.$props.max) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
methods: {
|
|
21
|
+
inputChange(list) {
|
|
22
|
+
if (this.module) {
|
|
23
|
+
for (let i = 0; i < list.length; i++) {
|
|
24
|
+
if (this.isMax) {
|
|
25
|
+
this.$message.error("超出文件上传限制");
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
this.module.push(list[i]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!this.uploadLoading) {
|
|
32
|
+
useUpload.toUpload(this.module ? this.module : list, this.uploadEd);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
this.uploadLoading = true;
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
uploadEd(list) {
|
|
39
|
+
console.log(list);
|
|
40
|
+
console.log(this.module);
|
|
41
|
+
this.module = list;
|
|
42
|
+
this.uploadLoading = false;
|
|
43
|
+
this.$emit("uploadEd", list);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="briefly-item-wrap"
|
|
4
|
+
:class="[`item${type}`]"
|
|
5
|
+
:style="{ padding: padding }"
|
|
6
|
+
>
|
|
7
|
+
<div class="briefly-title">
|
|
8
|
+
<span>{{ title }}</span>
|
|
9
|
+
<base-icon
|
|
10
|
+
v-if="icon"
|
|
11
|
+
:event="true"
|
|
12
|
+
:color="`m`"
|
|
13
|
+
:size="`l`"
|
|
14
|
+
:name="icon"
|
|
15
|
+
@iconClick="iconClick"
|
|
16
|
+
></base-icon>
|
|
17
|
+
<el-tag :type="tagType" effect="dark" size="mini" v-if="tagName">
|
|
18
|
+
{{ tagName }}
|
|
19
|
+
</el-tag>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="briefly-value">
|
|
22
|
+
{{ brieflyValue }}
|
|
23
|
+
<span class="company-text">{{ company }}</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="briefly-des">
|
|
26
|
+
{{ brieflyDes }}
|
|
27
|
+
<span class="briefly-des-value" :class="[desType]">
|
|
28
|
+
{{ brieflyDesValue }}
|
|
29
|
+
<base-icon
|
|
30
|
+
v-if="desType == 'top'"
|
|
31
|
+
:size="`l`"
|
|
32
|
+
class="des-type-icon"
|
|
33
|
+
:name="`icon-shangjiantou`"
|
|
34
|
+
>
|
|
35
|
+
</base-icon>
|
|
36
|
+
</span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
export default {
|
|
43
|
+
data() {
|
|
44
|
+
return {};
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
type: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "info",
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
padding: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "calc(var(--padding-4) * 2)",
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
brieflyValue: {
|
|
58
|
+
type: String | Number,
|
|
59
|
+
require: true,
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
brieflyDes: {
|
|
63
|
+
type: String,
|
|
64
|
+
require: true,
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
brieflyDesValue: {
|
|
68
|
+
type: String | Number,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
desType: {
|
|
72
|
+
type: String,
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
title: {
|
|
76
|
+
type: String,
|
|
77
|
+
require: true,
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
icon: {
|
|
81
|
+
type: String,
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
tagType: {
|
|
85
|
+
type: String,
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
tagName: {
|
|
89
|
+
type: String,
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
company: {
|
|
93
|
+
type: String,
|
|
94
|
+
require: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
computed: {},
|
|
98
|
+
methods: {
|
|
99
|
+
iconClick() {},
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<style lang="less" scoped>
|
|
105
|
+
.briefly-item-wrap {
|
|
106
|
+
width: auto;
|
|
107
|
+
height: auto;
|
|
108
|
+
display: flex;
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
align-items: flex-start;
|
|
111
|
+
flex-flow: column nowrap;
|
|
112
|
+
justify-content: space-between;
|
|
113
|
+
border-radius: calc(var(--radius) * 2);
|
|
114
|
+
.briefly-title {
|
|
115
|
+
width: 100%;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
flex-flow: row nowrap;
|
|
119
|
+
color: var(--font-color-s);
|
|
120
|
+
justify-content: flex-start;
|
|
121
|
+
font-size: var(--font-size-base);
|
|
122
|
+
}
|
|
123
|
+
.briefly-value {
|
|
124
|
+
font-weight: 700;
|
|
125
|
+
|
|
126
|
+
color: var(--font-color-d);
|
|
127
|
+
font-size: calc(var(--font-size-xl) + 4px);
|
|
128
|
+
.company-text {
|
|
129
|
+
font-weight: 400;
|
|
130
|
+
color: var(--font-color-m);
|
|
131
|
+
margin-left: var(--margin-2);
|
|
132
|
+
font-size: var(--font-size-s);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.briefly-des {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
color: var(--font-color-s);
|
|
140
|
+
font-size: var(--font-size-s);
|
|
141
|
+
|
|
142
|
+
.briefly-des-value {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
margin-left: var(--margin-4);
|
|
146
|
+
font-size: var(--font-size-base);
|
|
147
|
+
font-weight: var(--font-weight-kg);
|
|
148
|
+
.des-type-icon {
|
|
149
|
+
width: auto !important;
|
|
150
|
+
height: auto !important;
|
|
151
|
+
/deep/ i {
|
|
152
|
+
margin-top: var(--margin-1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.top {
|
|
158
|
+
color: var(--color-error);
|
|
159
|
+
.des-type-icon {
|
|
160
|
+
/deep/ i {
|
|
161
|
+
color: var(--color-error) !important;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
.down {
|
|
166
|
+
color: var(--color-success);
|
|
167
|
+
.des-type-icon {
|
|
168
|
+
/deep/ i {
|
|
169
|
+
color: var(--color-success) !important;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
.itemprimary {
|
|
176
|
+
background: var(--color-primary);
|
|
177
|
+
.briefly-title,
|
|
178
|
+
.briefly-value,
|
|
179
|
+
.company-text,
|
|
180
|
+
.briefly-des {
|
|
181
|
+
color: white !important;
|
|
182
|
+
.briefly-des-value {
|
|
183
|
+
color: white;
|
|
184
|
+
.des-type-icon {
|
|
185
|
+
/deep/ i {
|
|
186
|
+
color: white !important;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
.iteminfo {
|
|
193
|
+
background: var(--color-gray-m);
|
|
194
|
+
}
|
|
195
|
+
.shallow {
|
|
196
|
+
background: white;
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="upload-wrap" :style="wrapStyle">
|
|
3
|
+
<div class="upload-title" :class="{ isDown: isDown && completed }">
|
|
4
|
+
<div class="title-left">
|
|
5
|
+
<span>附件上传</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="title-right">
|
|
8
|
+
<base-icon
|
|
9
|
+
:size="`l`"
|
|
10
|
+
:color="`d`"
|
|
11
|
+
:event="true"
|
|
12
|
+
@iconClick="handleDown"
|
|
13
|
+
:name="handleDownIcon"
|
|
14
|
+
></base-icon>
|
|
15
|
+
<base-icon
|
|
16
|
+
:name="`icon-close`"
|
|
17
|
+
:color="`d`"
|
|
18
|
+
:size="`l`"
|
|
19
|
+
:event="true"
|
|
20
|
+
@iconClick="uploadCancel"
|
|
21
|
+
></base-icon>
|
|
22
|
+
</div>
|
|
23
|
+
<div v-if="isDown" class="total-process-wrap" :style="totalStyle"></div>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="upload-content">
|
|
26
|
+
<uploadItemVue
|
|
27
|
+
:key="index"
|
|
28
|
+
:item="item"
|
|
29
|
+
v-for="(item, index) in filterArray"
|
|
30
|
+
></uploadItemVue>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import uploadItemVue from "./uploadItem.vue";
|
|
37
|
+
//
|
|
38
|
+
import Upload from "../../../utils/upload";
|
|
39
|
+
export default {
|
|
40
|
+
name: "upload",
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
isDown: false,
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
mounted() {
|
|
47
|
+
this.startUpload();
|
|
48
|
+
},
|
|
49
|
+
components: {
|
|
50
|
+
uploadItemVue,
|
|
51
|
+
},
|
|
52
|
+
props: {
|
|
53
|
+
uploadArray: {
|
|
54
|
+
type: Array,
|
|
55
|
+
},
|
|
56
|
+
uploadEdEvent: {
|
|
57
|
+
type: Function,
|
|
58
|
+
require: true,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
computed: {
|
|
62
|
+
filterArray() {
|
|
63
|
+
return this.uploadArray.filter((item) => {
|
|
64
|
+
return item.file;
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
wrapStyle() {
|
|
68
|
+
return {
|
|
69
|
+
bottom: this.isDown ? "-360px" : "0px",
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
handleDownIcon() {
|
|
73
|
+
if (this.isDown) {
|
|
74
|
+
return "icon-shouqi";
|
|
75
|
+
}
|
|
76
|
+
return "icon-xiala";
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
completed() {
|
|
80
|
+
let uploadArray = this.$props.uploadArray;
|
|
81
|
+
return (
|
|
82
|
+
uploadArray.filter((item) => {
|
|
83
|
+
return item.process == 100;
|
|
84
|
+
}).length / uploadArray.length
|
|
85
|
+
);
|
|
86
|
+
},
|
|
87
|
+
totalStyle() {
|
|
88
|
+
return { width: `${this.completed * 100}%` };
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
methods: {
|
|
92
|
+
handleDown() {
|
|
93
|
+
this.isDown = !this.isDown;
|
|
94
|
+
},
|
|
95
|
+
async startUpload() {
|
|
96
|
+
for (let i = 0; i < this.$props.uploadArray.length; i++) {
|
|
97
|
+
let item = this.$props.uploadArray[i];
|
|
98
|
+
this.createUpload(item);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
appendUploadItem(list) {
|
|
103
|
+
if (list instanceof Array) {
|
|
104
|
+
list.forEach((item) => {
|
|
105
|
+
this.$props.uploadArray.push(item);
|
|
106
|
+
this.createUpload(item);
|
|
107
|
+
});
|
|
108
|
+
} else {
|
|
109
|
+
this.$props.uploadArray.push(list);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
createUpload(uploadItem) {
|
|
113
|
+
if (uploadItem.file && uploadItem.process != 100) {
|
|
114
|
+
uploadItem.upload = new Upload({
|
|
115
|
+
file: uploadItem.file,
|
|
116
|
+
uploadProgressFn: (process) => {
|
|
117
|
+
uploadItem.process = process;
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
uploadItem.upload
|
|
121
|
+
.start()
|
|
122
|
+
.then((uploadEdUrl) => {
|
|
123
|
+
this.$set(uploadItem, "url", uploadEdUrl);
|
|
124
|
+
// uploadItem.url = uploadEdUrl;
|
|
125
|
+
this.uploadEd();
|
|
126
|
+
})
|
|
127
|
+
.catch((error) => {
|
|
128
|
+
// uploadItem.url = "cancel";
|
|
129
|
+
this.$set(uploadItem, "url", "cancel");
|
|
130
|
+
this.uploadEd();
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
uploadCancel() {
|
|
136
|
+
let flag = this.$props.uploadArray.some((item) => {
|
|
137
|
+
return item.upload?.state == 0;
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
if (flag) {
|
|
141
|
+
this.$confirm("此操作将取消当前未上传的文件, 是否继续?", "提示", {
|
|
142
|
+
confirmButtonText: "确定",
|
|
143
|
+
cancelButtonText: "取消",
|
|
144
|
+
type: "warning",
|
|
145
|
+
})
|
|
146
|
+
.then(() => {
|
|
147
|
+
this.$props.uploadArray.forEach((item) => {
|
|
148
|
+
if (item.upload?.state == 0) {
|
|
149
|
+
item.upload.cancel();
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
this.uploadEd();
|
|
153
|
+
})
|
|
154
|
+
.catch(() => {});
|
|
155
|
+
} else {
|
|
156
|
+
this.uploadEd();
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
uploadEd() {
|
|
161
|
+
let flag = this.$props.uploadArray.every((item) => {
|
|
162
|
+
return !item.upload || item.upload.state != 0;
|
|
163
|
+
});
|
|
164
|
+
if (flag) {
|
|
165
|
+
if (this.$props.uploadEdEvent) {
|
|
166
|
+
let list = this.$props.uploadArray.filter((item) => {
|
|
167
|
+
return item.process == 100 || !item.upload;
|
|
168
|
+
});
|
|
169
|
+
this.$props.uploadArray = list;
|
|
170
|
+
console.log(this.$props.uploadArray);
|
|
171
|
+
this.$props.uploadEdEvent(list);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
uploadFailed() {
|
|
177
|
+
if (this.$props.uploadEdEvent) {
|
|
178
|
+
this.$props.uploadEdEvent();
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<style lang="less" scoped>
|
|
186
|
+
.upload-wrap {
|
|
187
|
+
right: 0px;
|
|
188
|
+
width: 380px;
|
|
189
|
+
height: 400px;
|
|
190
|
+
z-index: 999999;
|
|
191
|
+
position: fixed;
|
|
192
|
+
box-shadow: var(--shadow);
|
|
193
|
+
background: var(--bg-white);
|
|
194
|
+
transition: all 0.3s ease-in;
|
|
195
|
+
.upload-title {
|
|
196
|
+
width: 100%;
|
|
197
|
+
height: 40px;
|
|
198
|
+
display: flex;
|
|
199
|
+
position: relative;
|
|
200
|
+
align-items: center;
|
|
201
|
+
flex-flow: row nowrap;
|
|
202
|
+
box-sizing: border-box;
|
|
203
|
+
padding: var(--padding-5);
|
|
204
|
+
justify-content: space-between;
|
|
205
|
+
span {
|
|
206
|
+
text-align: left;
|
|
207
|
+
color: var(--font-color-m);
|
|
208
|
+
font-size: var(--font-size-base);
|
|
209
|
+
}
|
|
210
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
211
|
+
.title-right,
|
|
212
|
+
.title-left {
|
|
213
|
+
z-index: 2;
|
|
214
|
+
}
|
|
215
|
+
.title-right {
|
|
216
|
+
display: flex;
|
|
217
|
+
}
|
|
218
|
+
.total-process-wrap {
|
|
219
|
+
top: 0px;
|
|
220
|
+
left: 0px;
|
|
221
|
+
z-index: 1;
|
|
222
|
+
height: 100%;
|
|
223
|
+
position: absolute;
|
|
224
|
+
transition: all 0.3s ease;
|
|
225
|
+
background: var(--color-primary);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
.isDown {
|
|
229
|
+
position: relative;
|
|
230
|
+
span {
|
|
231
|
+
color: var(--bg-white) !important;
|
|
232
|
+
}
|
|
233
|
+
/deep/ i {
|
|
234
|
+
color: var(--bg-white) !important;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
.upload-content {
|
|
238
|
+
width: 100%;
|
|
239
|
+
overflow-y: auto;
|
|
240
|
+
box-sizing: border-box;
|
|
241
|
+
padding: var(--padding-5);
|
|
242
|
+
height: calc(100% - 40px);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
</style>
|