浏览代码

格式化代码eslint

zhangwenjian 5 年之前
父节点
当前提交
863a069dd2

+ 0 - 45
src/api/sysconfig.js

@@ -1,45 +0,0 @@
-import request from '@/utils/request'
-
-// 查询SysConfig列表
-export function listSysConfig(query) {
-  return request({
-    url: '/api/v1/sysconfigList',
-    method: 'get',
-    params: query
-  })
-}
-
-// 查询SysConfig详细
-export function getSysConfig(configId) {
-  return request({
-    url: '/api/v1/sysconfig/' + configId,
-    method: 'get'
-  })
-}
-
-// 新增SysConfig
-export function addSysConfig(data) {
-  return request({
-    url: '/api/v1/sysconfig',
-    method: 'post',
-    data: data
-  })
-}
-
-// 修改SysConfig
-export function updateSysConfig(data) {
-  return request({
-    url: '/api/v1/sysconfig',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除SysConfig
-export function delSysConfig(configId) {
-  return request({
-    url: '/api/v1/sysconfig/' + configId,
-    method: 'delete'
-  })
-}
-

+ 24 - 25
src/api/syscontent.js

@@ -2,45 +2,44 @@ import request from '@/utils/request'
 
 // 查询SysContent列表
 export function listSysContent(query) {
-return request({
-url: '/api/v1/syscontentList',
-method: 'get',
-params: query
-})
+  return request({
+    url: '/api/v1/syscontentList',
+    method: 'get',
+    params: query
+  })
 }
 
 // 查询SysContent详细
-export function getSysContent (id) {
-return request({
-url: '/api/v1/syscontent/' + id,
-method: 'get'
-})
+export function getSysContent(id) {
+  return request({
+    url: '/api/v1/syscontent/' + id,
+    method: 'get'
+  })
 }
 
-
 // 新增SysContent
 export function addSysContent(data) {
-return request({
-url: '/api/v1/syscontent',
-method: 'post',
-data: data
-})
+  return request({
+    url: '/api/v1/syscontent',
+    method: 'post',
+    data: data
+  })
 }
 
 // 修改SysContent
 export function updateSysContent(data) {
-return request({
-url: '/api/v1/syscontent',
-method: 'put',
-data: data
-})
+  return request({
+    url: '/api/v1/syscontent',
+    method: 'put',
+    data: data
+  })
 }
 
 // 删除SysContent
 export function delSysContent(id) {
-return request({
-url: '/api/v1/syscontent/' + id,
-method: 'delete'
-})
+  return request({
+    url: '/api/v1/syscontent/' + id,
+    method: 'delete'
+  })
 }
 

+ 8 - 7
src/components/Bar.vue

@@ -4,11 +4,12 @@
     <v-chart
       height="254"
       :data="arr"
-      :forceFit="true"
-      :padding="['auto', 'auto', '40', '50']">
+      :force-fit="true"
+      :padding="['auto', 'auto', '40', '50']"
+    >
       <v-tooltip />
       <v-axis />
-      <v-bar position="x*y"/>
+      <v-bar position="x*y" />
     </v-chart>
   </div>
 </template>
@@ -23,7 +24,7 @@ export default {
     },
     list: {
       type: Array,
-      default: ()=>{}
+      default: () => {}
     },
     scale: {
       type: Array,
@@ -52,13 +53,13 @@ export default {
       }
     }
   },
-  data () {
+  data() {
     return {
-      arr:[]
+      arr: []
     }
   },
   mounted() {
-    setTimeout(_=>{
+    setTimeout(_ => {
       this.arr = this.list
     }, 300)
   }

+ 3 - 3
src/components/ChartCard/index.vue

@@ -8,7 +8,7 @@
           </slot>
         </span>
         <span class="chart-card-action">
-          <slot name="action"></slot>
+          <slot name="action" />
         </span>
       </div>
       <div class="total">
@@ -19,12 +19,12 @@
     </div>
     <div class="chart-card-content">
       <div class="content-fix">
-        <slot></slot>
+        <slot />
       </div>
     </div>
     <div class="chart-card-footer">
       <div class="field">
-        <slot name="footer"></slot>
+        <slot name="footer" />
       </div>
     </div>
   </el-card>

+ 1 - 0
src/components/FileManage/Left.vue

@@ -14,6 +14,7 @@
           @node-contextmenu="rightKeyClick"
           @node-click="handleNodeClick"
         >
+
           <span slot-scope="{ node, data }" class="custom-tree-node">
             <span>
               <i

+ 159 - 161
src/components/FileManage/Right.vue

@@ -8,8 +8,7 @@
               <el-breadcrumb-item
                 v-for="item in treePath.treeNodePath"
                 :key="item.id"
-                >{{ item.label }}</el-breadcrumb-item
-              >
+              >{{ item.label }}</el-breadcrumb-item>
             </el-breadcrumb>
           </el-col>
           <el-col :span="6">
@@ -53,7 +52,7 @@
                 @contextmenu.prevent.stop="rightClick(item, '', $event, 2)"
               >
                 <div class="file-item-icon">
-                  <img :src="item.fullUrl | formatFile" alt="" />
+                  <img :src="item.fullUrl | formatFile" alt="">
                 </div>
                 <div v-if="!item.open" class="file-item-title">
                   {{ item.name }}
@@ -81,9 +80,9 @@
                 <span v-if="!scope.row.open" v-text="scope.row.name" />
                 <el-input
                   v-else
-                  @blur="handleBlur($event, scope.row)"
                   v-model="scope.row.name"
                   placeholder="请输入内容"
+                  @blur="handleBlur($event, scope.row)"
                 />
               </template>
             </el-table-column>
@@ -98,7 +97,7 @@
             <el-table-column prop="type" align="center" label="文件类型">
               <template slot-scope="scope">
                 <div class="type">
-                  <img :src="scope.row.fullUrl | formatFile" alt="" />
+                  <img :src="scope.row.fullUrl | formatFile" alt="">
                   <span v-text="scope.row.type" />
                 </div>
               </template>
@@ -112,7 +111,7 @@
               <template slot-scope="scope">
                 <el-dropdown trigger="click">
                   <span class="el-dropdown-link">
-                    操作<i class="el-icon-arrow-down el-icon--right"></i>
+                    操作<i class="el-icon-arrow-down el-icon--right" />
                   </span>
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item icon="el-icon-folder-add" @click.native.stop="handleTableAction(scope.row,1)">上传</el-dropdown-item>
@@ -130,12 +129,11 @@
             layout="prev, pager, next, jumper, total"
             prev-text="上一页"
             next-text="下一页"
-            @current-change="handlePage"
             :current-page="pageNo"
             :page-size="pageSize"
             :total="total"
-          >
-          </el-pagination>
+            @current-change="handlePage"
+          />
         </div>
       </div>
     </el-card>
@@ -197,151 +195,151 @@
 </template>
 
 <script>
-import Sortable from "sortablejs";
-import UploadDialog from "@/components/UploadDialog/index";
-import eventBus from "@/utils/eventbus";
-import { parseTime } from "@/utils";
+import Sortable from 'sortablejs'
+import UploadDialog from '@/components/UploadDialog/index'
+import eventBus from '@/utils/eventbus'
+// import { parseTime } from '@/utils'
 import {
-  sysfileinfo,
+  // sysfileinfo,
   sysfileinfoList,
   sysfileinfoAdd,
   sysfileinfoEdit,
   sysfileinfoDelete
-} from "@/api/file";
+} from '@/api/file'
 export default {
-  name: "Right",
+  name: 'Right',
   components: {
     UploadDialog
   },
-  data() {
-    return {
-      uploadShow: false,
-      pageNo: 1,
-      pageSize: 50,
-      total: 0,
-      rightBtn: [
-        {
-          icon: "el-icon-s-grid"
-        },
-        {
-          icon: "ri-table-fill"
-        }
-      ],
-      rightIndex: 0,
-      rightData: {},
-      tableData: [],
-      searchFile: "",
-      height: 0,
-      visible: false,
-      rightMenu: {},
-      treePath: {},
-      isBlank: false
-    };
-  },
   filters: {
     formatFile(pic) {
-      let type = pic.substring(pic.lastIndexOf(".") + 1, pic.length);
+      const type = pic.substring(pic.lastIndexOf('.') + 1, pic.length)
       const FileIcons = [
         {
-          icon: "",
-          matchList: ["bmp", "jpg", "png", "jpeg", "gif", "webp"]
+          icon: '',
+          matchList: ['bmp', 'jpg', 'png', 'jpeg', 'gif', 'webp']
         },
         {
-          icon: require("../../assets/icons/txtbeifen.png"),
-          matchList: ["text", "txt"]
+          icon: require('../../assets/icons/txtbeifen.png'),
+          matchList: ['text', 'txt']
         },
         {
-          icon: require("../../assets/icons/Zip.png"),
-          matchList: ["zip", "tar", "7z"]
+          icon: require('../../assets/icons/Zip.png'),
+          matchList: ['zip', 'tar', '7z']
         },
         {
-          icon: require("../../assets/icons/rar.png"),
-          matchList: ["rar"]
+          icon: require('../../assets/icons/rar.png'),
+          matchList: ['rar']
         },
         {
-          icon: require("../../assets/icons/Word.png"),
-          matchList: ["doc", "docx"]
+          icon: require('../../assets/icons/Word.png'),
+          matchList: ['doc', 'docx']
         },
         {
-          icon: require("../../assets/icons/pptbeifen.png"),
-          matchList: ["ppt", "pptx"]
+          icon: require('../../assets/icons/pptbeifen.png'),
+          matchList: ['ppt', 'pptx']
         },
         {
-          icon: require("../../assets/icons/Excel.png"),
-          matchList: ["xlsx", "xls"]
+          icon: require('../../assets/icons/Excel.png'),
+          matchList: ['xlsx', 'xls']
         },
         {
-          icon: require("../../assets/icons/PDFbeifen.png"),
-          matchList: ["pdf", "pdfx"]
+          icon: require('../../assets/icons/PDFbeifen.png'),
+          matchList: ['pdf', 'pdfx']
         },
         {
-          icon: require("../../assets/icons/Idea.png"),
-          matchList: ["java", "class", "jar", "kt"]
+          icon: require('../../assets/icons/Idea.png'),
+          matchList: ['java', 'class', 'jar', 'kt']
         },
         {
-          icon: require("../../assets/icons/tubiaozhizuomoban-01.png"),
-          matchList: ["psd"]
+          icon: require('../../assets/icons/tubiaozhizuomoban-01.png'),
+          matchList: ['psd']
         },
         {
-          icon: require("../../assets/icons/tubiaozhizuomoban2-01-01.png"),
-          matchList: ["ai"]
+          icon: require('../../assets/icons/tubiaozhizuomoban2-01-01.png'),
+          matchList: ['ai']
         },
         {
-          icon: require("../../assets/icons/Web.png"),
-          matchList: ["ts", "html", "css", "js"]
+          icon: require('../../assets/icons/Web.png'),
+          matchList: ['ts', 'html', 'css', 'js']
         },
         {
-          icon: require("../../assets/icons/video2.png"),
-          matchList: ["mp4"]
+          icon: require('../../assets/icons/video2.png'),
+          matchList: ['mp4']
         },
         {
-          icon: require("../../assets/icons/voice.png"),
-          matchList: ["mp3"]
+          icon: require('../../assets/icons/voice.png'),
+          matchList: ['mp3']
         },
         {
-          icon: require("../../assets/icons/AwesomeVue.png"),
-          matchList: ["vue"]
+          icon: require('../../assets/icons/AwesomeVue.png'),
+          matchList: ['vue']
         },
         {
-          icon: require("../../assets/icons/Pycharm.png"),
-          matchList: ["py"]
+          icon: require('../../assets/icons/Pycharm.png'),
+          matchList: ['py']
         },
         {
-          icon: require("../../assets/icons/Phpstorm-01.png"),
-          matchList: ["php"]
+          icon: require('../../assets/icons/Phpstorm-01.png'),
+          matchList: ['php']
         }
-      ];
-      const UnknowIcon = require("../../assets/icons/Unknow.png");
+      ]
+      const UnknowIcon = require('../../assets/icons/Unknow.png')
       if (FileIcons[0].matchList.includes(type)) {
-        return pic;
+        return pic
       } else {
-        let file = FileIcons.filter(item => item.matchList.includes(type));
+        const file = FileIcons.filter(item => item.matchList.includes(type))
         if (file.length > 0) {
-          return file[0].icon;
+          return file[0].icon
         } else {
-          return UnknowIcon;
+          return UnknowIcon
         }
       }
     }
   },
+  data() {
+    return {
+      uploadShow: false,
+      pageNo: 1,
+      pageSize: 50,
+      total: 0,
+      rightBtn: [
+        {
+          icon: 'el-icon-s-grid'
+        },
+        {
+          icon: 'ri-table-fill'
+        }
+      ],
+      rightIndex: 0,
+      rightData: {},
+      tableData: [],
+      searchFile: '',
+      height: 0,
+      visible: false,
+      rightMenu: {},
+      treePath: {},
+      isBlank: false
+    }
+  },
   mounted() {
-    eventBus.$on("treeNodeClick", e => {
-      this.treePath = e;
-      this.getList();
-    });
-    this.rowDrop();
-    this.height = document.querySelector(".layout-right").clientHeight - 107;
+    eventBus.$on('treeNodeClick', e => {
+      this.treePath = e
+      this.getList()
+    })
+    this.rowDrop()
+    this.height = document.querySelector('.layout-right').clientHeight - 107
   },
   destroyed() {
-    eventBus.$off("treeNodeClick");
+    eventBus.$off('treeNodeClick')
   },
   methods: {
     handlePage(e) {
-      this.pageNo = e;
-      this.getList();
+      this.pageNo = e
+      this.getList()
     },
     getList() {
-      const pId = this.treePath.currentNode.id;
+      const pId = this.treePath.currentNode.id
       if (pId) {
         sysfileinfoList({
           pId,
@@ -349,24 +347,24 @@ export default {
           pageSize: this.pageSize
         }).then(ret => {
           if (ret.code === 200) {
-            this.total = ret.data.count;
+            this.total = ret.data.count
             this.tableData = ret.data.list.map(item => {
               return {
                 ...item,
                 open: false
-              };
-            });
+              }
+            })
           }
-        });
+        })
       }
     },
     handleUploadConfirm(e) {
       this.uploadMultiple(e).then(ret => {
         if (ret) {
-          this.getList();
+          this.getList()
         }
-      });
-      this.uploadShow = false;
+      })
+      this.uploadShow = false
     },
     uploadMultiple(e) {
       const path = e.map(item => {
@@ -377,136 +375,136 @@ export default {
           url: item.path,
           fullUrl: item.full_path,
           pId: this.treePath.currentNode.id
-        });
-      });
-      return Promise.all(path);
+        })
+      })
+      return Promise.all(path)
     },
     handleUploadCancel() {
-      this.uploadShow = false;
+      this.uploadShow = false
     },
-    handleTableAction(a,b) {
+    handleTableAction(a, b) {
       console.log(typeof b)
       console.log(a)
-        this.rightData.currentData = a;
-        this.handleAction(b)
+      this.rightData.currentData = a
+      this.handleAction(b)
     },
     handleAction(e) {
       switch (e) {
         case 1:
-          this.uploadShow = true;
-          break;
+          this.uploadShow = true
+          break
         case 2:
           this.tableData.forEach((item, index) => {
             if (item.id === this.rightData.currentData.id) {
-              this.tableData[index].open = true;
+              this.tableData[index].open = true
             }
-          });
-          break;
+          })
+          break
         case 3:
           sysfileinfoDelete(this.rightData.currentData.id).then(ret => {
             if (ret.code === 200) {
-              this.getList();
+              this.getList()
             }
-          });
-          break;
+          })
+          break
         case 4:
-          window.open(this.rightData.currentData.fullUrl);
-          break;
+          window.open(this.rightData.currentData.fullUrl)
+          break
       }
     },
     handleTagsOver(index) {
-      const tags = document.querySelectorAll(".right-contextMenu-item");
-      const item = tags[index];
+      const tags = document.querySelectorAll('.right-contextMenu-item')
+      const item = tags[index]
       item.style.cssText = `color:${
         this.$store.state.settings.theme
-      };background:${this.$store.state.settings.theme.colorRgb()}`;
+      };background:${this.$store.state.settings.theme.colorRgb()}`
     },
     handleTagsLeave(index) {
-      const tags = document.querySelectorAll(".right-contextMenu-item");
-      const item = tags[index];
-      item.style.cssText = `color:#606266`;
+      const tags = document.querySelectorAll('.right-contextMenu-item')
+      const item = tags[index]
+      item.style.cssText = `color:#606266`
     },
     rightClick(a, b, c, d) {
-      c.preventDefault();
-      this.rightMenu = { top: c.pageY + "px", left: c.pageX + "px" };
-      this.visible = true;
+      c.preventDefault()
+      this.rightMenu = { top: c.pageY + 'px', left: c.pageX + 'px' }
+      this.visible = true
       if (!a) {
-        this.isBlank = true;
+        this.isBlank = true
       } else {
-        this.isBlank = false;
+        this.isBlank = false
       }
       this.rightData = {
         currentNode: b,
         currentData: a
-      };
+      }
       document.onclick = ev => {
-        if (ev.target !== document.getElementById("perTreeMenu")) {
-          this.visible = false;
+        if (ev.target !== document.getElementById('perTreeMenu')) {
+          this.visible = false
         }
-      };
+      }
     },
     handleBlur(a, b) {
-      console.log(a, b);
+      console.log(a, b)
       if (this.tableData.length > 0) {
         this.tableData.forEach(item => {
-          item.open = false;
-        });
+          item.open = false
+        })
         sysfileinfoEdit({
           ...b
-        });
+        })
       }
     },
     rowDrop() {
-      const tbody = document.querySelector(".el-table__body-wrapper tbody");
+      const tbody = document.querySelector('.el-table__body-wrapper tbody')
       if (tbody) {
-        const _this = this;
+        const _this = this
         Sortable.create(tbody, {
           onEnd({ newIndex, oldIndex }) {
-            const currRow = _this.tableData.splice(oldIndex, 1)[0];
-            _this.tableData.splice(newIndex, 0, currRow);
+            const currRow = _this.tableData.splice(oldIndex, 1)[0]
+            _this.tableData.splice(newIndex, 0, currRow)
           }
-        });
+        })
       }
     },
     handleRightBtn(e) {
-      this.rightIndex = e;
+      this.rightIndex = e
     },
     renderSize(value) {
-      if (value === null || value === "") {
-        return "0 Bytes";
+      if (value === null || value === '') {
+        return '0 Bytes'
       }
-      const unitArr = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
-      let index = 0;
-      const srcsize = parseFloat(value);
-      index = Math.floor(Math.log(srcsize) / Math.log(1024));
-      let size = srcsize / Math.pow(1024, index);
-      size = size.toFixed(2);
-      return size + unitArr[index];
+      const unitArr = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
+      let index = 0
+      const srcsize = parseFloat(value)
+      index = Math.floor(Math.log(srcsize) / Math.log(1024))
+      let size = srcsize / Math.pow(1024, index)
+      size = size.toFixed(2)
+      return size + unitArr[index]
     }
   }
-};
+}
 
 // eslint-disable-next-line no-extend-native
 String.prototype.colorRgb = function() {
-  let sColor = this.toLowerCase();
-  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
+  let sColor = this.toLowerCase()
+  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
   if (sColor && reg.test(sColor)) {
     if (sColor.length === 4) {
-      let sColorNew = "#";
+      let sColorNew = '#'
       for (let i = 1; i < 4; i += 1) {
-        sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
+        sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))
       }
-      sColor = sColorNew;
+      sColor = sColorNew
     }
-    const sColorChange = [];
+    const sColorChange = []
     for (let i = 1; i < 7; i += 2) {
-      sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
+      sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
     }
-    return "rgba(" + sColorChange.join(",") + ",0.2)";
+    return 'rgba(' + sColorChange.join(',') + ',0.2)'
   } else {
-    return sColor;
+    return sColor
   }
-};
+}
 </script>
 
 <style lang="scss" scoped>

+ 2 - 2
src/components/MiniArea/index.vue

@@ -37,7 +37,7 @@ const scale = [{
 }]
 export default {
   name: 'MiniArea',
-  data () {
+  data() {
     return {
       data,
       tooltip,
@@ -62,4 +62,4 @@ export default {
     overflow: hidden;*/
   }
 }
-</style>
+</style>

+ 2 - 2
src/components/MiniBar/index.vue

@@ -37,7 +37,7 @@ const scale = [{
 }]
 export default {
   name: 'MiniBar',
-  data () {
+  data() {
     return {
       data,
       tooltip,
@@ -62,4 +62,4 @@ export default {
     overflow: hidden;*/
   }
 }
-</style>
+</style>

+ 3 - 3
src/components/MiniProgress/index.vue

@@ -2,10 +2,10 @@
   <div class="chart-mini-progress">
     <div class="target" :style="{ left: target + '%'}">
       <span :style="{ backgroundColor: color }" />
-      <span :style="{ backgroundColor: color }"/>
+      <span :style="{ backgroundColor: color }" />
     </div>
     <div class="progress-wrapper">
-      <div class="progress" :style="{ backgroundColor: color, width: percentage + '%', height: height }"></div>
+      <div class="progress" :style="{ backgroundColor: color, width: percentage + '%', height: height }" />
     </div>
   </div>
 </template>
@@ -68,4 +68,4 @@ export default {
       }
     }
   }
-</style>
+</style>

+ 2 - 2
src/components/RankList/index.vue

@@ -2,7 +2,7 @@
   <div class="rank">
     <h4 class="title">{{ title }}</h4>
     <ul class="list">
-      <li :key="index" v-for="(item, index) in list">
+      <li v-for="(item, index) in list" :key="index">
         <span :class="index < 3 ? 'active' : null">{{ index + 1 }}</span>
         <span>{{ item.name }}</span>
         <span>{{ item.total }}</span>
@@ -66,4 +66,4 @@ export default {
   .mobile .rank {
     padding: 0 32px 32px 32px;
   }
-</style>
+</style>

+ 8 - 8
src/components/Trend/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="chart-trend">
-    <slot name="term"/>
+    <slot name="term" />
     <span>{{ rate }}%</span>
     <span :class="[flag]">
       <i :class="'el-icon-caret-' + flag" />
@@ -10,20 +10,20 @@
 
 <script>
 export default {
-  name: "Trend",
+  name: 'Trend',
   props: {
     rate: {
       type: String,
-      default: "",
+      default: '',
       required: true
     },
     flag: {
       type: String,
-      default: "",
+      default: '',
       required: true
-    },
-  },
-};
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
@@ -59,4 +59,4 @@ export default {
           color: #52c41a!important;
       }
     }
-</style>
+</style>

+ 4 - 4
src/components/UploadDialog/form.vue

@@ -55,17 +55,17 @@ export default {
         base64: ''
       },
       formData: '',
-      limit:10
+      limit: 10
     }
   },
   mounted() {},
   methods: {
     handleLimit(e) {
-      if(e.length > this.limit) {
-         this.$message({
+      if (e.length > this.limit) {
+        this.$message({
           message: `最大单次只可上传${this.limit}条`,
           type: 'warning'
-        });
+        })
       }
     },
     uploadFile(file) {

+ 1 - 1
src/components/UploadDialog/index.vue

@@ -7,7 +7,7 @@
       width="30%"
       @close="cancel"
     >
-      <upload-form @confirm="confirm" @cancel="cancel"/>
+      <upload-form @confirm="confirm" @cancel="cancel" />
     </el-dialog>
   </div>
 </template>

+ 2 - 2
src/layout/BasicLayout.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="basic-layout">
-    <slot name="wrapper"></slot>
+    <slot name="wrapper" />
   </div>
 </template>
 
 <script>
 export default {
-  name: "BasicLayout"
+  name: 'BasicLayout'
 }
 </script>
 

+ 1 - 11
src/layout/components/Navbar.vue

@@ -34,25 +34,15 @@
 import { mapGetters } from 'vuex'
 import Breadcrumb from '@/components/Breadcrumb'
 import Hamburger from '@/components/Hamburger'
-import ErrorLog from '@/components/ErrorLog'
 import Screenfull from '@/components/Screenfull'
-import SizeSelect from '@/components/SizeSelect'
 import Search from '@/components/HeaderSearch'
-import GoAdminGit from '@/components/Go-Admin/Git'
-import GoAdminDoc from '@/components/Go-Admin/Doc'
-import GoAdminDonate from '@/components/Go-Admin/Donate'
 
 export default {
   components: {
     Breadcrumb,
     Hamburger,
-    ErrorLog,
     Screenfull,
-    SizeSelect,
-    Search,
-    GoAdminGit,
-    GoAdminDoc,
-    GoAdminDonate
+    Search
   },
   computed: {
     ...mapGetters([

+ 2 - 2
src/layout/components/Settings/index.vue

@@ -48,12 +48,12 @@
 
         <div class="drawer-item">
           <span>Header 固定</span>
-          <el-switch :active-color="activeColor" v-model="fixedHeader" class="drawer-switch" />
+          <el-switch v-model="fixedHeader" :active-color="activeColor" class="drawer-switch" />
         </div>
 
         <div class="drawer-item">
           <span>侧边栏Logo</span>
-          <el-switch :active-color="activeColor" v-model="sidebarLogo" class="drawer-switch" />
+          <el-switch v-model="sidebarLogo" :active-color="activeColor" class="drawer-switch" />
         </div>
       </div>
     </div>

+ 1 - 0
src/layout/components/TagsView/index.vue

@@ -223,6 +223,7 @@ export default {
   }
 }
 
+// eslint-disable-next-line no-extend-native
 String.prototype.colorRgb = function() {
   let sColor = this.toLowerCase()
   const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/

+ 1 - 0
src/store/modules/user.js

@@ -120,6 +120,7 @@ const actions = {
 
   // dynamically modify permissions
   changeRoles({ commit, dispatch }, role) {
+    // eslint-disable-next-line no-async-promise-executor
     return new Promise(async resolve => {
       const token = role + '-token'
 

+ 1 - 1
src/utils/eventbus.js

@@ -1,2 +1,2 @@
 import Vue from 'vue'
-export default new Vue()
+export default new Vue()

+ 1 - 1
src/views/dashboard/admin/index.vue

@@ -61,7 +61,7 @@
 
     <el-card :bordered="false" :body-style="{padding: '0'}">
       <div class="salesCard">
-        <el-tabs >
+        <el-tabs>
           <el-tab-pane label="销售额">
             <el-row>
               <el-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">

+ 13 - 13
src/views/post/index.vue

@@ -331,20 +331,20 @@ export default {
         type: 'warning'
       }).then(() => {
         this.downloadLoading = true
-      import('@/vendor/Export2Excel').then(excel => {
-        const tHeader = ['岗位编号', '岗位编码', '岗位名称', '排序', '创建时间']
-        const filterVal = ['postId', 'postCode', 'postName', 'sort', 'createdAt']
-        const list = this.postList
-        const data = formatJson(filterVal, list)
-        excel.export_json_to_excel({
-          header: tHeader,
-          data,
-          filename: '岗位管理',
-          autoWidth: true, // Optional
-          bookType: 'xlsx' // Optional
+        import('@/vendor/Export2Excel').then(excel => {
+          const tHeader = ['岗位编号', '岗位编码', '岗位名称', '排序', '创建时间']
+          const filterVal = ['postId', 'postCode', 'postName', 'sort', 'createdAt']
+          const list = this.postList
+          const data = formatJson(filterVal, list)
+          excel.export_json_to_excel({
+            header: tHeader,
+            data,
+            filename: '岗位管理',
+            autoWidth: true, // Optional
+            bookType: 'xlsx' // Optional
+          })
+          this.downloadLoading = false
         })
-        this.downloadLoading = false
-      })
       }).catch(function() {})
     }
   }

+ 0 - 279
src/views/sysconfig/index.vue

@@ -1,279 +0,0 @@
-
-<template>
-  <BasicLayout>
-    <template #wrapper>
-      <el-card class="box-card">
-        <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
-
-          <el-form-item>
-            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-          </el-form-item>
-        </el-form>
-
-        <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
-            <el-button
-              v-permisaction="['sysconfig:sysconfig:add']"
-              type="primary"
-              icon="el-icon-plus"
-              size="mini"
-              @click="handleAdd"
-            >新增
-            </el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button
-              v-permisaction="['sysconfig:sysconfig:edit']"
-              type="success"
-              icon="el-icon-edit"
-              size="mini"
-              :disabled="single"
-              @click="handleUpdate"
-            >修改
-            </el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button
-              v-permisaction="['sysconfig:sysconfig:remove']"
-              type="danger"
-              icon="el-icon-delete"
-              size="mini"
-              :disabled="multiple"
-              @click="handleDelete"
-            >删除
-            </el-button>
-          </el-col>
-        </el-row>
-
-        <el-table v-loading="loading" :data="sysconfigList" @selection-change="handleSelectionChange">
-          <el-table-column type="selection" width="55" align="center" />
-          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-            <template slot-scope="scope">
-              <el-button
-                v-permisaction="['sysconfig:sysconfig:edit']"
-                size="mini"
-                type="text"
-                icon="el-icon-edit"
-                @click="handleUpdate(scope.row)"
-              >修改
-              </el-button>
-              <el-button
-                v-permisaction="['sysconfig:sysconfig:remove']"
-                size="mini"
-                type="text"
-                icon="el-icon-delete"
-                @click="handleDelete(scope.row)"
-              >删除
-              </el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-
-        <pagination
-          v-show="total>0"
-          :total="total"
-          :page.sync="queryParams.pageIndex"
-          :limit.sync="queryParams.pageSize"
-          @pagination="getList"
-        />
-
-        <!-- 添加或修改对话框 -->
-        <el-dialog :title="title" :visible.sync="open" width="500px">
-          <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-
-            <el-form-item label="" prop="configName">
-              <el-input
-                v-model="form.configName"
-                placeholder=""
-              />
-            </el-form-item>
-            <el-form-item label="" prop="configKey">
-              <el-input
-                v-model="form.configKey"
-                placeholder=""
-              />
-            </el-form-item>
-            <el-form-item label="" prop="configValue">
-              <el-input
-                v-model="form.configValue"
-                placeholder=""
-              />
-            </el-form-item>
-            <el-form-item label="" prop="configType">
-              <el-input
-                v-model="form.configType"
-                placeholder=""
-              />
-            </el-form-item>
-            <el-form-item label="" prop="remark">
-              <el-input
-                v-model="form.remark"
-                placeholder=""
-              />
-            </el-form-item>
-          </el-form>
-          <div slot="footer" class="dialog-footer">
-            <el-button type="primary" @click="submitForm">确 定</el-button>
-            <el-button @click="cancel">取 消</el-button>
-          </div>
-        </el-dialog>
-      </el-card>
-    </template>
-  </BasicLayout>
-</template>
-
-<script>
-import { addSysConfig, delSysConfig, getSysConfig, listSysConfig, updateSysConfig } from '@/api/sysconfig'
-
-export default {
-  name: 'Config',
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 总条数
-      total: 0,
-      // 弹出层标题
-      title: '',
-      // 是否显示弹出层
-      open: false,
-      isEdit: false,
-      // 类型数据字典
-      typeOptions: [],
-      sysconfigList: [],
-
-      // 查询参数
-      queryParams: {
-        pageIndex: 1,
-        pageSize: 10
-
-      },
-      // 表单参数
-      form: {
-      },
-      // 表单校验
-      rules: {}
-    }
-  },
-  created() {
-    this.getList()
-  },
-  methods: {
-    /** 查询参数列表 */
-    getList() {
-      this.loading = true
-      listSysConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
-        this.sysconfigList = response.data.list
-        this.total = response.data.count
-        this.loading = false
-      }
-      )
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false
-      this.reset()
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-
-        configId: undefined,
-        configName: undefined,
-        configKey: undefined,
-        configValue: undefined,
-        configType: undefined,
-        remark: undefined
-      }
-      this.resetForm('form')
-    },
-
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageIndex = 1
-      this.getList()
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.dateRange = []
-      this.resetForm('queryForm')
-      this.handleQuery()
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset()
-      this.open = true
-      this.title = '添加SysConfig'
-      this.isEdit = false
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.configId)
-      this.single = selection.length !== 1
-      this.multiple = !selection.length
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset()
-      const configId =
-                row.configId || this.ids
-      getSysConfig(configId).then(response => {
-        this.form = response.data
-        this.open = true
-        this.title = '修改SysConfig'
-        this.isEdit = true
-      })
-    },
-    /** 提交按钮 */
-    submitForm: function() {
-      this.$refs['form'].validate(valid => {
-        if (valid) {
-          if (this.form.configId !== undefined) {
-            updateSysConfig(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess('修改成功')
-                this.open = false
-                this.getList()
-              } else {
-                this.msgError(response.msg)
-              }
-            })
-          } else {
-            addSysConfig(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess('新增成功')
-                this.open = false
-                this.getList()
-              } else {
-                this.msgError(response.msg)
-              }
-            })
-          }
-        }
-      })
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const Ids = row.configId || this.ids
-      this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return delSysConfig(Ids)
-      }).then(() => {
-        this.getList()
-        this.msgSuccess('删除成功')
-      }).catch(function() {
-      })
-    }
-  }
-}
-</script>

+ 1 - 1
vue.config.js

@@ -31,7 +31,7 @@ module.exports = {
   outputDir: 'dist',
   // assetsDir: '../../static/admin',
   // assetsDir: '/',
-  lintOnSave: false, // process.env.NODE_ENV === 'development',
+  lintOnSave: process.env.NODE_ENV === 'development',
   productionSourceMap: false,
   devServer: {
     port: port,