adtec-core-package 0.4.4 → 0.4.6
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
|
@@ -12,7 +12,7 @@ const route = useRoute()
|
|
|
12
12
|
|
|
13
13
|
const IsOperationAuth = () => {
|
|
14
14
|
const data: ISysMenuInfoVo = route.meta.sysMenuData as ISysMenuInfoVo
|
|
15
|
-
const o = data
|
|
15
|
+
const o = data?.operation?.find((c) => c.code === props.operCode)
|
|
16
16
|
if (o) {
|
|
17
17
|
return true
|
|
18
18
|
} else {
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
>
|
|
27
27
|
<template #reference>
|
|
28
28
|
<el-tooltip :content="tip" placement="top" style="cursor: pointer">
|
|
29
|
-
<el-button v-if="elementType === 'button'" style="padding: 8px 10px; margin-left: 4px"
|
|
29
|
+
<el-button v-if="elementType === 'button'" style="padding: 8px 10px; margin-left: 4px">
|
|
30
30
|
<el-icon
|
|
31
31
|
ref="buttonRef"
|
|
32
32
|
:model-value="iconName"
|
|
33
33
|
:style="style"
|
|
34
34
|
:tip="tip"
|
|
35
|
-
|
|
35
|
+
@click="iconClick"
|
|
36
36
|
:class="getClass"
|
|
37
37
|
>
|
|
38
38
|
<svg v-if="selcomp" aria-hidden="true">
|
|
@@ -1,182 +1,181 @@
|
|
|
1
|
-
<!--创建人 丁盼-->
|
|
2
|
-
<!--说明: ElIconBtn-->
|
|
3
|
-
<!--创建时间: 2024/11/24 下午3:12-->
|
|
4
|
-
<!--修改时间: 2024/11/24 下午3:12-->
|
|
5
|
-
<template>
|
|
6
|
-
<el-button v-if="elementType === 'button'" style="padding: 8px 10px; margin-left: 4px">
|
|
7
|
-
<el-icon
|
|
8
|
-
ref="ref_icons"
|
|
9
|
-
@mouseenter="visible = true"
|
|
10
|
-
@mouseleave="visible = false"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
v-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
virtual-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@
|
|
35
|
-
|
|
36
|
-
class="
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
v-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
virtual-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
import {
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
className
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
* @
|
|
97
|
-
* @
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* @
|
|
106
|
-
* @
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
* @
|
|
115
|
-
* @
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
* @
|
|
126
|
-
* @
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
* @
|
|
137
|
-
* @
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
margin:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
--el-button-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
</style>
|
|
1
|
+
<!--创建人 丁盼-->
|
|
2
|
+
<!--说明: ElIconBtn-->
|
|
3
|
+
<!--创建时间: 2024/11/24 下午3:12-->
|
|
4
|
+
<!--修改时间: 2024/11/24 下午3:12-->
|
|
5
|
+
<template>
|
|
6
|
+
<el-button v-if="elementType === 'button'" class="icon-btn" style="padding: 8px 10px; margin-left: 4px">
|
|
7
|
+
<el-icon
|
|
8
|
+
ref="ref_icons"
|
|
9
|
+
@mouseenter="visible = true"
|
|
10
|
+
@mouseleave="visible = false"
|
|
11
|
+
style="margin: 0"
|
|
12
|
+
:class="getClass"
|
|
13
|
+
>
|
|
14
|
+
<svg v-if="selcomp" class="icon" aria-hidden="true">
|
|
15
|
+
<use :href="'#' + iconName"></use>
|
|
16
|
+
</svg>
|
|
17
|
+
<component v-else :is="iconName"></component>
|
|
18
|
+
<el-tooltip
|
|
19
|
+
v-model:visible="visible"
|
|
20
|
+
v-if="tip"
|
|
21
|
+
:content="tip"
|
|
22
|
+
placement="top"
|
|
23
|
+
effect="light"
|
|
24
|
+
trigger="click"
|
|
25
|
+
virtual-triggering
|
|
26
|
+
:virtual-ref="ref_icons"
|
|
27
|
+
/>
|
|
28
|
+
</el-icon>
|
|
29
|
+
</el-button>
|
|
30
|
+
<el-icon
|
|
31
|
+
v-else
|
|
32
|
+
ref="ref_icons"
|
|
33
|
+
@mouseenter="visible = true"
|
|
34
|
+
@mouseleave="visible = false"
|
|
35
|
+
class="icon-btn"
|
|
36
|
+
:class="getClass"
|
|
37
|
+
>
|
|
38
|
+
<svg v-if="selcomp" class="icon" aria-hidden="true">
|
|
39
|
+
<use :href="'#' + iconName"></use>
|
|
40
|
+
</svg>
|
|
41
|
+
<component v-else :is="iconName"></component>
|
|
42
|
+
<el-tooltip
|
|
43
|
+
v-model:visible="visible"
|
|
44
|
+
v-if="tip"
|
|
45
|
+
:content="tip"
|
|
46
|
+
placement="top"
|
|
47
|
+
effect="light"
|
|
48
|
+
trigger="click"
|
|
49
|
+
virtual-triggering
|
|
50
|
+
:virtual-ref="ref_icons"
|
|
51
|
+
/>
|
|
52
|
+
</el-icon>
|
|
53
|
+
</template>
|
|
54
|
+
<script setup lang="ts">
|
|
55
|
+
import { useVModel } from '@vueuse/core'
|
|
56
|
+
import { computed, ref } from 'vue'
|
|
57
|
+
const visible = ref(false)
|
|
58
|
+
const ref_icons = ref()
|
|
59
|
+
const selcomp = computed(() => {
|
|
60
|
+
if (iconName.value?.includes('adtec')) {
|
|
61
|
+
return true
|
|
62
|
+
} else {
|
|
63
|
+
return false
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
/**
|
|
67
|
+
* 获取样式
|
|
68
|
+
*/
|
|
69
|
+
const getClass = computed(() => {
|
|
70
|
+
let className = 'icon-btn--'
|
|
71
|
+
// + props.type
|
|
72
|
+
if (props.type !== 'default') {
|
|
73
|
+
className += props.type
|
|
74
|
+
} else {
|
|
75
|
+
if (iconName.value === 'adtec-plus') {
|
|
76
|
+
className += 'primary'
|
|
77
|
+
} else if (iconName.value === 'adtec-refresh') {
|
|
78
|
+
className += 'default'
|
|
79
|
+
} else if (iconName.value === 'adtec-delete') {
|
|
80
|
+
className += 'danger'
|
|
81
|
+
} else if (iconName.value === 'adtec-edit') {
|
|
82
|
+
className += 'warning'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (props.disabled) {
|
|
87
|
+
className += ' icon-btn--disabled'
|
|
88
|
+
}
|
|
89
|
+
className += ' icon-btn--size-' + props.size
|
|
90
|
+
return className
|
|
91
|
+
})
|
|
92
|
+
// 定义Props类型
|
|
93
|
+
const props = defineProps({
|
|
94
|
+
/**
|
|
95
|
+
* @type string
|
|
96
|
+
* @default ''
|
|
97
|
+
* @description 提示文字
|
|
98
|
+
*/
|
|
99
|
+
tip: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: '',
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* @type {'adtec-plus'|'adtec-refresh'|'adtec-delete'|'adtec-edit'}
|
|
105
|
+
* @default 'default'
|
|
106
|
+
* @description 图标
|
|
107
|
+
*/
|
|
108
|
+
modelValue: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: '',
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* @type {'small'|'default'|'large'}
|
|
114
|
+
* @default 'default'
|
|
115
|
+
* @description 图标大小
|
|
116
|
+
*/
|
|
117
|
+
size: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: 'default',
|
|
120
|
+
// 注意:在`<script setup>`中,直接使用函数进行验证,JSDoc辅助IDE提示
|
|
121
|
+
validator: (value: string) => ['large', 'default', 'small'].includes(value),
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* @type {"default" | "success" | "warning" | "info" | "primary" | "danger"}
|
|
125
|
+
* @default 'default'
|
|
126
|
+
* @description 图标类型
|
|
127
|
+
*/
|
|
128
|
+
type: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: 'default',
|
|
131
|
+
validator: (value: string) =>
|
|
132
|
+
['default', 'success', 'warning', 'info', 'primary', 'danger'].includes(value),
|
|
133
|
+
},
|
|
134
|
+
/**
|
|
135
|
+
* @type {"icon" | "button"}
|
|
136
|
+
* @default 'icon'
|
|
137
|
+
* @description 元素类型
|
|
138
|
+
*/
|
|
139
|
+
elementType: {
|
|
140
|
+
type: String,
|
|
141
|
+
default: 'icon',
|
|
142
|
+
},
|
|
143
|
+
disabled: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: false,
|
|
146
|
+
},
|
|
147
|
+
})
|
|
148
|
+
const emit = defineEmits(['update:modelValue'])
|
|
149
|
+
const iconName = useVModel(props, 'modelValue', emit)
|
|
150
|
+
</script>
|
|
151
|
+
<style scoped lang="scss">
|
|
152
|
+
.icon-btn {
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
margin: 0px 0px 0px 8px;
|
|
155
|
+
//margin-left: 5px;
|
|
156
|
+
--el-button-hover-bg-color: var(--el-color-primary-light-3);
|
|
157
|
+
&:hover {
|
|
158
|
+
color: var(--el-button-hover-bg-color);
|
|
159
|
+
}
|
|
160
|
+
&--disabled {
|
|
161
|
+
color: var(--el-color-disabled-text-color);
|
|
162
|
+
cursor: not-allowed !important;
|
|
163
|
+
}
|
|
164
|
+
&--size-large {
|
|
165
|
+
font-size: var(--el-font-size-large);
|
|
166
|
+
}
|
|
167
|
+
&--size-default {
|
|
168
|
+
font-size: var(--el-font-size-base);
|
|
169
|
+
}
|
|
170
|
+
&--size-small {
|
|
171
|
+
font-size: var(--el-font-size-small);
|
|
172
|
+
}
|
|
173
|
+
@each $type in (primary, success, warning, danger, info) {
|
|
174
|
+
&--#{$type} {
|
|
175
|
+
--el-button-hover-bg-color: var(--el-color-#{$type}-light-3);
|
|
176
|
+
--el-button-disabled-bg-color: var(--el-color-#{$type}-light-5);
|
|
177
|
+
color: var(--el-color-#{$type});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
</style>
|