@bsgoal/common 2.16.4 → 2.17.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/index.mjs +812 -798
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -3
- package/src/App.vue +0 -9
- package/src/combines/useComs.js +0 -41
- package/src/combines/useFetchs.js +0 -55
- package/src/components/bsgoal-baes-popover/demo.vue +0 -35
- package/src/components/bsgoal-baes-popover/index.vue +0 -66
- package/src/components/bsgoal-base-alert/demo.vue +0 -39
- package/src/components/bsgoal-base-alert/index.vue +0 -49
- package/src/components/bsgoal-base-button/demo.vue +0 -54
- package/src/components/bsgoal-base-button/index.vue +0 -166
- package/src/components/bsgoal-base-cascader/demo.vue +0 -128
- package/src/components/bsgoal-base-cascader/index.vue +0 -95
- package/src/components/bsgoal-base-dialog/demo.vue +0 -350
- package/src/components/bsgoal-base-dialog/index.vue +0 -260
- package/src/components/bsgoal-base-form/demo.vue +0 -289
- package/src/components/bsgoal-base-form/index.vue +0 -723
- package/src/components/bsgoal-base-frame/demo.vue +0 -35
- package/src/components/bsgoal-base-frame/index.vue +0 -28
- package/src/components/bsgoal-base-input/demo.vue +0 -48
- package/src/components/bsgoal-base-input/index.vue +0 -150
- package/src/components/bsgoal-base-item/demo.vue +0 -46
- package/src/components/bsgoal-base-item/index.vue +0 -66
- package/src/components/bsgoal-base-layout/demo.vue +0 -48
- package/src/components/bsgoal-base-layout/index.vue +0 -57
- package/src/components/bsgoal-base-line/demo.vue +0 -41
- package/src/components/bsgoal-base-line/index.vue +0 -70
- package/src/components/bsgoal-base-link/demo.vue +0 -38
- package/src/components/bsgoal-base-link/index.vue +0 -73
- package/src/components/bsgoal-base-search/demo.vue +0 -215
- package/src/components/bsgoal-base-search/index.vue +0 -534
- package/src/components/bsgoal-base-search-operation/index.vue +0 -77
- package/src/components/bsgoal-base-search-table/demo.vue +0 -784
- package/src/components/bsgoal-base-search-table/index.vue +0 -291
- package/src/components/bsgoal-base-select/demo.vue +0 -71
- package/src/components/bsgoal-base-select/index.vue +0 -111
- package/src/components/bsgoal-base-sizes/demo.vue +0 -34
- package/src/components/bsgoal-base-sizes/index.vue +0 -178
- package/src/components/bsgoal-base-switch/demo.vue +0 -39
- package/src/components/bsgoal-base-switch/index.vue +0 -76
- package/src/components/bsgoal-base-table/demo.vue +0 -302
- package/src/components/bsgoal-base-table/index.vue +0 -461
- package/src/components/bsgoal-base-table-content/index.vue +0 -64
- package/src/components/bsgoal-base-table-empty/demo.vue +0 -37
- package/src/components/bsgoal-base-table-empty/index.vue +0 -48
- package/src/components/bsgoal-base-table-pagination/demo.vue +0 -35
- package/src/components/bsgoal-base-table-pagination/index.vue +0 -110
- package/src/components/bsgoal-base-tabs/debug.log +0 -1
- package/src/components/bsgoal-base-tabs/demo.vue +0 -65
- package/src/components/bsgoal-base-tabs/index.vue +0 -122
- package/src/components/bsgoal-base-time/demo.vue +0 -69
- package/src/components/bsgoal-base-time/index.vue +0 -177
- package/src/components/bsgoal-base-time-range/demo.vue +0 -62
- package/src/components/bsgoal-base-time-range/index.vue +0 -170
- package/src/components/bsgoal-base-tooltip/demo.vue +0 -38
- package/src/components/bsgoal-base-tooltip/index.vue +0 -103
- package/src/components/bsgoal-base-tree/demo.vue +0 -141
- package/src/components/bsgoal-base-tree/index.vue +0 -286
- package/src/components/bsgoal-base-tree-fold/index.vue +0 -64
- package/src/components/bsgoal-base-tree-table/debug.log +0 -1
- package/src/components/bsgoal-base-tree-table/demo.vue +0 -859
- package/src/components/bsgoal-base-tree-table/index.vue +0 -351
- package/src/components/bsgoal-base-viewer/assets/upload_default.svg +0 -13
- package/src/components/bsgoal-base-viewer/demo.vue +0 -35
- package/src/components/bsgoal-base-viewer/index.vue +0 -66
- package/src/components/layout/layout-home.vue +0 -60
- package/src/components/layout/layout-left-menu.vue +0 -54
- package/src/components/layout/layout-right-container.vue +0 -39
- package/src/components/layout/layout-top-header.vue +0 -38
- package/src/debug.log +0 -1
- package/src/directives/directiveBase.js +0 -96
- package/src/entry.js +0 -77
- package/src/enums/componentTypeEnums.js +0 -35
- package/src/main.js +0 -11
- package/src/router/index.js +0 -161
- package/src/styles/index.css +0 -14
- package/src/utils/common.js +0 -56
package/package.json
CHANGED
package/src/App.vue
DELETED
package/src/combines/useComs.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-04-19 09:10:00
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-08 14:14:46
|
|
6
|
-
* @FilePath: \common\src\combines\useComs.js
|
|
7
|
-
* @Description: 组件相关的组合函数
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { unref, nextTick } from 'vue'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @Author: canlong.shen
|
|
15
|
-
* @description: 自动计算表格高度
|
|
16
|
-
* @param {*} el
|
|
17
|
-
* @param {*} expression
|
|
18
|
-
* @default:
|
|
19
|
-
* @return {*}
|
|
20
|
-
*/
|
|
21
|
-
export const useAutoHeight = (el = null, { expression = 75, arg = {}, height = '' } = {}) => {
|
|
22
|
-
const elValue = unref(el)
|
|
23
|
-
if (elValue) {
|
|
24
|
-
const elTable = elValue.querySelector('.el-table')
|
|
25
|
-
if (elTable) {
|
|
26
|
-
nextTick(() => {
|
|
27
|
-
const { y = 0 } = elTable.getBoundingClientRect()
|
|
28
|
-
let tableHeight = `calc(100vh - ${y + expression}px)`
|
|
29
|
-
const intHeight = Number.parseInt(height)
|
|
30
|
-
if (height) {
|
|
31
|
-
if (intHeight) {
|
|
32
|
-
tableHeight = `${height}px`
|
|
33
|
-
} else {
|
|
34
|
-
tableHeight = height
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
elTable.style.height = tableHeight
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-04-18 16:46:18
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-04-19 17:45:09
|
|
6
|
-
* @FilePath: \common\src\combines\useFetchs.js
|
|
7
|
-
* @Description: 请求组合函数
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { ref } from 'vue'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @Author: canlong.shen
|
|
15
|
-
* @description: 请求的组合函数
|
|
16
|
-
* @param {*} request
|
|
17
|
-
* @default:
|
|
18
|
-
* @return {*}
|
|
19
|
-
*/
|
|
20
|
-
export const useFetch = (
|
|
21
|
-
request = Promise.resolve(),
|
|
22
|
-
call = null,
|
|
23
|
-
loading = ref(false),
|
|
24
|
-
data = ref(null)
|
|
25
|
-
) => {
|
|
26
|
-
const message = ref('')
|
|
27
|
-
loading.value = true
|
|
28
|
-
request
|
|
29
|
-
.then((res = {}) => {
|
|
30
|
-
const { data: resData = {}, message: resMessage = '' } = res
|
|
31
|
-
data.value = resData
|
|
32
|
-
message.value = resMessage
|
|
33
|
-
if (call) {
|
|
34
|
-
call(true, resData)
|
|
35
|
-
}
|
|
36
|
-
loading.value = false
|
|
37
|
-
})
|
|
38
|
-
.catch((err = {}) => {
|
|
39
|
-
if (typeof err === 'object') {
|
|
40
|
-
const { message: errMessage = '' } = err
|
|
41
|
-
message.value = errMessage
|
|
42
|
-
} else {
|
|
43
|
-
message.value = err
|
|
44
|
-
}
|
|
45
|
-
if (call) {
|
|
46
|
-
call(false, err)
|
|
47
|
-
}
|
|
48
|
-
loading.value = false
|
|
49
|
-
})
|
|
50
|
-
.finally(() => {
|
|
51
|
-
loading.value = false
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
return { data, message, loading }
|
|
55
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-06-21 15:12:45
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-21 15:41:54
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-baes-popover\demo.vue
|
|
7
|
-
* @Description: 弹出框 演示
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
<script setup>
|
|
11
|
-
/* setup模板
|
|
12
|
-
---------------------------------------------------------------- */
|
|
13
|
-
import { ref } from 'vue'
|
|
14
|
-
import BsgoalBaesPopover from './index.vue';
|
|
15
|
-
defineOptions({
|
|
16
|
-
name: 'BsgoalBaesPopoverDemo'
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const props = defineProps({})
|
|
20
|
-
</script>
|
|
21
|
-
<template>
|
|
22
|
-
<div class="bsgoal-baes-popover-demo">
|
|
23
|
-
<BsgoalBaesPopover content="这是内容" :width="300">
|
|
24
|
-
<span>愚蠢的地球人</span>
|
|
25
|
-
</BsgoalBaesPopover>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
28
|
-
<style lang="scss" scoped>
|
|
29
|
-
/* 自定义样式
|
|
30
|
-
---------------------------------------------------------------- */
|
|
31
|
-
</style>
|
|
32
|
-
<style lang="scss">
|
|
33
|
-
/* 覆盖样式
|
|
34
|
-
---------------------------------------------------------------- */
|
|
35
|
-
</style>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-06-21 15:12:28
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-21 15:38:11
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-baes-popover\index.vue
|
|
7
|
-
* @Description: 弹出框 公共组件
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
<script setup>
|
|
11
|
-
/* setup模板
|
|
12
|
-
---------------------------------------------------------------- */
|
|
13
|
-
import { ref } from 'vue'
|
|
14
|
-
|
|
15
|
-
defineOptions({
|
|
16
|
-
name: 'BsgoalBaesPopover'
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const props = defineProps({
|
|
20
|
-
/**
|
|
21
|
-
* 内容
|
|
22
|
-
*/
|
|
23
|
-
content: {
|
|
24
|
-
type: [String],
|
|
25
|
-
default: ''
|
|
26
|
-
},
|
|
27
|
-
/**
|
|
28
|
-
* 标题
|
|
29
|
-
*/
|
|
30
|
-
title: {
|
|
31
|
-
type: [String],
|
|
32
|
-
default: ''
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* 宽度
|
|
36
|
-
*/
|
|
37
|
-
width: {
|
|
38
|
-
type: [Number],
|
|
39
|
-
default: 200
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
</script>
|
|
43
|
-
<template>
|
|
44
|
-
<div class="bsgoal-baes-popover">
|
|
45
|
-
<el-popover
|
|
46
|
-
class="baes_popover"
|
|
47
|
-
placement="top-start"
|
|
48
|
-
trigger="hover"
|
|
49
|
-
:width="width"
|
|
50
|
-
:title="title"
|
|
51
|
-
:content="content"
|
|
52
|
-
>
|
|
53
|
-
<template #reference>
|
|
54
|
-
<slot></slot>
|
|
55
|
-
</template>
|
|
56
|
-
</el-popover>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
59
|
-
<style lang="scss" scoped>
|
|
60
|
-
/* 自定义样式
|
|
61
|
-
---------------------------------------------------------------- */
|
|
62
|
-
</style>
|
|
63
|
-
<style lang="scss">
|
|
64
|
-
/* 覆盖样式
|
|
65
|
-
---------------------------------------------------------------- */
|
|
66
|
-
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-24 09:13:02
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-26 15:51:21
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-alert\demo.vue
|
|
7
|
-
* @Description: alert 提示演示
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
<script setup>
|
|
11
|
-
/* setup模板
|
|
12
|
-
---------------------------------------------------------------- */
|
|
13
|
-
import { ref } from 'vue'
|
|
14
|
-
import BsgoalBaseAlert from './index.vue'
|
|
15
|
-
|
|
16
|
-
defineOptions({
|
|
17
|
-
name: 'BsgoalBaseAlertDemo'
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const props = defineProps({})
|
|
21
|
-
</script>
|
|
22
|
-
<template>
|
|
23
|
-
<div class="$bsgoal-base-alert-demo">
|
|
24
|
-
<div class="base_alert_demo">
|
|
25
|
-
<BsgoalBaseAlert> 我就是我 </BsgoalBaseAlert>
|
|
26
|
-
<BsgoalBaseAlert type="success"> 我就是我 </BsgoalBaseAlert>
|
|
27
|
-
<BsgoalBaseAlert type="error"> 我就是我 </BsgoalBaseAlert>
|
|
28
|
-
<BsgoalBaseAlert type="warning"> 我就是我 </BsgoalBaseAlert>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
<style lang="scss" scoped>
|
|
33
|
-
/* 自定义样式
|
|
34
|
-
---------------------------------------------------------------- */
|
|
35
|
-
</style>
|
|
36
|
-
<style lang="scss">
|
|
37
|
-
/* 覆盖样式
|
|
38
|
-
---------------------------------------------------------------- */
|
|
39
|
-
</style>
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-24 09:12:54
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-26 15:52:34
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-alert\index.vue
|
|
7
|
-
* @Description: alert 提示组件
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref } from 'vue'
|
|
15
|
-
|
|
16
|
-
defineOptions({
|
|
17
|
-
name: 'BsgoalBaseAlert'
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const props = defineProps({
|
|
21
|
-
/**
|
|
22
|
-
* 类型
|
|
23
|
-
*/
|
|
24
|
-
type: {
|
|
25
|
-
type: [String],
|
|
26
|
-
default: 'info',
|
|
27
|
-
validator: (v) => ['success', 'warning', 'info', 'error'].includes(v)
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
</script>
|
|
31
|
-
<template>
|
|
32
|
-
<div class="bsgoal-base-alert">
|
|
33
|
-
<el-alert class="base_alert" :type="type" show-icon>
|
|
34
|
-
<template #title>
|
|
35
|
-
<slot></slot>
|
|
36
|
-
</template>
|
|
37
|
-
</el-alert>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
<style lang="scss">
|
|
41
|
-
/* 覆盖样式
|
|
42
|
-
---------------------------------------------------------------- */
|
|
43
|
-
.bsgoal-base-alert {
|
|
44
|
-
.el-alert {
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
</style>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-18 16:24:31
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-07-07 17:09:38
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-button\demo.vue
|
|
7
|
-
* @Description: 按钮 演示
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref } from 'vue'
|
|
15
|
-
import BsgoalBaseButton from './index.vue'
|
|
16
|
-
|
|
17
|
-
defineOptions({
|
|
18
|
-
name: 'BsgoalBaseButtonDemo'
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const props = defineProps({})
|
|
22
|
-
const task = (done) => {
|
|
23
|
-
setTimeout(() => {
|
|
24
|
-
done()
|
|
25
|
-
}, 3000)
|
|
26
|
-
}
|
|
27
|
-
</script>
|
|
28
|
-
<template>
|
|
29
|
-
<div class="bsgoal-base-button-demo">
|
|
30
|
-
<BsgoalBaseButton :task="task" mode="detail" disabled > </BsgoalBaseButton>
|
|
31
|
-
|
|
32
|
-
<BsgoalBaseButton :task="task" mode="edit" plain > </BsgoalBaseButton>
|
|
33
|
-
<BsgoalBaseButton :task="task" mode="cancel" > </BsgoalBaseButton>
|
|
34
|
-
<BsgoalBaseButton :task="task" mode="confirm" content="取消"> </BsgoalBaseButton>
|
|
35
|
-
|
|
36
|
-
<BsgoalBaseButton :task="task" mode="add" plain content="取消"> </BsgoalBaseButton>
|
|
37
|
-
<BsgoalBaseButton :task="task" mode="add"> </BsgoalBaseButton>
|
|
38
|
-
<BsgoalBaseButton :task="task" mode="delete"> </BsgoalBaseButton>
|
|
39
|
-
<BsgoalBaseButton :task="task" #default="{ loading }">
|
|
40
|
-
<div>
|
|
41
|
-
{{ loading }}
|
|
42
|
-
<el-button type="danger" :loading="loading">外部</el-button>
|
|
43
|
-
</div>
|
|
44
|
-
</BsgoalBaseButton>
|
|
45
|
-
</div>
|
|
46
|
-
</template>
|
|
47
|
-
<style lang="scss" scoped>
|
|
48
|
-
/* 自定义样式
|
|
49
|
-
---------------------------------------------------------------- */
|
|
50
|
-
</style>
|
|
51
|
-
<style lang="scss">
|
|
52
|
-
/* 覆盖样式
|
|
53
|
-
---------------------------------------------------------------- */
|
|
54
|
-
</style>
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-18 16:24:25
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-07-11 18:04:43
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-button\index.vue
|
|
7
|
-
* @Description: 统一按钮
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref, unref, computed } from 'vue'
|
|
15
|
-
import { Delete, Plus, CloseBold, Select } from '@element-plus/icons-vue'
|
|
16
|
-
|
|
17
|
-
defineOptions({
|
|
18
|
-
name: 'BsgoalBaseButton'
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const props = defineProps({
|
|
22
|
-
task: {
|
|
23
|
-
type: [Object, Function],
|
|
24
|
-
default: () => {
|
|
25
|
-
Promise.resolve()
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
type: {
|
|
29
|
-
type: [String],
|
|
30
|
-
default: '',
|
|
31
|
-
validator: (v) => ['primary', 'success', 'warning', 'danger', 'info'].includes(v)
|
|
32
|
-
},
|
|
33
|
-
icon: {
|
|
34
|
-
type: [String, Object, Boolean],
|
|
35
|
-
default: ''
|
|
36
|
-
},
|
|
37
|
-
content: {
|
|
38
|
-
type: [String],
|
|
39
|
-
default: ''
|
|
40
|
-
},
|
|
41
|
-
mode: {
|
|
42
|
-
type: [String],
|
|
43
|
-
default: 'default',
|
|
44
|
-
validator: (v) => ['add', 'delete', 'edit', 'detail', 'default', 'cancel'].includes(v)
|
|
45
|
-
},
|
|
46
|
-
values: {
|
|
47
|
-
type: [Array, Object],
|
|
48
|
-
default: () => ({})
|
|
49
|
-
},
|
|
50
|
-
plain: {
|
|
51
|
-
type: [Boolean],
|
|
52
|
-
default: false
|
|
53
|
-
},
|
|
54
|
-
/**
|
|
55
|
-
* 是否有 loading
|
|
56
|
-
*/
|
|
57
|
-
hasLoading: {
|
|
58
|
-
type: [Boolean],
|
|
59
|
-
default: true
|
|
60
|
-
},
|
|
61
|
-
/**
|
|
62
|
-
* disabled
|
|
63
|
-
*/
|
|
64
|
-
disabled: {
|
|
65
|
-
type: [Boolean],
|
|
66
|
-
default: false
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
// ---> S 触发按钮 <---
|
|
71
|
-
const loading = ref(false)
|
|
72
|
-
const triggerClick = () => {
|
|
73
|
-
// 默认 loading 是打开的
|
|
74
|
-
if (props.hasLoading) {
|
|
75
|
-
loading.value = true
|
|
76
|
-
}
|
|
77
|
-
const { task } = props
|
|
78
|
-
const taskValue = unref(task)
|
|
79
|
-
taskValue(() => {
|
|
80
|
-
loading.value = false
|
|
81
|
-
}, props.values)
|
|
82
|
-
}
|
|
83
|
-
// ---> E 触发按钮 <---
|
|
84
|
-
|
|
85
|
-
// ---> S 模式 <---
|
|
86
|
-
|
|
87
|
-
const typeGet = computed(() => {
|
|
88
|
-
const { mode = '', type = '' } = props
|
|
89
|
-
|
|
90
|
-
switch (mode) {
|
|
91
|
-
case 'delete':
|
|
92
|
-
return 'danger'
|
|
93
|
-
case 'cancel':
|
|
94
|
-
return ''
|
|
95
|
-
case 'confirm':
|
|
96
|
-
case 'add':
|
|
97
|
-
case 'edit':
|
|
98
|
-
return 'primary'
|
|
99
|
-
}
|
|
100
|
-
return type
|
|
101
|
-
})
|
|
102
|
-
const iconGet = computed(() => {
|
|
103
|
-
const { mode = '', icon = '' } = props
|
|
104
|
-
if (icon !== false) {
|
|
105
|
-
switch (mode) {
|
|
106
|
-
case 'delete':
|
|
107
|
-
return Delete
|
|
108
|
-
case 'add':
|
|
109
|
-
return Plus
|
|
110
|
-
case 'cancel':
|
|
111
|
-
return CloseBold
|
|
112
|
-
case 'confirm':
|
|
113
|
-
return Select
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return icon
|
|
118
|
-
})
|
|
119
|
-
const contentGet = computed(() => {
|
|
120
|
-
const { mode = '', content = '' } = props
|
|
121
|
-
|
|
122
|
-
switch (mode) {
|
|
123
|
-
case 'cancel':
|
|
124
|
-
return '取消'
|
|
125
|
-
case 'confirm':
|
|
126
|
-
return '确认'
|
|
127
|
-
case 'add':
|
|
128
|
-
return '新增'
|
|
129
|
-
case 'edit':
|
|
130
|
-
return '编辑'
|
|
131
|
-
case 'delete':
|
|
132
|
-
return '删除'
|
|
133
|
-
case 'detail':
|
|
134
|
-
return '详情'
|
|
135
|
-
}
|
|
136
|
-
return content
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
// ---> E 模式 <---
|
|
140
|
-
</script>
|
|
141
|
-
<template>
|
|
142
|
-
<div class="bsgoal-base-button">
|
|
143
|
-
<div class="base_button" @click="triggerClick">
|
|
144
|
-
<slot :loading="loading">
|
|
145
|
-
<el-button
|
|
146
|
-
:type="typeGet"
|
|
147
|
-
:icon="iconGet"
|
|
148
|
-
:loading="loading"
|
|
149
|
-
:plain="plain"
|
|
150
|
-
:disabled="disabled"
|
|
151
|
-
>{{ contentGet }}</el-button
|
|
152
|
-
>
|
|
153
|
-
</slot>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</template>
|
|
157
|
-
<style lang="scss">
|
|
158
|
-
/* 覆盖样式
|
|
159
|
-
---------------------------------------------------------------- */
|
|
160
|
-
.bsgoal-base-button {
|
|
161
|
-
&,
|
|
162
|
-
.base_button {
|
|
163
|
-
display: inline-block;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
</style>
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-04-25 15:29:36
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-04-27 16:05:33
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-cascader\demo.vue
|
|
7
|
-
* @Description: 级联选择公共组件 演示
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref ,watch ,toRaw} from 'vue';
|
|
15
|
-
import BsgoalBaseCascader from './index.vue'
|
|
16
|
-
|
|
17
|
-
defineOptions({
|
|
18
|
-
name: 'BsgoalBaseCascaderDemo'
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const props = defineProps({
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const cascaderValue = ref([])
|
|
26
|
-
|
|
27
|
-
watch(cascaderValue,(val) => {
|
|
28
|
-
console.log('cascaderValue >>', toRaw(val) );
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
const cascaderData = ref([
|
|
32
|
-
{
|
|
33
|
-
"id": 354,
|
|
34
|
-
"institutionName": "深圳市博思高科技有限公司",
|
|
35
|
-
"parentInstitutionId": 354,
|
|
36
|
-
"parentId": 2,
|
|
37
|
-
"userName": "卢阳万",
|
|
38
|
-
"phone": "13249398733",
|
|
39
|
-
"province": null,
|
|
40
|
-
"city": "深圳市",
|
|
41
|
-
"district": "光明区",
|
|
42
|
-
"detailsAddress": "百艺盛大厦9楼",
|
|
43
|
-
"provinceCode": null,
|
|
44
|
-
"cityCode": "430200",
|
|
45
|
-
"districtCode": null,
|
|
46
|
-
"systemAccount": null,
|
|
47
|
-
"children": [
|
|
48
|
-
{
|
|
49
|
-
"id": 2831,
|
|
50
|
-
"institutionName": "子机构",
|
|
51
|
-
"parentInstitutionId": 354,
|
|
52
|
-
"parentId": 3,
|
|
53
|
-
"userName": "成都",
|
|
54
|
-
"phone": "14548454545",
|
|
55
|
-
"province": null,
|
|
56
|
-
"city": "",
|
|
57
|
-
"district": "",
|
|
58
|
-
"detailsAddress": "",
|
|
59
|
-
"provinceCode": "",
|
|
60
|
-
"cityCode": "",
|
|
61
|
-
"districtCode": "",
|
|
62
|
-
"systemAccount": "479502",
|
|
63
|
-
"children": [],
|
|
64
|
-
"label": "子机构",
|
|
65
|
-
"value": 2831
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"id": 3302,
|
|
69
|
-
"institutionName": "新权限机构",
|
|
70
|
-
"parentInstitutionId": 354,
|
|
71
|
-
"parentId": 3,
|
|
72
|
-
"userName": "孙先生",
|
|
73
|
-
"phone": "18851450010",
|
|
74
|
-
"province": null,
|
|
75
|
-
"city": "",
|
|
76
|
-
"district": "",
|
|
77
|
-
"detailsAddress": "",
|
|
78
|
-
"provinceCode": "",
|
|
79
|
-
"cityCode": "",
|
|
80
|
-
"districtCode": "",
|
|
81
|
-
"systemAccount": "479608",
|
|
82
|
-
"children": [],
|
|
83
|
-
"label": "新权限机构",
|
|
84
|
-
"value": 3302
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"id": 3307,
|
|
88
|
-
"institutionName": "测试机构-shencanlong",
|
|
89
|
-
"parentInstitutionId": 354,
|
|
90
|
-
"parentId": 3,
|
|
91
|
-
"userName": "沈灿龙",
|
|
92
|
-
"phone": "15099836861",
|
|
93
|
-
"province": null,
|
|
94
|
-
"city": "深圳市",
|
|
95
|
-
"district": "光明区",
|
|
96
|
-
"detailsAddress": "xxx",
|
|
97
|
-
"provinceCode": "440000",
|
|
98
|
-
"cityCode": "440300",
|
|
99
|
-
"districtCode": "440311",
|
|
100
|
-
"systemAccount": "370259",
|
|
101
|
-
"children": [],
|
|
102
|
-
"label": "测试机构-shencanlong",
|
|
103
|
-
"value": 3307
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
"label": "深圳市博思高科技有限公司",
|
|
107
|
-
"value": 354
|
|
108
|
-
}
|
|
109
|
-
])
|
|
110
|
-
|
|
111
|
-
</script>
|
|
112
|
-
<template>
|
|
113
|
-
<div class="bsgoal-base-cascader-demo">
|
|
114
|
-
{{ cascaderValue }}
|
|
115
|
-
<BsgoalBaseCascader v-model="cascaderValue" :data-options="cascaderData" />
|
|
116
|
-
</div>
|
|
117
|
-
</template>
|
|
118
|
-
<style lang="scss" scoped>
|
|
119
|
-
/* 自定义样式
|
|
120
|
-
---------------------------------------------------------------- */
|
|
121
|
-
.bsgoal-base-cascader-demo {
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
</style>
|
|
125
|
-
<style lang="scss">
|
|
126
|
-
/* 覆盖样式
|
|
127
|
-
---------------------------------------------------------------- */
|
|
128
|
-
</style>
|