Commit 89bd2f6d9e61480621f9c6452a6d1b5c10e3318d

Authored by xingyu4j
2 parents f09a1a4b 29cd9b79

Merge remote-tracking branch 'origin/master' into feature/vue3

yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDataPermissionAutoConfiguration.java
@@ -27,9 +27,8 @@ public class YudaoDataPermissionAutoConfiguration { @@ -27,9 +27,8 @@ public class YudaoDataPermissionAutoConfiguration {
27 27
28 @Bean 28 @Bean
29 public DataPermissionDatabaseInterceptor dataPermissionDatabaseInterceptor(MybatisPlusInterceptor interceptor, 29 public DataPermissionDatabaseInterceptor dataPermissionDatabaseInterceptor(MybatisPlusInterceptor interceptor,
30 - List<DataPermissionRule> rules) { 30 + DataPermissionRuleFactory ruleFactory) {
31 // 创建 DataPermissionDatabaseInterceptor 拦截器 31 // 创建 DataPermissionDatabaseInterceptor 拦截器
32 - DataPermissionRuleFactory ruleFactory = dataPermissionRuleFactory(rules);  
33 DataPermissionDatabaseInterceptor inner = new DataPermissionDatabaseInterceptor(ruleFactory); 32 DataPermissionDatabaseInterceptor inner = new DataPermissionDatabaseInterceptor(ruleFactory);
34 // 添加到 interceptor 中 33 // 添加到 interceptor 中
35 // 需要加在首个,主要是为了在分页插件前面。这个是 MyBatis Plus 的规定 34 // 需要加在首个,主要是为了在分页插件前面。这个是 MyBatis Plus 的规定
yudao-ui-admin/src/App.vue
1 <template> 1 <template>
2 <div id="app"> 2 <div id="app">
3 <router-view /> 3 <router-view />
  4 + <theme-picker />
4 </div> 5 </div>
5 </template> 6 </template>
6 7
7 <script> 8 <script>
8 -export default {  
9 - name: 'App', 9 +import ThemePicker from "@/components/ThemePicker";
  10 +
  11 +export default {
  12 + name: "App",
  13 + components: { ThemePicker },
10 metaInfo() { 14 metaInfo() {
11 return { 15 return {
12 title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title, 16 title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
@@ -15,5 +19,10 @@ export default { @@ -15,5 +19,10 @@ export default {
15 } 19 }
16 } 20 }
17 } 21 }
18 -} 22 +};
19 </script> 23 </script>
  24 +<style scoped>
  25 +#app .theme-picker {
  26 + display: none;
  27 +}
  28 +</style>
yudao-ui-admin/src/assets/icons/svg/code.svg
1 -<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><defs><style/></defs><path d="M318.578 819.2L17.067 512l301.51-307.2 45.512 45.511L96.71 512 364.09 773.689zm386.844 0l-45.51-45.511L927.288 512 659.91 250.311l45.511-45.511L1006.933 512zM540.786 221.867l55.75 11.15-113.379 569.116-55.75-11.093z" fill="#bfbfbf"/></svg>  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1546567861908" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2422" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M318.577778 819.2L17.066667 512l301.511111-307.2 45.511111 45.511111L96.711111 512l267.377778 261.688889zM705.422222 819.2l-45.511111-45.511111L927.288889 512l-267.377778-261.688889 45.511111-45.511111L1006.933333 512zM540.785778 221.866667l55.751111 11.150222L483.157333 802.133333l-55.751111-11.093333z" p-id="2423"></path></svg>
yudao-ui-admin/src/assets/icons/svg/server.svg
1 -<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><defs><style/></defs><path d="M890 120H134a70 70 0 00-70 70v500a70 70 0 0070 70h756a70 70 0 0070-70V190a70 70 0 00-70-70zm-10 520a40 40 0 01-40 40H712V448a40 40 0 00-80 0v232h-80V368a40 40 0 00-80 0v312h-80V512a40 40 0 00-80 0v168H184a40 40 0 01-40-40V240a40 40 0 0140-40h656a40 40 0 0140 40zM696 824H328a40 40 0 000 80h368a40 40 0 000-80z" fill="#bfbfbf"/></svg>  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1547360688278" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6717" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M890 120H134a70 70 0 0 0-70 70v500a70 70 0 0 0 70 70h756a70 70 0 0 0 70-70V190a70 70 0 0 0-70-70z m-10 520a40 40 0 0 1-40 40H712V448a40 40 0 0 0-80 0v232h-80V368a40 40 0 0 0-80 0v312h-80V512a40 40 0 0 0-80 0v168H184a40 40 0 0 1-40-40V240a40 40 0 0 1 40-40h656a40 40 0 0 1 40 40zM696 824H328a40 40 0 0 0 0 80h368a40 40 0 0 0 0-80z" p-id="6718"></path></svg>
yudao-ui-admin/src/assets/icons/svg/system.svg
1 -<svg class="icon" viewBox="0 0 1084 1024" xmlns="http://www.w3.org/2000/svg" width="211.719" height="200"><defs><style/></defs><path d="M1080.096 434.5c-4.216-23.731-26.924-47.945-50.596-53.185l-17.648-4.096a175.94 175.94 0 01-101.613-80.832 177.807 177.807 0 01-18.732-129.802l5.541-16.685c7.108-23.13-2.108-54.992-20.6-70.833 0 0-16.624-14.095-63.244-41.2-46.8-26.984-66.858-34.513-66.858-34.513-22.768-8.373-54.632-.362-71.256 17.407l-12.287 13.251a173.47 173.47 0 01-120.466 48.066 174.133 174.133 0 01-121.008-48.487l-11.745-12.83C393.14 2.992 361.096-4.899 338.268 3.354c0 0-20.359 7.529-67.1 34.513-46.8 27.346-63.244 41.44-63.244 41.44-18.431 15.661-27.647 47.223-20.54 70.593l5.06 16.866a178.048 178.048 0 01-18.672 129.62A174.916 174.916 0 0171.496 377.46l-17.045 3.855c-23.31 5.421-46.26 29.334-50.596 53.186 0 0-3.855 21.382-3.855 75.712s3.855 75.713 3.855 75.713C8.07 609.9 30.779 633.872 54.45 639.112l16.624 3.855A174.254 174.254 0 01173.47 724.28c23.31 40.838 28.911 87.338 18.732 129.802l-4.818 16.444c-7.108 23.129 2.108 54.992 20.6 70.833 0 0 16.623 14.095 63.244 41.2 46.8 27.105 66.918 34.513 66.918 34.513 22.708 8.373 54.632.362 71.256-17.407l11.625-12.589a175.097 175.097 0 01242.257.12l11.624 12.65c16.384 17.708 48.428 25.599 71.256 17.347 0 0 20.359-7.53 67.16-34.514 46.74-27.105 63.124-41.2 63.124-41.2 18.491-15.6 27.707-47.463 20.6-70.833l-5.06-17.106A176.723 176.723 0 01910.66 724.4a176.06 176.06 0 01102.396-81.314l16.684-3.855c23.31-5.42 46.26-29.333 50.596-53.185 0 0 3.855-21.383 3.855-75.713-.241-54.33-4.096-75.833-4.096-75.833zm-537.82 293.335c-119.26 0-216.175-97.336-216.175-217.622a216.658 216.658 0 01216.236-217.32c119.2 0 216.115 97.276 216.115 217.561-.24 120.045-96.974 217.32-216.175 217.32z" fill="#bfbfbf"/></svg>  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543827724451" class="icon" style="" viewBox="0 0 1084 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10233" xmlns:xlink="http://www.w3.org/1999/xlink" width="211.71875" height="200"><defs><style type="text/css">@font-face { font-family: rbicon; src: url("chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2") format("woff2"); font-weight: normal; font-style: normal; }
  3 +</style></defs><path d="M1080.09609 434.500756c-4.216302-23.731757-26.9241-47.945376-50.595623-53.185637l-17.648235-4.095836a175.940257 175.940257 0 0 1-101.612877-80.832531 177.807476 177.807476 0 0 1-18.732427-129.801867l5.541425-16.684509c7.10748-23.129428-2.108151-54.992624-20.599646-70.833873 0 0-16.624276-14.094495-63.244529-41.199293-46.800951-26.984332-66.858502-34.513443-66.858502-34.513443-22.76803-8.372371-54.631227-0.361397-71.255503 17.407304l-12.287509 13.251234a173.470708 173.470708 0 0 1-120.465769 48.065842A174.13327 174.13327 0 0 1 421.329029 33.590675L409.583617 20.761071C393.140039 2.99237 361.096144-4.898138 338.267881 3.353767c0 0-20.358715 7.529111-67.099434 34.513443-46.800951 27.34573-63.244529 41.440225-63.244529 41.440225-18.431263 15.66055-27.646894 47.222582-20.539413 70.592941l5.059562 16.865207a178.048407 178.048407 0 0 1-18.672194 129.621169 174.916297 174.916297 0 0 1-102.275439 81.073463l-17.045906 3.854904c-23.310126 5.42096-46.258856 29.333415-50.595623 53.185637 0 0-3.854905 21.382674-3.854905 75.712737 0 54.330062 3.854905 75.712736 3.854905 75.712736 4.216302 23.972688 26.9241 47.945376 50.595623 53.185637l16.624276 3.854905a174.253736 174.253736 0 0 1 102.395904 81.314394c23.310126 40.837896 28.911785 87.337683 18.732427 129.801867l-4.81863 16.443578c-7.10748 23.129428 2.108151 54.992624 20.599646 70.833872 0 0 16.624276 14.094495 63.244529 41.199293 46.800951 27.104798 66.918735 34.513443 66.918735 34.513443 22.707798 8.372371 54.631227 0.361397 71.255503-17.407303l11.624947-12.588673a175.096996 175.096996 0 0 1 242.256662 0.120465l11.624947 12.648906c16.383345 17.708468 48.427239 25.598976 71.255503 17.347071 0 0 20.358715-7.529111 67.159666-34.513443 46.740719-27.104798 63.124063-41.199293 63.124064-41.199293 18.491496-15.600317 27.707127-47.463513 20.599646-70.833873l-5.059562-17.106139a176.723284 176.723284 0 0 1 18.672194-129.139305 176.060722 176.060722 0 0 1 102.395904-81.314394l16.68451-3.854905c23.310126-5.42096 46.258856-29.333415 50.595623-53.185637 0 0 3.854905-21.382674 3.854904-75.712737-0.240932-54.330062-4.095836-75.833202-4.095836-75.833202z m-537.819428 293.334149c-119.261112 0-216.175824-97.336342-216.175824-217.621412a216.657687 216.657687 0 0 1 216.236057-217.320249c119.200879 0 216.115591 97.276109 216.11559 217.56118-0.240932 120.044139-96.974945 217.320248-216.175823 217.320249z" p-id="10234"></path></svg>
yudao-ui-admin/src/assets/icons/svg/tool.svg
1 -<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><defs><style/></defs><path d="M898.832 900.518H103.817c-36.003 0-65.364-29.286-65.364-65.314v-554.95c0-36.041 29.362-65.326 65.364-65.326h795.016c36.003 0 65.199 29.285 65.199 65.327v554.95c-.001 36.027-29.197 65.313-65.2 65.313zM103.817 255.593c-13.576 0-24.712 11.086-24.712 24.663v554.95c0 13.575 11.137 24.662 24.712 24.662h795.016c13.577 0 24.547-11.087 24.547-24.663v-554.95c0-13.576-10.971-24.662-24.547-24.662H103.817zm560.53-3.819c-11.162 0-20.333-9.08-20.333-20.332V130.164c0-13.577-11.047-24.624-24.7-24.624H383.183c-13.577 0-24.713 11.046-24.713 24.624v101.278a20.278 20.278 0 01-20.332 20.332c-11.201 0-20.32-9.08-20.32-20.332V130.164c0-35.99 29.324-65.276 65.365-65.276h236.133c36.067 0 65.402 29.285 65.402 65.276v101.278c0 11.252-9.08 20.332-20.37 20.332zM413.232 521.726H75.694c-11.163 0-20.333-9.118-20.333-20.357 0-11.252 9.17-20.332 20.333-20.332h337.539c11.278 0 20.32 9.08 20.32 20.332 0 11.239-9.042 20.357-20.32 20.357zm499.661 0H575.368c-11.214 0-20.332-9.118-20.332-20.357 0-11.252 9.118-20.332 20.332-20.332h337.526c11.29 0 20.332 9.08 20.332 20.332 0 11.239-9.042 20.357-20.332 20.357zm-355.33 112.492H445.084c-11.213 0-20.332-9.08-20.332-20.331V445.123c0-11.251 9.12-20.332 20.332-20.332h112.48c11.29 0 20.37 9.08 20.37 20.332v168.764c0 11.25-9.082 20.33-20.372 20.33zm-92.146-40.703h71.827v-128.06h-71.827v128.06z" fill="#bfbfbf"/></svg>  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1553828490559" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1684" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M898.831744 900.517641 103.816972 900.517641c-36.002982 0-65.363683-29.286-65.363683-65.313541l0-554.949184c0-36.041868 29.361725-65.326844 65.363683-65.326844l795.015795 0c36.002982 0 65.198931 29.284977 65.198931 65.326844l0 554.949184C964.030675 871.231641 934.834726 900.517641 898.831744 900.517641L898.831744 900.517641zM103.816972 255.593236c-13.576203 0-24.711821 11.085476-24.711821 24.662703l0 554.949184c0 13.576203 11.136641 24.662703 24.711821 24.662703l795.015795 0c13.577227 0 24.547069-11.086499 24.547069-24.662703l0-554.949184c0-13.577227-10.970866-24.662703-24.547069-24.662703L103.816972 255.593236 103.816972 255.593236zM664.346245 251.774257c-11.161201 0-20.332071-9.080819-20.332071-20.332071l0-101.278661c0-13.576203-11.047614-24.623817-24.699542-24.623817L383.181611 105.539708c-13.576203 0-24.712845 11.04659-24.712845 24.623817l0 101.278661c0 11.252275-9.041934 20.332071-20.332071 20.332071-11.20111 0-20.319791-9.080819-20.319791-20.332071l0-101.278661c0-35.989679 29.323862-65.275679 65.364707-65.275679l236.133022 0c36.06745 0 65.402569 29.284977 65.402569 65.275679l0 101.278661C684.717202 242.694461 675.636383 251.774257 664.346245 251.774257L664.346245 251.774257zM413.233044 521.725502 75.694471 521.725502c-11.163247 0-20.333094-9.117658-20.333094-20.35663 0-11.252275 9.169847-20.332071 20.333094-20.332071l337.538573 0c11.277858 0 20.319791 9.080819 20.319791 20.332071C433.552835 512.607844 424.510902 521.725502 413.233044 521.725502L413.233044 521.725502zM912.894018 521.725502 575.367725 521.725502c-11.213389 0-20.332071-9.117658-20.332071-20.35663 0-11.252275 9.118682-20.332071 20.332071-20.332071l337.526293 0c11.290137 0 20.332071 9.080819 20.332071 20.332071C933.226089 512.607844 924.184155 521.725502 912.894018 521.725502L912.894018 521.725502zM557.56322 634.217552 445.085496 634.217552c-11.213389 0-20.332071-9.079796-20.332071-20.331048l0-168.763658c0-11.251252 9.118682-20.332071 20.332071-20.332071l112.478747 0c11.290137 0 20.370956 9.080819 20.370956 20.332071l0 168.763658C577.934177 625.137757 568.853357 634.217552 557.56322 634.217552L557.56322 634.217552zM465.417567 593.514525l71.827909 0L537.245476 465.454918l-71.827909 0L465.417567 593.514525 465.417567 593.514525z" p-id="1685"></path></svg>
yudao-ui-admin/src/assets/styles/ruoyi.scss
@@ -145,9 +145,8 @@ @@ -145,9 +145,8 @@
145 } 145 }
146 146
147 /** 表格更多操作下拉样式 */ 147 /** 表格更多操作下拉样式 */
148 -.el-table .el-dropdown-link { 148 +.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine {
149 cursor: pointer; 149 cursor: pointer;
150 - color: #409EFF;  
151 margin-left: 5px; 150 margin-left: 5px;
152 } 151 }
153 152
yudao-ui-admin/src/assets/styles/transition.scss
@@ -12,11 +12,16 @@ @@ -12,11 +12,16 @@
12 } 12 }
13 13
14 /* fade-transform */ 14 /* fade-transform */
  15 +.fade-transform--move,
15 .fade-transform-leave-active, 16 .fade-transform-leave-active,
16 .fade-transform-enter-active { 17 .fade-transform-enter-active {
17 transition: all .5s; 18 transition: all .5s;
18 } 19 }
19 20
  21 +.fade-transform-leave-active {
  22 + position: absolute;
  23 +}
  24 +
20 .fade-transform-enter { 25 .fade-transform-enter {
21 opacity: 0; 26 opacity: 0;
22 transform: translateX(-30px); 27 transform: translateX(-30px);
yudao-ui-admin/src/components/FileUpload/index.vue
1 <template> 1 <template>
2 <div class="upload-file"> 2 <div class="upload-file">
3 <el-upload 3 <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"
16 > 16 >
17 <!-- 上传按钮 --> 17 <!-- 上传按钮 -->
18 <el-button size="mini" type="primary">选取文件</el-button> 18 <el-button size="mini" type="primary">选取文件</el-button>
@@ -72,6 +72,7 @@ export default { @@ -72,6 +72,7 @@ export default {
72 return { 72 return {
73 number: 0, 73 number: 0,
74 uploadList: [], 74 uploadList: [],
  75 + baseUrl: process.env.VUE_APP_BASE_API,
75 uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址 76 uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
76 headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部 77 headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
77 fileList: [], 78 fileList: [],
@@ -118,7 +119,8 @@ export default { @@ -118,7 +119,8 @@ export default {
118 } 119 }
119 const isTypeOk = this.fileType.some((type) => { 120 const isTypeOk = this.fileType.some((type) => {
120 if (file.type.indexOf(type) > -1) return true; 121 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;
122 }); 124 });
123 if (!isTypeOk) { 125 if (!isTypeOk) {
124 this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`); 126 this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
@@ -147,15 +149,17 @@ export default { @@ -147,15 +149,17 @@ export default {
147 this.$modal.closeLoading() 149 this.$modal.closeLoading()
148 }, 150 },
149 // 上传成功回调 151 // 上传成功回调
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--;
158 this.$modal.closeLoading(); 159 this.$modal.closeLoading();
  160 + this.$modal.msgError(res.msg);
  161 + this.$refs.fileUpload.handleRemove(file);
  162 + this.uploadedSuccessfully();
159 } 163 }
160 }, 164 },
161 // 删除文件 165 // 删除文件
@@ -163,6 +167,16 @@ export default { @@ -163,6 +167,16 @@ export default {
163 this.fileList.splice(index, 1); 167 this.fileList.splice(index, 1);
164 this.$emit("input", this.listToString(this.fileList)); 168 this.$emit("input", this.listToString(this.fileList));
165 }, 169 },
  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 + },
166 // 获取文件名称 180 // 获取文件名称
167 getFileName(name) { 181 getFileName(name) {
168 if (name.lastIndexOf("/") > -1) { 182 if (name.lastIndexOf("/") > -1) {
@@ -178,7 +192,7 @@ export default { @@ -178,7 +192,7 @@ export default {
178 for (let i in list) { 192 for (let i in list) {
179 strs += list[i].url + separator; 193 strs += list[i].url + separator;
180 } 194 }
181 - return strs !== '' ? strs.substr(0, strs.length - 1) : ''; 195 + return strs != '' ? strs.substr(0, strs.length - 1) : '';
182 } 196 }
183 } 197 }
184 }; 198 };
yudao-ui-admin/src/components/ImagePreview/index.vue
@@ -19,7 +19,7 @@ export default { @@ -19,7 +19,7 @@ export default {
19 props: { 19 props: {
20 src: { 20 src: {
21 type: String, 21 type: String,
22 - required: true 22 + default: ""
23 }, 23 },
24 width: { 24 width: {
25 type: [Number, String], 25 type: [Number, String],
@@ -32,6 +32,9 @@ export default { @@ -32,6 +32,9 @@ export default {
32 }, 32 },
33 computed: { 33 computed: {
34 realSrc() { 34 realSrc() {
  35 + if (!this.src) {
  36 + return;
  37 + }
35 let real_src = this.src.split(",")[0]; 38 let real_src = this.src.split(",")[0];
36 if (isExternal(real_src)) { 39 if (isExternal(real_src)) {
37 return real_src; 40 return real_src;
@@ -39,6 +42,9 @@ export default { @@ -39,6 +42,9 @@ export default {
39 return process.env.VUE_APP_BASE_API + real_src; 42 return process.env.VUE_APP_BASE_API + real_src;
40 }, 43 },
41 realSrcList() { 44 realSrcList() {
  45 + if (!this.src) {
  46 + return;
  47 + }
42 let real_src_list = this.src.split(","); 48 let real_src_list = this.src.split(",");
43 let srcList = []; 49 let srcList = [];
44 real_src_list.forEach(item => { 50 real_src_list.forEach(item => {
yudao-ui-admin/src/components/RightToolbar/index.vue
1 <template> 1 <template>
2 - <div class="top-right-btn"> 2 + <div class="top-right-btn" :style="style">
3 <el-row> 3 <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">
5 <el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" /> 5 <el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
6 </el-tooltip> 6 </el-tooltip>
7 <el-tooltip class="item" effect="dark" content="刷新" placement="top"> 7 <el-tooltip class="item" effect="dark" content="刷新" placement="top">
@@ -13,10 +13,10 @@ @@ -13,10 +13,10 @@
13 </el-row> 13 </el-row>
14 <el-dialog :title="title" :visible.sync="open" append-to-body> 14 <el-dialog :title="title" :visible.sync="open" append-to-body>
15 <el-transfer 15 <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"
20 ></el-transfer> 20 ></el-transfer>
21 </el-dialog> 21 </el-dialog>
22 </div> 22 </div>
@@ -42,6 +42,23 @@ export default { @@ -42,6 +42,23 @@ export default {
42 columns: { 42 columns: {
43 type: Array, 43 type: Array,
44 }, 44 },
  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 + }
45 }, 62 },
46 created() { 63 created() {
47 // 显隐列初始默认隐藏列 64 // 显隐列初始默认隐藏列
@@ -75,13 +92,13 @@ export default { @@ -75,13 +92,13 @@ export default {
75 }; 92 };
76 </script> 93 </script>
77 <style lang="scss" scoped> 94 <style lang="scss" scoped>
78 -:deep(.el-transfer__button) { 95 +::v-deep .el-transfer__button {
79 border-radius: 50%; 96 border-radius: 50%;
80 padding: 12px; 97 padding: 12px;
81 display: block; 98 display: block;
82 - margin-left: 0; 99 + margin-left: 0px;
83 } 100 }
84 -:deep(.el-transfer__button:first-child) { 101 +::v-deep .el-transfer__button:first-child {
85 margin-bottom: 10px; 102 margin-bottom: 10px;
86 } 103 }
87 </style> 104 </style>
yudao-ui-admin/src/layout/components/AppMain.vue
@@ -2,15 +2,19 @@ @@ -2,15 +2,19 @@
2 <section class="app-main"> 2 <section class="app-main">
3 <transition name="fade-transform" mode="out-in"> 3 <transition name="fade-transform" mode="out-in">
4 <keep-alive :include="cachedViews"> 4 <keep-alive :include="cachedViews">
5 - <router-view :key="key" /> 5 + <router-view v-if="!$route.meta.link" :key="key" />
6 </keep-alive> 6 </keep-alive>
7 </transition> 7 </transition>
  8 + <iframe-toggle />
8 </section> 9 </section>
9 </template> 10 </template>
10 11
11 <script> 12 <script>
  13 +import iframeToggle from "./IframeToggle/index"
  14 +
12 export default { 15 export default {
13 name: 'AppMain', 16 name: 'AppMain',
  17 + components: { iframeToggle },
14 computed: { 18 computed: {
15 cachedViews() { 19 cachedViews() {
16 return this.$store.state.tagsView.cachedViews 20 return this.$store.state.tagsView.cachedViews
@@ -31,7 +35,7 @@ export default { @@ -31,7 +35,7 @@ export default {
31 overflow: hidden; 35 overflow: hidden;
32 } 36 }
33 37
34 -.fixed-header+.app-main { 38 +.fixed-header + .app-main {
35 padding-top: 50px; 39 padding-top: 50px;
36 } 40 }
37 41
@@ -41,7 +45,7 @@ export default { @@ -41,7 +45,7 @@ export default {
41 min-height: calc(100vh - 84px); 45 min-height: calc(100vh - 84px);
42 } 46 }
43 47
44 - .fixed-header+.app-main { 48 + .fixed-header + .app-main {
45 padding-top: 84px; 49 padding-top: 84px;
46 } 50 }
47 } 51 }
@@ -51,7 +55,7 @@ export default { @@ -51,7 +55,7 @@ export default {
51 // fix css style bug in open el-dialog 55 // fix css style bug in open el-dialog
52 .el-popup-parent--hidden { 56 .el-popup-parent--hidden {
53 .fixed-header { 57 .fixed-header {
54 - padding-right: 15px; 58 + padding-right: 17px;
55 } 59 }
56 } 60 }
57 </style> 61 </style>
yudao-ui-admin/src/layout/components/TagsView/index.vue
@@ -2,16 +2,16 @@ @@ -2,16 +2,16 @@
2 <div id="tags-view-container" class="tags-view-container"> 2 <div id="tags-view-container" class="tags-view-container">
3 <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll"> 3 <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
4 <router-link 4 <router-link
5 - v-for="tag in visitedViews"  
6 - ref="tag"  
7 - :key="tag.path"  
8 - :class="isActive(tag)?'active':''"  
9 - :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"  
10 - tag="span"  
11 - class="tags-view-item"  
12 - :style="activeStyle(tag)"  
13 - @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"  
14 - @contextmenu.prevent.native="openMenu(tag,$event)" 5 + v-for="tag in visitedViews"
  6 + ref="tag"
  7 + :key="tag.path"
  8 + :class="isActive(tag)?'active':''"
  9 + :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
  10 + tag="span"
  11 + class="tags-view-item"
  12 + :style="activeStyle(tag)"
  13 + @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
  14 + @contextmenu.prevent.native="openMenu(tag,$event)"
15 > 15 >
16 {{ tag.title }} 16 {{ tag.title }}
17 <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" /> 17 <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
@@ -133,6 +133,9 @@ export default { @@ -133,6 +133,9 @@ export default {
133 const { name } = this.$route 133 const { name } = this.$route
134 if (name) { 134 if (name) {
135 this.$store.dispatch('tagsView/addView', this.$route) 135 this.$store.dispatch('tagsView/addView', this.$route)
  136 + if (this.$route.meta.link) {
  137 + this.$store.dispatch('tagsView/addIframeView', this.$route)
  138 + }
136 } 139 }
137 return false 140 return false
138 }, 141 },
@@ -153,6 +156,9 @@ export default { @@ -153,6 +156,9 @@ export default {
153 }, 156 },
154 refreshSelectedTag(view) { 157 refreshSelectedTag(view) {
155 this.$tab.refreshPage(view); 158 this.$tab.refreshPage(view);
  159 + if (this.$route.meta.link) {
  160 + this.$store.dispatch('tagsView/delIframeView', this.$route)
  161 + }
156 }, 162 },
157 closeSelectedTag(view) { 163 closeSelectedTag(view) {
158 this.$tab.closePage(view).then(({ visitedViews }) => { 164 this.$tab.closePage(view).then(({ visitedViews }) => {
yudao-ui-admin/src/store/modules/tagsView.js
1 const state = { 1 const state = {
2 visitedViews: [], 2 visitedViews: [],
3 - cachedViews: [] 3 + cachedViews: [],
  4 + iframeViews: []
4 } 5 }
5 6
6 const mutations = { 7 const mutations = {
  8 + ADD_IFRAME_VIEW: (state, view) => {
  9 + if (state.iframeViews.some(v => v.path === view.path)) return
  10 + state.iframeViews.push(
  11 + Object.assign({}, view, {
  12 + title: view.meta.title || 'no-name'
  13 + })
  14 + )
  15 + },
7 ADD_VISITED_VIEW: (state, view) => { 16 ADD_VISITED_VIEW: (state, view) => {
8 if (state.visitedViews.some(v => v.path === view.path)) return 17 if (state.visitedViews.some(v => v.path === view.path)) return
9 state.visitedViews.push( 18 state.visitedViews.push(
@@ -18,7 +27,6 @@ const mutations = { @@ -18,7 +27,6 @@ const mutations = {
18 state.cachedViews.push(view.name) 27 state.cachedViews.push(view.name)
19 } 28 }
20 }, 29 },
21 -  
22 DEL_VISITED_VIEW: (state, view) => { 30 DEL_VISITED_VIEW: (state, view) => {
23 for (const [i, v] of state.visitedViews.entries()) { 31 for (const [i, v] of state.visitedViews.entries()) {
24 if (v.path === view.path) { 32 if (v.path === view.path) {
@@ -26,6 +34,10 @@ const mutations = { @@ -26,6 +34,10 @@ const mutations = {
26 break 34 break
27 } 35 }
28 } 36 }
  37 + state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
  38 + },
  39 + DEL_IFRAME_VIEW: (state, view) => {
  40 + state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
29 }, 41 },
30 DEL_CACHED_VIEW: (state, view) => { 42 DEL_CACHED_VIEW: (state, view) => {
31 const index = state.cachedViews.indexOf(view.name) 43 const index = state.cachedViews.indexOf(view.name)
@@ -36,6 +48,7 @@ const mutations = { @@ -36,6 +48,7 @@ const mutations = {
36 state.visitedViews = state.visitedViews.filter(v => { 48 state.visitedViews = state.visitedViews.filter(v => {
37 return v.meta.affix || v.path === view.path 49 return v.meta.affix || v.path === view.path
38 }) 50 })
  51 + state.iframeViews = state.iframeViews.filter(item => item.path === view.path)
39 }, 52 },
40 DEL_OTHERS_CACHED_VIEWS: (state, view) => { 53 DEL_OTHERS_CACHED_VIEWS: (state, view) => {
41 const index = state.cachedViews.indexOf(view.name) 54 const index = state.cachedViews.indexOf(view.name)
@@ -45,16 +58,15 @@ const mutations = { @@ -45,16 +58,15 @@ const mutations = {
45 state.cachedViews = [] 58 state.cachedViews = []
46 } 59 }
47 }, 60 },
48 -  
49 DEL_ALL_VISITED_VIEWS: state => { 61 DEL_ALL_VISITED_VIEWS: state => {
50 // keep affix tags 62 // keep affix tags
51 const affixTags = state.visitedViews.filter(tag => tag.meta.affix) 63 const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
52 state.visitedViews = affixTags 64 state.visitedViews = affixTags
  65 + state.iframeViews = []
53 }, 66 },
54 DEL_ALL_CACHED_VIEWS: state => { 67 DEL_ALL_CACHED_VIEWS: state => {
55 state.cachedViews = [] 68 state.cachedViews = []
56 }, 69 },
57 -  
58 UPDATE_VISITED_VIEW: (state, view) => { 70 UPDATE_VISITED_VIEW: (state, view) => {
59 for (let v of state.visitedViews) { 71 for (let v of state.visitedViews) {
60 if (v.path === view.path) { 72 if (v.path === view.path) {
@@ -63,7 +75,6 @@ const mutations = { @@ -63,7 +75,6 @@ const mutations = {
63 } 75 }
64 } 76 }
65 }, 77 },
66 -  
67 DEL_RIGHT_VIEWS: (state, view) => { 78 DEL_RIGHT_VIEWS: (state, view) => {
68 const index = state.visitedViews.findIndex(v => v.path === view.path) 79 const index = state.visitedViews.findIndex(v => v.path === view.path)
69 if (index === -1) { 80 if (index === -1) {
@@ -77,10 +88,13 @@ const mutations = { @@ -77,10 +88,13 @@ const mutations = {
77 if (i > -1) { 88 if (i > -1) {
78 state.cachedViews.splice(i, 1) 89 state.cachedViews.splice(i, 1)
79 } 90 }
  91 + if(item.meta.link) {
  92 + const fi = state.iframeViews.findIndex(v => v.path === item.path)
  93 + state.iframeViews.splice(fi, 1)
  94 + }
80 return false 95 return false
81 }) 96 })
82 }, 97 },
83 -  
84 DEL_LEFT_VIEWS: (state, view) => { 98 DEL_LEFT_VIEWS: (state, view) => {
85 const index = state.visitedViews.findIndex(v => v.path === view.path) 99 const index = state.visitedViews.findIndex(v => v.path === view.path)
86 if (index === -1) { 100 if (index === -1) {
@@ -94,6 +108,10 @@ const mutations = { @@ -94,6 +108,10 @@ const mutations = {
94 if (i > -1) { 108 if (i > -1) {
95 state.cachedViews.splice(i, 1) 109 state.cachedViews.splice(i, 1)
96 } 110 }
  111 + if(item.meta.link) {
  112 + const fi = state.iframeViews.findIndex(v => v.path === item.path)
  113 + state.iframeViews.splice(fi, 1)
  114 + }
97 return false 115 return false
98 }) 116 })
99 } 117 }
@@ -104,13 +122,15 @@ const actions = { @@ -104,13 +122,15 @@ const actions = {
104 dispatch('addVisitedView', view) 122 dispatch('addVisitedView', view)
105 dispatch('addCachedView', view) 123 dispatch('addCachedView', view)
106 }, 124 },
  125 + addIframeView({ commit }, view) {
  126 + commit('ADD_IFRAME_VIEW', view)
  127 + },
107 addVisitedView({ commit }, view) { 128 addVisitedView({ commit }, view) {
108 commit('ADD_VISITED_VIEW', view) 129 commit('ADD_VISITED_VIEW', view)
109 }, 130 },
110 addCachedView({ commit }, view) { 131 addCachedView({ commit }, view) {
111 commit('ADD_CACHED_VIEW', view) 132 commit('ADD_CACHED_VIEW', view)
112 }, 133 },
113 -  
114 delView({ dispatch, state }, view) { 134 delView({ dispatch, state }, view) {
115 return new Promise(resolve => { 135 return new Promise(resolve => {
116 dispatch('delVisitedView', view) 136 dispatch('delVisitedView', view)
@@ -127,13 +147,18 @@ const actions = { @@ -127,13 +147,18 @@ const actions = {
127 resolve([...state.visitedViews]) 147 resolve([...state.visitedViews])
128 }) 148 })
129 }, 149 },
  150 + delIframeView({ commit, state }, view) {
  151 + return new Promise(resolve => {
  152 + commit('DEL_IFRAME_VIEW', view)
  153 + resolve([...state.iframeViews])
  154 + })
  155 + },
130 delCachedView({ commit, state }, view) { 156 delCachedView({ commit, state }, view) {
131 return new Promise(resolve => { 157 return new Promise(resolve => {
132 commit('DEL_CACHED_VIEW', view) 158 commit('DEL_CACHED_VIEW', view)
133 resolve([...state.cachedViews]) 159 resolve([...state.cachedViews])
134 }) 160 })
135 }, 161 },
136 -  
137 delOthersViews({ dispatch, state }, view) { 162 delOthersViews({ dispatch, state }, view) {
138 return new Promise(resolve => { 163 return new Promise(resolve => {
139 dispatch('delOthersVisitedViews', view) 164 dispatch('delOthersVisitedViews', view)
@@ -156,7 +181,6 @@ const actions = { @@ -156,7 +181,6 @@ const actions = {
156 resolve([...state.cachedViews]) 181 resolve([...state.cachedViews])
157 }) 182 })
158 }, 183 },
159 -  
160 delAllViews({ dispatch, state }, view) { 184 delAllViews({ dispatch, state }, view) {
161 return new Promise(resolve => { 185 return new Promise(resolve => {
162 dispatch('delAllVisitedViews', view) 186 dispatch('delAllVisitedViews', view)
@@ -179,18 +203,15 @@ const actions = { @@ -179,18 +203,15 @@ const actions = {
179 resolve([...state.cachedViews]) 203 resolve([...state.cachedViews])
180 }) 204 })
181 }, 205 },
182 -  
183 updateVisitedView({ commit }, view) { 206 updateVisitedView({ commit }, view) {
184 commit('UPDATE_VISITED_VIEW', view) 207 commit('UPDATE_VISITED_VIEW', view)
185 }, 208 },
186 -  
187 delRightTags({ commit }, view) { 209 delRightTags({ commit }, view) {
188 return new Promise(resolve => { 210 return new Promise(resolve => {
189 commit('DEL_RIGHT_VIEWS', view) 211 commit('DEL_RIGHT_VIEWS', view)
190 resolve([...state.visitedViews]) 212 resolve([...state.visitedViews])
191 }) 213 })
192 }, 214 },
193 -  
194 delLeftTags({ commit }, view) { 215 delLeftTags({ commit }, view) {
195 return new Promise(resolve => { 216 return new Promise(resolve => {
196 commit('DEL_LEFT_VIEWS', view) 217 commit('DEL_LEFT_VIEWS', view)
yudao-ui-admin/src/views/infra/job/index.vue
@@ -62,9 +62,7 @@ @@ -62,9 +62,7 @@
62 v-hasPermi="['infra:job:delete']">删除</el-button> 62 v-hasPermi="['infra:job:delete']">删除</el-button>
63 <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" 63 <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
64 v-hasPermi="['infra:job:trigger', 'infra:job:query']"> 64 v-hasPermi="['infra:job:trigger', 'infra:job:query']">
65 - <span class="el-dropdown-link">  
66 - <i class="el-icon-d-arrow-right el-icon--right"></i>更多  
67 - </span> 65 + <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
68 <el-dropdown-menu slot="dropdown"> 66 <el-dropdown-menu slot="dropdown">
69 <el-dropdown-item command="handleRun" icon="el-icon-caret-right" 67 <el-dropdown-item command="handleRun" icon="el-icon-caret-right"
70 v-hasPermi="['infra:job:trigger']">执行一次</el-dropdown-item> 68 v-hasPermi="['infra:job:trigger']">执行一次</el-dropdown-item>
yudao-ui-admin/src/views/system/user/index.vue
@@ -79,9 +79,7 @@ @@ -79,9 +79,7 @@
79 v-hasPermi="['system:user:update']">修改</el-button> 79 v-hasPermi="['system:user:update']">修改</el-button>
80 <el-dropdown @command="(command) => handleCommand(command, scope.$index, scope.row)" 80 <el-dropdown @command="(command) => handleCommand(command, scope.$index, scope.row)"
81 v-hasPermi="['system:user:delete', 'system:user:update-password', 'system:permission:assign-user-role']"> 81 v-hasPermi="['system:user:delete', 'system:user:update-password', 'system:permission:assign-user-role']">
82 - <span class="el-dropdown-link">  
83 - <i class="el-icon-d-arrow-right el-icon--right"></i>更多  
84 - </span> 82 + <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
85 <el-dropdown-menu slot="dropdown"> 83 <el-dropdown-menu slot="dropdown">
86 <el-dropdown-item command="handleDelete" v-if="scope.row.id !== 1" size="mini" type="text" icon="el-icon-delete" 84 <el-dropdown-item command="handleDelete" v-if="scope.row.id !== 1" size="mini" type="text" icon="el-icon-delete"
87 v-hasPermi="['system:user:delete']">删除</el-dropdown-item> 85 v-hasPermi="['system:user:delete']">删除</el-dropdown-item>