作者 RuoYi

优化代码

1 - /**  
2 - * 通用css样式布局处理  
3 - * Copyright (c) 2019 ruoyi  
4 - */ 1 +/**
  2 +* 通用css样式布局处理
  3 +* Copyright (c) 2019 ruoyi
  4 +*/
5 5
6 - /** 基础通用 **/ 6 +/** 基础通用 **/
7 .pt5 { 7 .pt5 {
8 padding-top: 5px; 8 padding-top: 5px;
9 } 9 }
  10 +
10 .pr5 { 11 .pr5 {
11 padding-right: 5px; 12 padding-right: 5px;
12 } 13 }
  14 +
13 .pb5 { 15 .pb5 {
14 padding-bottom: 5px; 16 padding-bottom: 5px;
15 } 17 }
  18 +
16 .mt5 { 19 .mt5 {
17 margin-top: 5px; 20 margin-top: 5px;
18 } 21 }
  22 +
19 .mr5 { 23 .mr5 {
20 margin-right: 5px; 24 margin-right: 5px;
21 } 25 }
  26 +
22 .mb5 { 27 .mb5 {
23 margin-bottom: 5px; 28 margin-bottom: 5px;
24 } 29 }
  30 +
25 .mb8 { 31 .mb8 {
26 margin-bottom: 8px; 32 margin-bottom: 8px;
27 } 33 }
  34 +
28 .ml5 { 35 .ml5 {
29 margin-left: 5px; 36 margin-left: 5px;
30 } 37 }
  38 +
31 .mt10 { 39 .mt10 {
32 margin-top: 10px; 40 margin-top: 10px;
33 } 41 }
  42 +
34 .mr10 { 43 .mr10 {
35 margin-right: 10px; 44 margin-right: 10px;
36 } 45 }
  46 +
37 .mb10 { 47 .mb10 {
38 margin-bottom: 10px; 48 margin-bottom: 10px;
39 } 49 }
40 .ml10 { 50 .ml10 {
41 margin-left: 10px; 51 margin-left: 10px;
42 } 52 }
  53 +
43 .mt20 { 54 .mt20 {
44 margin-top: 20px; 55 margin-top: 20px;
45 } 56 }
  57 +
46 .mr20 { 58 .mr20 {
47 margin-right: 20px; 59 margin-right: 20px;
48 } 60 }
  61 +
49 .mb20 { 62 .mb20 {
50 margin-bottom: 20px; 63 margin-bottom: 20px;
51 } 64 }
@@ -85,6 +98,7 @@ @@ -85,6 +98,7 @@
85 font-size: 13px; 98 font-size: 13px;
86 } 99 }
87 } 100 }
  101 +
88 .el-table__body-wrapper { 102 .el-table__body-wrapper {
89 .el-button [class*="el-icon-"] + span { 103 .el-button [class*="el-icon-"] + span {
90 margin-left: 1px; 104 margin-left: 1px;
@@ -94,11 +108,11 @@ @@ -94,11 +108,11 @@
94 108
95 /** 表单布局 **/ 109 /** 表单布局 **/
96 .form-header { 110 .form-header {
97 - font-size:15px;  
98 - color:#6379bb;  
99 - border-bottom:1px solid #ddd;  
100 - margin:8px 10px 25px 10px;  
101 - padding-bottom:5px 111 + font-size: 15px;
  112 + color: #6379bb;
  113 + border-bottom: 1px solid #ddd;
  114 + margin: 8px 10px 25px 10px;
  115 + padding-bottom: 5px
102 } 116 }
103 117
104 /** 表格布局 **/ 118 /** 表格布局 **/
@@ -115,7 +129,7 @@ @@ -115,7 +129,7 @@
115 margin-top: 5px; 129 margin-top: 5px;
116 border: 1px solid #e5e6e7; 130 border: 1px solid #e5e6e7;
117 background: #FFFFFF none; 131 background: #FFFFFF none;
118 - border-radius:4px; 132 + border-radius: 4px;
119 } 133 }
120 134
121 .pagination-container .el-pagination { 135 .pagination-container .el-pagination {
@@ -123,7 +137,7 @@ @@ -123,7 +137,7 @@
123 position: absolute; 137 position: absolute;
124 } 138 }
125 139
126 -@media ( max-width : 768px) { 140 +@media (max-width: 768px) {
127 .pagination-container .el-pagination > .el-pagination__jump { 141 .pagination-container .el-pagination > .el-pagination__jump {
128 display: none !important; 142 display: none !important;
129 } 143 }
@@ -265,10 +279,10 @@ @@ -265,10 +279,10 @@
265 } 279 }
266 280
267 /* 拖拽列样式 */ 281 /* 拖拽列样式 */
268 -.sortable-ghost{ 282 +.sortable-ghost {
269 opacity: .8; 283 opacity: .8;
270 - color: #fff!important;  
271 - background: #42b983!important; 284 + color: #fff !important;
  285 + background: #42b983 !important;
272 } 286 }
273 287
274 .top-right-btn { 288 .top-right-btn {
@@ -142,7 +142,7 @@ export default { @@ -142,7 +142,7 @@ export default {
142 // 上传失败 142 // 上传失败
143 handleUploadError(err) { 143 handleUploadError(err) {
144 this.$modal.msgError("上传文件失败,请重试"); 144 this.$modal.msgError("上传文件失败,请重试");
145 - this.$modal.closeLoading() 145 + this.$modal.closeLoading();
146 }, 146 },
147 // 上传成功回调 147 // 上传成功回调
148 handleUploadSuccess(res, file) { 148 handleUploadSuccess(res, file) {
@@ -174,10 +174,11 @@ export default { @@ -174,10 +174,11 @@ export default {
174 }, 174 },
175 // 获取文件名称 175 // 获取文件名称
176 getFileName(name) { 176 getFileName(name) {
  177 + // 如果是url那么取最后的名字 如果不是直接返回
177 if (name.lastIndexOf("/") > -1) { 178 if (name.lastIndexOf("/") > -1) {
178 return name.slice(name.lastIndexOf("/") + 1); 179 return name.slice(name.lastIndexOf("/") + 1);
179 } else { 180 } else {
180 - return ""; 181 + return name;
181 } 182 }
182 }, 183 },
183 // 对象转成指定字符串分隔 184 // 对象转成指定字符串分隔
@@ -5,13 +5,12 @@ @@ -5,13 +5,12 @@
5 @select="handleSelect" 5 @select="handleSelect"
6 > 6 >
7 <template v-for="(item, index) in topMenus"> 7 <template v-for="(item, index) in topMenus">
8 - <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber"  
9 - ><svg-icon 8 + <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber">
  9 + <svg-icon
10 v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" 10 v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"
11 - :icon-class="item.meta.icon"  
12 - />  
13 - {{ item.meta.title }}</el-menu-item  
14 - > 11 + :icon-class="item.meta.icon"/>
  12 + {{ item.meta.title }}
  13 + </el-menu-item>
15 </template> 14 </template>
16 15
17 <!-- 顶部菜单超出数量折叠 --> 16 <!-- 顶部菜单超出数量折叠 -->
@@ -21,10 +20,12 @@ @@ -21,10 +20,12 @@
21 <el-menu-item 20 <el-menu-item
22 :index="item.path" 21 :index="item.path"
23 :key="index" 22 :key="index"
24 - v-if="index >= visibleNumber"  
25 - ><svg-icon :icon-class="item.meta.icon" />  
26 - {{ item.meta.title }}</el-menu-item  
27 - > 23 + v-if="index >= visibleNumber">
  24 + <svg-icon
  25 + v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"
  26 + :icon-class="item.meta.icon"/>
  27 + {{ item.meta.title }}
  28 + </el-menu-item>
28 </template> 29 </template>
29 </el-submenu> 30 </el-submenu>
30 </el-menu> 31 </el-menu>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 </template> 3 </template>
4 4
5 <script> 5 <script>
6 -import * as echarts from 'echarts'; 6 +import * as echarts from 'echarts'
7 require('echarts/theme/macarons') // echarts theme 7 require('echarts/theme/macarons') // echarts theme
8 import resize from './mixins/resize' 8 import resize from './mixins/resize'
9 9
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 </template> 3 </template>
4 4
5 <script> 5 <script>
6 -import * as echarts from 'echarts'; 6 +import * as echarts from 'echarts'
7 require('echarts/theme/macarons') // echarts theme 7 require('echarts/theme/macarons') // echarts theme
8 import resize from './mixins/resize' 8 import resize from './mixins/resize'
9 9
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 </template> 3 </template>
4 4
5 <script> 5 <script>
6 -import * as echarts from 'echarts'; 6 +import * as echarts from 'echarts'
7 require('echarts/theme/macarons') // echarts theme 7 require('echarts/theme/macarons') // echarts theme
8 import resize from './mixins/resize' 8 import resize from './mixins/resize'
9 9
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 </template> 3 </template>
4 4
5 <script> 5 <script>
6 -import * as echarts from 'echarts'; 6 +import * as echarts from 'echarts'
7 require('echarts/theme/macarons') // echarts theme 7 require('echarts/theme/macarons') // echarts theme
8 import resize from './mixins/resize' 8 import resize from './mixins/resize'
9 9
@@ -160,7 +160,7 @@ @@ -160,7 +160,7 @@
160 /> 160 />
161 161
162 <!-- 操作日志详细 --> 162 <!-- 操作日志详细 -->
163 - <el-dialog title="操作日志详细" :visible.sync="open" width="700px" append-to-body> 163 + <el-dialog title="操作日志详细" :visible.sync="open" width="800px" append-to-body>
164 <el-form ref="form" :model="form" label-width="100px" size="mini"> 164 <el-form ref="form" :model="form" label-width="100px" size="mini">
165 <el-row> 165 <el-row>
166 <el-col :span="12"> 166 <el-col :span="12">
@@ -182,7 +182,7 @@ @@ -182,7 +182,7 @@
182 <el-col :span="24"> 182 <el-col :span="24">
183 <el-form-item label="返回参数:">{{ form.jsonResult }}</el-form-item> 183 <el-form-item label="返回参数:">{{ form.jsonResult }}</el-form-item>
184 </el-col> 184 </el-col>
185 - <el-col :span="6"> 185 + <el-col :span="8">
186 <el-form-item label="操作状态:"> 186 <el-form-item label="操作状态:">
187 <div v-if="form.status === 0">正常</div> 187 <div v-if="form.status === 0">正常</div>
188 <div v-else-if="form.status === 1">失败</div> 188 <div v-else-if="form.status === 1">失败</div>
@@ -191,7 +191,7 @@ @@ -191,7 +191,7 @@
191 <el-col :span="8"> 191 <el-col :span="8">
192 <el-form-item label="消耗时间:">{{ form.costTime }}毫秒</el-form-item> 192 <el-form-item label="消耗时间:">{{ form.costTime }}毫秒</el-form-item>
193 </el-col> 193 </el-col>
194 - <el-col :span="10"> 194 + <el-col :span="8">
195 <el-form-item label="操作时间:">{{ parseTime(form.operTime) }}</el-form-item> 195 <el-form-item label="操作时间:">{{ parseTime(form.operTime) }}</el-form-item>
196 </el-col> 196 </el-col>
197 <el-col :span="24"> 197 <el-col :span="24">