@bsgoal/common 1.7.2 → 1.7.3

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": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-05-18 16:24:31
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-18 17:29:13
5
+ * @LastEditTime: 2023-05-18 18:13:42
6
6
  * @FilePath: \common\src\components\bsgoal-base-button\demo.vue
7
7
  * @Description: 按钮 演示
8
8
  *
@@ -16,12 +16,10 @@ import BsgoalBaseButton from './index.vue'
16
16
  // props
17
17
  const props = defineProps({})
18
18
 
19
- const task = () => {
20
- return new Promise((resolve) => {
21
- setTimeout(() => {
22
- resolve()
23
- }, 3000)
24
- })
19
+ const task = (done) => {
20
+ setTimeout(() => {
21
+ done()
22
+ }, 3000)
25
23
  }
26
24
  </script>
27
25
  <script>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-05-18 16:24:25
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-18 17:28:21
5
+ * @LastEditTime: 2023-05-18 18:25:55
6
6
  * @FilePath: \common\src\components\bsgoal-base-button\index.vue
7
7
  * @Description: 统一按钮
8
8
  *
@@ -13,6 +13,7 @@
13
13
  ---------------------------------------------------------------- */
14
14
  import { ref, unref, computed } from 'vue'
15
15
  import { Delete, Plus } from '@element-plus/icons-vue'
16
+ import { values } from 'lodash';
16
17
 
17
18
  // props
18
19
  const props = defineProps({
@@ -39,6 +40,10 @@ const props = defineProps({
39
40
  type: [String],
40
41
  default: 'add',
41
42
  validator: (v) => ['add', 'delete', 'edit', 'detail'].includes(v)
43
+ },
44
+ values: {
45
+ type: [Array, Object],
46
+ default: () => ({})
42
47
  }
43
48
  })
44
49
 
@@ -48,11 +53,9 @@ const triggerClick = () => {
48
53
  loading.value = true
49
54
  const { task } = props
50
55
  const taskValue = unref(task)
51
- taskValue()
52
- .then()
53
- .finally(() => {
54
- loading.value = false
55
- })
56
+ taskValue(() => {
57
+ loading.value = false
58
+ },props.values)
56
59
  }
57
60
  // ---> E 触发按钮 <---
58
61
 
@@ -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 15:56:29
5
+ * @LastEditTime: 2023-05-18 18:26:57
6
6
  * @FilePath: \common\src\components\bsgoal-base-search-table\demo.vue
7
7
  * @Description: 查询 + 表格 组合公共组件
8
8
  *
@@ -20,6 +20,8 @@ import { ref, unref } from 'vue'
20
20
  import EnumType from '../../enums/enumType.js'
21
21
  import BsgoalBaseSearchTable from './index.vue'
22
22
  import DemoTable from './demo-table.vue'
23
+ import BsgoalBaseButton from '../bsgoal-base-button/index.vue'
24
+
23
25
  // props
24
26
  const props = defineProps({})
25
27
 
@@ -728,6 +730,13 @@ const BSGOAL_BASE_SEARCH_TABLE_REF = ref(null)
728
730
  const test = () => {
729
731
  BSGOAL_BASE_SEARCH_TABLE_REF.value.refresh()
730
732
  }
733
+
734
+ const task = (done = () => {}, rows = {}) => {
735
+ console.log('rows', rows.prop1)
736
+ setTimeout(() => {
737
+ done()
738
+ }, 3000)
739
+ }
731
740
  </script>
732
741
  <template>
733
742
  <div class="bsgoal-search-table-demo">
@@ -758,8 +767,10 @@ const test = () => {
758
767
  <template v-slot:menu>
759
768
  <el-button type="primary" @click="test">操作按钮</el-button>
760
769
  </template>
761
- <template v-slot:operation>
762
- <el-button type="primary">编辑</el-button>
770
+ <template v-slot:operation="{ row }">
771
+ <div>
772
+ <BsgoalBaseButton :task="task" :values="row" />
773
+ </div>
763
774
  </template>
764
775
  </BsgoalBaseSearchTable>
765
776
  </div>