@bsgoal/common 2.15.6 → 2.15.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsgoal/common",
3
- "version": "2.15.6",
3
+ "version": "2.15.8",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-23 16:35:24
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-31 11:44:23
5
+ * @LastEditTime: 2023-06-30 09:17:44
6
6
  * @FilePath: \common\src\components\bsgoal-base-dialog\demo.vue
7
7
  * @Description: 弹窗公共组件 演示
8
8
  *
@@ -53,10 +53,17 @@ const tabsConfigOptions = ref([
53
53
 
54
54
  const triggerConfirm = (done) => {
55
55
  setTimeout(() => {
56
- done()
56
+ done(false)
57
57
  }, 3000)
58
58
  console.log('关闭前')
59
59
  }
60
+
61
+ const triggerShow = (status = '') => {
62
+ console.log(status, '显示')
63
+ }
64
+ const triggerHide = (status = '') => {
65
+ console.log(status, '关闭')
66
+ }
60
67
  </script>
61
68
  <template>
62
69
  <div class="bsgoal-base-dialog-demo">
@@ -72,6 +79,8 @@ const triggerConfirm = (done) => {
72
79
  size="max"
73
80
  type="blank"
74
81
  @on-confirm="triggerConfirm"
82
+ @on-show="triggerShow"
83
+ @on-hide="triggerHide"
75
84
  >
76
85
  <BsgoalBaseTabs v-memo="activeTabName" :config-options="tabsConfigOptions" />
77
86
  </BsgoalBaseDialog>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-23 16:35:19
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-01 11:56:02
5
+ * @LastEditTime: 2023-06-30 09:13:34
6
6
  * @FilePath: \common\src\components\bsgoal-base-dialog\index.vue
7
7
  * @Description: 弹窗公共组件
8
8
  *
@@ -78,7 +78,7 @@ const props = defineProps({
78
78
  }
79
79
  })
80
80
 
81
- const emits = defineEmits(['update:modelValue', 'on-confirm'])
81
+ const emits = defineEmits(['update:modelValue', 'on-confirm','on-show','on-hide'])
82
82
  const dialogVisible = ref(props.modelValue.value)
83
83
 
84
84
  /**
@@ -97,8 +97,10 @@ const cancel = () => {
97
97
  * @return {*}
98
98
  */
99
99
  const confirm = (done = () => {}) => {
100
- emits('on-confirm', () => {
101
- dialogVisible.value = false
100
+ emits('on-confirm', (close = true) => {
101
+ if (close) {
102
+ dialogVisible.value = false
103
+ }
102
104
  done()
103
105
  })
104
106
  }
@@ -112,6 +114,11 @@ watch(
112
114
 
113
115
  watch(dialogVisible, (v) => {
114
116
  emits('update:modelValue', v)
117
+ if (v) {
118
+ emits('on-show', v)
119
+ } else {
120
+ emits('on-hide', v)
121
+ }
115
122
  })
116
123
 
117
124
  // 设置不同尺寸
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-10 15:00:00
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-26 09:20:07
5
+ * @LastEditTime: 2023-06-30 08:59:19
6
6
  * @FilePath: \common\src\components\bsgoal-base-form\demo.vue
7
7
  * @Description: 表单公共组件演示组件
8
8
  *
@@ -32,6 +32,9 @@ const confirm = () => {
32
32
  console.log('res', res)
33
33
  })
34
34
  }
35
+ const resetFields = () => {
36
+ BSGOAL_BASE_FORM_REF.value.resetFields()
37
+ }
35
38
 
36
39
  const bindModel = ref({ prop1: '111', prop99: 1, prop101: '否', prop102: '0', _prop104: '' })
37
40
 
@@ -265,6 +268,7 @@ const configOptions = ref([
265
268
  <template #_prop104> 6666 </template>
266
269
  </BsgoalBaseForm>
267
270
  <el-button type="primary" @click="confirm">提交</el-button>
271
+ <el-button type="primary" @click="resetFields">重置</el-button>
268
272
  </div>
269
273
  </template>
270
274
  <style lang="scss" scoped>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-17 11:44:29
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-26 11:56:55
5
+ * @LastEditTime: 2023-06-30 09:19:56
6
6
  * @FilePath: \common\src\components\bsgoal-base-form\index.vue
7
7
  * @Description: 表单公共组件
8
8
  *
@@ -340,7 +340,9 @@ const filterSlotProps = (model = {}) => {
340
340
  const rebuildModel = {}
341
341
  for (const prop of Object.keys(model)) {
342
342
  if (!prop.startsWith('_')) {
343
- rebuildModel[prop] = model[prop]
343
+ const value = model[prop]
344
+ const valueInt = Number.parseInt(value);
345
+ rebuildModel[prop] = valueInt || ['0', 0].includes(value) ? valueInt : value;
344
346
  }
345
347
  }
346
348
  return rebuildModel
@@ -406,7 +408,8 @@ const setActiveValueText = (range = [], type = '') => {
406
408
  defineExpose({
407
409
  triggerOperationClear,
408
410
  triggerOperationForm,
409
- validateForm
411
+ validateForm,
412
+ resetFields:triggerOperationClear
410
413
  })
411
414
  </script>
412
415
  <template>
@@ -440,7 +443,7 @@ defineExpose({
440
443
  limit = limits,
441
444
  length = 255,
442
445
  visible = true,
443
- multiple= false,
446
+ multiple = false,
444
447
  formatter = (v) => {
445
448
  return v
446
449
  },
@@ -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-06-26 11:52:21
5
+ * @LastEditTime: 2023-06-29 14:43:56
6
6
  * @FilePath: \common\src\components\bsgoal-base-search-table\demo.vue
7
7
  * @Description: 查询 + 表格 组合公共组件
8
8
  *
@@ -743,6 +743,7 @@ const task = (done = () => {}, rows = {}) => {
743
743
  ref="BSGOAL_BASE_SEARCH_TABLE_REF"
744
744
  selection
745
745
  operation
746
+ :show-summary="true"
746
747
  :call="call"
747
748
  :fetch="fetch"
748
749
  :config-options="configOptions"
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-18 17:04:47
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-28 14:19:38
5
+ * @LastEditTime: 2023-06-29 14:35:56
6
6
  * @FilePath: \common\src\components\bsgoal-base-search-table\index.vue
7
7
  * @Description: 查询+表格 基础组件
8
8
  *
@@ -130,6 +130,13 @@ const props = defineProps({
130
130
  pageSize: {
131
131
  type: [Number],
132
132
  default: 20
133
+ },
134
+ /**
135
+ * 是否显示合计
136
+ */
137
+ showSummary: {
138
+ type: [Boolean],
139
+ default: false
133
140
  }
134
141
  })
135
142
 
@@ -234,6 +241,7 @@ defineExpose({
234
241
  <!-- S 表格 -->
235
242
  <BsgoalBaseTable
236
243
  ref="BSGOAL_BASE_TABLE_REF"
244
+ :show-summary="showSummary"
237
245
  :page-size="pageSize"
238
246
  :map-props="mapProps"
239
247
  :operationWidth="operationWidth"
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-10 14:26:44
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-28 13:53:43
5
+ * @LastEditTime: 2023-06-29 17:34:31
6
6
  * @FilePath: \common\src\components\bsgoal-base-table\demo.vue
7
7
  * @Description: 表格公共组件演示页面
8
8
  *
@@ -163,52 +163,52 @@ const data = ref([])
163
163
  setTimeout(() => {
164
164
  data.value = [
165
165
  {
166
- prop1: 'prop1',
167
- prop2: 'prop2',
168
- prop3: 'prop3',
169
- prop4: 'prop4',
170
- prop5: 'prop5',
171
- prop6: 'prop6'
166
+ prop1: 1,
167
+ prop2: 2,
168
+ prop3: 3,
169
+ prop4: 4,
170
+ prop5: 5,
171
+ prop6: 6
172
172
  },
173
173
  {
174
- prop1: 'prop1',
175
- prop2: 'prop2',
176
- prop3: 'prop3',
177
- prop4: 'prop4',
178
- prop5: 'prop5',
179
- prop6: 'prop6'
174
+ prop1: 1,
175
+ prop2: 2,
176
+ prop3: 3,
177
+ prop4: 4,
178
+ prop5: 5,
179
+ prop6: 6
180
180
  },
181
181
  {
182
- prop1: 'prop1',
183
- prop2: 'prop2',
184
- prop3: 'prop3',
185
- prop4: 'prop4',
186
- prop5: 'prop5',
187
- prop6: 'prop6'
182
+ prop1: 1,
183
+ prop2: 2,
184
+ prop3: 3,
185
+ prop4: 4,
186
+ prop5: 5,
187
+ prop6: 6
188
188
  },
189
189
  {
190
- prop1: 'prop1',
191
- prop2: 'prop2',
192
- prop3: 'prop3',
193
- prop4: 'prop4',
194
- prop5: 'prop5',
195
- prop6: 'prop6'
190
+ prop1: 1,
191
+ prop2: 2,
192
+ prop3: 3,
193
+ prop4: 4,
194
+ prop5: 5,
195
+ prop6: 6
196
196
  },
197
197
  {
198
- prop1: 'prop1',
199
- prop2: 'prop2',
200
- prop3: 'prop3',
201
- prop4: 'prop4',
202
- prop5: 'prop5',
203
- prop6: 'prop6'
198
+ prop1: 1,
199
+ prop2: 2,
200
+ prop3: 3,
201
+ prop4: 4,
202
+ prop5: 5,
203
+ prop6: 6
204
204
  },
205
205
  {
206
- prop1: 'prop1',
207
- prop2: 'prop2',
208
- prop3: 'prop3',
209
- prop4: 'prop4',
210
- prop5: 'prop5',
211
- prop6: 'prop6'
206
+ prop1: 1,
207
+ prop2: 2,
208
+ prop3: 3,
209
+ prop4: 4,
210
+ prop5: 5,
211
+ prop6: 6
212
212
  }
213
213
  ]
214
214
  }, 3000)
@@ -271,7 +271,7 @@ const clearSelection = () => {
271
271
  ref="BSGOAL_EL_TABLE_REF"
272
272
  operation-width="200"
273
273
  operation
274
- selection
274
+ :showSummary="true"
275
275
  :has-page="false"
276
276
  :config-options="configOptionsTable"
277
277
  :data="data"
@@ -283,7 +283,7 @@ const clearSelection = () => {
283
283
  <!-- S 操作项 -->
284
284
  <template v-slot:operation="{ row }">
285
285
  <div>
286
- {{ row }}
286
+ <!-- {{ row }} -->
287
287
  </div>
288
288
  </template>
289
289
  <!-- E 操作项 -->
@@ -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-06-28 15:50:58
5
+ * @LastEditTime: 2023-06-30 08:40:07
6
6
  * @FilePath: \common\src\components\bsgoal-base-table\index.vue
7
7
  * @Description:
8
8
  *
@@ -133,6 +133,13 @@ const props = defineProps({
133
133
  pageSize: {
134
134
  type: [Number],
135
135
  default: 20
136
+ },
137
+ /**
138
+ * 是否显示合计
139
+ */
140
+ showSummary: {
141
+ type: [Boolean],
142
+ default: false
136
143
  }
137
144
  })
138
145
 
@@ -268,6 +275,29 @@ const clearSelection = () => {
268
275
 
269
276
  // ---> E 暴露事件 <---
270
277
 
278
+ // ---> S 表格绑定的方法 <---
279
+
280
+ const summaryMethod = (columns = '') => {
281
+ const dataList = columns.data
282
+ const calcResultList = []
283
+
284
+ dataList.forEach((fi = {}) => {
285
+ let calcIndex = 0
286
+ for (const [prop, value] of Object.entries(fi)) {
287
+ const cellValue = calcResultList[calcIndex]
288
+ const cellValueInt = parseInt(cellValue) || 0
289
+ const valueInt = parseInt(value) || 0
290
+ calcResultList[calcIndex] = cellValueInt + valueInt
291
+ calcIndex++
292
+ }
293
+ })
294
+
295
+
296
+ return ['合计', ...calcResultList.slice(1)]
297
+ }
298
+
299
+ // ---> E 表格绑定的方法 <---
300
+
271
301
  // ---> S 兼容微前端 <---
272
302
  const isMicroApp = window.__MICRO_APP_ENVIRONMENT__
273
303
  // ---> E 兼容微前端 <---
@@ -299,6 +329,9 @@ defineExpose({
299
329
  highlight-current-row
300
330
  style="width: 100%"
301
331
  v-loading="tableLoading"
332
+ sum-text="合计"
333
+ :summary-method="summaryMethod"
334
+ :show-summary="showSummary"
302
335
  :data="tableData"
303
336
  :header-cell-style="{
304
337
  fontWeight: 'bold',
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-06-20 09:20:51
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-28 14:22:20
5
+ * @LastEditTime: 2023-06-30 08:42:21
6
6
  * @FilePath: \common\src\components\bsgoal-base-tree-table\demo.vue
7
7
  * @Description: 树 + 列表 + 演示
8
8
  *
@@ -826,6 +826,7 @@ const clearSelection = () => {
826
826
  ref="BSGOAL_BASE_TREE_TABLE_REF"
827
827
  selection
828
828
  operation
829
+ showSummary
829
830
  :expandedKeys="expandedKeys"
830
831
  :tree-data="treeData"
831
832
  :page-size="40"
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-06-20 09:20:44
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-28 14:21:32
5
+ * @LastEditTime: 2023-06-29 14:37:18
6
6
  * @FilePath: \common\src\components\bsgoal-base-tree-table\index.vue
7
7
  * @Description: 树结构 + 列表
8
8
  *
@@ -168,6 +168,13 @@ const props = defineProps({
168
168
  expandedKeys: {
169
169
  type: [Array],
170
170
  default: () => []
171
+ },
172
+ /**
173
+ * 是否显示合计
174
+ */
175
+ showSummary: {
176
+ type: [Boolean],
177
+ default: false
171
178
  }
172
179
  })
173
180
 
@@ -295,6 +302,7 @@ const tableStyler = computed(() => {
295
302
  <BsgoalBaseSearchTable
296
303
  ref="BSGOAL_BASE_SEARCH_TABLE_REF"
297
304
  v-bind="$props"
305
+ :show-summary="showSummary"
298
306
  @select="triggerSelect"
299
307
  @select-all="triggerSelectAll"
300
308
  @selection-change="triggerSelectionChange"
package/src/entry.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-05-11 18:31:55
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-25 17:21:19
5
+ * @LastEditTime: 2023-06-29 13:42:31
6
6
  * @FilePath: \common\src\entry.js
7
7
  * @Description: 打包 入口文件
8
8
  *
@@ -30,6 +30,7 @@ import BsgoalBaseInput from '@/components/bsgoal-base-input/index.vue'
30
30
  import BsgoalBaseTreeTable from '@/components/bsgoal-base-tree-table/index.vue'
31
31
  import BsgoalBaesPopover from '@/components/bsgoal-baes-popover/index.vue'
32
32
  import BsgoalBaseViewer from '@/components/bsgoal-base-viewer/index.vue'
33
+ import BsgoalBaseTooltip from '@/components/bsgoal-base-tooltip/index.vue'
33
34
  import componentTypeEnums from '@/enums/componentTypeEnums.js'
34
35
  import { useFetch } from '@/combines/useFetchs.js'
35
36
 
@@ -61,7 +62,8 @@ export default {
61
62
  BsgoalBaseInput,
62
63
  BsgoalBaseTreeTable,
63
64
  BsgoalBaesPopover,
64
- BsgoalBaseViewer
65
+ BsgoalBaseViewer,
66
+ BsgoalBaseTooltip
65
67
  }
66
68
 
67
69
  for (const [name, component] of Object.entries(componentsMap)) {