@ebiz/designer-components 0.0.18-kzy.3 → 0.0.18-kzy.5
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/designer-components.css +2 -2
- package/dist/index.mjs +43839 -39549
- package/package.json +1 -1
- package/src/apiService/simpleDataService.js +7 -4
- package/src/components/Button.vue +1 -1
- package/src/components/EbizDetailBlock.vue +82 -0
- package/src/components/EbizDialog.vue +249 -0
- package/src/components/EbizGridEditorSelect.vue +238 -0
- package/src/components/EbizPageHeader.vue +96 -0
- package/src/components/EbizRemoteSelect.vue +7 -5
- package/src/components/EbizTimePicker.vue +144 -0
- package/src/components/EbizTree.vue +153 -0
- package/src/components/EbizTreeSelector.vue +423 -0
- package/src/components/TddesignButton.vue +153 -0
- package/src/components/TdesignUpload.vue +2 -3
- package/src/index.js +17 -1
- package/src/router/index.js +44 -0
- package/src/views/Button.vue +7 -3
- package/src/views/EbizDetailBlockDemo.vue +31 -0
- package/src/views/Home.vue +31 -2
- package/src/views/PageHeaderDemo.vue +105 -0
- package/src/views/TimePickerDemo.vue +147 -0
- package/src/views/TreeDemo.vue +255 -0
- package/src/views/TreeSelectorDemo.vue +246 -0
- package/src/components/Button copy.vue +0 -104
@@ -41,7 +41,9 @@ const props = defineProps({
|
|
41
41
|
*/
|
42
42
|
queryParams: {
|
43
43
|
type: Object,
|
44
|
-
default: () => ({
|
44
|
+
default: () => ({
|
45
|
+
name: ''
|
46
|
+
})
|
45
47
|
},
|
46
48
|
/**
|
47
49
|
* 是否多选
|
@@ -62,7 +64,7 @@ const props = defineProps({
|
|
62
64
|
*/
|
63
65
|
clearable: {
|
64
66
|
type: Boolean,
|
65
|
-
default:
|
67
|
+
default: true
|
66
68
|
},
|
67
69
|
/**
|
68
70
|
* 是否禁用
|
@@ -141,18 +143,18 @@ const focus = () => {
|
|
141
143
|
|
142
144
|
defineExpose({
|
143
145
|
focus,
|
144
|
-
selectRef
|
146
|
+
selectRef,
|
147
|
+
options
|
145
148
|
});
|
146
149
|
|
147
150
|
// 远程搜索处理函数
|
148
151
|
const handleRemoteSearch = async (keyword) => {
|
149
152
|
loading.value = true;
|
150
|
-
console.log('handleRemoteSearch', keyword);
|
151
153
|
try {
|
152
154
|
const params = {
|
153
155
|
queryParams: {
|
154
156
|
...queryParams.value,
|
155
|
-
keyword
|
157
|
+
name: keyword
|
156
158
|
}
|
157
159
|
};
|
158
160
|
const res = await dataService.fetch(params, {
|
@@ -0,0 +1,144 @@
|
|
1
|
+
<template>
|
2
|
+
<t-time-picker
|
3
|
+
v-bind="$attrs"
|
4
|
+
:value="modelValue"
|
5
|
+
:allow-input="allowInput"
|
6
|
+
:clearable="clearable"
|
7
|
+
:disabled="disabled"
|
8
|
+
:disable-time="disableTime"
|
9
|
+
:format="format"
|
10
|
+
:input-props="inputProps"
|
11
|
+
:placeholder="placeholder"
|
12
|
+
:popup-props="popupProps"
|
13
|
+
:size="size"
|
14
|
+
:steps="steps"
|
15
|
+
:range="range"
|
16
|
+
:range-separator="rangeSeparator"
|
17
|
+
:tips="tips"
|
18
|
+
@change="handleChange"
|
19
|
+
@blur="$emit('blur', $event)"
|
20
|
+
@focus="$emit('focus', $event)"
|
21
|
+
@close="$emit('close', $event)"
|
22
|
+
@open="$emit('open', $event)"
|
23
|
+
@dayclick="$emit('dayclick', $event)"
|
24
|
+
@pick="$emit('pick', $event)"
|
25
|
+
>
|
26
|
+
<template v-if="$slots.suffixIcon" #suffixIcon>
|
27
|
+
<slot name="suffixIcon"></slot>
|
28
|
+
</template>
|
29
|
+
<template v-if="$slots.panel" #panel="slotProps">
|
30
|
+
<slot name="panel" v-bind="slotProps"></slot>
|
31
|
+
</template>
|
32
|
+
<template v-if="$slots.prepend" #prepend>
|
33
|
+
<slot name="prepend"></slot>
|
34
|
+
</template>
|
35
|
+
<template v-if="$slots.tips" #tips>
|
36
|
+
<slot name="tips"></slot>
|
37
|
+
</template>
|
38
|
+
</t-time-picker>
|
39
|
+
</template>
|
40
|
+
|
41
|
+
<script setup>
|
42
|
+
import { TimePicker as TTimePicker } from 'tdesign-vue-next';
|
43
|
+
import { computed } from 'vue';
|
44
|
+
|
45
|
+
const props = defineProps({
|
46
|
+
// 选中值
|
47
|
+
modelValue: {
|
48
|
+
type: [String, Array],
|
49
|
+
default: '',
|
50
|
+
},
|
51
|
+
// 是否允许直接输入时间
|
52
|
+
allowInput: {
|
53
|
+
type: Boolean,
|
54
|
+
default: true,
|
55
|
+
},
|
56
|
+
// 是否允许清除选中值
|
57
|
+
clearable: {
|
58
|
+
type: Boolean,
|
59
|
+
default: true,
|
60
|
+
},
|
61
|
+
// 是否禁用组件
|
62
|
+
disabled: {
|
63
|
+
type: Boolean,
|
64
|
+
default: false,
|
65
|
+
},
|
66
|
+
// 禁用时间项
|
67
|
+
disableTime: {
|
68
|
+
type: Function,
|
69
|
+
default: null,
|
70
|
+
},
|
71
|
+
// 时间格式
|
72
|
+
format: {
|
73
|
+
type: String,
|
74
|
+
default: 'HH:mm:ss',
|
75
|
+
},
|
76
|
+
// 透传给输入框的属性
|
77
|
+
inputProps: {
|
78
|
+
type: Object,
|
79
|
+
default: () => ({}),
|
80
|
+
},
|
81
|
+
// 输入框占位文本
|
82
|
+
placeholder: {
|
83
|
+
type: String,
|
84
|
+
default: '请选择时间',
|
85
|
+
},
|
86
|
+
// 透传给 popup 组件的属性
|
87
|
+
popupProps: {
|
88
|
+
type: Object,
|
89
|
+
default: () => ({}),
|
90
|
+
},
|
91
|
+
// 尺寸
|
92
|
+
size: {
|
93
|
+
type: String,
|
94
|
+
default: 'medium',
|
95
|
+
validator(val) {
|
96
|
+
return ['small', 'medium', 'large'].includes(val);
|
97
|
+
},
|
98
|
+
},
|
99
|
+
// 时间间隔步数
|
100
|
+
steps: {
|
101
|
+
type: Array,
|
102
|
+
default: () => [1, 1, 1],
|
103
|
+
},
|
104
|
+
// 是否为时间范围选择
|
105
|
+
range: {
|
106
|
+
type: Boolean,
|
107
|
+
default: false,
|
108
|
+
},
|
109
|
+
// 范围分隔符
|
110
|
+
rangeSeparator: {
|
111
|
+
type: String,
|
112
|
+
default: ' - ',
|
113
|
+
},
|
114
|
+
// 提示文本
|
115
|
+
tips: {
|
116
|
+
type: [String, Function],
|
117
|
+
default: '',
|
118
|
+
},
|
119
|
+
});
|
120
|
+
|
121
|
+
const emit = defineEmits([
|
122
|
+
'update:modelValue',
|
123
|
+
'change',
|
124
|
+
'blur',
|
125
|
+
'focus',
|
126
|
+
'close',
|
127
|
+
'open',
|
128
|
+
'dayclick',
|
129
|
+
'pick',
|
130
|
+
]);
|
131
|
+
|
132
|
+
// 处理值变更事件
|
133
|
+
const handleChange = (value) => {
|
134
|
+
emit('update:modelValue', value);
|
135
|
+
emit('change', value);
|
136
|
+
};
|
137
|
+
|
138
|
+
</script>
|
139
|
+
|
140
|
+
<style>
|
141
|
+
.t-time-picker {
|
142
|
+
width: 100%;
|
143
|
+
}
|
144
|
+
</style>
|
@@ -0,0 +1,153 @@
|
|
1
|
+
<template>
|
2
|
+
<t-tree
|
3
|
+
ref="treeRef"
|
4
|
+
v-bind="$attrs"
|
5
|
+
:data="data"
|
6
|
+
:value="modelValue"
|
7
|
+
:expanded="expandedModel"
|
8
|
+
:actived="activedModel"
|
9
|
+
:transition="transition"
|
10
|
+
:disable-check="disableCheck"
|
11
|
+
:keys="keys"
|
12
|
+
@change="handleChange"
|
13
|
+
@expand="handleExpand"
|
14
|
+
@active="handleActive"
|
15
|
+
@select="$emit('select', $event)"
|
16
|
+
@drag-start="$emit('drag-start', $event)"
|
17
|
+
@drag-end="$emit('drag-end', $event)"
|
18
|
+
@drag-over="$emit('drag-over', $event)"
|
19
|
+
@drag-leave="$emit('drag-leave', $event)"
|
20
|
+
@drag-drop="$emit('drag-drop', $event)"
|
21
|
+
@click="$emit('click', $event)"
|
22
|
+
@load="$emit('load', $event)"
|
23
|
+
>
|
24
|
+
<template v-if="$slots.default" #default="slotProps">
|
25
|
+
<slot :node="slotProps.node"></slot>
|
26
|
+
</template>
|
27
|
+
<template v-if="$slots.empty" #empty>
|
28
|
+
<slot name="empty"></slot>
|
29
|
+
</template>
|
30
|
+
<template v-if="$slots.icon" #icon="slotProps">
|
31
|
+
<slot name="icon" :node="slotProps.node"></slot>
|
32
|
+
</template>
|
33
|
+
<template v-if="$slots.label" #label="slotProps">
|
34
|
+
<slot name="label" :node="slotProps.node"></slot>
|
35
|
+
</template>
|
36
|
+
<template v-if="$slots.line" #line="slotProps">
|
37
|
+
<slot name="line" :node="slotProps.node"></slot>
|
38
|
+
</template>
|
39
|
+
<template v-if="$slots.operations" #operations="slotProps">
|
40
|
+
<slot name="operations" :node="slotProps.node"></slot>
|
41
|
+
</template>
|
42
|
+
</t-tree>
|
43
|
+
</template>
|
44
|
+
|
45
|
+
<script setup>
|
46
|
+
import { Tree as TTree } from 'tdesign-vue-next';
|
47
|
+
import { computed ,ref} from 'vue';
|
48
|
+
|
49
|
+
// 定义组件属性
|
50
|
+
const props = defineProps({
|
51
|
+
// 选中值
|
52
|
+
modelValue: {
|
53
|
+
type: Array,
|
54
|
+
default: () => []
|
55
|
+
},
|
56
|
+
// 展开节点
|
57
|
+
expanded: {
|
58
|
+
type: Array,
|
59
|
+
default: () => []
|
60
|
+
},
|
61
|
+
// 激活节点
|
62
|
+
actived: {
|
63
|
+
type: Array,
|
64
|
+
default: () => []
|
65
|
+
},
|
66
|
+
// 数据
|
67
|
+
items: {
|
68
|
+
type: Array,
|
69
|
+
default: () => []
|
70
|
+
},
|
71
|
+
// 是否启用过渡动画
|
72
|
+
transition: {
|
73
|
+
type: Boolean,
|
74
|
+
default: false
|
75
|
+
},
|
76
|
+
// 自定义节点禁用状态,返回true表示禁用
|
77
|
+
disableCheck: {
|
78
|
+
type: Function,
|
79
|
+
default: null
|
80
|
+
},
|
81
|
+
// 自定义节点数据中的字段名称
|
82
|
+
keys: {
|
83
|
+
type: Object,
|
84
|
+
default: () => ({
|
85
|
+
label: 'label',
|
86
|
+
value: 'value',
|
87
|
+
children: 'children'
|
88
|
+
})
|
89
|
+
}
|
90
|
+
});
|
91
|
+
|
92
|
+
const treeRef = ref();
|
93
|
+
// 定义组件事件
|
94
|
+
const emit = defineEmits([
|
95
|
+
'update:modelValue',
|
96
|
+
'update:expanded',
|
97
|
+
'update:actived',
|
98
|
+
'change',
|
99
|
+
'expand',
|
100
|
+
'active',
|
101
|
+
'select',
|
102
|
+
'click',
|
103
|
+
'load',
|
104
|
+
'drag-start',
|
105
|
+
'drag-end',
|
106
|
+
'drag-over',
|
107
|
+
'drag-leave',
|
108
|
+
'drag-drop'
|
109
|
+
]);
|
110
|
+
|
111
|
+
// 处理items映射到data
|
112
|
+
const data = computed(() => props.items);
|
113
|
+
|
114
|
+
// 展开事件
|
115
|
+
const expandedModel = computed({
|
116
|
+
get: () => props.expanded,
|
117
|
+
set: (val) => emit('update:expanded', val)
|
118
|
+
});
|
119
|
+
|
120
|
+
// 激活节点
|
121
|
+
const activedModel = computed({
|
122
|
+
get: () => props.actived,
|
123
|
+
set: (val) => emit('update:actived', val)
|
124
|
+
});
|
125
|
+
|
126
|
+
// 值改变事件
|
127
|
+
const handleChange = (val, context) => {
|
128
|
+
emit('update:modelValue', val);
|
129
|
+
emit('change', val, context);
|
130
|
+
};
|
131
|
+
|
132
|
+
// 节点展开事件
|
133
|
+
const handleExpand = (val, context) => {
|
134
|
+
emit('update:expanded', val);
|
135
|
+
emit('expand', val, context);
|
136
|
+
};
|
137
|
+
|
138
|
+
// 节点激活事件
|
139
|
+
const handleActive = (val, context) => {
|
140
|
+
emit('update:actived', val);
|
141
|
+
emit('active', val, context);
|
142
|
+
};
|
143
|
+
|
144
|
+
defineExpose({
|
145
|
+
treeRef
|
146
|
+
});
|
147
|
+
</script>
|
148
|
+
|
149
|
+
<style>
|
150
|
+
.t-tree {
|
151
|
+
width: 100%;
|
152
|
+
}
|
153
|
+
</style>
|