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