Procházet zdrojové kódy

优化但优化没啥大用版

hongxudong před 2 roky
rodič
revize
d3cfa3c3d0

+ 1 - 7
package.json

@@ -19,18 +19,12 @@
     "axios": "^0.18.0",
     "echarts": "^5.4.1",
     "element-ui": "^2.15.12",
-    "js-cookie": "^2.2.0",
     "less": "^2.7.3",
     "less-loader": "^4.0.5",
-    "tinymce": "^5.10.7",
     "view-design": "^4.7.0",
     "vue": "^2.7.14",
-    "vue-i18n": "^7.8.0",
     "vue-router": "3.0.0",
-    "vue-seamless-scroll": "^1.1.23",
-    "vuex": "^3.0.1",
-    "vuex-persistedstate": "^2.5.4",
-    "xe-utils": "^3.5.7"
+    "vue-seamless-scroll": "^1.1.23"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "^3.0.1",

+ 1 - 1
public/index.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link rel="icon" href="<%= BASE_URL %>logo.png">
+<!--    <link rel="icon" href="<%= BASE_URL %>logo.png">-->
     <title></title>
   </head>
   <body>

+ 1 - 187
src/App.vue

@@ -1,51 +1,16 @@
 <template>
   <div id="app">
-    <router-view v-if="isRouterAlive"></router-view>
+    <router-view></router-view>
   </div>
 </template>
 
 <script>
-  import store from '@/store'
-  import { setTagNavListInLocalstorage } from '@/libs/base/util'
-  import {mapActions} from "vuex";
   export default {
     name: 'App',
-    provide () {
-      return{
-        reload: this.reload
-      }
-    },
-    data() {
-      return {
-        isRouterAlive: true
-      }
-    },
-    methods: {
-      reload(){
-        this.isRouterAlive = false
-        this.$nextTick(function(){
-          this.isRouterAlive = true
-        })
-      },
-    },
-    mounted(){
-      this.$Message.config({
-        top: 50,
-        duration: 5
-      })
-    }
   }
 </script>
 
 <style lang="less">
-body{
-  //transform: scale(0.5);
-  //width: 200% !important;
-  //height: 200% !important;
-  //post: absolute !important;
-  //top: -50% !important;
-  //left: -50% !important;
-}
   .size {
     width: 100%;
     height: 100%;
@@ -57,160 +22,9 @@ body{
     margin: 0;
     padding: 0;
     font-family:"iconfont";
-    // font-size:12px!important;
-    // font-family:"Helvetica Neue",Helvetica,Arial,"Microsoft Yahei","Hiragino Sans GB","Heiti SC","WenQuanYi Micro Hei",sans-serif !important;
-    // font-family:"webfont"!important;
-
-  }
-
-
-  //修改select控件disable样式
-  .ivu-select-disabled .ivu-select-selection{
-    // background-color: unset!important;
-    color: unset!important;
-  }
-
-  //修改input控件disable样式
-  .ivu-input[disabled], fieldset[disabled] .ivu-input{
-    // background-color: unset!important;
-    color: unset!important;
   }
-  .ivu-input-number-input[disabled]{
-    color: black!important;
-  }
-
-  //修改button控件disable样式
-  .ivu-btn-primary[disabled]{
-    color: unset!important;
-  }
-
-  //修改地址栏内街道 select disable样式
-  .ivu-select-input[disabled]{
-    -webkit-text-fill-color:unset!important;
-    color: unset!important;
-  }
-
-
-  //修改inputNumber控件disable样式
-  // .ivu-input-number-disabled{
-  //   background-color: unset!important;
-  // }
-  //修改table内button控件disable样式
-  // .ivu-btn[disabled]{
-  //   color: unset!important;
-  // }
 
   #app {
     .size;
   }
-  .fade-enter {
-    opacity:0;
-  }
-  .fade-leave{
-    opacity:1;
-  }
-  .fade-enter-active{
-    transition:opacity .5s;
-  }
-  .fade-leave-active{
-    opacity:0;
-    transition:opacity .5s;
-  }
-</style>
-
-<style>
-/* 去掉授权信息 */
-#hot-display-license-info{
-  display: none !important;
-}
-.icon-huoche {
-    font-family:'iconfont' !important;
-  }
-  .Poptip {
-    margin-right: 10px;
-  }
-  .formItem {
-    margin-right: 10px;
-    margin-bottom: 10px !important;
-  }
-  .searchForm {
-    display: flex;
-  }
-  .form_outer{
-    padding: 0 20% 0 1%;
-    border-radius: 15px;
-  }
-  .form_inner{
-    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
-  }
-
-  .searchForm-no-inline{
-    display: inline-block;
-  }
-
-  .formItem-no-inline {
-    margin-bottom: 5px !important;
-    /*margin-top: 5px !important;*/
-    padding-left: 10px;
-    display: block;
-    float: left;
-  }
-</style>
-<style>
-  /*iview table 选中颜色*/
-  .ivu-table-row-highlight td, .ivu-table-stripe .ivu-table-body tr.ivu-table-row-highlight:nth-child(2n) td, .ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-highlight:nth-child(2n) td, tr.ivu-table-row-highlight.ivu-table-row-hover td{
-    background-color:#BFEFFF !important
-  }
-  /*iview table 悬停颜色*/
-  /*tr.ivu-table-row-hover td{*/
-  /*  background-color: #BFEFFF !important*/
-  /*}*/
-  .my-btn-color1 {
-    border-color: #9f4fff !important;
-    background-color: #9f4fff !important;
-    color: white !important;
-    border:2px #9f4fff solid;
-  }
-  .my-btn-color1:hover {
-    opacity: 0.9
-  }
-
-  .my-btn-color2 {
-    border-color: #ff71c9 !important;
-    background-color: #ff71c9 !important;
-    color: white !important
-  }
-  .my-btn-color2:hover {
-    opacity: 0.9
-  }
-
-  .my-btn-color3 {
-    border-color: #78cdd1 !important;
-    background-color: #78cdd1 !important;
-    color: white !important
-  }
-  .my-btn-color3:hover {
-    opacity: 0.9
-  }
-
-  .my-btn-color4 {
-    border-color: #e0a089 !important;
-    background-color: #e0a089 !important;
-    color: white !important
-  }
-  .my-btn-color4:hover {
-    opacity: 0.9
-  }
-
-  .my-btn-color5 {
-    border-color: #999d9c !important;
-    background-color: #999d9c !important;
-    color: white !important
-  }
-  .my-btn-color5:hover {
-    opacity: 0.9
-  }
-
-
-
 </style>

+ 8 - 4
src/components/echart/bar.vue

@@ -1,9 +1,10 @@
 <template>
-  <div :id="id"/>
+  <div ref="chart"/>
 </template>
 
 <script>
 import { chartMixin } from '_c/echart/mixin'
+import * as echarts from 'echarts';
 
 export default {
   name: 'line-chart',
@@ -16,7 +17,6 @@ export default {
   },
   data() {
     return {
-      id: 'line-',
     }
   },
   methods: {
@@ -60,9 +60,13 @@ export default {
         index++
       }
 
-      let echarts = require('echarts')
-      let chart = echarts.getInstanceByDom(document.getElementById(this.id)) || echarts.init(document.getElementById(this.id))
+      // let echarts = require('echarts')
+      let chart = echarts.getInstanceByDom(this.$refs.chart) || echarts.init(this.$refs.chart, null, {notMerge: true, lazyUpdate: true, renderer: 'svg'})
+      // if (!chart) {
+      //   chart = echarts.init(this.$refs.chart, null, {notMerge: true, lazyUpdate: true, renderer: 'svg'})
+      // }
       chart.resize()
+      //chart.clear()
       chart.setOption(
         {
           title: {

+ 7 - 4
src/components/echart/line-bar.vue

@@ -1,9 +1,10 @@
 <template>
-  <div :id="id"/>
+  <div ref="chart"/>
 </template>
 
 <script>
 import { chartMixin } from '_c/echart/mixin'
+import * as echarts from 'echarts';
 
 export default {
   name: 'line-chart',
@@ -20,7 +21,6 @@ export default {
   },
   data() {
     return {
-      id: 'line-bar-',
     }
   },
   methods: {
@@ -77,9 +77,12 @@ export default {
         index++
       }
 
-      let echarts = require('echarts')
-      let chart = echarts.getInstanceByDom(document.getElementById(this.id)) || echarts.init(document.getElementById(this.id))
+      let chart = echarts.getInstanceByDom(this.$refs.chart) || echarts.init(this.$refs.chart, null, {notMerge: true, lazyUpdate: true, renderer: 'svg'})
+      // if (!chart) {
+      //   chart = echarts.init(this.$refs.chart, null, {notMerge: true, lazyUpdate: true, renderer: 'svg'})
+      // }
       chart.resize()
+      //chart.clear()
       chart.setOption(
         {
           title: {

+ 8 - 4
src/components/echart/line.vue

@@ -1,9 +1,10 @@
 <template>
-  <div :id="id"/>
+  <div ref="chart"/>
 </template>
 
 <script>
 import { chartMixin } from '_c/echart/mixin'
+import * as echarts from 'echarts';
 
 export default {
   name: 'line-chart',
@@ -20,7 +21,6 @@ export default {
   },
   data() {
     return {
-      id: 'line-',
     }
   },
   methods: {
@@ -83,9 +83,13 @@ export default {
         index++
       }
 
-      let echarts = require('echarts')
-      let chart = echarts.getInstanceByDom(document.getElementById(this.id)) || echarts.init(document.getElementById(this.id))
+      // let echarts = require('echarts')
+      let chart = echarts.getInstanceByDom(this.$refs.chart) || echarts.init(this.$refs.chart, null, {notMerge: true, lazyUpdate: true, renderer: 'svg'})
+      // if (!chart) {
+      //   chart = echarts.init(this.$refs.chart, null, {notMerge: true, lazyUpdate: true, renderer: 'svg'})
+      // }
       chart.resize()
+      //chart.clear()
       chart.setOption(
         {
           title: {

+ 5 - 4
src/components/echart/mixin.js

@@ -1,3 +1,4 @@
+import * as echarts from 'echarts';
 export const chartMixin = {
   data() {
     return {
@@ -11,9 +12,9 @@ export const chartMixin = {
      * @date   : 2023-07-13 13:26
      */
     dispose() {
-      let echarts = require('echarts')
-      let chart = echarts.init(document.getElementById(this.id))
-      chart.dispose();
+      // let echarts = require('echarts')
+      let chart = echarts.getInstanceByDom(this.$refs.chart)
+      if (chart) chart.dispose();
     },
     /**
      * @desc   : 换算当前大小
@@ -26,7 +27,7 @@ export const chartMixin = {
     }
   },
   created() {
-    this.id += this.getUuid()
+    // this.id += this.getUuid()
   },
   beforeDestroy() {
     this.dispose()

+ 7 - 4
src/components/echart/pie.vue

@@ -1,9 +1,10 @@
 <template>
-  <div :id="id"/>
+  <div ref="chart"/>
 </template>
 
 <script>
 import { chartMixin } from '_c/echart/mixin'
+import * as echarts from 'echarts';
 
 export default {
   name: 'pie-chart',
@@ -21,7 +22,6 @@ export default {
   },
   data() {
     return {
-      id: 'pie-',
     }
   },
   methods: {
@@ -31,9 +31,12 @@ export default {
      * @date   : 2023-07-12 15:35
      */
     init (list) {
-      let echarts = require('echarts')
-      let chart = echarts.getInstanceByDom(document.getElementById(this.id)) || echarts.init(document.getElementById(this.id))
+      let chart = echarts.getInstanceByDom(this.$refs.chart) || echarts.init(this.$refs.chart, null, {notMerge: true, lazyUpdate: true, renderer: 'svg'})
+      // if (!chart) {
+      //   chart = echarts.init(this.$refs.chart, null, {notMerge: true, lazyUpdate: true, renderer: 'svg'})
+      // }
       chart.resize()
+      //chart.clear()
       chart.setOption(
         {
           title: {

+ 0 - 1
src/components/table/index.vue

@@ -141,7 +141,6 @@ export default {
           < this.$refs['top-table'].$el.children[1].clientHeight * this.data.length
 
         this.classOption.singleHeight = this.$refs['top-table'].$el.children[1].clientHeight
-        console.log(this.classOption.singleHeight)
       }
 
       return this.scroll && over

+ 0 - 444
src/libs/base/util.js

@@ -1,84 +1,9 @@
-import Cookies from 'js-cookie'
-// cookie保存的天数
 import config from '@/config'
-import {forEach, hasOneOf, objEqual, hasAllOf} from '@/libs/tools/tools'
-import Vue from 'vue'
 
 const {title, cookieExpires, useI18n} = config
 
 export const TOKEN_KEY = 'token'
 
-export const setToken = (token) => {
-  Cookies.set(TOKEN_KEY, token, {expires: cookieExpires || 1})
-}
-
-export const getToken = () => {
-  const token = Cookies.get(TOKEN_KEY)
-  if (token) return token
-  else return false
-}
-
-export const hasChild = (item) => {
-  return item.children && item.children.length !== 0
-}
-
-const showThisMenuEle = (item, access) => {
-  if (item.meta && item.meta.access && item.meta.access.length) {
-    if (hasAllOf(item.meta.access, access)) return true
-    else return false
-  } else return true
-}
-/**
- * @param {Array} list 通过路由列表得到菜单列表
- * @returns {Array}
- */
-export const getMenuByRouter = (list, access) => {
-  let res = []
-  list.forEach(item => {
-    if (item.objectCode !== 'home') {
-      let obj = {
-        icon: (item.meta && item.meta.icon) || '',
-        name: item.name,
-        meta: item.meta
-      }
-      if (item.children && item.children.length > 0) {
-        obj.children = item.children.copy();
-      }
-      res.push(obj);
-    }
-  })
-  return res
-}
-
-/**
- * @param {Array} routeMetched 当前路由metched
- * @returns {Array}
- */
-export const getBreadCrumbList = (route, homeRoute) => {
-  let homeItem = {...homeRoute, icon: homeRoute.meta ? homeRoute.meta.icon : null}
-  let routeMetched = route.matched
-  if (routeMetched.some(item => item.name === homeRoute.name)) return [homeItem]
-  let res = routeMetched.filter(item => {
-    return item.meta === undefined || !item.hideInBread
-  }).map(item => {
-    let meta =  {...item.meta}
-    if (meta.title && typeof meta.title === 'function') {
-      meta.__titleIsFunction__ = true
-      meta.title = meta.title(route)
-    }
-    let obj = {
-      icon: (item.meta && item.meta.icon) || '',
-      name: item.name,
-      meta: meta
-    }
-    return obj
-  })
-  // 隐藏在菜单的在面包屑中显示
-  // res = res.filter(item => {
-  //   return !item.meta.hideInMenu
-  // })
-  return [{...homeItem, to: homeRoute.path}, ...res]
-}
 
 export const getRouteTitleHandled = (route) => {
   let router = {...route}
@@ -110,332 +35,7 @@ export const showTitle = (item, vm) => {
   return title
 }
 
-/**
- * @description 本地存储和获取标签导航列表
- */
-export const setTagNavListInLocalstorage = list => {
-  localStorage.tagNaveList = JSON.stringify(list)
-}
-/**
- * @returns {Array} 其中的每个元素只包含路由原信息中的name, path, meta三项
- */
-export const getTagNavListFromLocalstorage = () => {
-  const list = localStorage.tagNaveList
-  return list ? JSON.parse(list) : []
-}
-
-/**
- * @param {Array} routers 路由列表数组
- * @description 用于找到路由列表中name为home的对象
- */
-export const getHomeRoute = (routers, homeName = 'home') => {
-  let i = -1
-  let len = routers.length
-  let homeRoute = {}
-  while (++i < len) {
-    let item = routers[i]
-    if (item.children && item.children.length) {
-      let res = getHomeRoute(item.children, homeName)
-      if (res.name) return res
-    } else {
-      if (item.name === homeName) homeRoute = item
-    }
-  }
-  return homeRoute
-}
-
-/**
- * @param {*} list 现有标签导航列表
- * @param {*} newRoute 新添加的路由原信息对象
- * @description 如果该newRoute已经存在则不再添加
- * @H_X_D 如果当前路由中的参数不相同,则替换为新的参数
- */
-export const getNewTagList = (list, newRoute) => {
-  const {name, path, meta, params} = newRoute
-  let newList = [...list]
-  let index = newList.findIndex(item => item.name === name)
-  if (index >= 0) {
-    if (list[index].params === params) return newList
-    else list[index].params = params
-  } else {
-    newList.push({name, path, meta})
-  }
-  return newList
-}
-
-/**
- * @param {*} access 用户权限数组,如 ['super_admin', 'admin']
- * @param {*} route 路由列表
- */
-const hasAccess = (access, route) => {
-  if (route.meta && route.meta.access) return hasOneOf(access, route.meta.access)
-  else return true
-}
-
-/**
- * 权鉴
- * @param {*} name 即将跳转的路由name
- * @param {*} access 用户权限数组
- * @param {*} routes 路由列表
- * @description 用户是否可跳转到该页
- */
-export const canTurnTo = (name, access, routes) => {
-  const routePermissionJudge = (list) => {
-    return list.some(item => {
-      if (item.name !== name && item.children && item.children.length) {
-        return routePermissionJudge(item.children)
-      } else if (item.name === name) {
-        return hasAccess(access, item)
-      }
-      // if(item.name === name){
-      //   return hasAccess(access, item)
-      // }else if (item.children && item.children.length) {
-      //   return routePermissionJudge(item.children)
-      // }
-    })
-  }
-
-  return routePermissionJudge(routes)
-}
 
-/**
- * @param {String} url
- * @description 从URL中解析参数
- */
-export const getParams = url => {
-  const keyValueArr = url.split('?')[1].split('&')
-  let paramObj = {}
-  keyValueArr.forEach(item => {
-    const keyValue = item.split('=')
-    paramObj[keyValue[0]] = keyValue[1]
-  })
-  return paramObj
-}
-
-/**
- * @desc   : 跳转到前一个Tab
- * @author : 周兴
- * @date   : 2022/5/23 9:22
- */
-export const getPreviousRoute = (list, route) => {
-  let res = {}
-  const index = list.findIndex(item => routeEqual(item, route))
-  if (index >= 1) {
-    res = list[index - 1]
-  }
-  return res
-}
-
-/**
- * @param {Array} list 标签列表
- * @param {String} name 当前关闭的标签的name
- * @H_x_d  关闭标签后,打开前一页
- */
-export const getNextRoute = (list, route) => {
-  let res = {}
-  // 如果有parentPath,需要跳转到对应的页面
-  if (route.meta && route.meta.parentPath) {
-    let newRoute = {}
-    newRoute.name = route.meta.parentPath;
-    const index = list.findIndex(item => routeEqual(item, newRoute))
-    if (index >= 0) {
-      res = list[index];
-      return res;
-    } else {
-      //跳转到首页
-      let homePage = {}
-      homePage.name = 'home'
-      return homePage
-    }
-  }
-  const index = list.findIndex(item => routeEqual(item, route))
-  // 如果是最后一个页面,打开前一个
-  if (index === list.length - 1) {
-    if (list[list.length - 2]) {
-      res = list[list.length - 2]
-    }
-  } else {
-    // 如果不是最后一个页面,打开后面一个
-    if (list[index + 1]) {
-      res = list[index + 1]
-    }
-  }
-  return res
-}
-
-/**
- * @param {Number} times 回调函数需要执行的次数
- * @param {Function} callback 回调函数
- */
-export const doCustomTimes = (times, callback) => {
-  let i = -1
-  while (++i < times) {
-    callback(i)
-  }
-}
-
-/**
- * @param {Object} file 从上传组件得到的文件对象
- * @returns {Promise} resolve参数是解析后的二维数组
- * @description 从Csv文件中解析出表格,解析成二维数组
- */
-export const getArrayFromFile = (file) => {
-  let nameSplit = file.name.split('.')
-  let format = nameSplit[nameSplit.length - 1]
-  return new Promise((resolve, reject) => {
-    let reader = new FileReader()
-    reader.readAsText(file) // 以文本格式读取
-    let arr = []
-    reader.onload = function (evt) {
-      let data = evt.target.result // 读到的数据
-      let pasteData = data.trim()
-      arr = pasteData.split((/[\n\u0085\u2028\u2029]|\r\n?/g)).map(row => {
-        return row.split('\t')
-      }).map(item => {
-        return item[0].split(',')
-      })
-      if (format === 'csv') resolve(arr)
-      else reject(new Error('[Format Error]:你上传的不是Csv文件'))
-    }
-  })
-}
-
-/**
- * @param {Array} array 表格数据二维数组
- * @returns {Object} { columns, tableData }
- * @description 从二维数组中获取表头和表格数据,将第一行作为表头,用于在iView的表格中展示数据
- */
-export const getTableDataFromArray = (array) => {
-  let columns = []
-  let tableData = []
-  if (array.length > 1) {
-    let titles = array.shift()
-    columns = titles.map(item => {
-      return {
-        title: item,
-        key: item
-      }
-    })
-    tableData = array.map(item => {
-      let res = {}
-      item.forEach((col, i) => {
-        res[titles[i]] = col
-      })
-      return res
-    })
-  }
-  return {
-    columns,
-    tableData
-  }
-}
-
-export const findNodeUpper = (ele, tag) => {
-  if (ele.parentNode) {
-    if (ele.parentNode.tagName === tag.toUpperCase()) {
-      return ele.parentNode
-    } else {
-      return findNodeUpper(ele.parentNode, tag)
-    }
-  }
-}
-
-export const findNodeUpperByClasses = (ele, classes) => {
-  let parentNode = ele.parentNode
-  if (parentNode) {
-    let classList = parentNode.classList
-    if (classList && classes.every(className => classList.contains(className))) {
-      return parentNode
-    } else {
-      return findNodeUpperByClasses(parentNode, classes)
-    }
-  }
-}
-
-export const findNodeDownward = (ele, tag) => {
-  const tagName = tag.toUpperCase()
-  if (ele.childNodes.length) {
-    let i = -1
-    let len = ele.childNodes.length
-    while (++i < len) {
-      let child = ele.childNodes[i]
-      if (child.tagName === tagName) return child
-      else return findNodeDownward(child, tag)
-    }
-  }
-}
-
-export const showByAccess = (access, canViewAccess) => {
-  return hasAllOf(canViewAccess, access)
-}
-
-/**
- * @description 根据name/params/query判断两个路由对象是否相等
- * @param {*} route1 路由对象
- * @param {*} route2 路由对象
- */
-export const routeEqual = (route1, route2) => {
-  // const params1 = route1.params || {}
-  // const params2 = route2.params || {}
-  // const query1 = route1.query || {}
-  // const query2 = route2.query || {}
-  // return (route1.name === route2.name) && objEqual(params1, params2) && objEqual(query1, query2)
-  return route1.name === route2.name // 只判断name(新建编辑不多)
-}
-
-/**
- * 判断打开的标签列表里是否已存在这个新添加的路由对象
- */
-export const routeHasExist = (tagNavList, routeItem) => {
-  let len = tagNavList.length
-  let res = false
-  doCustomTimes(len, (index) => {
-    // if (routeEqual(tagNavList[index], routeItem)) {
-    //   res = true
-    // }
-    // 如果名称相同 但是菜单Id不同打开多个
-    if(tagNavList[index].name === routeItem.name){
-      if(tagNavList[index].meta && routeItem.meta
-      && tagNavList[index].meta.menuUuid  === routeItem.meta.menuUuid){
-        res = true;
-      }
-    }
-  })
-  return res
-}
-
-/**
- * @desc   : 保存本地缓存(Session中)
- * @author : 周兴
- * @date   : 2022/12/21 14:34
- */
-export const sessionSave = (key, value) => {
-  sessionStorage.setItem(key, value)
-}
-
-/**
- * @desc   : 保存到本地缓存(Session中)
- * @author : 周兴
- * @date   : 2022/12/21 14:35
- */
-export const sessionRead = (key) => {
-  return sessionStorage.getItem(key) || ''
-}
-
-/**
- * @desc   : 保存本地缓存(Local中)
- * @author : 周兴
- * @date   : 2022/12/21 14:34
- */
-export const localSave = (key, value) => {
-  //处理语言
-  if (key === 'local') {
-    localStorage.setItem(key, value)
-    localStorage.setItem(key + '_lan', value.replace('-', '_'))
-  } else {
-    localStorage.setItem(key, value)
-  }
-}
 
 /**
  * @desc   : 保存到本地缓存(Local中)
@@ -446,50 +46,6 @@ export const localRead = (key) => {
   return localStorage.getItem(key) || ''
 }
 
-/**
- * @desc   : 保存到本地缓存(Local中)
- * @author : 周兴
- * @date   : 2022/12/21 14:35
- */
-export const localRemove = (key) => {
-  return localStorage.removeItem(key)
-}
-
-// scrollTop animation
-export const scrollTop = (el, from = 0, to, duration = 500, endCallback) => {
-  if (!window.requestAnimationFrame) {
-    window.requestAnimationFrame = (
-      window.webkitRequestAnimationFrame ||
-      window.mozRequestAnimationFrame ||
-      window.msRequestAnimationFrame ||
-      function (callback) {
-        return window.setTimeout(callback, 1000 / 60)
-      }
-    )
-  }
-  const difference = Math.abs(from - to)
-  const step = Math.ceil(difference / duration * 50)
-
-  const scroll = (start, end, step) => {
-    if (start === end) {
-      endCallback && endCallback()
-      return
-    }
-
-    let d = (start + step > end) ? end : start + step
-    if (start > end) {
-      d = (start - step < end) ? end : start - step
-    }
-
-    if (el === window) {
-      window.scrollTo(d, d)
-    } else {
-      el.scrollTop = d
-    }
-    window.requestAnimationFrame(() => scroll(d, end, step))
-  }
-  scroll(from, to, step)
-}
 
 /**
  * @description 根据当前跳转的路由设置显示在浏览器标签的title

+ 0 - 1
src/libs/tools/date-tools.js

@@ -1,4 +1,3 @@
-import XEUtils from "xe-utils";
 import Vue from "vue";
 
 /**

+ 0 - 14
src/libs/tools/tools.js

@@ -1,20 +1,6 @@
-import XEUtils from "xe-utils";
 import Vue from "vue";
 
 /**
- * @desc   : 千分位展示
- * @author : 周兴
- * @param  : digits 小数位数,默认为2
- * @date   : 2022/11/16 10:44
- */
-Number.prototype.toThousandth = function (digits) {
-  if(digits == undefined){
-    digits = 0;
-  }
-  return XEUtils.commafy(this, {digits});
-}
-
-/**
  * @desc   : 给列表的行设置行错误信息
  * @author : 周兴
  * @param  : row:行 msg:错误信息

+ 0 - 44
src/locale/index.js

@@ -1,44 +0,0 @@
-import Vue from 'vue'
-import VueI18n from 'vue-i18n'
-import {localRead} from '@/libs/base/util'
-import customZhCn from './lang/zh-CN'
-import zhCnLocale from 'view-design/src/locale/lang/zh-CN'
-// import enUsLocale from 'view-design/src/locale/lang/en-US'
-// import zhTwLocale from 'view-design/src/locale/lang/zh-TW'
-import iView from 'view-design'
-import config from '@/config/index'
-
-Vue.use(VueI18n)
-
-// 自动根据浏览器系统语言设置语言
-const navLang = navigator.language
-const localLang = (navLang === 'zh-CN' || navLang === 'en-US') ? navLang : false
-// let lang = localLang || sessionRead('local') || 'zh-CN'
-let lang = localRead('local') || config.currentLang
-// lang = lang ? lang : this.$config.currentLang
-Vue.config.lang = lang
-
-// vue-i18n 6.x+写法
-Vue.locale = () => {
-}
-const messages = {
-  'zh-CN': Object.assign(zhCnLocale, customZhCn()),
-  // 'zh-TW': Object.assign(zhTwLocale, customZhTw()),
-  // 'en-US': Object.assign(enUsLocale, customEnUs())
-}
-const i18n = new VueI18n({
-  locale: lang,
-  messages
-})
-
-//调用方式: $t{key}
-Vue.use(iView, {
-  i18n: (key, value) => i18n.t(key, value)
-})
-
-export default i18n
-
-// vue-i18n 5.x写法
-// Vue.locale('zh-CN', Object.assign(zhCnLocale, customZhCn))
-// Vue.locale('en-US', Object.assign(zhTwLocale, customZhTw))
-// Vue.locale('zh-TW', Object.assign(enUsLocale, customEnUs))

+ 0 - 19
src/locale/lang/zh-CN.js

@@ -1,19 +0,0 @@
-/**
- * @desc   : 国际化语言包(中文)
- * @author : 周兴
- * @date   : 2022/3/2 9:50
- */
-export default function () {
-  return Object.assign({},
-    columns,
-  )
-}
-
-/**
- * @desc   : 数据库表的列
- * @author : 周兴
- * @date   : 2022/3/2 9:51
- */
-export const columns = {}
-
-

+ 9 - 19
src/main.js

@@ -3,24 +3,18 @@
 import Vue from 'vue'
 import App from './App'
 import router from './router'
-import store from './store'
+// import store from './store'
 import iView from 'view-design'
-import i18n from '@/locale'
 import config from '@/config'
-// import installPlugin from '@/plugin'
-import './libs/base/prototype'
-import Loading from '_c/loading'
+// import './libs/base/prototype'
 
 
-import '@/libs/tools/date-tools'
-import '@/libs/tools/array-tools'
-import '@/libs/tools/tools'
-import '@/libs/tools/user-tools'
-import 'xe-utils'
-// import 'vxe-table/lib/style.css'
-import tools from '@/libs/tools/tools'
+// import '@/libs/tools/date-tools'
+// import '@/libs/tools/array-tools'
+// import '@/libs/tools/tools'
+// import '@/libs/tools/user-tools'
+// import 'xe-utils'
 import './index.less'
-import {localRead} from "@/libs/base/util";
 
 /* eslint-disable */
 //iview 4.0
@@ -28,8 +22,7 @@ import 'view-design/dist/styles/iview.css';
 
 Vue.use(iView)
 
-// Vue.component(Tree.name, Tree);
-Vue.component(Loading.name, Loading);
+// Vue.component(Loading.name, Loading);
 /**
  * @description 注册admin内置插件
  */
@@ -43,8 +36,6 @@ Vue.config.productionTip = false
  */
 
 
-Vue.prototype.$config = config
-
 import scroll from 'vue-seamless-scroll'
 Vue.use(scroll)
 
@@ -64,8 +55,7 @@ Vue.component('AnimatedNumber', AnimatedNumber);
 window.vm = new Vue({
   el: '#app',
   router,
-  i18n,
-  store,
+  // store,
   render: h => h(App)
 })
 

+ 8 - 1
src/router/dev.js

@@ -29,7 +29,14 @@ let menu = [
     },
     component: () => import('@/view/test.vue')
   },
-
+  {
+    path: '/shaocheng',
+    name: 'shaocheng',
+    meta: {
+      title: 'shaocheng',
+    },
+    component: () => import('@/view/shaocheng.vue')
+  },
 ]
 
 

+ 2 - 5
src/store/module/app.js

@@ -1,14 +1,11 @@
-import {
-  sessionRead,
-} from '@/libs/base/util'
 
 export default {
   state: {
     breadCrumbList: [],
     tagNavList: [],
     homeRoute: {},
-    local: sessionRead('local') || 'zh-CN',
-    local_lan: sessionRead('local_lan') || 'zh_CN',
+    local: 'zh-CN',
+    local_lan: 'zh_CN',
     errorList: [],
     hasReadErrorPage: false,
   },

+ 0 - 3
src/utils/request.js

@@ -1,5 +1,4 @@
 import axios from 'axios';
-import { getToken } from '@/libs/base/util';
 import { errorCode, successCode } from '@/utils/httpCode';
 const ERR_MSG_DURATION = 2000;
 const AXIOS_TIMEOUT = 60000;
@@ -16,8 +15,6 @@ const service = axios.create({
 service.interceptors.request.use(
   (config) => {
     // 是否需要设置 token
-    const token = getToken()
-    config.headers['Authorization'] = 'Bearer ' + token
     // if (token) {
     //   config.headers['Authorization'] = 'Bearer ' + token
     //   // config.headers['content-type' ] = 'application/x-www-form-urlencoded'

+ 24 - 4
src/view/test.vue

@@ -148,6 +148,7 @@ export default {
       processData: [],
       ringData: {},
       animatedNumber: 0,
+      timer: null,
     }
   },
   methods: {
@@ -266,19 +267,38 @@ export default {
       this.$nextTick(()=>{
         this.init()
       })
+    },
+    /**
+     * @desc   : 定时刷新
+     * @author : 洪旭东
+     * @date   : 2023-07-20 11:40
+     */
+    refresh() {
+      let _this = this
+      this.timer = setTimeout(() => {
+        _this.init()
+        _this.refresh();
+      }, 3000)
+    },
+    chart(){
+      this.$destroy();
     }
   },
   mounted() {
     this.init()
-    let _this = this
-    setInterval(function () {
-      _this.init()
-    }, 3000)
+    this.refresh()
+    // let _this = this
+    // setInterval(function () {
+    //   _this.init()
+    // }, 3000)
 
     window.addEventListener('resize', this.listenResize)
+    window.addEventListener('beforeunload', this.chart)
   },
   destroyed() {
+    clearTimeout(this.timer)
     window.removeEventListener('resize', this.listenResize)
+    window.removeEventListener('beforeunload', this.chart)
   }
 }
 </script>

+ 0 - 1
vue.config.js

@@ -1,5 +1,4 @@
 const path = require('path')
-const webpack = require('webpack')
 
 if (process.env.NODE_ENV === 'prod') {