@bsgoal/common 2.15.7 → 2.15.9

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.7",
3
+ "version": "2.15.9",
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-06-29 11:13:20
5
+ * @LastEditTime: 2023-06-30 09:17:44
6
6
  * @FilePath: \common\src\components\bsgoal-base-dialog\demo.vue
7
7
  * @Description: 弹窗公共组件 演示
8
8
  *
@@ -51,12 +51,19 @@ const tabsConfigOptions = ref([
51
51
  }
52
52
  ])
53
53
 
54
- const triggerConfirm = (done ) => {
54
+ const triggerConfirm = (done) => {
55
55
  setTimeout(() => {
56
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-29 10:41:56
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
  /**
@@ -98,7 +98,7 @@ const cancel = () => {
98
98
  */
99
99
  const confirm = (done = () => {}) => {
100
100
  emits('on-confirm', (close = true) => {
101
- if(close){
101
+ if (close) {
102
102
  dialogVisible.value = false
103
103
  }
104
104
  done()
@@ -114,6 +114,11 @@ watch(
114
114
 
115
115
  watch(dialogVisible, (v) => {
116
116
  emits('update:modelValue', v)
117
+ if (v) {
118
+ emits('on-show', v)
119
+ } else {
120
+ emits('on-hide', v)
121
+ }
117
122
  })
118
123
 
119
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-29 11:13:00
5
+ * @LastEditTime: 2023-06-30 09:19:56
6
6
  * @FilePath: \common\src\components\bsgoal-base-form\index.vue
7
7
  * @Description: 表单公共组件
8
8
  *
@@ -341,7 +341,8 @@ const filterSlotProps = (model = {}) => {
341
341
  for (const prop of Object.keys(model)) {
342
342
  if (!prop.startsWith('_')) {
343
343
  const value = model[prop]
344
- rebuildModel[prop] = parseInt(value) ? +value : value
344
+ const valueInt = Number.parseInt(value);
345
+ rebuildModel[prop] = valueInt || ['0', 0].includes(value) ? valueInt : value;
345
346
  }
346
347
  }
347
348
  return rebuildModel
@@ -407,7 +408,8 @@ const setActiveValueText = (range = [], type = '') => {
407
408
  defineExpose({
408
409
  triggerOperationClear,
409
410
  triggerOperationForm,
410
- validateForm
411
+ validateForm,
412
+ resetFields:triggerOperationClear
411
413
  })
412
414
  </script>
413
415
  <template>
@@ -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-30 10:12:43
6
6
  * @FilePath: \common\src\components\bsgoal-base-search-table\index.vue
7
7
  * @Description: 查询+表格 基础组件
8
8
  *
@@ -130,6 +130,20 @@ 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
140
+ },
141
+ /**
142
+ * 合计的列
143
+ */
144
+ summaryProps: {
145
+ type: [Array],
146
+ default: () => []
133
147
  }
134
148
  })
135
149
 
@@ -234,6 +248,7 @@ defineExpose({
234
248
  <!-- S 表格 -->
235
249
  <BsgoalBaseTable
236
250
  ref="BSGOAL_BASE_TABLE_REF"
251
+ :show-summary="showSummary"
237
252
  :page-size="pageSize"
238
253
  :map-props="mapProps"
239
254
  :operationWidth="operationWidth"
@@ -245,6 +260,7 @@ defineExpose({
245
260
  :fetch="fetch"
246
261
  :call="call"
247
262
  :has-page="hasPage"
263
+ :summary-props="summaryProps"
248
264
  @select="triggerSelect"
249
265
  @select-all="triggerSelectAll"
250
266
  @selection-change="triggerSelectionChange"
@@ -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-30 10:04:04
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,11 +271,12 @@ 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"
278
278
  :auto-height="false"
279
+ :summary-props="['prop1', 'prop2', 'prop3', 'prop4', 'prop5', 'prop6']"
279
280
  @select="triggerSelect"
280
281
  @select-all="triggerSelectAll"
281
282
  @selection-change="triggerSelectionChange"
@@ -283,7 +284,7 @@ const clearSelection = () => {
283
284
  <!-- S 操作项 -->
284
285
  <template v-slot:operation="{ row }">
285
286
  <div>
286
- {{ row }}
287
+ <!-- {{ row }} -->
287
288
  </div>
288
289
  </template>
289
290
  <!-- 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 09:56:18
6
6
  * @FilePath: \common\src\components\bsgoal-base-table\index.vue
7
7
  * @Description:
8
8
  *
@@ -133,6 +133,20 @@ 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
143
+ },
144
+ /**
145
+ * 合计的列
146
+ */
147
+ summaryProps: {
148
+ type: [Array],
149
+ default: () => []
136
150
  }
137
151
  })
138
152
 
@@ -268,6 +282,30 @@ const clearSelection = () => {
268
282
 
269
283
  // ---> E 暴露事件 <---
270
284
 
285
+ // ---> S 表格绑定的方法 <---
286
+
287
+ const summaryMethod = (columns = '') => {
288
+ const { summaryProps = [] } = props
289
+ const dataList = columns.data
290
+ const calcResultList = []
291
+
292
+ summaryProps.forEach((prop = '', index = 0) => {
293
+ let sum = 0
294
+ const propDataList = dataList.map((mi) => mi[prop])
295
+ propDataList.forEach((pfi) => {
296
+ const valueInt = parseInt(pfi) || 0
297
+ sum += valueInt
298
+ })
299
+ calcResultList[index] = sum
300
+ })
301
+
302
+ console.log('calcResultList',calcResultList);
303
+
304
+ return ['合计', ...calcResultList.slice(1)]
305
+ }
306
+
307
+ // ---> E 表格绑定的方法 <---
308
+
271
309
  // ---> S 兼容微前端 <---
272
310
  const isMicroApp = window.__MICRO_APP_ENVIRONMENT__
273
311
  // ---> E 兼容微前端 <---
@@ -299,6 +337,9 @@ defineExpose({
299
337
  highlight-current-row
300
338
  style="width: 100%"
301
339
  v-loading="tableLoading"
340
+ sum-text="合计"
341
+ :summary-method="summaryMethod"
342
+ :show-summary="showSummary"
302
343
  :data="tableData"
303
344
  :header-cell-style="{
304
345
  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-30 10:13:58
6
6
  * @FilePath: \common\src\components\bsgoal-base-tree-table\index.vue
7
7
  * @Description: 树结构 + 列表
8
8
  *
@@ -168,6 +168,20 @@ 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
178
+ },
179
+ /**
180
+ * 合计的列
181
+ */
182
+ summaryProps: {
183
+ type: [Array],
184
+ default: () => []
171
185
  }
172
186
  })
173
187
 
@@ -226,7 +240,7 @@ const refreshList = (params = {}) => {
226
240
  }
227
241
 
228
242
  // ---> S 触发事件 <---
229
- const triggerSelect = (selection = {}, row =[]) => {
243
+ const triggerSelect = (selection = {}, row = []) => {
230
244
  emits('on-select-table', selection, row)
231
245
  }
232
246
  const triggerSelectAll = (selection = {}) => {
@@ -295,6 +309,8 @@ const tableStyler = computed(() => {
295
309
  <BsgoalBaseSearchTable
296
310
  ref="BSGOAL_BASE_SEARCH_TABLE_REF"
297
311
  v-bind="$props"
312
+ :show-summary="showSummary"
313
+ :summary-props="summaryProps"
298
314
  @select="triggerSelect"
299
315
  @select-all="triggerSelectAll"
300
316
  @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)) {