-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rdmclin2
committed
Jul 22, 2023
1 parent
5c659f2
commit 1f936fc
Showing
9 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from '../../types/schema'; | ||
export * from './asset'; | ||
export * from './code'; | ||
export * from './model'; | ||
export * from './render'; | ||
export * from './schema'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { CategoryConfig } from '@c2d2c/types'; | ||
|
||
export enum CategoryMap { | ||
type = 'type', | ||
content = 'content', | ||
function = 'function', | ||
style = 'style', | ||
status = 'status', | ||
bind = 'bind', | ||
table = 'table', | ||
customStyle = 'customStyle', | ||
} | ||
|
||
export const configCategoryMap: CategoryConfig = { | ||
[CategoryMap.type]: { title: '类型', defaultActive: true }, | ||
[CategoryMap.content]: { title: '内容与功能', defaultActive: true }, | ||
[CategoryMap.style]: { title: '样式', defaultActive: true }, | ||
[CategoryMap.status]: { title: '状态', defaultActive: true }, | ||
[CategoryMap.bind]: { title: '分页字段绑定', defaultActive: true }, | ||
[CategoryMap.table]: { title: '表格要素', defaultActive: true }, | ||
[CategoryMap.customStyle]: { title: '自定义样式', defaultActive: true }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,2 @@ | ||
import type { CategoryConfig } from '@c2d2c/types'; | ||
|
||
export enum CategoryMap { | ||
type = 'type', | ||
content = 'content', | ||
function = 'function', | ||
style = 'style', | ||
status = 'status', | ||
bind = 'bind', | ||
table = 'table', | ||
customStyle = 'customStyle', | ||
} | ||
|
||
export const configCategoryMap: CategoryConfig = { | ||
[CategoryMap.type]: { title: '类型', defaultActive: true }, | ||
[CategoryMap.content]: { title: '内容与功能', defaultActive: true }, | ||
[CategoryMap.style]: { title: '样式', defaultActive: true }, | ||
[CategoryMap.status]: { title: '状态', defaultActive: true }, | ||
[CategoryMap.bind]: { title: '分页字段绑定', defaultActive: true }, | ||
[CategoryMap.table]: { title: '表格要素', defaultActive: true }, | ||
[CategoryMap.customStyle]: { title: '自定义样式', defaultActive: true }, | ||
}; | ||
export * from './catogory'; | ||
export * from './schema'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './autoId'; | ||
export * from './schema'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { JSONSchema } from '@/types/schema'; | ||
/** | ||
* 从schema 获取预设值 | ||
* @param schema | ||
*/ | ||
export const getDefaultValueFromSchema = (schema: JSONSchema) => { | ||
if (!schema.properties) return; | ||
|
||
return Object.fromEntries( | ||
Object.entries(schema.properties).map(([key, value]) => [key, value.default]), | ||
); | ||
}; |