@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
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-04-18 17:04:47
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-07-11 11:04:07
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-search-table\index.vue
|
|
7
|
-
* @Description: 查询+表格 基础组件
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref, computed, unref, provide, useSlots } from 'vue'
|
|
15
|
-
import BsgoalBaseSearch from '../bsgoal-base-search/index.vue'
|
|
16
|
-
import BsgoalBaseTable from '../bsgoal-base-table/index.vue'
|
|
17
|
-
|
|
18
|
-
defineOptions({
|
|
19
|
-
name: 'BsgoalBaseSearchTable'
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const props = defineProps({
|
|
23
|
-
/**
|
|
24
|
-
* >----------props----------<
|
|
25
|
-
* {
|
|
26
|
-
*
|
|
27
|
-
* label: '' // 列名
|
|
28
|
-
* prop : '' // 绑定字段
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* value: '' // 初始值 (查询)
|
|
32
|
-
* type : '' // 查询组件的类型 (查询)
|
|
33
|
-
* item : false // 只为查询项
|
|
34
|
-
* single : false // 机构选择器配置为单个值输出
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* width: 0 // 列宽度 (表格)
|
|
38
|
-
*
|
|
39
|
-
* }
|
|
40
|
-
*
|
|
41
|
-
* >----------slots----------<
|
|
42
|
-
*
|
|
43
|
-
* menu: 顶部操作区域
|
|
44
|
-
* operation: 列表右侧操作区域
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
|
-
configOptions: {
|
|
48
|
-
type: [Array],
|
|
49
|
-
default: () => []
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 表格数据
|
|
54
|
-
*/
|
|
55
|
-
tableData: {
|
|
56
|
-
type: [Array],
|
|
57
|
-
default: () => []
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* 是否多选
|
|
61
|
-
*/
|
|
62
|
-
selection: {
|
|
63
|
-
type: [Boolean],
|
|
64
|
-
default: false
|
|
65
|
-
},
|
|
66
|
-
/**
|
|
67
|
-
* 是否配置操作列
|
|
68
|
-
*/
|
|
69
|
-
operation: {
|
|
70
|
-
type: [Boolean],
|
|
71
|
-
default: false
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* 操作列宽度
|
|
75
|
-
*/
|
|
76
|
-
operationWidth: {
|
|
77
|
-
type: [String, Number],
|
|
78
|
-
default: 100
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* 请求的 promise
|
|
82
|
-
*/
|
|
83
|
-
fetch: {
|
|
84
|
-
type: [Object, Function],
|
|
85
|
-
default: null
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* 响应的 call
|
|
89
|
-
*/
|
|
90
|
-
call: {
|
|
91
|
-
type: [Object, Function],
|
|
92
|
-
default: null
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* 表格高度 下边距值
|
|
96
|
-
*/
|
|
97
|
-
expression: {
|
|
98
|
-
type: [Number],
|
|
99
|
-
default: 75
|
|
100
|
-
},
|
|
101
|
-
/**
|
|
102
|
-
* 映射字段
|
|
103
|
-
*/
|
|
104
|
-
mapProps: {
|
|
105
|
-
type: [Object],
|
|
106
|
-
default: () => ({
|
|
107
|
-
currentPage: 'currentPage',
|
|
108
|
-
pageSize: 'pageSize',
|
|
109
|
-
rows: 'rows',
|
|
110
|
-
total: 'total'
|
|
111
|
-
})
|
|
112
|
-
},
|
|
113
|
-
/**
|
|
114
|
-
* 是否显示分页
|
|
115
|
-
*/
|
|
116
|
-
hasPage: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
default: true
|
|
119
|
-
},
|
|
120
|
-
/**
|
|
121
|
-
* 是否显示查询
|
|
122
|
-
*/
|
|
123
|
-
hasSearch: {
|
|
124
|
-
type: Boolean,
|
|
125
|
-
default: true
|
|
126
|
-
},
|
|
127
|
-
/**
|
|
128
|
-
* pageSize
|
|
129
|
-
*/
|
|
130
|
-
pageSize: {
|
|
131
|
-
type: [Number],
|
|
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: () => []
|
|
147
|
-
},
|
|
148
|
-
/**
|
|
149
|
-
* 序号 列
|
|
150
|
-
*/
|
|
151
|
-
serial: {
|
|
152
|
-
type: [Boolean],
|
|
153
|
-
default: false
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
const emits = defineEmits(['select', 'select-all', 'selection-change', 'on-total-change'])
|
|
158
|
-
|
|
159
|
-
const transferFoldStatus = ref(false)
|
|
160
|
-
provide('transferFoldStatus', transferFoldStatus)
|
|
161
|
-
|
|
162
|
-
const options = unref(props.configOptions)
|
|
163
|
-
|
|
164
|
-
// 查询 配置项
|
|
165
|
-
const searchOptions = computed(() => {
|
|
166
|
-
return options.filter((fi) => {
|
|
167
|
-
const { type = '' } = fi
|
|
168
|
-
return !!type
|
|
169
|
-
})
|
|
170
|
-
})
|
|
171
|
-
|
|
172
|
-
// 表格 配置项
|
|
173
|
-
const tableOptions = computed(() => {
|
|
174
|
-
return options.filter((fi) => {
|
|
175
|
-
const { item = false } = fi
|
|
176
|
-
return !item
|
|
177
|
-
})
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
// 注入插槽列表
|
|
181
|
-
const slots = useSlots()
|
|
182
|
-
const slotNames = ref(Object.keys(slots))
|
|
183
|
-
|
|
184
|
-
// 触发查询
|
|
185
|
-
const BSGOAL_BASE_TABLE_REF = ref(null)
|
|
186
|
-
const triggerSearch = (searchParams) => {
|
|
187
|
-
BSGOAL_BASE_TABLE_REF.value.refreshList(searchParams)
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// ---> S 计算expression <---
|
|
191
|
-
const expresionGet = computed(() => {
|
|
192
|
-
const { expression, hasPage } = props
|
|
193
|
-
if (hasPage === false) {
|
|
194
|
-
return 25
|
|
195
|
-
}
|
|
196
|
-
return expression
|
|
197
|
-
})
|
|
198
|
-
// ---> E 计算expression <---
|
|
199
|
-
|
|
200
|
-
// ---> S 刷新 <---
|
|
201
|
-
const BSGOAL_BASE_SEARCH_REF = ref(null)
|
|
202
|
-
const refresh = () => {
|
|
203
|
-
const { hasSearch } = props
|
|
204
|
-
if (unref(hasSearch)) {
|
|
205
|
-
BSGOAL_BASE_SEARCH_REF.value.triggerOperationSearch()
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
// ---> E 刷新 <---
|
|
209
|
-
|
|
210
|
-
// ---> S 触发事件 <---
|
|
211
|
-
const triggerSelect = (selection, row) => {
|
|
212
|
-
emits('select', selection, row)
|
|
213
|
-
}
|
|
214
|
-
const triggerSelectAll = (selection) => {
|
|
215
|
-
emits('select-all', selection)
|
|
216
|
-
}
|
|
217
|
-
const triggerSelectionChange = (selection) => {
|
|
218
|
-
emits('selection-change', selection)
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const triggerTotalChange = (total = 0) => {
|
|
222
|
-
emits('on-total-change', total)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// ---> E 触发事件 <---
|
|
226
|
-
|
|
227
|
-
// ---> S 暴露事件 <---
|
|
228
|
-
|
|
229
|
-
const clearSelection = () => {
|
|
230
|
-
BSGOAL_BASE_TABLE_REF.value.clearSelection()
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// ---> E 暴露事件 <---
|
|
234
|
-
|
|
235
|
-
// ---> S 暴露 <---
|
|
236
|
-
|
|
237
|
-
defineExpose({
|
|
238
|
-
refresh,
|
|
239
|
-
clearSelection
|
|
240
|
-
})
|
|
241
|
-
// ---> E 暴露 <---
|
|
242
|
-
</script>
|
|
243
|
-
<template>
|
|
244
|
-
<div class="bsgoal-base-search-table">
|
|
245
|
-
<div class="base_search_table">
|
|
246
|
-
<!-- S 查询 -->
|
|
247
|
-
<BsgoalBaseSearch
|
|
248
|
-
ref="BSGOAL_BASE_SEARCH_REF"
|
|
249
|
-
v-show="hasSearch"
|
|
250
|
-
:config-options="searchOptions"
|
|
251
|
-
@on-search="triggerSearch"
|
|
252
|
-
@on-clear="triggerSearch"
|
|
253
|
-
/>
|
|
254
|
-
<!-- E 查询 -->
|
|
255
|
-
<!-- S 表格 -->
|
|
256
|
-
<BsgoalBaseTable
|
|
257
|
-
ref="BSGOAL_BASE_TABLE_REF"
|
|
258
|
-
:show-summary="showSummary"
|
|
259
|
-
:page-size="pageSize"
|
|
260
|
-
:map-props="mapProps"
|
|
261
|
-
:operationWidth="operationWidth"
|
|
262
|
-
:config-options="tableOptions"
|
|
263
|
-
:data="tableData"
|
|
264
|
-
:selection="selection"
|
|
265
|
-
:operation="operation"
|
|
266
|
-
:expression="expresionGet"
|
|
267
|
-
:fetch="fetch"
|
|
268
|
-
:call="call"
|
|
269
|
-
:has-page="hasPage"
|
|
270
|
-
:summary-props="summaryProps"
|
|
271
|
-
:serial="serial"
|
|
272
|
-
@select="triggerSelect"
|
|
273
|
-
@select-all="triggerSelectAll"
|
|
274
|
-
@selection-change="triggerSelectionChange"
|
|
275
|
-
@on-total-change="triggerTotalChange"
|
|
276
|
-
>
|
|
277
|
-
<!-- S 顶部菜单 -->
|
|
278
|
-
|
|
279
|
-
<template v-for="slotName of slotNames" v-slot:[slotName]="{ row = {} , column = {} , index = 0 }">
|
|
280
|
-
<slot :name="slotName" :row="row" :column="column" :index="index"></slot>
|
|
281
|
-
</template>
|
|
282
|
-
<!-- E 顶部菜单 -->
|
|
283
|
-
</BsgoalBaseTable>
|
|
284
|
-
<!-- E 表格 -->
|
|
285
|
-
</div>
|
|
286
|
-
</div>
|
|
287
|
-
</template>
|
|
288
|
-
<style lang="scss">
|
|
289
|
-
/* 覆盖样式
|
|
290
|
-
---------------------------------------------------------------- */
|
|
291
|
-
</style>
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-24 11:10:09
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-24 14:07:27
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-select\demo.vue
|
|
7
|
-
* @Description: select 演示
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref } from 'vue'
|
|
15
|
-
import BsgoalBaseSelect from './index.vue'
|
|
16
|
-
|
|
17
|
-
defineOptions({
|
|
18
|
-
name: 'BsgoalBaseSelectDemo'
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const props = defineProps({})
|
|
22
|
-
|
|
23
|
-
const selectValue = ref('11')
|
|
24
|
-
const selectRange = ref([
|
|
25
|
-
{
|
|
26
|
-
label: '11',
|
|
27
|
-
value: '11',
|
|
28
|
-
data: { prop1: 'prop1', prop2: 'prop2' }
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: '22',
|
|
32
|
-
value: '22'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
label: '33',
|
|
36
|
-
value: '33'
|
|
37
|
-
}
|
|
38
|
-
])
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @Author: canlong.shen
|
|
42
|
-
* @description: 触发 值变动
|
|
43
|
-
* @default:
|
|
44
|
-
* @return {*}
|
|
45
|
-
*/
|
|
46
|
-
const change = (value = '', data = {}) => {
|
|
47
|
-
console.log('value', value)
|
|
48
|
-
console.log('data', data)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const test = (params = '') => {
|
|
52
|
-
selectValue.value = ''
|
|
53
|
-
}
|
|
54
|
-
</script>
|
|
55
|
-
<template>
|
|
56
|
-
<div class="bsgoal-base-select-demo">
|
|
57
|
-
<div class="base_select_demo">
|
|
58
|
-
{{ selectValue }}
|
|
59
|
-
<BsgoalBaseSelect :model-value="selectValue" :range="selectRange" @change="change" />
|
|
60
|
-
<el-button type="primary" @click="test">test</el-button>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</template>
|
|
64
|
-
<style lang="scss" scoped>
|
|
65
|
-
/* 自定义样式
|
|
66
|
-
---------------------------------------------------------------- */
|
|
67
|
-
</style>
|
|
68
|
-
<style lang="scss">
|
|
69
|
-
/* 覆盖样式
|
|
70
|
-
---------------------------------------------------------------- */
|
|
71
|
-
</style>
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-24 11:09:59
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-30 17:58:18
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-select\index.vue
|
|
7
|
-
* @Description: Select 公共组件
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref, watchEffect } from 'vue'
|
|
15
|
-
|
|
16
|
-
defineOptions({
|
|
17
|
-
name: 'BsgoalBaseSelect'
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const props = defineProps({
|
|
21
|
-
/**
|
|
22
|
-
* 占位提示符
|
|
23
|
-
*/
|
|
24
|
-
placeholder: {
|
|
25
|
-
type: [String],
|
|
26
|
-
default: '请选择'
|
|
27
|
-
},
|
|
28
|
-
/**
|
|
29
|
-
* 可选范围 { label : '' , value : ''}
|
|
30
|
-
*/
|
|
31
|
-
range: {
|
|
32
|
-
type: [Array],
|
|
33
|
-
default: () => []
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* value
|
|
37
|
-
*/
|
|
38
|
-
modelValue: {
|
|
39
|
-
type: [],
|
|
40
|
-
default: ''
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* 无数据提示
|
|
44
|
-
*/
|
|
45
|
-
none: {
|
|
46
|
-
type: [String],
|
|
47
|
-
default: '暂无数据'
|
|
48
|
-
},
|
|
49
|
-
/**
|
|
50
|
-
* 是否可清空
|
|
51
|
-
*/
|
|
52
|
-
clearable: {
|
|
53
|
-
type: [Boolean],
|
|
54
|
-
default: false
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
const emits = defineEmits(['update:modelValue', 'change'])
|
|
59
|
-
|
|
60
|
-
// ---> S 值绑定 <---
|
|
61
|
-
|
|
62
|
-
const selectValue = ref('')
|
|
63
|
-
watchEffect(() => {
|
|
64
|
-
selectValue.value = props.modelValue
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
// ---> E 值绑定 <---
|
|
68
|
-
|
|
69
|
-
// ---> S 触发 方法 <---
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @Author: canlong.shen
|
|
73
|
-
* @description: 触发 change
|
|
74
|
-
* @default:
|
|
75
|
-
* @return {*}
|
|
76
|
-
*/
|
|
77
|
-
const triggerChange = (value = '') => {
|
|
78
|
-
const { range = [] } = props
|
|
79
|
-
const finder = range.find((fi) => fi.value === value)
|
|
80
|
-
const data = finder ? finder.data : null
|
|
81
|
-
|
|
82
|
-
emits('update:modelValue', value)
|
|
83
|
-
emits('change', value, data)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ---> E 触发 方法 <---
|
|
87
|
-
</script>
|
|
88
|
-
<template>
|
|
89
|
-
<div class="bsgoal-base-select">
|
|
90
|
-
<el-select
|
|
91
|
-
class="base_select"
|
|
92
|
-
v-model="selectValue"
|
|
93
|
-
:clearable="clearable"
|
|
94
|
-
:no-data-text="none"
|
|
95
|
-
:placeholder="placeholder"
|
|
96
|
-
@change="triggerChange"
|
|
97
|
-
>
|
|
98
|
-
<template v-for="({ label = '', value = '' }, key) of range" :key="key">
|
|
99
|
-
<el-option :label="label" :value="value"></el-option>
|
|
100
|
-
</template>
|
|
101
|
-
</el-select>
|
|
102
|
-
</div>
|
|
103
|
-
</template>
|
|
104
|
-
<style lang="scss" scoped>
|
|
105
|
-
/* 自定义样式
|
|
106
|
-
---------------------------------------------------------------- */
|
|
107
|
-
</style>
|
|
108
|
-
<style lang="scss">
|
|
109
|
-
/* 覆盖样式
|
|
110
|
-
---------------------------------------------------------------- */
|
|
111
|
-
</style>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-06-27 17:10:41
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-28 09:12:38
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-sizes\demo.vue
|
|
7
|
-
* @Description: 页数切换
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
<script setup>
|
|
11
|
-
/* setup模板
|
|
12
|
-
---------------------------------------------------------------- */
|
|
13
|
-
import { ref } from 'vue'
|
|
14
|
-
import BsgoalBaseSizes from './index.vue'
|
|
15
|
-
defineOptions({
|
|
16
|
-
name: 'BsgoalBaseSizesDemo'
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const props = defineProps({})
|
|
20
|
-
|
|
21
|
-
const triggerSizeChange = (params = '') => {
|
|
22
|
-
console.log(params)
|
|
23
|
-
}
|
|
24
|
-
</script>
|
|
25
|
-
<template>
|
|
26
|
-
<div class="bsgoal-base-sizes-demo">
|
|
27
|
-
<div style="height: 400px; background-color: red"></div>
|
|
28
|
-
<BsgoalBaseSizes :page-size="20" @on-size-change="triggerSizeChange" />
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
<style lang="scss">
|
|
32
|
-
.bsgoal-base-sizes-demo {
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-06-27 16:52:31
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-28 14:56:45
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-sizes\index.vue
|
|
7
|
-
* @Description: 页数切换 公共组件
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
<script setup>
|
|
11
|
-
/* setup模板
|
|
12
|
-
---------------------------------------------------------------- */
|
|
13
|
-
import { ref, watch, watchEffect } from 'vue'
|
|
14
|
-
import { ArrowDown, ArrowUp } from '@element-plus/icons-vue'
|
|
15
|
-
defineOptions({
|
|
16
|
-
name: 'BsgoalBaseSizes'
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const props = defineProps({
|
|
20
|
-
/**
|
|
21
|
-
* 每页显示个数选择器的选项设置
|
|
22
|
-
*/
|
|
23
|
-
pageSizes: {
|
|
24
|
-
type: [Array],
|
|
25
|
-
default: () => [10, 20, 30, 40, 50, 100]
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* 每页显示条目个数
|
|
30
|
-
*/
|
|
31
|
-
pageSize: {
|
|
32
|
-
type: [Number],
|
|
33
|
-
default: 0
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* width 宽度
|
|
37
|
-
*/
|
|
38
|
-
width: {
|
|
39
|
-
type: [String, Number],
|
|
40
|
-
default: 100
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const emits = defineEmits(['on-size-change'])
|
|
45
|
-
|
|
46
|
-
// ---> S popover <---
|
|
47
|
-
const visible = ref(false)
|
|
48
|
-
const suffixIcon = ref(ArrowDown)
|
|
49
|
-
|
|
50
|
-
const showPopover = () => {
|
|
51
|
-
suffixIcon.value = ArrowUp
|
|
52
|
-
}
|
|
53
|
-
const hidePopover = () => {
|
|
54
|
-
suffixIcon.value = ArrowDown
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const selectedIndex = ref(-1)
|
|
58
|
-
const selectedSize = ref(10)
|
|
59
|
-
|
|
60
|
-
watch(
|
|
61
|
-
() => props.pageSize,
|
|
62
|
-
() => {
|
|
63
|
-
const { pageSize = 0, pageSizes = [] } = props
|
|
64
|
-
|
|
65
|
-
const curIndex = pageSizes.findIndex((fi) => fi === pageSize)
|
|
66
|
-
|
|
67
|
-
if (curIndex !== -1) {
|
|
68
|
-
selectedIndex.value = curIndex
|
|
69
|
-
selectedSize.value = pageSize
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
immediate: true
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @Author: canlong.shen
|
|
79
|
-
* @description: 单击单项
|
|
80
|
-
* @param {*} size
|
|
81
|
-
* @param {*} key
|
|
82
|
-
* @default:
|
|
83
|
-
* @return {*}
|
|
84
|
-
*/
|
|
85
|
-
const handleSizeItem = (size = 0, index = 0) => {
|
|
86
|
-
selectedIndex.value = index
|
|
87
|
-
selectedSize.value = size
|
|
88
|
-
emits('on-size-change', size)
|
|
89
|
-
visible.value = false
|
|
90
|
-
}
|
|
91
|
-
// ---> E popover <---
|
|
92
|
-
|
|
93
|
-
// ---> S input <---
|
|
94
|
-
const content = ref('')
|
|
95
|
-
|
|
96
|
-
watchEffect(() => {
|
|
97
|
-
const curPageSize = selectedSize.value
|
|
98
|
-
content.value = `${curPageSize}条/页`
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
const isMicroApp = window.__MICRO_APP_ENVIRONMENT__
|
|
102
|
-
|
|
103
|
-
// ---> E input <---
|
|
104
|
-
</script>
|
|
105
|
-
<template>
|
|
106
|
-
<div class="bsgoal-base-sizes">
|
|
107
|
-
<el-popover
|
|
108
|
-
class="base_sizes"
|
|
109
|
-
placement="top"
|
|
110
|
-
trigger="click"
|
|
111
|
-
:width="`${width}px`"
|
|
112
|
-
v-model:visible="visible"
|
|
113
|
-
:teleported="false"
|
|
114
|
-
@show="showPopover"
|
|
115
|
-
@hide="hidePopover"
|
|
116
|
-
>
|
|
117
|
-
<template #reference>
|
|
118
|
-
<el-input
|
|
119
|
-
v-model="content"
|
|
120
|
-
readonly
|
|
121
|
-
class="base_sizes_input"
|
|
122
|
-
placeholder="Please input"
|
|
123
|
-
:class="{ bsgoal_micro_app: isMicroApp }"
|
|
124
|
-
:style="{ width: `${width}px` }"
|
|
125
|
-
:suffix-icon="suffixIcon"
|
|
126
|
-
>
|
|
127
|
-
</el-input>
|
|
128
|
-
</template>
|
|
129
|
-
|
|
130
|
-
<template #default>
|
|
131
|
-
<template v-for="(size, key) of pageSizes" :key="key">
|
|
132
|
-
<div
|
|
133
|
-
class="base_sizes_item"
|
|
134
|
-
:class="{ 'base_sizes_item--selected': selectedIndex === key }"
|
|
135
|
-
@click="handleSizeItem(size, key)"
|
|
136
|
-
>
|
|
137
|
-
{{ `${size}条/页` }}
|
|
138
|
-
</div>
|
|
139
|
-
</template>
|
|
140
|
-
</template>
|
|
141
|
-
</el-popover>
|
|
142
|
-
</div>
|
|
143
|
-
</template>
|
|
144
|
-
<style lang="scss">
|
|
145
|
-
/* 覆盖样式
|
|
146
|
-
---------------------------------------------------------------- */
|
|
147
|
-
.bsgoal-base-sizes {
|
|
148
|
-
display: inline-block;
|
|
149
|
-
.base_sizes_input {
|
|
150
|
-
cursor: pointer;
|
|
151
|
-
margin-left: 16px;
|
|
152
|
-
}
|
|
153
|
-
.base_sizes_item {
|
|
154
|
-
text-align: center;
|
|
155
|
-
font-size: 14px;
|
|
156
|
-
padding: 0 20px;
|
|
157
|
-
color: #606266;
|
|
158
|
-
height: 34px;
|
|
159
|
-
line-height: 34px;
|
|
160
|
-
cursor: pointer;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.base_sizes_item:hover {
|
|
164
|
-
background-color: #f5f7fa;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.base_sizes_item--selected {
|
|
168
|
-
color: #409eff;
|
|
169
|
-
font-weight: 700;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.bsgoal_micro_app {
|
|
173
|
-
.el-input__suffix {
|
|
174
|
-
margin-right: 8px !important;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-24 17:20:47
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-24 17:43:05
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-switch\demo.vue
|
|
7
|
-
* @Description: 开关 公共组件 演示
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
<script setup>
|
|
11
|
-
/* setup模板
|
|
12
|
-
---------------------------------------------------------------- */
|
|
13
|
-
import { ref } from 'vue'
|
|
14
|
-
import BsgoalBaseSwitch from './index.vue'
|
|
15
|
-
|
|
16
|
-
defineOptions({
|
|
17
|
-
name: 'BsgoalBaseSwitchDemo'
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const props = defineProps({})
|
|
21
|
-
|
|
22
|
-
const modelValue = ref('0')
|
|
23
|
-
</script>
|
|
24
|
-
<template>
|
|
25
|
-
<div class="bsgoal-base-switch-demo">
|
|
26
|
-
<div class="base_switch_demo">
|
|
27
|
-
{{ modelValue }}
|
|
28
|
-
<BsgoalBaseSwitch v-model="modelValue" />
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
<style lang="scss" scoped>
|
|
33
|
-
/* 自定义样式
|
|
34
|
-
---------------------------------------------------------------- */
|
|
35
|
-
</style>
|
|
36
|
-
<style lang="scss">
|
|
37
|
-
/* 覆盖样式
|
|
38
|
-
---------------------------------------------------------------- */
|
|
39
|
-
</style>
|