Browse Source
Merge pull request #706 from colinin/upt-5.3.5
Icon-Picker component allows searching external sources
pull/708/head
yx lin
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
22 additions and
3 deletions
-
apps/vue/src/components/Icon/src/IconPicker.vue
-
apps/vue/src/views/dashboard/workbench/components/MenuReference.vue
-
apps/vue/src/views/platform/menu/hooks/useMenuFormContext.ts
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<a-input |
|
|
|
disabled |
|
|
|
:disabled="onlyDefineIcons" |
|
|
|
:style="{ width }" |
|
|
|
:placeholder="t('component.icon.placeholder')" |
|
|
|
:class="prefixCls" |
|
|
|
@ -109,6 +109,8 @@ |
|
|
|
pageSize: propTypes.number.def(140), |
|
|
|
copy: propTypes.bool.def(false), |
|
|
|
mode: propTypes.oneOf<('svg' | 'iconify')[]>(['svg', 'iconify']).def('iconify'), |
|
|
|
// 仅在datas中定义的图标 |
|
|
|
onlyDefineIcons: propTypes.bool.def(true), |
|
|
|
}); |
|
|
|
|
|
|
|
const emit = defineEmits(['change', 'update:value']); |
|
|
|
|
|
|
|
@ -6,7 +6,13 @@ |
|
|
|
:width="500" |
|
|
|
@ok="handleSubmit" |
|
|
|
> |
|
|
|
<Form :model="formModel" ref="formElRef" :label-col="{ span: 6 }" :wrapper-col="{ span: 17 }"> |
|
|
|
<Form |
|
|
|
ref="formElRef" |
|
|
|
:model="formModel" |
|
|
|
:rules="formRules" |
|
|
|
:label-col="{ span: 6 }" |
|
|
|
:wrapper-col="{ span: 17 }" |
|
|
|
> |
|
|
|
<Form.Item :label="t('routes.dashboard.workbench.menus.selectMenu')" name="menuId"> |
|
|
|
<VTreeSelect |
|
|
|
allowClear |
|
|
|
@ -33,7 +39,7 @@ |
|
|
|
<VInput v-model:value="formModel.aliasName" autocomplete="off" /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item :label="t('routes.dashboard.workbench.menus.defineIcon')" name="icon"> |
|
|
|
<IconPicker v-model:value="formModel.icon" /> |
|
|
|
<IconPicker v-model:value="formModel.icon" :onlyDefineIcons="false" /> |
|
|
|
</Form.Item> |
|
|
|
</Form> |
|
|
|
</BasicModal> |
|
|
|
@ -63,6 +69,11 @@ |
|
|
|
color: '#000000', |
|
|
|
aliasName: '', |
|
|
|
}); |
|
|
|
const formRules = reactive({ |
|
|
|
menuId: { |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}); |
|
|
|
const formElRef = ref<any>(null); |
|
|
|
const menuTreeData = ref<any[]>([]); |
|
|
|
const radio = ref(false); |
|
|
|
|
|
|
|
@ -83,6 +83,12 @@ export function useMenuFormContext({ menuModel, formElRef, framework }: UseMenuF |
|
|
|
case ValueType.Object: |
|
|
|
if (item.name === 'icon') { |
|
|
|
schema.component = 'IconPicker'; |
|
|
|
schema.componentProps = { |
|
|
|
onlyDefineIcons: false, |
|
|
|
style: { |
|
|
|
width: '100%', |
|
|
|
}, |
|
|
|
}; |
|
|
|
} else { |
|
|
|
schema.component = 'Input'; |
|
|
|
schema.componentProps = { |
|
|
|
|