@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,242 @@
|
|
|
1
|
+
<!-- 代码编辑器 -->
|
|
2
|
+
<template>
|
|
3
|
+
<div ref="dom" class="j-monaco-editor"></div>
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script setup>
|
|
7
|
+
import {
|
|
8
|
+
ref,
|
|
9
|
+
onMounted,
|
|
10
|
+
watch,
|
|
11
|
+
onUnmounted,
|
|
12
|
+
toRaw,
|
|
13
|
+
nextTick
|
|
14
|
+
} from 'vue';
|
|
15
|
+
import * as monaco from 'monaco-editor';
|
|
16
|
+
import { omit } from 'lodash-es';
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
modelValue: [String, Number],
|
|
20
|
+
theme: {type: String, default: 'vs-dark'},
|
|
21
|
+
language: {type: String, default: 'json'},
|
|
22
|
+
codeTips: {type: Array, default: () => []},
|
|
23
|
+
init: {type: Function, default: undefined},
|
|
24
|
+
registrationTips: {type: Object, default: () => ({})},
|
|
25
|
+
registrationTypescript: {type: Object, default: () => ({})},
|
|
26
|
+
blurFormat: {type: Boolean, default: true},
|
|
27
|
+
readOnly: {type: Boolean, default: false},
|
|
28
|
+
options: {type: Object, default: () => ({})},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const emit = defineEmits([
|
|
32
|
+
'update:modelValue',
|
|
33
|
+
'blur',
|
|
34
|
+
'focus',
|
|
35
|
+
'change',
|
|
36
|
+
'errorChange',
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
const dom = ref();
|
|
40
|
+
|
|
41
|
+
const instance = ref();
|
|
42
|
+
|
|
43
|
+
const monacoProviderRef = ref();
|
|
44
|
+
const monacoTypescriptProviderRef = ref();
|
|
45
|
+
|
|
46
|
+
// codeTipItem.dispose() // 销毁自定义提示
|
|
47
|
+
|
|
48
|
+
const handleSuggestions = (suggestions, range) => {
|
|
49
|
+
return Array.isArray(suggestions)
|
|
50
|
+
? suggestions.map((item) => ({...item, range}))
|
|
51
|
+
: [];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const disposeRegister = () => {
|
|
55
|
+
monacoProviderRef.value?.dispose();
|
|
56
|
+
monacoProviderRef.value = null;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* 代码提示注册
|
|
60
|
+
*/
|
|
61
|
+
const registerCompletionItemProvider = () => {
|
|
62
|
+
disposeRegister();
|
|
63
|
+
if (monaco.languages && props.registrationTips?.suggestions) {
|
|
64
|
+
const {name, suggestions} = props.registrationTips;
|
|
65
|
+
monacoProviderRef.value =
|
|
66
|
+
monaco.languages.registerCompletionItemProvider(name || 'json', {
|
|
67
|
+
provideCompletionItems: function (model, position) {
|
|
68
|
+
const word = model.getWordUntilPosition(position); // 获取提示代码范围位置
|
|
69
|
+
const range = {
|
|
70
|
+
startLineNumber: position.lineNumber,
|
|
71
|
+
endLineNumber: position.lineNumber,
|
|
72
|
+
startColumn: word.startColumn,
|
|
73
|
+
endColumn: word.endColumn,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
suggestions: handleSuggestions(suggestions, range),
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const disposeTypescript = () => {
|
|
85
|
+
monacoTypescriptProviderRef.value?.dispose();
|
|
86
|
+
monacoTypescriptProviderRef.value = null;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const registerTypescript = () => {
|
|
90
|
+
disposeTypescript();
|
|
91
|
+
if (monaco.languages && props.registrationTypescript?.typescript) {
|
|
92
|
+
const {name, typescript} = props.registrationTypescript;
|
|
93
|
+
monacoTypescriptProviderRef.value =
|
|
94
|
+
monaco.languages.typescript.javascriptDefaults.addExtraLib(
|
|
95
|
+
typescript,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 代码格式化
|
|
102
|
+
*/
|
|
103
|
+
const editorFormat = () => {
|
|
104
|
+
if (!instance.value) return;
|
|
105
|
+
toRaw(instance.value).getAction('editor.action.formatDocument')?.run();
|
|
106
|
+
if (props.hasOwnProperty('readOnly')) {
|
|
107
|
+
setTimeout(() => {
|
|
108
|
+
toRaw(instance.value).updateOptions({
|
|
109
|
+
readOnly: props.readOnly !== false,
|
|
110
|
+
});
|
|
111
|
+
}, 100);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
monaco.editor.onDidChangeMarkers(([uri]) => {
|
|
116
|
+
const markers = monaco.editor.getModelMarkers({resource: uri});
|
|
117
|
+
emit('errorChange', markers);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
onMounted(async () => {
|
|
121
|
+
const _model = monaco.editor.createModel(props.modelValue, props.language);
|
|
122
|
+
|
|
123
|
+
instance.value = monaco.editor.create(dom.value, {
|
|
124
|
+
model: _model,
|
|
125
|
+
tabSize: 2,
|
|
126
|
+
automaticLayout: true,
|
|
127
|
+
scrollBeyondLastLine: false,
|
|
128
|
+
theme: props.theme, // 主题色: vs(默认高亮), vs-dark(黑色), hc-black(高亮黑色)
|
|
129
|
+
formatOnPaste: true,
|
|
130
|
+
...(omit(props.options, ['readOnly']) || {}),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
instance.value.onDidChangeModelContent(() => {
|
|
134
|
+
//
|
|
135
|
+
const value = toRaw(instance.value).getValue();
|
|
136
|
+
nextTick(() => {
|
|
137
|
+
emit('update:modelValue', value);
|
|
138
|
+
emit('change', value);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
instance.value.onDidBlurEditorText(() => {
|
|
143
|
+
emit('blur');
|
|
144
|
+
if (props.blurFormat) {
|
|
145
|
+
editorFormat();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
instance.value.onDidFocusEditorText(() => {
|
|
150
|
+
emit('focus');
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
if (props.modelValue) {
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
editorFormat();
|
|
156
|
+
}, 200);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
props.init?.(instance.value, monaco);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 光标位置插入内容
|
|
164
|
+
* @param {String} val
|
|
165
|
+
* @param position
|
|
166
|
+
*/
|
|
167
|
+
const insert = (val, position) => {
|
|
168
|
+
if (!instance.value) return;
|
|
169
|
+
const _position = position || toRaw(instance.value).getPosition();
|
|
170
|
+
const value = toRaw(instance.value).getValue();
|
|
171
|
+
|
|
172
|
+
if (position && position.lineNumber) {
|
|
173
|
+
toRaw(instance.value).setPosition(position);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
toRaw(instance.value).executeEdits(value, [
|
|
177
|
+
{
|
|
178
|
+
range: new monaco.Range(
|
|
179
|
+
_position?.lineNumber,
|
|
180
|
+
_position?.column,
|
|
181
|
+
_position?.lineNumber,
|
|
182
|
+
_position?.column,
|
|
183
|
+
),
|
|
184
|
+
text: val,
|
|
185
|
+
},
|
|
186
|
+
]);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
watch(
|
|
190
|
+
() => props.modelValue,
|
|
191
|
+
(val) => {
|
|
192
|
+
if (
|
|
193
|
+
!instance.value ||
|
|
194
|
+
(instance.value &&
|
|
195
|
+
props.modelValue === toRaw(instance.value).getValue())
|
|
196
|
+
)
|
|
197
|
+
return;
|
|
198
|
+
// setValue之前获取光标位置
|
|
199
|
+
const position = toRaw(instance.value).getPosition();
|
|
200
|
+
|
|
201
|
+
// setValue之后光标位置改变
|
|
202
|
+
toRaw(instance.value).setValue(val);
|
|
203
|
+
// 设置光标位置为setValue之前的位置
|
|
204
|
+
toRaw(instance.value).setPosition(position);
|
|
205
|
+
|
|
206
|
+
editorFormat();
|
|
207
|
+
},
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
watch(
|
|
211
|
+
() => JSON.stringify(props.registrationTips),
|
|
212
|
+
() => {
|
|
213
|
+
registerCompletionItemProvider();
|
|
214
|
+
},
|
|
215
|
+
{immediate: true},
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
watch(
|
|
219
|
+
() => JSON.stringify(props.registrationTypescript),
|
|
220
|
+
() => {
|
|
221
|
+
registerTypescript();
|
|
222
|
+
},
|
|
223
|
+
{immediate: true},
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
onUnmounted(() => {
|
|
227
|
+
disposeRegister();
|
|
228
|
+
disposeTypescript();
|
|
229
|
+
toRaw(instance.value).editor?.dispose?.();
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
defineExpose({
|
|
233
|
+
editorFormat,
|
|
234
|
+
insert,
|
|
235
|
+
});
|
|
236
|
+
</script>
|
|
237
|
+
<style lang="less" scoped>
|
|
238
|
+
.j-monaco-editor {
|
|
239
|
+
min-height: 50px;
|
|
240
|
+
height: 100%;
|
|
241
|
+
}
|
|
242
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: Components
|
|
3
|
+
type: 数据录入
|
|
4
|
+
title: MonacoEditor
|
|
5
|
+
subtitle: 代码编辑器
|
|
6
|
+
cols: 1
|
|
7
|
+
cover: https://gw.alipayobjects.com/zos/alicdn/xS9YEJhfe/Input.svg
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## API
|
|
11
|
+
|
|
12
|
+
> 在 vite 项目中使用需要安装[`vite-plugin-monaco-editor`](https://github.com/vdesjs/vite-plugin-monaco-editor), 并在 vite.config.ts 中配置
|
|
13
|
+
|
|
14
|
+
### MonacoEditor
|
|
15
|
+
|
|
16
|
+
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
17
|
+
| --- |-----------------------------------------------------------| --- | --- | --- |
|
|
18
|
+
| value(v-model) | 编辑器内容 | string | | |
|
|
19
|
+
| theme | 主题色: vs(默认高亮), vs-dark(黑色), hc-black(高亮黑色) | string | | |
|
|
20
|
+
| language | 编辑器支持的语言: json, css, html, typescript, javascript, vue | string | | |
|
|
21
|
+
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
22
|
+
| -------------- | --------------------------------------------------------- | ------ | ------ | ---- |
|
|
23
|
+
| value(v-model) | 编辑器内容 | string | | |
|
|
24
|
+
| theme | 主题色: vs(默认高亮), vs-dark(黑色), hc-black(高亮黑色) | string | | |
|
|
25
|
+
| language | 编辑器支持的语言: json, css, html, typescript, javascript, vue | string | | |
|
|
26
|
+
|
|
@@ -1,107 +1,110 @@
|
|
|
1
|
-
import {h, defineComponent, computed} from "vue";
|
|
1
|
+
import { h, defineComponent, computed } from "vue";
|
|
2
2
|
import type { PropType, CSSProperties, ExtractPropTypes } from 'vue'
|
|
3
|
-
import { Button, Tooltip, Popconfirm } from '
|
|
4
|
-
import {PopconfirmProps, TooltipProps} from "ant-design-vue/es";
|
|
5
|
-
import {omit} from "lodash-es";
|
|
6
|
-
import {buttonProps} from "ant-design-vue/es/button/button";
|
|
7
|
-
import { usePermission } from '
|
|
3
|
+
import { Button, Tooltip, Popconfirm } from 'ant-design-vue'
|
|
4
|
+
import { PopconfirmProps, TooltipProps } from "ant-design-vue/es";
|
|
5
|
+
import { omit } from "lodash-es";
|
|
6
|
+
import { buttonProps } from "ant-design-vue/es/button/button";
|
|
7
|
+
import { usePermission } from '@jetlinks-web/hooks'
|
|
8
8
|
|
|
9
9
|
type PermissionType = string | Array<string> | boolean
|
|
10
10
|
|
|
11
11
|
const definedProps = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
tooltip: {
|
|
13
|
+
type: Object as PropType<TooltipProps>,
|
|
14
|
+
},
|
|
15
|
+
popConfirm: {
|
|
16
|
+
type: Object as PropType<PopconfirmProps>,
|
|
17
|
+
},
|
|
18
|
+
hasPermission: {
|
|
19
|
+
type: [String, Array, Boolean] as PropType<PermissionType>,
|
|
20
|
+
default: undefined
|
|
21
|
+
},
|
|
22
|
+
style: {
|
|
23
|
+
type: Object as PropType<CSSProperties>
|
|
24
|
+
},
|
|
25
|
+
noPermissionTitle: {
|
|
26
|
+
type: String
|
|
27
|
+
},
|
|
28
|
+
...omit(buttonProps(), 'icon')
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
type DefinedPropsType = Partial<ExtractPropTypes<typeof definedProps>>
|
|
32
32
|
|
|
33
33
|
const PermissionButton = defineComponent({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
34
|
+
name: 'PermissionButton',
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
slots: ['button', 'icon'],
|
|
37
|
+
props: definedProps,
|
|
38
|
+
setup(props, {slots}) {
|
|
39
|
+
|
|
40
|
+
const {popConfirm, tooltip} = props
|
|
41
|
+
const {hasPerm} = usePermission(props.hasPermission as PermissionType)
|
|
42
|
+
|
|
43
|
+
const permission = computed(() => {
|
|
44
|
+
if (!props.hasPermission || props.hasPermission === true) {
|
|
45
|
+
return true
|
|
46
|
+
}
|
|
47
|
+
return hasPerm.value
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const isPermission = computed(() => {
|
|
51
|
+
if ('hasPermission' in props && permission.value) {
|
|
52
|
+
return 'disabled' in props ? props.disabled : false
|
|
53
|
+
}
|
|
54
|
+
return true
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const hasPopConfirm = computed(() => !!popConfirm) // 是否包含确认弹窗
|
|
58
|
+
const hasTooltip = computed(() => !!tooltip) // 是否包含文字提示
|
|
59
|
+
|
|
60
|
+
return () => {
|
|
61
|
+
const {popConfirm, tooltip, hasPermission, noPermissionTitle, ...buttonProps} = props
|
|
62
|
+
|
|
63
|
+
const button = !slots.button ?
|
|
64
|
+
h(Button,
|
|
65
|
+
{
|
|
66
|
+
...buttonProps,
|
|
67
|
+
disabled: isPermission.value,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
default: () => slots?.default?.(),
|
|
71
|
+
icon: () => slots?.icon?.()
|
|
72
|
+
}) :
|
|
73
|
+
slots.button()
|
|
74
|
+
|
|
75
|
+
// 文字提示
|
|
76
|
+
const _tooltip = tooltip ? h(Tooltip, Object.assign(tooltip, {disabled: isPermission.value}), {default: () => button}) : undefined
|
|
77
|
+
|
|
78
|
+
// 无权限
|
|
79
|
+
const noPermissionButton = !permission.value ? h(Tooltip, {title: noPermissionTitle || '暂无权限,请联系管理员'}, {default: () => button}) : undefined
|
|
80
|
+
|
|
81
|
+
// 二次确认
|
|
82
|
+
const _popConfirm = popConfirm ?
|
|
83
|
+
h(Popconfirm,
|
|
84
|
+
Object.assign(
|
|
85
|
+
{overlayStyle: {width: '220px'}},
|
|
86
|
+
popConfirm,
|
|
87
|
+
{
|
|
88
|
+
disabled: !permission.value || buttonProps.disabled
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
{default: () => tooltip ? _tooltip : button})
|
|
92
|
+
: undefined
|
|
93
|
+
|
|
94
|
+
if (permission.value) {
|
|
95
|
+
if (hasPopConfirm.value) {
|
|
96
|
+
return _popConfirm
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (hasTooltip.value) {
|
|
100
|
+
return _tooltip
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return button
|
|
104
|
+
}
|
|
105
|
+
return noPermissionButton
|
|
94
106
|
}
|
|
95
|
-
|
|
96
|
-
if (hasTooltip.value) {
|
|
97
|
-
return _tooltip
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return button
|
|
101
|
-
}
|
|
102
|
-
return noPermissionButton
|
|
103
107
|
}
|
|
104
|
-
}
|
|
105
108
|
})
|
|
106
109
|
|
|
107
110
|
export default PermissionButton
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@import '../style/default.less';
|
|
2
|
+
|
|
3
|
+
.@{basicLayout-prefix-cls} {
|
|
4
|
+
// BFC
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
width: 100%;
|
|
8
|
+
min-height: 100%;
|
|
9
|
+
|
|
10
|
+
.@{ant-prefix}-layout-header {
|
|
11
|
+
&.@{ant-prefix}-pro-fixed-header {
|
|
12
|
+
position: fixed;
|
|
13
|
+
top: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-content {
|
|
18
|
+
position: relative;
|
|
19
|
+
margin: 24px;
|
|
20
|
+
|
|
21
|
+
.@{ant-prefix}-pro-page-container {
|
|
22
|
+
margin: -24px -24px 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-disable-margin {
|
|
26
|
+
margin: 0;
|
|
27
|
+
|
|
28
|
+
.@{ant-prefix}-pro-page-container {
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
> .@{ant-prefix}-layout {
|
|
34
|
+
max-height: 100%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// children should support fixed
|
|
39
|
+
.@{basicLayout-prefix-cls}-is-children.@{basicLayout-prefix-cls}-fix-siderbar {
|
|
40
|
+
height: 100vh;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
transform: rotate(0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.@{basicLayout-prefix-cls}-has-header {
|
|
46
|
+
// tech-page-container
|
|
47
|
+
.tech-page-container {
|
|
48
|
+
height: calc(100vh - @pro-layout-header-height);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.@{basicLayout-prefix-cls}-is-children.@{basicLayout-prefix-cls}-has-header {
|
|
52
|
+
.tech-page-container {
|
|
53
|
+
height: calc(100vh - @pro-layout-header-height -
|
|
54
|
+
@pro-layout-header-height);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.@{basicLayout-prefix-cls}-is-children {
|
|
58
|
+
min-height: calc(100vh - @pro-layout-header-height);
|
|
59
|
+
|
|
60
|
+
&.@{basicLayout-prefix-cls}-fix-siderbar {
|
|
61
|
+
height: calc(100vh - @pro-layout-header-height);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|