@bsgoal/common 0.1.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +521 -437
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -3
- package/src/App.vue +9 -0
- package/src/combines/useComs.js +32 -0
- package/src/combines/useFetchs.js +48 -0
- package/src/components/bsgoal-base-cascader/demo.vue +317 -0
- package/src/components/bsgoal-base-cascader/index.vue +93 -0
- package/src/components/bsgoal-base-dialog/demo.vue +50 -0
- package/src/components/bsgoal-base-dialog/index.vue +133 -0
- package/src/components/bsgoal-base-form/demo.vue +187 -0
- package/src/components/bsgoal-base-form/index.vue +499 -0
- package/src/components/bsgoal-base-frame/demo.vue +35 -0
- package/src/components/bsgoal-base-frame/index.vue +29 -0
- package/src/components/bsgoal-base-line/demo.vue +42 -0
- package/src/components/bsgoal-base-line/index.vue +54 -0
- package/src/components/bsgoal-base-search/demo.vue +217 -0
- package/src/components/bsgoal-base-search/index.vue +506 -0
- package/src/components/bsgoal-base-search-operation/index.vue +74 -0
- package/src/components/bsgoal-base-search-table/demo-table.vue +52 -0
- package/src/components/bsgoal-base-search-table/demo.vue +664 -0
- package/src/components/bsgoal-base-search-table/index.vue +159 -0
- package/src/components/bsgoal-base-table/demo.vue +270 -0
- package/src/components/bsgoal-base-table/index.vue +281 -0
- package/src/components/bsgoal-base-table-content/index.vue +42 -0
- package/src/components/bsgoal-base-table-pagination/index.vue +107 -0
- package/src/components/bsgoal-base-tree/demo.vue +113 -0
- package/src/components/bsgoal-base-tree/index.vue +213 -0
- package/src/components/bsgoal-base-tree-fold/index.vue +65 -0
- package/src/components/layout/layout-home.vue +60 -0
- package/src/components/layout/layout-left-menu.vue +48 -0
- package/src/components/layout/layout-right-container.vue +36 -0
- package/src/components/layout/layout-top-header.vue +40 -0
- package/src/directives/directiveBase.js +94 -0
- package/src/entry.js +35 -0
- package/src/enums/enumType.js +32 -0
- package/src/main.js +11 -0
- package/src/router/index.js +71 -0
- package/src/styles/index.css +14 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-04-15 13:49:25
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-04-18 18:12:06
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-table-content\index.vue
|
|
7
|
+
* @Description: 表格内容
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: "BsgoalBaseTableContent",
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
<script setup>
|
|
17
|
+
/* setup模板
|
|
18
|
+
---------------------------------------------------------------- */
|
|
19
|
+
import { ref } from 'vue';
|
|
20
|
+
// props
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
data: {
|
|
23
|
+
type: [String,Number,Object,Number,Boolean],
|
|
24
|
+
default: ''
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
</script>
|
|
28
|
+
<template>
|
|
29
|
+
<div class="bsgoal-base-table-content">
|
|
30
|
+
<div class="bas_tabl_content">
|
|
31
|
+
{{ data }}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
<style lang="scss">
|
|
36
|
+
/* 覆盖样式
|
|
37
|
+
---------------------------------------------------------------- */
|
|
38
|
+
.bsgoal-base-table-content {
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
42
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-04-15 16:34:57
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-04-25 13:50:40
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-table-pagination\index.vue
|
|
7
|
+
* @Description: 表格的分页按钮
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'BsgoalBaseTablePagination'
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
<script setup>
|
|
17
|
+
/* setup模板
|
|
18
|
+
---------------------------------------------------------------- */
|
|
19
|
+
import { ref, computed } from 'vue'
|
|
20
|
+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
21
|
+
// props
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
/**
|
|
24
|
+
* 当前页数
|
|
25
|
+
*/
|
|
26
|
+
currentPage: {
|
|
27
|
+
type: [Number],
|
|
28
|
+
default: 1
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* 可选页数集合
|
|
32
|
+
*/
|
|
33
|
+
pageSizes: {
|
|
34
|
+
type: [Array],
|
|
35
|
+
default: () => [10, 20, 30, 40, 50, 100]
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* 每页显示条目个数
|
|
39
|
+
*/
|
|
40
|
+
pageSize: {
|
|
41
|
+
type: [Number],
|
|
42
|
+
default: 10
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* 总条目
|
|
46
|
+
*/
|
|
47
|
+
total: {
|
|
48
|
+
type: [Number],
|
|
49
|
+
default: 0
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const emits = defineEmits(['on-size-change', 'on-current-change'])
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @Author: canlong.shen
|
|
57
|
+
* @description: page-size 改变时触发
|
|
58
|
+
* @default:
|
|
59
|
+
* @return {*}
|
|
60
|
+
*/
|
|
61
|
+
const triggerSizeChange = (size = 0) => {
|
|
62
|
+
emits('on-size-change', size)
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @Author: canlong.shen
|
|
66
|
+
* @description: current-change
|
|
67
|
+
* @default:
|
|
68
|
+
* @return {*}
|
|
69
|
+
*/
|
|
70
|
+
const triggerCurrentChange = (current = 1) => {
|
|
71
|
+
emits('on-current-change', current)
|
|
72
|
+
}
|
|
73
|
+
const page = ref(1)
|
|
74
|
+
</script>
|
|
75
|
+
<template>
|
|
76
|
+
<div class="bsgoal-base-table-pagination">
|
|
77
|
+
<div class="base_table_pagination">
|
|
78
|
+
<el-config-provider :locale="zhCn">
|
|
79
|
+
<el-pagination
|
|
80
|
+
background
|
|
81
|
+
layout="total, sizes, prev, pager, next, jumper"
|
|
82
|
+
v-model:current-page="page"
|
|
83
|
+
:page-sizes="pageSizes"
|
|
84
|
+
:page-size="pageSize"
|
|
85
|
+
:total="total"
|
|
86
|
+
@size-change="triggerSizeChange"
|
|
87
|
+
@current-change="triggerCurrentChange"
|
|
88
|
+
>
|
|
89
|
+
<template v-slot:next>
|
|
90
|
+
<span>总数</span>
|
|
91
|
+
</template>
|
|
92
|
+
</el-pagination>
|
|
93
|
+
</el-config-provider>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</template>
|
|
97
|
+
<style lang="scss">
|
|
98
|
+
/* 覆盖样式
|
|
99
|
+
---------------------------------------------------------------- */
|
|
100
|
+
.bsgoal-base-table-pagination {
|
|
101
|
+
text-align: right;
|
|
102
|
+
.base_table_pagination {
|
|
103
|
+
display: inline-block;
|
|
104
|
+
margin-top: 16px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-04-21 08:43:39
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-04-21 18:03:30
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-tree\demo.vue
|
|
7
|
+
* @Description: 左侧树的演示
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'BsgoalBaseTreeDemo'
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
<script setup>
|
|
17
|
+
/* setup模板
|
|
18
|
+
---------------------------------------------------------------- */
|
|
19
|
+
import BsgoalBaseTree from './index.vue'
|
|
20
|
+
|
|
21
|
+
import { ref } from 'vue'
|
|
22
|
+
// props
|
|
23
|
+
const props = defineProps({})
|
|
24
|
+
|
|
25
|
+
const treeData = ref([])
|
|
26
|
+
const getKey = (prefix, id) => {
|
|
27
|
+
return `${prefix}-${id}`
|
|
28
|
+
}
|
|
29
|
+
const createData = (maxDeep, maxChildren, minNodesNumber, deep = 1, key = 'node') => {
|
|
30
|
+
let id = 0
|
|
31
|
+
return Array.from({ length: minNodesNumber })
|
|
32
|
+
.fill(deep)
|
|
33
|
+
.map(() => {
|
|
34
|
+
const childrenNumber = deep === maxDeep ? 0 : Math.round(Math.random() * maxChildren)
|
|
35
|
+
const nodeKey = getKey(key, ++id)
|
|
36
|
+
return {
|
|
37
|
+
id: nodeKey,
|
|
38
|
+
value: nodeKey,
|
|
39
|
+
label: nodeKey,
|
|
40
|
+
children: childrenNumber
|
|
41
|
+
? createData(maxDeep, maxChildren, childrenNumber, deep + 1, nodeKey)
|
|
42
|
+
: undefined
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
treeData.value = createData(4, 4, 4)
|
|
47
|
+
|
|
48
|
+
const triggerTreeClick = (value,node,treeNode,event ) => {
|
|
49
|
+
console.log('value', value)
|
|
50
|
+
console.log('node', node)
|
|
51
|
+
console.log('treeNode', treeNode)
|
|
52
|
+
console.log('event', event)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const treeLazyLoad = (node) => {
|
|
56
|
+
console.log('treeLazyLoad', node)
|
|
57
|
+
return new Promise((resove, reject) => {
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
resove([
|
|
60
|
+
{
|
|
61
|
+
label: 'label2-1',
|
|
62
|
+
isLeaf: true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'label2-2',
|
|
66
|
+
children: [
|
|
67
|
+
{
|
|
68
|
+
label: 'label2-2-1'
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: 'label2-3'
|
|
74
|
+
}
|
|
75
|
+
])
|
|
76
|
+
}, 1000)
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const treeInitNode = (node) => {
|
|
81
|
+
console.log('treeInitNode', node)
|
|
82
|
+
|
|
83
|
+
return new Promise((resolve, reject) => {
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
resolve([
|
|
86
|
+
{
|
|
87
|
+
value: 'value1',
|
|
88
|
+
label: 'label1'
|
|
89
|
+
}
|
|
90
|
+
])
|
|
91
|
+
}, 1000)
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
<template>
|
|
96
|
+
<div class="bsgoal-base-tree-demo">
|
|
97
|
+
<div class="base_tree_demo">
|
|
98
|
+
<BsgoalBaseTree
|
|
99
|
+
:lazy-load="treeLazyLoad"
|
|
100
|
+
:init-node="treeInitNode"
|
|
101
|
+
@on-click="triggerTreeClick"
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
<style lang="scss" scoped>
|
|
107
|
+
/* 自定义样式
|
|
108
|
+
---------------------------------------------------------------- */
|
|
109
|
+
</style>
|
|
110
|
+
<style lang="scss">
|
|
111
|
+
/* 覆盖样式
|
|
112
|
+
---------------------------------------------------------------- */
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-04-21 08:43:33
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-04-25 09:10:35
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-tree\index.vue
|
|
7
|
+
* @Description: 虚拟化树型结构 公共组件
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'BsgoalBaseTree'
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
<script setup>
|
|
16
|
+
/* setup模板
|
|
17
|
+
---------------------------------------------------------------- */
|
|
18
|
+
import { ref, watch } from 'vue'
|
|
19
|
+
import directiveBase from '../../directives/directiveBase.js'
|
|
20
|
+
import BsgoalBaseLine from '../bsgoal-base-line/index.vue'
|
|
21
|
+
import BsgoalBaseTreeFold from '../bsgoal-base-tree-fold/index.vue'
|
|
22
|
+
// props
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
/**
|
|
25
|
+
* 树结构 的下边距
|
|
26
|
+
*/
|
|
27
|
+
gasket: {
|
|
28
|
+
type: [String, Number],
|
|
29
|
+
default: 10
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* 数据
|
|
33
|
+
*/
|
|
34
|
+
data: {
|
|
35
|
+
type: [Object, Array],
|
|
36
|
+
default: () => []
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* 配置
|
|
40
|
+
*/
|
|
41
|
+
treeProps: {
|
|
42
|
+
type: [Object],
|
|
43
|
+
default: () => ({
|
|
44
|
+
label: 'label',
|
|
45
|
+
children: 'children',
|
|
46
|
+
disabled: 'disabled',
|
|
47
|
+
isLeaf: 'isLeaf',
|
|
48
|
+
class: 'class'
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* 懒加载数据方法
|
|
53
|
+
* () => {
|
|
54
|
+
* return Promise(resolve => resolve([]))
|
|
55
|
+
* }
|
|
56
|
+
*/
|
|
57
|
+
lazyLoad: {
|
|
58
|
+
type: [Function],
|
|
59
|
+
default: () => {}
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* 初始化树节点
|
|
63
|
+
* () => {
|
|
64
|
+
* return Promise(resolve => resolve([]))
|
|
65
|
+
* }
|
|
66
|
+
*/
|
|
67
|
+
initNode: {
|
|
68
|
+
type: [Function],
|
|
69
|
+
default: () => {}
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const emits = defineEmits(['on-click'])
|
|
74
|
+
|
|
75
|
+
// 计算高度的指令
|
|
76
|
+
const vHeight = directiveBase.height
|
|
77
|
+
|
|
78
|
+
const filterText = ref('')
|
|
79
|
+
const EL_TREE_REF = ref(null)
|
|
80
|
+
|
|
81
|
+
watch(filterText, (val) => {
|
|
82
|
+
EL_TREE_REF.value.filter(val)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @Author: canlong.shen
|
|
87
|
+
* @description: 过滤节点
|
|
88
|
+
* @param {*} value
|
|
89
|
+
* @param {*} data
|
|
90
|
+
* @default:
|
|
91
|
+
* @return {*}
|
|
92
|
+
*/
|
|
93
|
+
const filterNode = (value, data) => {
|
|
94
|
+
if (!value) return true
|
|
95
|
+
return data.label.includes(value)
|
|
96
|
+
}
|
|
97
|
+
// 折叠的状态
|
|
98
|
+
const foldStatus = ref(true)
|
|
99
|
+
/**
|
|
100
|
+
* @Author: canlong.shen
|
|
101
|
+
* @description: 当节点被点击的时候触发
|
|
102
|
+
* @param {*} value 节点点击的节点对象
|
|
103
|
+
* @param {*} node TreeNode 的 node 属性
|
|
104
|
+
* @param {*} TreeNode TreeNode
|
|
105
|
+
* @param {*} event 事件对象
|
|
106
|
+
* @default:
|
|
107
|
+
* @return {*}
|
|
108
|
+
*/
|
|
109
|
+
const clickNodeTree = (value, node, treeNode, event) => {
|
|
110
|
+
emits('on-click', value, node, treeNode, event)
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @Author: canlong.shen
|
|
114
|
+
* @description: 懒加载数据
|
|
115
|
+
* @param {*} node
|
|
116
|
+
* @param {*} resolve
|
|
117
|
+
* @default:
|
|
118
|
+
* @return {*}
|
|
119
|
+
*/
|
|
120
|
+
const loadNode = async (node, resolve, props) => {
|
|
121
|
+
// console.log('props',props);
|
|
122
|
+
if (node.level === 0) {
|
|
123
|
+
const initNodeData = await props.initNode(node)
|
|
124
|
+
// console.log('initNodeData',initNodeData);
|
|
125
|
+
return resolve(initNodeData || [])
|
|
126
|
+
} else {
|
|
127
|
+
const lazyNodeData = await props.lazyLoad(node)
|
|
128
|
+
// console.log('lazyNodeData',lazyNodeData);
|
|
129
|
+
resolve(lazyNodeData || [])
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</script>
|
|
133
|
+
<template>
|
|
134
|
+
<div class="bsgoal-base-tree">
|
|
135
|
+
<div class="base_tree" v-height="gasket">
|
|
136
|
+
<div v-show="foldStatus" class="base_tree_main">
|
|
137
|
+
<!-- S 查询 -->
|
|
138
|
+
<el-input v-model="filterText" class="base_tree_main_input" placeholder="输入关键字过滤" />
|
|
139
|
+
<!-- E 查询 -->
|
|
140
|
+
<!-- S 树结构 -->
|
|
141
|
+
<el-tree
|
|
142
|
+
ref="EL_TREE_REF"
|
|
143
|
+
lazy
|
|
144
|
+
highlight-current
|
|
145
|
+
empty-text="暂无数据"
|
|
146
|
+
:load="(node, resolve) => loadNode(node, resolve, props)"
|
|
147
|
+
:expand-on-click-node="false"
|
|
148
|
+
:props="treeProps"
|
|
149
|
+
:filter-node-method="filterNode"
|
|
150
|
+
@node-click="clickNodeTree"
|
|
151
|
+
/>
|
|
152
|
+
<!-- E 树结构 -->
|
|
153
|
+
</div>
|
|
154
|
+
<!-- S 横线 -->
|
|
155
|
+
<BsgoalBaseLine vertical v-show="foldStatus" />
|
|
156
|
+
<!-- E 横线 -->
|
|
157
|
+
<!-- S 折叠按钮 -->
|
|
158
|
+
<BsgoalBaseTreeFold v-model="foldStatus" />
|
|
159
|
+
<!-- E 折叠按钮 -->
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
163
|
+
<style lang="scss">
|
|
164
|
+
/* 覆盖样式
|
|
165
|
+
---------------------------------------------------------------- */
|
|
166
|
+
|
|
167
|
+
.bsgoal-base-tree {
|
|
168
|
+
display: inline-block;
|
|
169
|
+
.base_tree {
|
|
170
|
+
display: flex;
|
|
171
|
+
box-sizing: border-box;
|
|
172
|
+
position: relative;
|
|
173
|
+
min-width: 14px;
|
|
174
|
+
}
|
|
175
|
+
.base_tree_main {
|
|
176
|
+
width: 221px;
|
|
177
|
+
padding: 16px;
|
|
178
|
+
|
|
179
|
+
// 隐藏掉滚动条
|
|
180
|
+
scrollbar-width: none; /* firefox */
|
|
181
|
+
-ms-overflow-style: none; /* IE 10+ */
|
|
182
|
+
overflow-x: hidden;
|
|
183
|
+
overflow-y: auto;
|
|
184
|
+
/*滚动条样式*/
|
|
185
|
+
&::-webkit-scrollbar {
|
|
186
|
+
width: 6px;
|
|
187
|
+
height: 6px;
|
|
188
|
+
}
|
|
189
|
+
&::-webkit-scrollbar-thumb {
|
|
190
|
+
border-radius: 10px;
|
|
191
|
+
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
|
192
|
+
// -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
|
193
|
+
background: rgba(0, 0, 0, 0.2);
|
|
194
|
+
width: 20px;
|
|
195
|
+
}
|
|
196
|
+
&::-webkit-scrollbar-track {
|
|
197
|
+
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
|
198
|
+
// -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
|
199
|
+
// border-radius: 0;
|
|
200
|
+
// background: rgba(0, 0, 0, 0.1);
|
|
201
|
+
// opacity: 0.1;
|
|
202
|
+
background-color: #fff;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
.base_tree_main_input {
|
|
206
|
+
margin-bottom: 10px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.base_tree .el-tree-node__content > i.el-tree-node__expand-icon {
|
|
210
|
+
padding-left: 0px;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-04-21 14:30:43
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-04-25 09:11:19
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-tree-fold\index.vue
|
|
7
|
+
* @Description: 树结构折叠按钮
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'BsgoalBaseTreeFold'
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
<script setup>
|
|
17
|
+
/* setup模板
|
|
18
|
+
---------------------------------------------------------------- */
|
|
19
|
+
import { ref } from 'vue'
|
|
20
|
+
import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'
|
|
21
|
+
|
|
22
|
+
defineProps(['modelValue'])
|
|
23
|
+
const emits = defineEmits(['update:modelValue'])
|
|
24
|
+
|
|
25
|
+
let status = ref(true)
|
|
26
|
+
const triggerFold = () => {
|
|
27
|
+
status.value = !status.value
|
|
28
|
+
emits('update:modelValue', status.value)
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
<template>
|
|
32
|
+
<div class="bsgoal-base-tree-fold">
|
|
33
|
+
<div class="base_tree_fold" :class="{ 'base_tree_fold--hide': !status }" @click="triggerFold">
|
|
34
|
+
<el-icon color="#fff"
|
|
35
|
+
><ArrowLeft v-show="status" />
|
|
36
|
+
<ArrowRight v-show="!status" />
|
|
37
|
+
</el-icon>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
<style lang="scss">
|
|
42
|
+
/* 覆盖样式
|
|
43
|
+
---------------------------------------------------------------- */
|
|
44
|
+
.bsgoal-base-tree-fold {
|
|
45
|
+
.base_tree_fold {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 0;
|
|
48
|
+
bottom: 0;
|
|
49
|
+
right: 10px;
|
|
50
|
+
margin: auto;
|
|
51
|
+
width: 14px;
|
|
52
|
+
height: 38px;
|
|
53
|
+
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
|
|
58
|
+
border-radius: 10px;
|
|
59
|
+
background-color: #409eff;
|
|
60
|
+
}
|
|
61
|
+
.base_tree_fold--hide {
|
|
62
|
+
right: 0px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-04-10 13:41:13
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-04-15 11:20:10
|
|
6
|
+
* @FilePath: \common\src\components\layout\layout-home.vue
|
|
7
|
+
* @Description: 首页
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="layout-home">
|
|
13
|
+
<el-container>
|
|
14
|
+
<el-header class="layout_el_header">
|
|
15
|
+
<LayoutTopHeader />
|
|
16
|
+
</el-header>
|
|
17
|
+
<el-container>
|
|
18
|
+
<el-aside width="200px">
|
|
19
|
+
<LayoutLeftMenu />
|
|
20
|
+
</el-aside>
|
|
21
|
+
<el-main style="padding:10px; background-color:#f0f2f5 ;">
|
|
22
|
+
<LayoutRightContainer style="background-color: #fff;">
|
|
23
|
+
<router-view />
|
|
24
|
+
</LayoutRightContainer>
|
|
25
|
+
</el-main>
|
|
26
|
+
</el-container>
|
|
27
|
+
</el-container>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
<script>
|
|
31
|
+
export default {
|
|
32
|
+
name: 'LayoutHome'
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
<script setup>
|
|
36
|
+
/* setup模板
|
|
37
|
+
---------------------------------------------------------------- */
|
|
38
|
+
import LayoutLeftMenu from '@/components/layout/layout-left-menu.vue'
|
|
39
|
+
import LayoutTopHeader from '@/components/layout/layout-top-header.vue'
|
|
40
|
+
import LayoutRightContainer from '@/components/layout/layout-right-container.vue'
|
|
41
|
+
</script>
|
|
42
|
+
<style lang="scss" scoped>
|
|
43
|
+
/* 自定义样式
|
|
44
|
+
---------------------------------------------------------------- */
|
|
45
|
+
.layout-home {
|
|
46
|
+
position: fixed;
|
|
47
|
+
top: 0;
|
|
48
|
+
bottom: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
right: 0;
|
|
51
|
+
}
|
|
52
|
+
.layout_el_header {
|
|
53
|
+
background-color: #409eff;
|
|
54
|
+
padding: 0px;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
57
|
+
<style lang="scss">
|
|
58
|
+
/* 覆盖样式
|
|
59
|
+
---------------------------------------------------------------- */
|
|
60
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-04-10 14:05:59
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-04-19 09:27:42
|
|
6
|
+
* @FilePath: \common\src\components\layout\layout-left-menu.vue
|
|
7
|
+
* @Description: 左侧菜单栏
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="layout-left-menu">
|
|
13
|
+
<el-menu default-active="0" style="height: calc(100vh - 60px) ;">
|
|
14
|
+
<template v-for=" (menu, index) of menuList" :key="index">
|
|
15
|
+
<el-menu-item :index="index">
|
|
16
|
+
<el-icon><icon-menu /></el-icon>
|
|
17
|
+
<router-link :to="menu.path">
|
|
18
|
+
<span>{{ menu.name }}</span>
|
|
19
|
+
</router-link>
|
|
20
|
+
</el-menu-item>
|
|
21
|
+
</template>
|
|
22
|
+
</el-menu>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
<script>
|
|
26
|
+
export default {
|
|
27
|
+
name: 'LayoutLeftMenu'
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
<script setup>
|
|
31
|
+
/* setup模板
|
|
32
|
+
---------------------------------------------------------------- */
|
|
33
|
+
import { Menu as IconMenu } from '@element-plus/icons-vue'
|
|
34
|
+
import { ref, computed, toRefs, watch, unref } from 'vue'
|
|
35
|
+
import { useRouter } from 'vue-router'
|
|
36
|
+
const router = useRouter()
|
|
37
|
+
const routes = router.getRoutes()
|
|
38
|
+
const { children = [] } = routes.find((fi) => fi.name === 'home') || {}
|
|
39
|
+
const menuList = ref(children)
|
|
40
|
+
</script>
|
|
41
|
+
<style lang="scss" scoped>
|
|
42
|
+
/* 自定义样式
|
|
43
|
+
---------------------------------------------------------------- */
|
|
44
|
+
</style>
|
|
45
|
+
<style lang="scss">
|
|
46
|
+
/* 覆盖样式
|
|
47
|
+
---------------------------------------------------------------- */
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-04-10 14:12:09
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-04-13 17:49:15
|
|
6
|
+
* @FilePath: \common\src\components\layout\layout-right-container.vue
|
|
7
|
+
* @Description: 主体内容容器
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="layout-right-container">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'LayoutRightContainer'
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
<script setup>
|
|
22
|
+
/* setup模板
|
|
23
|
+
---------------------------------------------------------------- */
|
|
24
|
+
import { ref, computed, toRefs, watch, unref } from 'vue'
|
|
25
|
+
</script>
|
|
26
|
+
<style lang="scss" scoped>
|
|
27
|
+
/* 自定义样式
|
|
28
|
+
---------------------------------------------------------------- */
|
|
29
|
+
.layout-right-container {
|
|
30
|
+
height: 100%;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
33
|
+
<style lang="scss">
|
|
34
|
+
/* 覆盖样式
|
|
35
|
+
---------------------------------------------------------------- */
|
|
36
|
+
</style>
|