Commit f9ae0d6f by liwk

添加菜单组件

2 parents bd78279a 67343365
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"glsx-vue-common": "^1.1.8", "glsx-vue-common": "^1.1.9",
"glsx-vue-components": "^1.0.12", "glsx-vue-components": "^1.0.12",
"lodash": "^4.17.10", "lodash": "^4.17.10",
"node-sass": "^4.9.3", "node-sass": "^4.9.3",
......
...@@ -4,14 +4,15 @@ import Vue from 'vue' ...@@ -4,14 +4,15 @@ import Vue from 'vue'
import GlsxVueComponents from 'glsx-vue-components' import GlsxVueComponents from 'glsx-vue-components'
import 'glsx-vue-components/dist/glsx-vue-components.css' import 'glsx-vue-components/dist/glsx-vue-components.css'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import config from './config' import { common } from '@/config'
import './styles/role-user-common.scss' import './styles/role-user-common.scss'
import './styles/index.scss' import './styles/index.scss'
// import _ from 'lodash' // import _ from 'lodash'
import { Tree } from '@/components' import { Tree } from '@/components'
Vue.use(GlsxVueComponents) Vue.use(GlsxVueComponents)
Vue.use(GlsxVueCommon, config)
Vue.component('tree', Tree) Vue.component('tree', Tree)
Vue.use(GlsxVueCommon, common)
var mixin = { var mixin = {
mounted() { mounted() {
const _this = this const _this = this
......
Date.prototype.format = function (formatStr) {
var date = this;
var zeroize = function (value, length) {
if (!length) {
length = 2;
}
value = new String(value);
for (var i = 0, zeros = ''; i < (length - value.length); i++) {
zeros += '0';
}
return zeros + value;
};
return formatStr.replace(/"[^"]*"|'[^']*'|\b(?:d{1,4}|M{1,4}|yy(?:yy)?|([hHmstT])\1?|[lLZ])\b/g, function($0) {
switch ($0) {
case 'd': return date.getDate();
case 'dd': return zeroize(date.getDate());
case 'ddd': return ['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat'][date.getDay()];
case 'dddd': return ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][date.getDay()];
case 'M': return date.getMonth() + 1;
case 'MM': return zeroize(date.getMonth() + 1);
case 'MMM': return ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][date.getMonth()];
case 'MMMM': return ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][date.getMonth()];
case 'yy': return new String(date.getFullYear()).substr(2);
case 'yyyy': return date.getFullYear();
case 'h': return date.getHours() % 12 || 12;
case 'hh': return zeroize(date.getHours() % 12 || 12);
case 'H': return date.getHours();
case 'HH': return zeroize(date.getHours());
case 'm': return date.getMinutes();
case 'mm': return zeroize(date.getMinutes());
case 's': return date.getSeconds();
case 'ss': return zeroize(date.getSeconds());
case 'l': return date.getMilliseconds();
case 'll': return zeroize(date.getMilliseconds());
case 'tt': return date.getHours() < 12 ? 'am' : 'pm';
case 'TT': return date.getHours() < 12 ? 'AM' : 'PM';
}
})
}
\ No newline at end of file \ No newline at end of file
Date['prototype'['format']] = (formatStr) => {
var zeroize = function(value, length) {
if (!length) {
length = 2
}
for (var i = 0, zeros = ''; i < (length - value.length); i++) {
zeros += '0'
}
return zeros + value
}
return formatStr.replace(/"[^"]*"|'[^']*'|\b(?:d{1,4}|M{1,4}|yy(?:yy)?|([hHmstT])\1?|[lLZ])\b/g, function($0) {
switch ($0) {
case 'd': return this.getDate()
case 'dd': return zeroize(this.getDate())
case 'ddd': return ['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat'][this.getDay()]
case 'dddd': return ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][this.getDay()]
case 'M': return this.getMonth() + 1
case 'MM': return zeroize(this.getMonth() + 1)
case 'MMM': return ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][this.getMonth()]
case 'MMMM': return ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][this.getMonth()]
case 'yy': return this.getFullYear().substr(2)
case 'yyyy': return this.getFullYear()
case 'h': return this.getHours() % 12 || 12
case 'hh': return zeroize(this.getHours() % 12 || 12)
case 'H': return this.getHours()
case 'HH': return zeroize(this.getHours())
case 'm': return this.getMinutes()
case 'mm': return zeroize(this.getMinutes())
case 's': return this.getSeconds()
case 'ss': return zeroize(this.getSeconds())
case 'l': return this.getMilliseconds()
case 'll': return zeroize(this.getMilliseconds())
case 'tt': return this.getHours() < 12 ? 'am' : 'pm'
case 'TT': return this.getHours() < 12 ? 'AM' : 'PM'
}
})
}
import Tree from './Tree' import Tree from './Tree'
export { Tree } import RoleCreateDialog from './RoleCreateDialog'
export {
RoleCreateDialog,
Tree
}
<!-- menuManagement -->
<template> <template>
<div> <div>
<tree :data='res' :title="'菜单列表'" :props='props' consoleItem></tree> <tree :data='res' :title="'菜单列表'" :props='props' consoleItem></tree>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!