Skip to content

Commit 9d05c8d

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/vue3
2 parents 8f2e42a + 5e5c761 commit 9d05c8d

File tree

15 files changed

+151
-73
lines changed

15 files changed

+151
-73
lines changed

src/App.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<template>
22
<div id="app">
33
<router-view />
4+
<theme-picker />
45
</div>
56
</template>
67

78
<script>
8-
export default {
9-
name: 'App',
9+
import ThemePicker from "@/components/ThemePicker";
10+
11+
export default {
12+
name: "App",
13+
components: { ThemePicker },
1014
metaInfo() {
1115
return {
1216
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
@@ -15,5 +19,10 @@ export default {
1519
}
1620
}
1721
}
18-
}
22+
};
1923
</script>
24+
<style scoped>
25+
#app .theme-picker {
26+
display: none;
27+
}
28+
</style>

src/assets/icons/svg/code.svg

Lines changed: 1 addition & 1 deletion
Loading

src/assets/icons/svg/server.svg

Lines changed: 1 addition & 1 deletion
Loading

src/assets/icons/svg/system.svg

Lines changed: 2 additions & 1 deletion
Loading

src/assets/icons/svg/tool.svg

Lines changed: 1 addition & 1 deletion
Loading

src/assets/styles/ruoyi.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@
145145
}
146146

147147
/** 表格更多操作下拉样式 */
148-
.el-table .el-dropdown-link {
148+
.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine {
149149
cursor: pointer;
150-
color: #409EFF;
151150
margin-left: 5px;
152151
}
153152

src/assets/styles/transition.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
}
1313

1414
/* fade-transform */
15+
.fade-transform--move,
1516
.fade-transform-leave-active,
1617
.fade-transform-enter-active {
1718
transition: all .5s;
1819
}
1920

21+
.fade-transform-leave-active {
22+
position: absolute;
23+
}
24+
2025
.fade-transform-enter {
2126
opacity: 0;
2227
transform: translateX(-30px);

src/components/FileUpload/index.vue

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<template>
22
<div class="upload-file">
33
<el-upload
4-
multiple
5-
:action="uploadFileUrl"
6-
:before-upload="handleBeforeUpload"
7-
:file-list="fileList"
8-
:limit="limit"
9-
:on-error="handleUploadError"
10-
:on-exceed="handleExceed"
11-
:on-success="handleUploadSuccess"
12-
:show-file-list="false"
13-
:headers="headers"
14-
class="upload-file-uploader"
15-
ref="upload"
4+
multiple
5+
:action="uploadFileUrl"
6+
:before-upload="handleBeforeUpload"
7+
:file-list="fileList"
8+
:limit="limit"
9+
:on-error="handleUploadError"
10+
:on-exceed="handleExceed"
11+
:on-success="handleUploadSuccess"
12+
:show-file-list="false"
13+
:headers="headers"
14+
class="upload-file-uploader"
15+
ref="fileUpload"
1616
>
1717
<!-- 上传按钮 -->
1818
<el-button size="mini" type="primary">选取文件</el-button>
@@ -72,6 +72,7 @@ export default {
7272
return {
7373
number: 0,
7474
uploadList: [],
75+
baseUrl: process.env.VUE_APP_BASE_API,
7576
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
7677
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
7778
fileList: [],
@@ -118,7 +119,8 @@ export default {
118119
}
119120
const isTypeOk = this.fileType.some((type) => {
120121
if (file.type.indexOf(type) > -1) return true;
121-
return !!(fileExtension && fileExtension.indexOf(type) > -1);
122+
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
123+
return false;
122124
});
123125
if (!isTypeOk) {
124126
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
@@ -147,22 +149,34 @@ export default {
147149
this.$modal.closeLoading()
148150
},
149151
// 上传成功回调
150-
handleUploadSuccess(res) {
151-
// edit by 芋道源码
152-
this.uploadList.push({ name: res.data, url: res.data });
153-
if (this.uploadList.length === this.number) {
154-
this.fileList = this.fileList.concat(this.uploadList);
155-
this.uploadList = [];
156-
this.number = 0;
157-
this.$emit("input", this.listToString(this.fileList));
152+
handleUploadSuccess(res, file) {
153+
if (res.code === 200) {
154+
// edit by 芋道源码
155+
this.uploadList.push({ name: res.data, url: res.data });
156+
this.uploadedSuccessfully();
157+
} else {
158+
this.number--;
158159
this.$modal.closeLoading();
160+
this.$modal.msgError(res.msg);
161+
this.$refs.fileUpload.handleRemove(file);
162+
this.uploadedSuccessfully();
159163
}
160164
},
161165
// 删除文件
162166
handleDelete(index) {
163167
this.fileList.splice(index, 1);
164168
this.$emit("input", this.listToString(this.fileList));
165169
},
170+
// 上传结束处理
171+
uploadedSuccessfully() {
172+
if (this.number > 0 && this.uploadList.length === this.number) {
173+
this.fileList = this.fileList.concat(this.uploadList);
174+
this.uploadList = [];
175+
this.number = 0;
176+
this.$emit("input", this.listToString(this.fileList));
177+
this.$modal.closeLoading();
178+
}
179+
},
166180
// 获取文件名称
167181
getFileName(name) {
168182
if (name.lastIndexOf("/") > -1) {
@@ -178,7 +192,7 @@ export default {
178192
for (let i in list) {
179193
strs += list[i].url + separator;
180194
}
181-
return strs !== '' ? strs.substr(0, strs.length - 1) : '';
195+
return strs != '' ? strs.substr(0, strs.length - 1) : '';
182196
}
183197
}
184198
};

src/components/ImagePreview/index.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default {
1919
props: {
2020
src: {
2121
type: String,
22-
required: true
22+
default: ""
2323
},
2424
width: {
2525
type: [Number, String],
@@ -32,13 +32,19 @@ export default {
3232
},
3333
computed: {
3434
realSrc() {
35+
if (!this.src) {
36+
return;
37+
}
3538
let real_src = this.src.split(",")[0];
3639
if (isExternal(real_src)) {
3740
return real_src;
3841
}
3942
return process.env.VUE_APP_BASE_API + real_src;
4043
},
4144
realSrcList() {
45+
if (!this.src) {
46+
return;
47+
}
4248
let real_src_list = this.src.split(",");
4349
let srcList = [];
4450
real_src_list.forEach(item => {

src/components/RightToolbar/index.vue

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
2-
<div class="top-right-btn">
2+
<div class="top-right-btn" :style="style">
33
<el-row>
4-
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
4+
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top" v-if="search">
55
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
66
</el-tooltip>
77
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
@@ -13,10 +13,10 @@
1313
</el-row>
1414
<el-dialog :title="title" :visible.sync="open" append-to-body>
1515
<el-transfer
16-
:titles="['显示', '隐藏']"
17-
v-model="value"
18-
:data="columns"
19-
@change="dataChange"
16+
:titles="['显示', '隐藏']"
17+
v-model="value"
18+
:data="columns"
19+
@change="dataChange"
2020
></el-transfer>
2121
</el-dialog>
2222
</div>
@@ -42,6 +42,23 @@ export default {
4242
columns: {
4343
type: Array,
4444
},
45+
search: {
46+
type: Boolean,
47+
default: true,
48+
},
49+
gutter: {
50+
type: Number,
51+
default: 10,
52+
},
53+
},
54+
computed: {
55+
style() {
56+
const ret = {};
57+
if (this.gutter) {
58+
ret.marginRight = `${this.gutter / 2}px`;
59+
}
60+
return ret;
61+
}
4562
},
4663
created() {
4764
// 显隐列初始默认隐藏列
@@ -75,13 +92,13 @@ export default {
7592
};
7693
</script>
7794
<style lang="scss" scoped>
78-
:deep(.el-transfer__button) {
95+
::v-deep .el-transfer__button {
7996
border-radius: 50%;
8097
padding: 12px;
8198
display: block;
82-
margin-left: 0;
99+
margin-left: 0px;
83100
}
84-
:deep(.el-transfer__button:first-child) {
101+
::v-deep .el-transfer__button:first-child {
85102
margin-bottom: 10px;
86103
}
87104
</style>

0 commit comments

Comments
 (0)