@bsgoal/common 2.9.1 → 2.10.0

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/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.base_tooltip_popper{max-width:20em}.bsgoal-base-form .base_form .el-form-item{margin-right:10px}.bsgoal-base-form .base_form div.el-input,.bsgoal-base-form .base_form div.el-select{width:100%}.bsgoal-base-form .base_form--visible{width:0px;height:0px;overflow:hidden}.bsgoal-base-table-pagination{text-align:right}.bsgoal-base-table-pagination .base_table_pagination{display:inline-block;margin-top:16px}.bsgoal-base-table-empty .base_table_empty{text-align:center}.bsgoal-base-table-empty .base_table_empty_img{padding-top:16px;line-height:initial}.bsgoal-base-table-empty .base_table_empty_text{display:inline-block}.bsgoal-base-table .base_table{padding:16px}.bsgoal-base-table .base_table_menu{margin-bottom:8px}.bsgoal-base-table .el-table__body-wrapper{overflow-y:hidden!important}.bsgoal-base-table .el-scrollbar__view{height:100%}.bsgoal-base-line .base_line{height:10px;background-color:#f0f2f5}.bsgoal-base-line .bsgoal-base-line__vertical{display:inline-block;height:100%}.bsgoal-base-line .base_line__vertical{width:10px;height:100%}.bsgoal-base-search-operation{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bsgoal-base-search-operation .operation_fold{margin-left:12px;cursor:pointer;min-width:3em}.bsgoal-base-cascader{width:100%}.bsgoal-base-cascader .base_cascader{width:inherit}.bsgoal-base-search .base_search{padding:16px 6px 8px 16px}.bsgoal-base-search .base_search .el-form-item{margin-bottom:8px;margin-right:10px}.bsgoal-base-search .base_search div.el-input,.bsgoal-base-search .base_search div.el-select{width:100%}.bsgoal-base-tree-fold .base_tree_fold{position:absolute;top:0;bottom:0;right:10px;margin:auto;width:14px;height:38px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:10px;background-color:#409eff}.bsgoal-base-tree-fold .base_tree_fold--hide{right:0px}.bsgoal-base-tree{display:inline-block}.bsgoal-base-tree .base_tree{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;min-width:14px}.bsgoal-base-tree .base_tree_main{width:221px;padding:16px;scrollbar-width:none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar{width:6px;height:6px}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar-thumb{border-radius:10px;background:rgba(0,0,0,.2);width:20px}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar-track{background-color:#fff}.bsgoal-base-tree .base_tree_main_input{margin-bottom:10px}.bsgoal-base-tree .base_tree .el-tree-node__content>i.el-tree-node__expand-icon{padding-left:0}.bsgoal-base-button,.bsgoal-base-button .base_button{display:inline-block}.bsgoal-base-dialog .base_dialog_header{font-weight:500;color:#303133;font-size:16px}.bsgoal-base-dialog .bsgoal-dialog__footer--conceal .el-dialog__footer{display:none}.bsgoal-base-dialog .el-dialog__footer{height:initial;line-height:initial}.bsgoal-base-dialog .el-dialog__footer .el-button{margin-left:initial}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__header{padding:16px 30px;margin-right:0;background-color:#f5f7fa;height:initial!important}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__header .el-dialog__headerbtn{top:0px;right:8px}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__body{padding:0}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content{padding:30px}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content--form{padding:0 0 0 30px}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content--form .bsgoal-base-form .base_form{padding:initial;padding-top:16px}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content--blank{padding-top:0}.bsgoal-base-dialog .base_dialog_footer_cancel{margin-right:16px}.bsgoal-base-tabs .base_tabs--fill{position:absolute;top:8px;bottom:0;left:16px;right:16px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.bsgoal-base-tabs .base_tabs--fill>div.el-tabs__content{-webkit-box-flex:1;-ms-flex:1;flex:1;position:relative}.bsgoal-base-alert .el-alert,.bsgoal-base-item .base_item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bsgoal-base-item .base_item_label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:14px;color:#606266;height:32px;line-height:32px;padding-right:12px}
1
+ @charset "UTF-8";.base_tooltip_popper{max-width:20em}.bsgoal-base-form .base_form .el-form-item{margin-right:10px}.bsgoal-base-form .base_form div.el-input,.bsgoal-base-form .base_form div.el-select{width:100%}.bsgoal-base-form .base_form--visible{width:0px;height:0px;overflow:hidden}.bsgoal-base-table-pagination{text-align:right}.bsgoal-base-table-pagination .base_table_pagination{display:inline-block;margin-top:16px}.bsgoal-base-table-empty .base_table_empty{text-align:center}.bsgoal-base-table-empty .base_table_empty_img{padding-top:16px;line-height:initial}.bsgoal-base-table-empty .base_table_empty_text{display:inline-block}.bsgoal-base-table .base_table{padding:16px}.bsgoal-base-table .base_table_menu{margin-bottom:8px}.bsgoal-base-table .el-table__body-wrapper{overflow-y:hidden!important}.bsgoal-base-table .el-scrollbar__view{height:100%}.bsgoal-base-table .base_table--tree{margin-top:10px}.bsgoal-base-line .base_line{height:10px;background-color:#f0f2f5}.bsgoal-base-line .bsgoal-base-line__vertical{display:inline-block;height:100%}.bsgoal-base-line .base_line__vertical{width:10px;height:100%}.bsgoal-base-line .bsgoal-base-line__fill{position:absolute;left:0;right:0}.bsgoal-base-search-operation{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bsgoal-base-search-operation .operation_fold{margin-left:12px;cursor:pointer;min-width:3em}.bsgoal-base-cascader{width:100%}.bsgoal-base-cascader .base_cascader{width:inherit}.bsgoal-base-search .base_search{padding:16px 6px 8px 16px}.bsgoal-base-search .base_search .el-form-item{margin-bottom:8px;margin-right:10px}.bsgoal-base-search .base_search div.el-input,.bsgoal-base-search .base_search div.el-select{width:100%}.bsgoal-base-tree-fold .base_tree_fold{position:absolute;top:0;bottom:0;right:10px;margin:auto;width:14px;height:38px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:10px;background-color:#409eff}.bsgoal-base-tree-fold .base_tree_fold--hide{right:0px}.bsgoal-base-tree{display:inline-block}.bsgoal-base-tree .base_tree{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;min-width:14px}.bsgoal-base-tree .base_tree_main{width:221px;padding:16px;scrollbar-width:none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar{width:6px;height:6px}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar-thumb{border-radius:10px;background:rgba(0,0,0,.2);width:20px}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar-track{background-color:#fff}.bsgoal-base-tree .base_tree_main_input{margin-bottom:10px}.bsgoal-base-tree .base_tree .el-tree-node__content>i.el-tree-node__expand-icon{padding-left:0}.bsgoal-base-button,.bsgoal-base-button .base_button{display:inline-block}.bsgoal-base-dialog .base_dialog_header{font-weight:500;color:#303133;font-size:16px}.bsgoal-base-dialog .bsgoal-dialog__footer--conceal .el-dialog__footer{display:none}.bsgoal-base-dialog .el-dialog__footer{height:initial;line-height:initial}.bsgoal-base-dialog .el-dialog__footer .el-button{margin-left:initial}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__header{padding:16px 30px;margin-right:0;background-color:#f5f7fa;height:initial!important}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__header .el-dialog__headerbtn{top:0px;right:8px}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__body{padding:0}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content{padding:30px}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content--form{padding:0 0 0 30px}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content--form .bsgoal-base-form .base_form{padding:initial;padding-top:16px}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content--blank{padding-top:0}.bsgoal-base-dialog .base_dialog_footer_cancel{margin-right:16px}.bsgoal-base-tabs .base_tabs--fill{position:absolute;top:8px;bottom:0;left:16px;right:16px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.bsgoal-base-tabs .base_tabs--fill>div.el-tabs__content{-webkit-box-flex:1;-ms-flex:1;flex:1;position:relative}.bsgoal-base-alert .el-alert,.bsgoal-base-item .base_item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bsgoal-base-item .base_item_label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:14px;color:#606266;height:32px;line-height:32px;padding-right:12px}.bsgoal-base-tree-table .base_tree_table{display:-webkit-box;display:-ms-flexbox;display:flex}.bsgoal-base-tree-table .base_tree_table--table{overflow:hidden}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsgoal/common",
3
- "version": "2.9.1",
3
+ "version": "2.10.0",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-13 17:12:43
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-26 15:59:36
5
+ * @LastEditTime: 2023-06-20 19:14:29
6
6
  * @FilePath: \common\src\components\bsgoal-base-line\index.vue
7
7
  * @Description: 分割线公共组件
8
8
  *
@@ -11,7 +11,7 @@
11
11
  <script setup>
12
12
  /* setup模板
13
13
  ---------------------------------------------------------------- */
14
- import { ref } from 'vue'
14
+ import { ref, inject, watchEffect } from 'vue'
15
15
 
16
16
  defineOptions({
17
17
  name: 'BsgoalBaseLine'
@@ -26,10 +26,21 @@ const props = defineProps({
26
26
  default: false
27
27
  }
28
28
  })
29
+
30
+ // ---> S 左侧机构树折叠状态 <---
31
+ const TREE_SWITCH_STATUS = inject('TREE_SWITCH_STATUS')
32
+ // ---> E 左侧机构树折叠状态 <---
29
33
  </script>
34
+
30
35
  <template>
31
36
  <div class="bsgoal-base-line" :class="{ 'bsgoal-base-line__vertical': vertical }">
32
- <div class="base_line" :class="{ base_line__vertical: vertical }"></div>
37
+ <div
38
+ class="base_line"
39
+ :class="{
40
+ 'base_line__vertical': vertical,
41
+ 'bsgoal-base-line__fill': TREE_SWITCH_STATUS === false
42
+ }"
43
+ ></div>
33
44
  </div>
34
45
  </template>
35
46
  <style lang="scss">
@@ -49,5 +60,11 @@ const props = defineProps({
49
60
  width: 10px;
50
61
  height: 100%;
51
62
  }
63
+
64
+ .bsgoal-base-line__fill {
65
+ position: absolute;
66
+ left: 0;
67
+ right: 0;
68
+ }
52
69
  }
53
70
  </style>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-13 09:38:11
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-18 15:53:40
5
+ * @LastEditTime: 2023-06-20 19:03:02
6
6
  * @FilePath: \common\src\components\bsgoal-base-search\index.vue
7
7
  * @Description: 表格查询 公共组件
8
8
  *
@@ -271,6 +271,7 @@ const triggerValueChange = (type, prop) => {
271
271
  emits('on-change', emitValue)
272
272
  }
273
273
 
274
+
274
275
  // ---> S 暴露 <---
275
276
  defineExpose({
276
277
  triggerOperationSearch
@@ -303,7 +304,9 @@ defineExpose({
303
304
  :key="index"
304
305
  >
305
306
  <el-col
306
- v-show="index < 7 || type === ComponentTypeEnums.OPERATION || (index >= 7 && foldStatus)"
307
+ v-show="
308
+ index < 7 || type === ComponentTypeEnums.OPERATION || (index >= 7 && foldStatus)
309
+ "
307
310
  :xs="24"
308
311
  :sm="12"
309
312
  :md="medium"
@@ -388,9 +391,12 @@ defineExpose({
388
391
  <!-- / 日期选择器 -->
389
392
  <template
390
393
  v-if="
391
- [ComponentTypeEnums.DATE, ComponentTypeEnums.MONTH, ComponentTypeEnums.YEAR, ComponentTypeEnums.DATE_TIME].includes(
392
- type
393
- )
394
+ [
395
+ ComponentTypeEnums.DATE,
396
+ ComponentTypeEnums.MONTH,
397
+ ComponentTypeEnums.YEAR,
398
+ ComponentTypeEnums.DATE_TIME
399
+ ].includes(type)
394
400
  "
395
401
  >
396
402
  <el-date-picker
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-18 17:04:53
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-18 18:26:57
5
+ * @LastEditTime: 2023-06-19 18:20:59
6
6
  * @FilePath: \common\src\components\bsgoal-base-search-table\demo.vue
7
7
  * @Description: 查询 + 表格 组合公共组件
8
8
  *
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-10 11:29:04
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-19 17:51:57
5
+ * @LastEditTime: 2023-06-20 19:21:34
6
6
  * @FilePath: \common\src\components\bsgoal-base-table\index.vue
7
7
  * @Description:
8
8
  *
@@ -164,9 +164,6 @@ watchEffect(() => {
164
164
  }
165
165
  })
166
166
 
167
-
168
-
169
-
170
167
  // 触发搜索
171
168
  const mapPropsVal = unref(props.mapProps)
172
169
  const mapPropsFuse = {
@@ -182,7 +179,7 @@ const pageSize = ref(10)
182
179
  const total = ref(0)
183
180
  const searchParams = ref({})
184
181
  const tableLoading = ref(props.loading)
185
- const tableData = ref()
182
+ const tableData = ref()
186
183
  const resData = ref({})
187
184
  const ping = () => {
188
185
  const { fetch, call, hasPage } = props
@@ -199,9 +196,8 @@ const ping = () => {
199
196
  useFetch(fetch(fetchParams), call, tableLoading, resData)
200
197
  }
201
198
 
202
-
203
199
  watchEffect(() => {
204
- tableData.value = props.data
200
+ tableData.value = props.data
205
201
  })
206
202
 
207
203
  watch(resData, (data) => {
@@ -233,6 +229,10 @@ watch([currentPage, pageSize], () => {
233
229
  ping()
234
230
  })
235
231
 
232
+ // ---> S 左侧机构树折叠状态 <---
233
+ const TREE_SWITCH_STATUS = inject('TREE_SWITCH_STATUS')
234
+ // ---> E 左侧机构树折叠状态 <---
235
+
236
236
  // 暴露的属性
237
237
  defineExpose({
238
238
  refreshList
@@ -241,7 +241,7 @@ defineExpose({
241
241
 
242
242
  <template>
243
243
  <div class="bsgoal-base-table">
244
- <div class="base_table">
244
+ <div class="base_table" :class="{ 'base_table--tree': TREE_SWITCH_STATUS === false }">
245
245
  <!-- S 表头操作区域 -->
246
246
  <div class="base_table_menu" v-if="$slots.menu">
247
247
  <slot name="menu"></slot>
@@ -337,5 +337,8 @@ defineExpose({
337
337
  .el-scrollbar__view {
338
338
  height: 100%;
339
339
  }
340
+ .base_table--tree {
341
+ margin-top: 10px;
342
+ }
340
343
  }
341
344
  </style>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-15 16:34:57
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-04-25 13:50:40
5
+ * @LastEditTime: 2023-06-20 19:34:36
6
6
  * @FilePath: \common\src\components\bsgoal-base-table-pagination\index.vue
7
7
  * @Description: 表格的分页按钮
8
8
  *
@@ -11,7 +11,7 @@
11
11
  <script setup>
12
12
  /* setup模板
13
13
  ---------------------------------------------------------------- */
14
- import { ref, computed } from 'vue'
14
+ import { ref, computed, inject, unref } from 'vue'
15
15
  import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
16
16
 
17
17
  defineOptions({
@@ -70,6 +70,17 @@ const triggerCurrentChange = (current = 1) => {
70
70
  emits('on-current-change', current)
71
71
  }
72
72
  const page = ref(1)
73
+
74
+ const injectPageSize = inject('PAGINATION_PAGE_SIZE')
75
+ console.log('injectPageSize',injectPageSize);
76
+ // ---> S pageSize 值注入 <---
77
+ const pageSizeValueGet = computed(() => {
78
+ if (injectPageSize) {
79
+ return unref(injectPageSize)
80
+ }
81
+ return props.pageSize
82
+ })
83
+ // ---> E pageSize 值注入 <---
73
84
  </script>
74
85
  <template>
75
86
  <div class="bsgoal-base-table-pagination">
@@ -80,7 +91,7 @@ const page = ref(1)
80
91
  layout="total, sizes, prev, pager, next, jumper"
81
92
  v-model:current-page="page"
82
93
  :page-sizes="pageSizes"
83
- :page-size="pageSize"
94
+ :page-size="pageSizeValueGet"
84
95
  :total="total"
85
96
  @size-change="triggerSizeChange"
86
97
  @current-change="triggerCurrentChange"
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-21 08:43:39
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-04-21 18:03:30
5
+ * @LastEditTime: 2023-06-19 15:21:32
6
6
  * @FilePath: \common\src\components\bsgoal-base-tree\demo.vue
7
7
  * @Description: 左侧树的演示
8
8
  *
@@ -44,7 +44,7 @@ const createData = (maxDeep, maxChildren, minNodesNumber, deep = 1, key = 'node'
44
44
  }
45
45
  treeData.value = createData(4, 4, 4)
46
46
 
47
- const triggerTreeClick = (value,node,treeNode,event ) => {
47
+ const triggerTreeClick = (value, node, treeNode, event) => {
48
48
  console.log('value', value)
49
49
  console.log('node', node)
50
50
  console.log('treeNode', treeNode)
@@ -99,6 +99,7 @@ const treeInitNode = (node) => {
99
99
  :init-node="treeInitNode"
100
100
  @on-click="triggerTreeClick"
101
101
  />
102
+
102
103
  </div>
103
104
  </div>
104
105
  </template>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-21 08:43:33
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-04-25 09:10:35
5
+ * @LastEditTime: 2023-06-20 18:21:46
6
6
  * @FilePath: \common\src\components\bsgoal-base-tree\index.vue
7
7
  * @Description: 虚拟化树型结构 公共组件
8
8
  *
@@ -10,7 +10,7 @@
10
10
  <script setup>
11
11
  /* setup模板
12
12
  ---------------------------------------------------------------- */
13
- import { ref, watch } from 'vue'
13
+ import { ref, watch, watchEffect } from 'vue'
14
14
  import directiveBase from '../../directives/directiveBase.js'
15
15
  import BsgoalBaseLine from '../bsgoal-base-line/index.vue'
16
16
  import BsgoalBaseTreeFold from '../bsgoal-base-tree-fold/index.vue'
@@ -69,7 +69,7 @@ const props = defineProps({
69
69
  }
70
70
  })
71
71
 
72
- const emits = defineEmits(['on-click'])
72
+ const emits = defineEmits(['on-click', 'on-switch'])
73
73
 
74
74
  // 计算高度的指令
75
75
  const vHeight = directiveBase.height
@@ -108,6 +108,11 @@ const foldStatus = ref(true)
108
108
  const clickNodeTree = (value, node, treeNode, event) => {
109
109
  emits('on-click', value, node, treeNode, event)
110
110
  }
111
+
112
+ watch(foldStatus, () => {
113
+ emits('on-switch', foldStatus.value)
114
+ })
115
+
111
116
  /**
112
117
  * @Author: canlong.shen
113
118
  * @description: 懒加载数据