@jetlinks-web/components 1.0.5 → 2.0.1
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/index.ts +54 -15
- package/package.json +11 -8
- package/src/AMap/Map.vue +110 -107
- package/src/BadgeStatus/Badge.vue +41 -40
- package/src/BadgeStatus/color.ts +25 -23
- package/src/CardSelect/CardSelect.vue +136 -0
- package/src/CardSelect/index.ts +3 -0
- package/src/CheckButton/CheckButton.vue +146 -0
- package/src/CheckButton/index.md +27 -0
- package/src/CheckButton/index.ts +3 -0
- package/src/ConfigProvider/context.ts +17 -0
- package/src/ConfigProvider/index.tsx +42 -0
- package/src/Echarts/Echarts.vue +43 -43
- package/src/Ellipsis/Ellipsis.vue +182 -0
- package/src/Ellipsis/index.ts +3 -0
- package/src/Empty/Empty.vue +43 -0
- package/src/Empty/image.ts +3 -0
- package/src/Empty/index.ts +2 -0
- package/src/FullPage/{index.vue → FullPage.vue} +30 -27
- package/src/FullPage/index.ts +3 -0
- package/src/Icon/icon.tsx +40 -0
- package/src/Icon/index.ts +3 -0
- package/src/MonacoEditor/Monaco.vue +242 -0
- package/src/MonacoEditor/index.md +26 -0
- package/src/MonacoEditor/index.ts +2 -0
- package/src/PermissionButton/index.tsx +95 -92
- package/src/ProLayout/Basic/BasicLayout.less +66 -0
- package/src/ProLayout/Basic/BasicLayout.tsx +392 -0
- package/src/ProLayout/Basic/Header.less +8 -0
- package/src/ProLayout/Basic/Header.tsx +115 -0
- package/src/ProLayout/PageContainer/index.less +103 -0
- package/src/ProLayout/PageContainer/index.tsx +441 -0
- package/src/ProLayout/PageContainer/typings.ts +56 -0
- package/src/ProLayout/RouteContext.ts +87 -0
- package/src/ProLayout/SiderMenu/BaseMenu.tsx +296 -0
- package/src/ProLayout/SiderMenu/SiderMenu.tsx +320 -0
- package/src/ProLayout/SiderMenu/index.less +212 -0
- package/src/ProLayout/SiderMenu/index.ts +2 -0
- package/src/ProLayout/SiderMenu/typings.ts +49 -0
- package/src/ProLayout/TopHeader/index.less +174 -0
- package/src/ProLayout/TopHeader/index.tsx +210 -0
- package/src/ProLayout/defaultSettings.ts +106 -0
- package/src/ProLayout/index.ts +6 -0
- package/src/ProLayout/style/default.less +4 -0
- package/src/ProLayout/style/index.ts +1 -0
- package/src/ProLayout/style/style.less +7 -0
- package/src/ProLayout/typings.ts +87 -0
- package/src/ProLayout/util.ts +64 -0
- package/src/ProTable/index.md +53 -0
- package/src/ProTable/index.tsx +551 -0
- package/src/ProTable/proTableTypes.ts +70 -0
- package/src/ProTable/style/index.less +92 -0
- package/src/ProTable/style/index.ts +1 -0
- package/src/Scrollbar/Bar.vue +75 -0
- package/src/Scrollbar/Scrollbar.vue +260 -0
- package/src/Scrollbar/Thumb.vue +163 -0
- package/src/Scrollbar/constants.ts +10 -0
- package/src/Scrollbar/index.ts +4 -0
- package/src/Scrollbar/scrollbar.ts +108 -0
- package/src/Scrollbar/thumb.ts +16 -0
- package/src/Scrollbar/util.ts +38 -0
- package/src/Search/Advanced/History.vue +140 -0
- package/src/Search/Advanced/SaveHistory.vue +108 -0
- package/src/Search/Advanced/index.vue +435 -0
- package/src/Search/Item.vue +525 -0
- package/src/Search/Search.vue +398 -0
- package/src/Search/hooks/index.ts +1 -0
- package/src/Search/hooks/useSearchItems.ts +68 -0
- package/src/Search/index.md +57 -0
- package/src/Search/index.ts +5 -0
- package/src/Search/setting.ts +55 -0
- package/src/Search/typing.ts +76 -0
- package/src/Search/util.ts +263 -0
- package/src/ValueItem/ValueItem.vue +50 -35
- package/src/ValueItem/util.ts +2 -1
- package/src/style/index.ts +3 -0
- package/src/style/variable.less +4 -0
- package/src/GeoComponent/GeoComponent.vue +0 -139
- package/src/GeoComponent/index.ts +0 -3
- package/src/PermissionButton/hooks.ts +0 -20
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['j-check-button', props.class]" :style="style">
|
|
3
|
+
<div
|
|
4
|
+
v-for="item in _options"
|
|
5
|
+
:key="item.value"
|
|
6
|
+
:class="[
|
|
7
|
+
'j-check-button-item',
|
|
8
|
+
myValue.includes(item.value) ? 'selected' : '',
|
|
9
|
+
item.disabled ? 'disabled' : '',
|
|
10
|
+
]"
|
|
11
|
+
@click="
|
|
12
|
+
() => {
|
|
13
|
+
selected(item.value, item.disabled);
|
|
14
|
+
}
|
|
15
|
+
"
|
|
16
|
+
>
|
|
17
|
+
{{ item.label }}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import { computed, CSSProperties, PropType, ref, watch } from 'vue';
|
|
24
|
+
import { isArray } from '@jetlinks-web/utils';
|
|
25
|
+
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
value: {
|
|
28
|
+
type: [String, Array],
|
|
29
|
+
default: undefined,
|
|
30
|
+
},
|
|
31
|
+
options: {
|
|
32
|
+
type: Array as PropType<{ disabled?: boolean; label: string; value: string }[]>,
|
|
33
|
+
default: () => [],
|
|
34
|
+
},
|
|
35
|
+
multiple: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
disabled: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
class: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: undefined,
|
|
46
|
+
},
|
|
47
|
+
style: {
|
|
48
|
+
type: Object as PropType<CSSProperties>,
|
|
49
|
+
default: () => ({}),
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
const emit = defineEmits(['update:value', 'change', 'select']);
|
|
53
|
+
|
|
54
|
+
const myValue = ref();
|
|
55
|
+
const optionsMap = ref(new Map());
|
|
56
|
+
|
|
57
|
+
const _options = computed(() => {
|
|
58
|
+
props.options.forEach((item: any) => {
|
|
59
|
+
if (props.disabled) {
|
|
60
|
+
item.display = props.disabled;
|
|
61
|
+
}
|
|
62
|
+
optionsMap.value.set(item.value, item);
|
|
63
|
+
});
|
|
64
|
+
return props.options;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
watch(
|
|
68
|
+
() => props.value,
|
|
69
|
+
() => {
|
|
70
|
+
if (props.value) {
|
|
71
|
+
myValue.value = isArray(props.value) ? props.value : [props.value];
|
|
72
|
+
} else {
|
|
73
|
+
myValue.value = [];
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{immediate: true, deep: true},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const selected = (key: string | number, disabled: boolean) => {
|
|
80
|
+
if (disabled) return;
|
|
81
|
+
|
|
82
|
+
const values = new Set(myValue.value);
|
|
83
|
+
|
|
84
|
+
if (values.has(key)) {
|
|
85
|
+
values.delete(key);
|
|
86
|
+
} else {
|
|
87
|
+
if (!props.multiple) {
|
|
88
|
+
values.clear();
|
|
89
|
+
}
|
|
90
|
+
values.add(key);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
myValue.value = [...values.values()];
|
|
94
|
+
|
|
95
|
+
const optionsItems = myValue.value.map((_key) => {
|
|
96
|
+
return optionsMap.value.get(_key);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const _value = props.multiple ? myValue.value : myValue.value[0];
|
|
100
|
+
|
|
101
|
+
emit('update:value', _value);
|
|
102
|
+
emit('change', _value, props.multiple ? optionsItems : optionsItems[0]);
|
|
103
|
+
emit('select', _value, props.multiple ? optionsItems : optionsItems[0]);
|
|
104
|
+
};
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style scoped lang="less">
|
|
108
|
+
.j-check-button {
|
|
109
|
+
display: flex;
|
|
110
|
+
gap: 16px;
|
|
111
|
+
width: 100%;
|
|
112
|
+
|
|
113
|
+
.j-check-button-item {
|
|
114
|
+
flex: 1;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
padding: 8px;
|
|
117
|
+
border-radius: @border-radius-base;
|
|
118
|
+
background-color: #f2f3f5;
|
|
119
|
+
transition: all 0.3s;
|
|
120
|
+
color: #333;
|
|
121
|
+
text-align: center;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
|
|
124
|
+
&:hover {
|
|
125
|
+
background-color: @primary-color;
|
|
126
|
+
opacity: 0.85;
|
|
127
|
+
color: #fff;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&.selected {
|
|
131
|
+
background-color: @primary-color;
|
|
132
|
+
color: #fff;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&.disabled {
|
|
136
|
+
cursor: not-allowed;
|
|
137
|
+
color: #00000060;
|
|
138
|
+
|
|
139
|
+
&:hover {
|
|
140
|
+
background-color: #f2f3f5;
|
|
141
|
+
color: #00000060;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: Components
|
|
3
|
+
subtitle: 选择按钮
|
|
4
|
+
type: 数据录入
|
|
5
|
+
title: Checkbutton
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## API
|
|
9
|
+
|
|
10
|
+
### 属性
|
|
11
|
+
|
|
12
|
+
#### CheckButton
|
|
13
|
+
|
|
14
|
+
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
15
|
+
| -------- | ------------------------------- | ------------------------------------------------------------ | ------ | ---- |
|
|
16
|
+
| multiple | 多选 | boolean | false | |
|
|
17
|
+
| disabled | 失效状态 | boolean | false | |
|
|
18
|
+
| value | 与 CheckboxGroup 组合使用时的值 | boolean \| string \| number | - | |
|
|
19
|
+
| options | 选择项 | Array<{ label: string value: string disabled?: boolean }> | \[] | |
|
|
20
|
+
| class | 类名 | string | undefined | - |
|
|
21
|
+
| style | css样式 | CSSProperties | {} | - |
|
|
22
|
+
|
|
23
|
+
#### 事件
|
|
24
|
+
|
|
25
|
+
| 事件名称 | 说明 | 回调参数 | 默认值 |版本 | |
|
|
26
|
+
| -------- | -------------- | --------------------- | ----------------------- | --- | --- |
|
|
27
|
+
| change | 变化时回调函数 | Function(keys: string | string[], nodes: any[]) | - | |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type {PropType} from "vue";
|
|
2
|
+
import { configProviderProps } from 'ant-design-vue/lib/config-provider/context';
|
|
3
|
+
|
|
4
|
+
export type MapConfigType = {
|
|
5
|
+
mapStyle?: any
|
|
6
|
+
JSKey?: string
|
|
7
|
+
WebKey?: string
|
|
8
|
+
}
|
|
9
|
+
export const configProps = () => ({
|
|
10
|
+
...configProviderProps(),
|
|
11
|
+
IconConfig: {
|
|
12
|
+
type: Object as PropType<{ scriptUrl: string }>
|
|
13
|
+
},
|
|
14
|
+
MapConfig: {
|
|
15
|
+
type: Object as PropType<MapConfigType>
|
|
16
|
+
}
|
|
17
|
+
})
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {defineComponent, provide, reactive} from 'vue'
|
|
2
|
+
import { configProps } from './context'
|
|
3
|
+
import type { MapConfigType } from './context'
|
|
4
|
+
import { ComponentsEnum, MAPConfig } from '@jetlinks-web/constants'
|
|
5
|
+
import { ConfigProvider } from 'ant-design-vue'
|
|
6
|
+
import {omit} from 'lodash-es'
|
|
7
|
+
import Empty from '../Empty'
|
|
8
|
+
|
|
9
|
+
const JConfigProvider = defineComponent({
|
|
10
|
+
name: 'JConfigProvider',
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
props: {
|
|
13
|
+
...configProps()
|
|
14
|
+
},
|
|
15
|
+
setup(props, { slots }) {
|
|
16
|
+
|
|
17
|
+
const _iconConfig = reactive(props.IconConfig || {})
|
|
18
|
+
const _mapConfig = reactive<MapConfigType>(props.MapConfig || {})
|
|
19
|
+
|
|
20
|
+
provide(ComponentsEnum.Icon, _iconConfig) // 全局Icon 配置
|
|
21
|
+
|
|
22
|
+
provide(MAPConfig, _mapConfig) // 全局地图配置
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
return (
|
|
26
|
+
<ConfigProvider
|
|
27
|
+
{...omit(props, ['IconConfig', 'MapConfig'])}
|
|
28
|
+
v-slots={{
|
|
29
|
+
renderEmpty: () => (slots.renderEmpty?.() || <Empty />),
|
|
30
|
+
...slots,
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
{ slots.default?.() }
|
|
34
|
+
</ConfigProvider>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
JConfigProvider.config = ConfigProvider.config
|
|
41
|
+
|
|
42
|
+
export default JConfigProvider
|
package/src/Echarts/Echarts.vue
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div ref="echartsDom" class="echarts-warp" :style="style"></div>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
style?: CSSProperties
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const props = defineProps({
|
|
14
|
-
options: {
|
|
15
|
-
type: Object,
|
|
16
|
-
default: undefined,
|
|
17
|
-
},
|
|
18
|
-
style: Object as PropType<Props['style']>,
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const echartsDom = ref<Ref<HTMLDivElement> | HTMLDivElement>()
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
watch(
|
|
26
|
-
() => props.options,
|
|
27
|
-
() => {
|
|
28
|
-
if (props.options) {
|
|
29
|
-
nextTick(() => {
|
|
30
|
-
setOptions(props.options)
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
)
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<style scoped>
|
|
39
|
-
.echarts-warp {
|
|
40
|
-
width: 100%;
|
|
41
|
-
height: 100%;
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="echartsDom" class="echarts-warp" :style="style"></div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" name="Echarts" setup>
|
|
6
|
+
import {CSSProperties, nextTick, ref, watch, Ref} from 'vue'
|
|
7
|
+
import {useECharts} from '@jetlinks-web/hooks'
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
style?: CSSProperties
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
options: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: undefined,
|
|
17
|
+
},
|
|
18
|
+
style: Object as PropType<Props['style']>,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const echartsDom = ref<Ref<HTMLDivElement> | HTMLDivElement>()
|
|
22
|
+
|
|
23
|
+
const {setOptions} = useECharts(echartsDom.value)
|
|
24
|
+
|
|
25
|
+
watch(
|
|
26
|
+
() => JSON.stringify(props.options),
|
|
27
|
+
() => {
|
|
28
|
+
if (props.options) {
|
|
29
|
+
nextTick(() => {
|
|
30
|
+
setOptions(props.options)
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{immediate: true},
|
|
35
|
+
)
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style scoped>
|
|
39
|
+
.echarts-warp {
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Tooltip ref="tooltipRef" placement="top" v-bind="tooltip" :visible="visible">
|
|
3
|
+
<template v-if="tooltip">
|
|
4
|
+
<div :class="[jEllipsisLineClampClass, jEllipsis, 'j-ellipsis-deep']">
|
|
5
|
+
<slot></slot>
|
|
6
|
+
<slot name="tooltip"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<span
|
|
10
|
+
ref="triggerRef"
|
|
11
|
+
v-bind="triggerAttrs()"
|
|
12
|
+
@click="handleClickRef"
|
|
13
|
+
@mouseleave="visible = false"
|
|
14
|
+
@mouseenter="
|
|
15
|
+
;[
|
|
16
|
+
props.expandTrigger === 'click'
|
|
17
|
+
? getTooltipDisabled()
|
|
18
|
+
: showTooltip(),
|
|
19
|
+
]
|
|
20
|
+
"
|
|
21
|
+
>
|
|
22
|
+
</span>
|
|
23
|
+
</Tooltip>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup>
|
|
27
|
+
import { Tooltip } from 'ant-design-vue'
|
|
28
|
+
import { computed, mergeProps, ref, useAttrs } from 'vue'
|
|
29
|
+
|
|
30
|
+
defineOptions({
|
|
31
|
+
name: 'Ellipsis',
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const props = defineProps({
|
|
35
|
+
expandTrigger: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: undefined,
|
|
38
|
+
},
|
|
39
|
+
/** multiline ellipsis */
|
|
40
|
+
lineClamp: {
|
|
41
|
+
type: [Number, String],
|
|
42
|
+
default: 1,
|
|
43
|
+
},
|
|
44
|
+
tooltip: {
|
|
45
|
+
type: [Boolean, Object],
|
|
46
|
+
default: true,
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
// define class name
|
|
51
|
+
const jEllipsis = 'j-ellipsis'
|
|
52
|
+
const jEllipsisCursorClass = 'j-ellipsis-cursor'
|
|
53
|
+
const jEllipsisLineClampClass = 'j-ellipsis-line-clamp'
|
|
54
|
+
|
|
55
|
+
const expandedRef = ref(false)
|
|
56
|
+
const tooltipRef = ref(null)
|
|
57
|
+
const triggerRef = ref(null)
|
|
58
|
+
const visible = ref(false)
|
|
59
|
+
|
|
60
|
+
const attrs = useAttrs()
|
|
61
|
+
|
|
62
|
+
const handleClickRef = computed(() => {
|
|
63
|
+
return props.expandTrigger === 'click'
|
|
64
|
+
? () => {
|
|
65
|
+
const { value: expanded } = expandedRef
|
|
66
|
+
expandedRef.value = !expanded
|
|
67
|
+
}
|
|
68
|
+
: undefined
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
function triggerAttrs() {
|
|
72
|
+
return {
|
|
73
|
+
...mergeProps(attrs, {
|
|
74
|
+
class: [
|
|
75
|
+
jEllipsis,
|
|
76
|
+
props.lineClamp !== undefined ? jEllipsisLineClampClass : undefined,
|
|
77
|
+
props.expandTrigger === 'click' ? jEllipsisCursorClass : undefined,
|
|
78
|
+
],
|
|
79
|
+
style: ellipsisStyleRef.value,
|
|
80
|
+
}),
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const showTooltip = () => {
|
|
85
|
+
const { value: trigger } = triggerRef
|
|
86
|
+
if (trigger) {
|
|
87
|
+
visible.value = trigger.scrollHeight > trigger.offsetHeight
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const ellipsisStyleRef = computed(() => {
|
|
92
|
+
const { lineClamp } = props
|
|
93
|
+
const { value: expanded } = expandedRef
|
|
94
|
+
if (lineClamp !== undefined) {
|
|
95
|
+
return {
|
|
96
|
+
textOverflow: '',
|
|
97
|
+
'-webkit-line-clamp': expanded ? '' : lineClamp,
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
return {
|
|
101
|
+
textOverflow: expanded ? '' : 'ellipsis',
|
|
102
|
+
'-webkit-line-clamp': '',
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
const syncEllipsisStyle = (trigger) => {
|
|
108
|
+
if (!trigger) return
|
|
109
|
+
const latestStyle = ellipsisStyleRef.value
|
|
110
|
+
const lineClampClass = jEllipsisLineClampClass
|
|
111
|
+
if (props.lineClamp !== undefined) {
|
|
112
|
+
syncTriggerClass(trigger, lineClampClass, 'add')
|
|
113
|
+
} else {
|
|
114
|
+
syncTriggerClass(trigger, lineClampClass, 'remove')
|
|
115
|
+
}
|
|
116
|
+
for (const key in latestStyle) {
|
|
117
|
+
if (trigger.style[key] !== latestStyle[key]) {
|
|
118
|
+
trigger.style[key] = latestStyle[key]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const syncTriggerClass = (trigger, styleClass, action) => {
|
|
124
|
+
if (action === 'add') {
|
|
125
|
+
if (!trigger.classList.contains(styleClass)) {
|
|
126
|
+
trigger.classList.add(styleClass)
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
if (trigger.classList.contains(styleClass)) {
|
|
130
|
+
trigger.classList.remove(styleClass)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const syncCursorStyle = (trigger, tooltipDisabled) => {
|
|
136
|
+
if (props.expandTrigger === 'click' && !tooltipDisabled) {
|
|
137
|
+
syncTriggerClass(trigger, jEllipsisCursorClass, 'add')
|
|
138
|
+
} else {
|
|
139
|
+
syncTriggerClass(trigger, jEllipsisCursorClass, 'remove')
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const getTooltipDisabled = () => {
|
|
144
|
+
let tooltipDisabled = false
|
|
145
|
+
const { value: expanded } = expandedRef
|
|
146
|
+
|
|
147
|
+
if (expanded) return true
|
|
148
|
+
|
|
149
|
+
const { value: trigger } = triggerRef
|
|
150
|
+
|
|
151
|
+
if (trigger) {
|
|
152
|
+
syncEllipsisStyle(trigger)
|
|
153
|
+
tooltipDisabled = trigger.scrollHeight <= trigger.offsetHeight
|
|
154
|
+
|
|
155
|
+
syncCursorStyle(trigger, tooltipDisabled)
|
|
156
|
+
}
|
|
157
|
+
return tooltipDisabled
|
|
158
|
+
}
|
|
159
|
+
</script>
|
|
160
|
+
|
|
161
|
+
<style scoped>
|
|
162
|
+
.j-ellipsis {
|
|
163
|
+
overflow: hidden;
|
|
164
|
+
vertical-align: bottom;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.j-ellipsis-cursor {
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.j-ellipsis-line-clamp {
|
|
172
|
+
display: -webkit-box;
|
|
173
|
+
-webkit-box-orient: vertical;
|
|
174
|
+
word-break: break-all;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.j-ellipsis-deep {
|
|
178
|
+
max-height: 380px;
|
|
179
|
+
-webkit-line-clamp: 17;
|
|
180
|
+
text-overflow: ellipsis;
|
|
181
|
+
}
|
|
182
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Empty v-bind="baseProps">
|
|
3
|
+
<template v-for="item in renderArr" :key="item" #[item]="scope">
|
|
4
|
+
<slot :name="item" :scope="scope"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</Empty>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup name="JEmpty">
|
|
10
|
+
import { Empty } from 'ant-design-vue'
|
|
11
|
+
import { useSlots } from 'vue'
|
|
12
|
+
import NoData from './image'
|
|
13
|
+
import { omit } from 'lodash-es'
|
|
14
|
+
import type { PropType, CSSProperties } from 'vue'
|
|
15
|
+
|
|
16
|
+
const slots = useSlots()
|
|
17
|
+
const renderArr = Object.keys(slots)
|
|
18
|
+
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
description: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: '暂无数据',
|
|
23
|
+
},
|
|
24
|
+
image: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: NoData,
|
|
27
|
+
},
|
|
28
|
+
imageStyle: {
|
|
29
|
+
type: Object as PropType<CSSProperties>,
|
|
30
|
+
default: () => {
|
|
31
|
+
return { height: '60px' }
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const baseProps = omit(props, ...renderArr)
|
|
37
|
+
</script>
|
|
38
|
+
<style lang="less">
|
|
39
|
+
.@{ant-prefix}-empty-description {
|
|
40
|
+
color: #b3b3b3;
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const img =
|
|
2
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAuCAYAAABu3ppsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAWUSURBVHgB7ZoLTuNIEIY7vN8k4iWE0Don2LnBZG/AnoDMCbJ7gpk9wbInGOYGszfw3IAbxAghhAAR3m/Y+hpX1DF24gerzIz4JctOu92u/6/qqnaDMT84SqYP2N7ebjw9PdXlslwqlfzHx8c/q9Vqy+TAkCkIMWZdjNnAGDl8uf4gxgTNZpPfnhzvnO7BwMDAr4ODgxtzc3NGrs3Z2Vldjm2598nkQCEPiJHe8PBwE2PGxsbM6empOT4+DkJDa2KoGRkZafe/v783Nzc3tm12dtZMTEzYtt3d3ZbneRWTA0U9sDY6OmqNv729RU0jv71yuezRloTz83OImqurK0vEPHsvF4oSKA8NDVmDTk5OTKVSsar2wtTUlD1arZbZ39+nKTA5MWCKISAkUHNhYSGV8S7EU2ZyctJeEo4mB4oS2Lq+vrbGu7GeBZCQMCIbfTY5UIiATNQGBnSL9zQIx6iJF/4wGZE7C2kGWlpaMsyDosCTMh9akoarWWpCbg+I+h/JQEWMlwJmU+/l5aX1ohxko3qWMTK/XZSvifHvRanazMxMxz1yOhMaw6gNvcjt7e3ZM6mUTMZZPNGQd7TEC5smBXqGUJgd1mSSvZdzTcKmTIHC2JWVlY6+R0dH1pDV1VVLBBJJgOTOzo4lifpUZQhIUbMJQYgE8s5N6feFym7SEgiXAKrympxtUWLQ8fFxI4PaAkTMLi4udjx7cHBgiSmWl5fb1xDjHvlfPQNJ2hiLvrRTF0jHIpQtjIRXSOSvOCIdBGRd8zeLLFRmEIxmoCgYGMXIHi4whoIWTa3hcsFeI4JLnAoO8MjFxYV9hrE58DTtkOCQa4j8I0S2XhDQrMLEpDjxMC+LK05xBHgRbXHg3uHhobm7uzPT09MmOnfAw8ODJe4C8fC4iGqJUrmlH5nqdyHh06c9y8gqOriyRk2Mxe2EEaRcYBB9ASFCVYVEtKjRhhAIw3UcWVUcb2GwjonhvAcy2CH9yhJ6H+W2b9QDqC9Mm0zKaOZgEA5erh7hJRz8dg1wf7tAOZ7XfnFZCvXpo3NFF4k6/5QwzxKO4okK9UJHWEO9uLSnCy+UIGeTaQBq0Y5auDlpKYFhGEFfDFNjaMfLJATGZjz6Qcw1OAra6SfzpS4/N6wHgiBAfS9NUcIIV1EGI/31epbnMJjnMF49pionGRwHvCRC+vIN8VtJwqcu7D+zFEaltHDnCcYRWnhRJ70aTPxyxkANC/pkMTju3XwESRhVdQ5QqBqiYg01sxAB7jzB/byAw1X4NdZLQOcK4SwEPnTUASGyKS9aJ6bzEKGyYjjGRqt0XqinMZpz2Ma3N4XNj8oSaCjAkPBISwQPaErlTAjlVV1V5swEJ4UyFmHOpJcJ/O1FHXBBRqAzxUWJQCIpUwGqKM/xDLGOWnEFKw5RlRmH9zBOL/G6ShQlgsp4iILnEkFtJiv3KHzMA5TqRiCqMs+oyoRwWqTycZQIhQRlNH3iIdRqDyptEHErLtc60TGaMQmNNCoXJhAlgrIuEQyan5+3YQRQkL4QA9zXIpZH5VcjEEcEo+PWSShLGKEy6TRuVfsaKJScMTopzjX//98ouq3Sd7wR6DfeCPQbPx8Byrq7NfK9I1oHNsM9ynVZ13jRNU+/wGcroiJu+CXY3jtNrOd8qUm5Z//TEnHXOklgecEaiGVFUbB2wtgwIthK2ZLjX7n11d3gSrO1aInIUsBj3dPtjxhFCERVFgKBGizHVtKOdeoVVUikIcuHdywf4ohkJeCqzEo3/NJ6oXI3ZF4SsjuNR4SI3Z12dxR6EYhRmdD4Yp43qfw8fysu9AcOOX3iG5ovNVacfE1FCXRR2Xf3OPOi8KJciYhX1vWTkg8dV2W591XOanSuv8gn4dX+1cAh8gu/ReVv5tlg37whGf8BDgTT6KlQOV4AAAAASUVORK5CYII=';
|
|
3
|
+
export default img;
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="full-page-warp"
|
|
4
|
+
ref="fullPage"
|
|
5
|
+
:style="{ minHeight: `calc(100vh - ${y + 24}px)` }"
|
|
6
|
+
>
|
|
7
|
+
<div class="full-page-warp-content">
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts" name="FullPage">
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
import { useElementBounding } from '@vueuse/core'
|
|
16
|
+
|
|
17
|
+
const fullPage = ref(null)
|
|
18
|
+
const { y } = useElementBounding(fullPage)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped lang="less">
|
|
22
|
+
.full-page-warp {
|
|
23
|
+
background: #fff;
|
|
24
|
+
display: flex;
|
|
25
|
+
|
|
26
|
+
.full-page-warp-content {
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineComponent, createVNode, watchEffect } from 'vue';
|
|
2
|
+
import * as aIcon from '@ant-design/icons-vue';
|
|
3
|
+
import { createFromIconfontCN } from '@ant-design/icons-vue';
|
|
4
|
+
import { useIcon } from '@jetlinks-web/hooks'
|
|
5
|
+
|
|
6
|
+
let MyIcon = createFromIconfontCN({
|
|
7
|
+
scriptUrl: '//at.alicdn.com/t/c/font_3183515_i7oma42he.js', // 在 iconfont.cn 上生成
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const AntdIcon = (props: { type: string }) => createVNode(aIcon[props.type]);
|
|
11
|
+
|
|
12
|
+
const Icon = (props: any) =>
|
|
13
|
+
Object.keys(aIcon).includes(props.type) ? (
|
|
14
|
+
<AntdIcon {...props} />
|
|
15
|
+
) : (
|
|
16
|
+
<MyIcon {...props} />
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
name: 'AIcon',
|
|
21
|
+
// 传入组件配置
|
|
22
|
+
props: ['type', 'scriptUrl', 'class'],
|
|
23
|
+
emits: ['click'],
|
|
24
|
+
setup(props, {emit, attrs}) {
|
|
25
|
+
const config = useIcon()
|
|
26
|
+
watchEffect(() => {
|
|
27
|
+
const url = props.scriptUrl || config.scriptUrl
|
|
28
|
+
if (url) {
|
|
29
|
+
MyIcon = createFromIconfontCN({
|
|
30
|
+
scriptUrl: url,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const click = () => {
|
|
36
|
+
emit('click');
|
|
37
|
+
};
|
|
38
|
+
return () => <Icon {...props} style={attrs.style} onClick={click}/>;
|
|
39
|
+
},
|
|
40
|
+
});
|