小小调整目录结构

修改使用字符串substring方法的地方
master
toesbieya 6 years ago
parent b8ed38e6d7
commit 507d51b96d
  1. 3
      vue/public/index.html
  2. 3
      vue/src/components/Charts/PieChart.vue
  3. 2
      vue/src/components/TinymceEditor/index.vue
  4. 98
      vue/src/layout/components/Sidebar/components/SidebarItem.vue
  5. 4
      vue/src/mixins/chart/index.js
  6. 0
      vue/src/mixins/chart/logic.js
  7. 0
      vue/src/mixins/chart/resize.js
  8. 13
      vue/src/mixins/guide/base.js
  9. 0
      vue/src/plugin/webgl/fluid/Material.js
  10. 0
      vue/src/plugin/webgl/fluid/Pointer.js
  11. 0
      vue/src/plugin/webgl/fluid/Program.js
  12. 0
      vue/src/plugin/webgl/fluid/config.js
  13. 0
      vue/src/plugin/webgl/fluid/factory.js
  14. 0
      vue/src/plugin/webgl/fluid/index.js
  15. 0
      vue/src/plugin/webgl/fluid/shader.js
  16. 0
      vue/src/plugin/webgl/fluid/util.js
  17. 2
      vue/src/router/index.js
  18. 2
      vue/src/store/modules/app.js
  19. 2
      vue/src/store/modules/message.js
  20. 2
      vue/src/store/modules/resource.js
  21. 2
      vue/src/store/modules/setting.js
  22. 2
      vue/src/store/modules/user.js
  23. 100
      vue/src/utils/index.js
  24. 42
      vue/src/utils/math.js
  25. 19
      vue/src/utils/secret.js
  26. 29
      vue/src/utils/sessionStorage.js
  27. 32
      vue/src/utils/storage.js
  28. 4
      vue/src/views/app/login/index.vue
  29. 2
      vue/src/views/app/login/style.scss
  30. 2
      vue/src/views/example/cool/fluid.vue
  31. 2
      vue/src/views/example/developingTest/components/ImageCompressTest.vue
  32. 3
      vue/src/views/index/components/DailyFinishOrderStat.vue
  33. 3
      vue/src/views/index/components/DailyProfitStat.vue
  34. 3
      vue/src/views/purchase/order/components/EditDialog.vue
  35. 3
      vue/src/views/sell/order/components/EditDialog.vue
  36. 3
      vue/src/views/sell/outbound/components/EditDialog.vue
  37. 3
      vue/src/views/stock/current/DetailDialog.vue
  38. 3
      vue/src/views/stock/current/index.vue
  39. 3
      vue/src/views/system/monitor/components/Cpu.vue
  40. 3
      vue/src/views/system/monitor/components/Jvm.vue
  41. 3
      vue/src/views/system/monitor/components/Memory.vue
  42. 3
      vue/src/views/system/monitor/index.vue

@ -2,6 +2,9 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta content="webkit" name="renderer">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

@ -3,8 +3,7 @@
</template>
<script>
import resize from '@/mixins/chartResizeMixin'
import logic from '@/mixins/chartLogicMixin'
import {logic, resize} from "@/mixins/chart"
export default {
mixins: [resize, logic],

@ -118,6 +118,6 @@
}
.tox-tinymce-aux {
z-index: 10000!important;
z-index: 10000 !important;
}
</style>

@ -11,64 +11,64 @@
return null
}
export default {
functional: true,
props: {
item: Object,
isNest: Boolean,
showParent: Boolean,
collapse: Boolean
},
render(h, context) {
function renderNode({item, isNest, showParent, collapse}) {
let onlyOneChild = getOnlyChild(item)
function renderNode(h, {item, isNest, showParent, collapse}) {
let onlyOneChild = getOnlyChild(item)
const showSingle = onlyOneChild && !onlyOneChild.children
const showSingle = onlyOneChild && !onlyOneChild.children
if (showSingle) {
const {icon, title} = onlyOneChild.meta
if (showSingle) {
const {icon, title} = onlyOneChild.meta
return (
<el-menu-item
index={onlyOneChild.fullPath}
class={{'submenu-title-noDropdown': !isNest, 'nest-menu': isNest}}
>
<SidebarItemContent icon={icon} title={title}/>
</el-menu-item>
)
}
else {
const {icon, title} = item.meta
const children = item.children.map(child => renderNode({
isNest: true,
item: child,
showParent,
collapse
}))
return (
<el-menu-item
index={onlyOneChild.fullPath}
class={{'submenu-title-noDropdown': !isNest, 'nest-menu': isNest}}
>
<SidebarItemContent icon={icon} title={title}/>
</el-menu-item>
)
}
else {
const {icon, title} = item.meta
//mouseleavemouseleave
if (collapse) {
//
if (showParent) {
children.unshift(
<div class="popover-menu__title el-menu-item">
<SidebarItemContent icon={icon} title={title}/>
</div>
)
}
}
const children = item.children.map(child => renderNode(h, {
isNest: true,
item: child,
showParent,
collapse
}))
return (
<el-submenu class={{'nest-menu': isNest}} index={item.fullPath} popper-append-to-body>
<SidebarItemContent slot="title" icon={icon} title={title}/>
{children}
</el-submenu>
//mouseleavemouseleave
if (collapse) {
//
if (showParent) {
children.unshift(
<div class="popover-menu__title el-menu-item">
<SidebarItemContent icon={icon} title={title}/>
</div>
)
}
}
return renderNode(context.props)
return (
<el-submenu class={{'nest-menu': isNest}} index={item.fullPath} popper-append-to-body>
<SidebarItemContent slot="title" icon={icon} title={title}/>
{children}
</el-submenu>
)
}
}
export default {
functional: true,
props: {
item: Object,
isNest: Boolean,
showParent: Boolean,
collapse: Boolean
},
render(h, context) {
return renderNode(h, context.props)
}
}
</script>

@ -0,0 +1,4 @@
import logic from "./logic"
import resize from "./resize"
export {logic, resize}

@ -1,4 +1,15 @@
import {delAllUrlParam, transformGuideSteps} from "@/utils"
import {delAllUrlParam} from "@/utils"
//将引导步骤中函数的this绑定为组件实例
function transformGuideSteps(instance, steps) {
steps.forEach(step => {
Object.keys(step).forEach(key => {
if (typeof step[key] === 'function') {
step[key] = step[key].bind(instance)
}
})
})
}
export default {
methods: {

@ -15,7 +15,7 @@ import Vue from 'vue'
import Router from 'vue-router'
import store from "@/store"
import NProgress from 'nprogress'
import {isUserExist} from "@/utils/sessionStorage"
import {isUserExist} from "@/utils/storage"
import {auth, needAuth} from "@/utils/auth"
import {getPageTitle, transformWhiteList, metaExtend} from './util'
import {routerMode} from '@/config'

@ -1,4 +1,4 @@
import {getLocalPersonalSettings} from "@/utils/localStorage"
import {getLocalPersonalSettings} from "@/utils/storage"
import {createMutations} from "@/utils"
import {isMobile} from "@/utils/browser"

@ -7,7 +7,7 @@ const state = {
const mutations = createMutations(state)
const actions={
const actions = {
refresh({commit}) {
search({page: 1, pageSize: 1, unread: true})
.then(({data}) => commit('unreadCount', data))

@ -3,7 +3,7 @@ import constantRoutes from '@/router/constant'
import authorityRoutes from '@/router/authority'
import {needAuth} from "@/utils/auth"
import {createTree} from "@/utils/tree"
import {getLocalResource, setLocalResource} from "@/utils/localStorage"
import {getLocalResource, setLocalResource} from "@/utils/storage"
import {getResources} from "@/api/system/resource"
import {isEmpty} from "@/utils"

@ -3,7 +3,7 @@
* */
import {isEmpty} from "@/utils"
import {getLocalPersonalSettings, setLocalPersonalSettings} from "@/utils/localStorage"
import {getLocalPersonalSettings, setLocalPersonalSettings} from "@/utils/storage"
const localSettings = getLocalPersonalSettings()

@ -1,7 +1,7 @@
import {login, logout} from '@/api/account'
import {createMutations, isEmpty} from "@/utils"
import {autoCompleteUrl} from "@/utils/file"
import {getUser, setUser} from "@/utils/sessionStorage"
import {getUser, setUser} from "@/utils/storage"
//刷新时从本地存储中获取用户信息
const user = getUser()

@ -1,6 +1,3 @@
import pako from 'pako'
import Decimal from 'decimal.js'
export function isEmpty(...str) {
return str.some(i => i === undefined || i === null || i === '')
}
@ -34,9 +31,10 @@ export function mergeObj(target, source) {
})
}
export function timeFormat(fmt = 'yyyy-MM-dd HH:mm:ss', date = new Date()) {
export function timeFormat(fmt, date = new Date()) {
if (isEmpty(fmt)) fmt = 'yyyy-MM-dd HH:mm:ss'
let o = {
const o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"H+": date.getHours(), //小时
@ -45,9 +43,20 @@ export function timeFormat(fmt = 'yyyy-MM-dd HH:mm:ss', date = new Date()) {
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
}
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length))
for (let k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)))
if (/(y+)/.test(fmt)) {
const replace = (date.getFullYear() + "").substring(4 - RegExp.$1.length)
fmt = fmt.replace(RegExp.$1, [...replace].join(''))
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
const firstMatch = RegExp.$1
const replace = firstMatch.length === 1 ? o[k] : ("00" + o[k]).substring(("" + o[k]).length)
fmt = fmt.replace(firstMatch, [...replace].join(''))
}
}
return fmt
}
@ -111,24 +120,6 @@ export function throttle(func, delay = 100) {
return wrapper
}
export function unzip(b64Data) {
let strData = atob(b64Data)
// Convert binary string to character-number array
let charData = strData.split('').map(x => x.charCodeAt(0))
// Turn number array into byte-array
let binData = new Uint8Array(charData)
// unzip
let data = pako.inflate(binData)
// Convert gunzipped byteArray back to ascii string:
strData = String.fromCharCode.apply(null, new Uint16Array(data))
return decodeURIComponent(strData)
}
export function zip(str) {
let binaryString = pako.gzip(encodeURIComponent(str), {to: 'string'})
return btoa(binaryString)
}
/**
* 循环等待成功事件
* @param success 判断是否成功true or false
@ -170,68 +161,15 @@ export function createMutations(state, all = false) {
return obj
}
//将引导步骤中函数的this绑定为组件实例
export function transformGuideSteps(instance, steps) {
steps.forEach(step => {
Object.keys(step).forEach(key => {
if (typeof step[key] === 'function') {
step[key] = step[key].bind(instance)
}
})
})
}
//删除所有url参数
export function delAllUrlParam() {
let paramStartIndex = location.href.indexOf('?')
if (paramStartIndex > -1) {
history.replaceState(null, null, location.href.substring(0, paramStartIndex))
}
}
/*基于decimal.js的运算封装*/
export function plus(...val) {
if (val.length === 0) return 0
else if (val.length === 1) return new Decimal(val[0]).toNumber()
let f = new Decimal(val[0])
for (let i = 1; i < val.length; i++) {
f = f.add(new Decimal(val[i]))
}
return f.toNumber()
}
export function sub(...val) {
if (val.length === 0) return 0
else if (val.length === 1) return new Decimal(val[0]).toNumber()
let f = new Decimal(val[0])
for (let i = 1; i < val.length; i++) {
f = f.sub(new Decimal(val[i]))
const href = location.href.substring(0, paramStartIndex)
history.replaceState(null, null, [...href].join(''))
}
return f.toNumber()
}
export function mul(...val) {
if (val.length === 0) return 0
else if (val.length === 1) return new Decimal(val[0]).toNumber()
let f = new Decimal(val[0])
for (let i = 1; i < val.length; i++) {
f = f.mul(new Decimal(val[i]))
}
return f.toNumber()
}
export function div(...val) {
if (val.length === 0) return 0
else if (val.length === 1) return new Decimal(val[0]).toNumber()
let f = new Decimal(val[0])
for (let i = 1; i < val.length; i++) {
f = f.div(new Decimal(val[i]))
}
return f.toNumber()
}
export function deepClone(data) {
if (data === null || data === undefined) {
return undefined

@ -0,0 +1,42 @@
import Decimal from 'decimal.js'
/*基于decimal.js的运算封装*/
export function plus(...val) {
if (val.length === 0) return 0
else if (val.length === 1) return new Decimal(val[0]).toNumber()
let f = new Decimal(val[0])
for (let i = 1; i < val.length; i++) {
f = f.add(new Decimal(val[i]))
}
return f.toNumber()
}
export function sub(...val) {
if (val.length === 0) return 0
else if (val.length === 1) return new Decimal(val[0]).toNumber()
let f = new Decimal(val[0])
for (let i = 1; i < val.length; i++) {
f = f.sub(new Decimal(val[i]))
}
return f.toNumber()
}
export function mul(...val) {
if (val.length === 0) return 0
else if (val.length === 1) return new Decimal(val[0]).toNumber()
let f = new Decimal(val[0])
for (let i = 1; i < val.length; i++) {
f = f.mul(new Decimal(val[i]))
}
return f.toNumber()
}
export function div(...val) {
if (val.length === 0) return 0
else if (val.length === 1) return new Decimal(val[0]).toNumber()
let f = new Decimal(val[0])
for (let i = 1; i < val.length; i++) {
f = f.div(new Decimal(val[i]))
}
return f.toNumber()
}

@ -0,0 +1,19 @@
import pako from 'pako'
export function unzip(b64Data) {
let strData = atob(b64Data)
// Convert binary string to character-number array
let charData = strData.split('').map(x => x.charCodeAt(0))
// Turn number array into byte-array
let binData = new Uint8Array(charData)
// unzip
let data = pako.inflate(binData)
// Convert gunzipped byteArray back to ascii string:
strData = String.fromCharCode.apply(null, new Uint16Array(data))
return decodeURIComponent(strData)
}
export function zip(str) {
let binaryString = pako.gzip(encodeURIComponent(str), {to: 'string'})
return btoa(binaryString)
}

@ -1,29 +0,0 @@
import {sessionUserKey} from '@/config'
import {isEmpty, unzip, zip} from "@/utils"
export function isUserExist() {
return !isEmpty(sessionStorage.getItem(sessionUserKey))
}
export function getUser() {
let obj = sessionStorage.getItem(sessionUserKey)
if (isEmpty(obj)) return {}
try {
obj = JSON.parse(unzip(obj))
}
catch (e) {
console.error('用户数据异常!', e)
obj = {}
removeUser()
}
return obj
}
export function setUser(user) {
if (isEmpty(user)) return removeUser()
sessionStorage.setItem(sessionUserKey, zip(JSON.stringify(user)))
}
function removeUser() {
sessionStorage.removeItem(sessionUserKey)
}

@ -1,5 +1,29 @@
import {localPersonalSettingsKey, localResourceKey} from '@/config'
import {isEmpty, unzip, zip} from "@/utils"
import {sessionUserKey, localPersonalSettingsKey, localResourceKey} from '@/config'
import {isEmpty} from "@/utils"
import {unzip, zip} from "@/utils/secret"
export function isUserExist() {
return !isEmpty(sessionStorage.getItem(sessionUserKey))
}
export function getUser() {
let obj = sessionStorage.getItem(sessionUserKey)
if (isEmpty(obj)) return {}
try {
obj = JSON.parse(unzip(obj))
}
catch (e) {
console.error('用户数据异常!', e)
obj = {}
removeUser()
}
return obj
}
export function setUser(user) {
if (isEmpty(user)) return removeUser()
sessionStorage.setItem(sessionUserKey, zip(JSON.stringify(user)))
}
export function getLocalResource() {
let obj = localStorage.getItem(localResourceKey)
@ -41,6 +65,10 @@ export function setLocalPersonalSettings(settings) {
localStorage.setItem(localPersonalSettingsKey, JSON.stringify(settings))
}
function removeUser() {
sessionStorage.removeItem(sessionUserKey)
}
function removeLocalResource() {
localStorage.removeItem(localResourceKey)
}

@ -34,8 +34,8 @@
animation: state => state.loginBackgroundAnimation
}),
component() {
const {path} = this.$route
return `${path.substring(1)}-form`
const formType = this.$route.path.substring(1)
return `${[...formType].join('')}-form`
}
},
methods: {

@ -12,7 +12,7 @@ $cursor: #fff;
.login-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100%;
overflow: auto;
canvas {

@ -26,7 +26,7 @@
window.removeEventListener('resize', this.$_resizeHandler)
},
start() {
import('@/plugin/fluid').then(_ => _.default(this.$el.querySelector('#canvas-fluid')))
import('@/plugin/webgl/fluid').then(_ => _.default(this.$el.querySelector('#canvas-fluid')))
},
close() {
window.location.reload()

@ -73,7 +73,7 @@
import {elError, elSuccess} from "@/utils/message"
import compressJPG from '@/plugin/imageCompress/cjpeg'
import compressPNG from '@/plugin/imageCompress/pngquant'
import {div, mul, sub} from "@/utils"
import {sub, mul, div} from "@/utils/math"
const commonData = () => ({
loading: false,

@ -3,8 +3,7 @@
</template>
<script>
import resize from '@/mixins/chartResizeMixin'
import logic from '@/mixins/chartLogicMixin'
import {logic, resize} from "@/mixins/chart"
import {getDailyFinishOrder} from '@/api/statistic/index'
import {timeFormat} from "@/utils"

@ -3,8 +3,7 @@
</template>
<script>
import resize from '@/mixins/chartResizeMixin'
import logic from '@/mixins/chartLogicMixin'
import {logic, resize} from "@/mixins/chart"
import {getDailyProfitStat} from '@/api/statistic/index'
import {timeFormat} from "@/utils"

@ -120,7 +120,8 @@
import CategorySelector from './CategorySelector'
import bizDocumentDialogMixin from "@/mixins/bizDocumentDialogMixin"
import {add, commit, getById, pass, reject, update, withdraw} from "@/api/purchase/order"
import {isEmpty, mul, plus} from "@/utils"
import {isEmpty} from "@/utils"
import {plus, mul} from "@/utils/math"
import {isInteger} from "@/utils/validate"
export default {

@ -108,7 +108,8 @@
import CustomerSelector from './CustomerSelector'
import bizDocumentDialogMixin from "@/mixins/bizDocumentDialogMixin"
import {add, commit, getById, pass, reject, update, withdraw} from "@/api/sell/order"
import {isEmpty, mul, plus} from "@/utils"
import {isEmpty} from "@/utils"
import {mul, plus} from "@/utils/math"
import {isInteger} from "@/utils/validate"
export default {

@ -105,7 +105,8 @@
import {getDetailById as getStockDetail} from "@/api/stock/current"
import {getSubById as getParentSubById} from "@/api/sell/order"
import {add, commit, getById, pass, reject, update, withdraw} from "@/api/sell/outbound"
import {isEmpty, plus, sub} from "@/utils"
import {isEmpty} from "@/utils"
import {plus, sub} from "@/utils/math"
import {isInteger} from "@/utils/validate"
import {elAlert} from "@/utils/message"

@ -35,7 +35,8 @@
import LinerProgress from '@/components/LinerProgress'
import DialogForm from "@/components/DialogForm"
import dialogMixin from "@/mixins/dialogMixin"
import {isEmpty, mul, plus} from "@/utils"
import {isEmpty} from "@/utils"
import {plus, mul} from "@/utils/math"
import {getDetail} from "@/api/stock/current"
export default {

@ -70,7 +70,8 @@
import CategoryTree from '@/bizComponents/CategoryTree'
import DetailDialog from "./DetailDialog"
import {search} from "@/api/stock/current"
import {debounce, isEmpty, plus} from "@/utils"
import {isEmpty, debounce} from "@/utils"
import {plus} from "@/utils/math"
import {exportExcel} from "@/utils/excel"
import {getNodeId} from "@/utils/tree"
import tableMixin from '@/mixins/tablePageMixin'

@ -26,8 +26,7 @@
</template>
<script>
import resize from '@/mixins/chartResizeMixin'
import logic from '@/mixins/chartLogicMixin'
import {logic, resize} from "@/mixins/chart"
import CountTo from 'vue-count-to'
export default {

@ -27,8 +27,7 @@
</template>
<script>
import resize from '@/mixins/chartResizeMixin'
import logic from '@/mixins/chartLogicMixin'
import {logic, resize} from "@/mixins/chart"
import CountTo from 'vue-count-to'
export default {

@ -27,8 +27,7 @@
</template>
<script>
import resize from '@/mixins/chartResizeMixin'
import logic from '@/mixins/chartLogicMixin'
import {logic, resize} from "@/mixins/chart"
import CountTo from 'vue-count-to'
export default {

@ -21,7 +21,8 @@
import CpuInfo from './components/Cpu'
import MemoryInfo from './components/Memory'
import JvmInfo from './components/Jvm'
import {sub, timeFormat} from "@/utils"
import {timeFormat} from "@/utils"
import {sub} from "@/utils/math"
export default {
name: "systemMonitor",

Loading…
Cancel
Save