mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-08-27 21:36:44 +08:00
refactor(editor): 导出ErrorType类型以便业务方使用
This commit is contained in:
parent
c3b502254b
commit
ff3adbb1d0
@ -61,15 +61,10 @@ import { flattenDeep, forIn, isEmpty, values } from 'lodash-es';
|
|||||||
|
|
||||||
import Icon from '../../../components/Icon.vue';
|
import Icon from '../../../components/Icon.vue';
|
||||||
import type { CodeBlockContent, Services } from '../../../type';
|
import type { CodeBlockContent, Services } from '../../../type';
|
||||||
import { CodeDslList, EditorMode, ListState } from '../../../type';
|
import { CodeDslList, EditorMode, ErrorType, ListState } from '../../../type';
|
||||||
|
|
||||||
import codeBlockEditor from './CodeBlockEditor.vue';
|
import codeBlockEditor from './CodeBlockEditor.vue';
|
||||||
|
|
||||||
enum ErrorType {
|
|
||||||
UNDELETEABLE = 'undeleteable',
|
|
||||||
BIND = 'bind',
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
customError?: (id: string, errorType: ErrorType) => any;
|
customError?: (id: string, errorType: ErrorType) => any;
|
||||||
}>();
|
}>();
|
||||||
|
@ -346,14 +346,26 @@ export enum EditorMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type CompRelation = {
|
export type CompRelation = {
|
||||||
|
/** 代码块绑定关系:组件id-代码块id数组 */
|
||||||
[compId: string | number]: string[];
|
[compId: string | number]: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface CodeDslList {
|
export interface CodeDslList {
|
||||||
|
/** 代码块id */
|
||||||
id: string;
|
id: string;
|
||||||
|
/** 代码块名称 */
|
||||||
name: string;
|
name: string;
|
||||||
|
/** 代码块函数内容 */
|
||||||
content: any;
|
content: any;
|
||||||
}
|
}
|
||||||
export interface ListState {
|
export interface ListState {
|
||||||
|
/** 代码块列表 */
|
||||||
codeList: CodeDslList[];
|
codeList: CodeDslList[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum ErrorType {
|
||||||
|
/** 代码块存在于不可删除列表中 */
|
||||||
|
UNDELETEABLE = 'undeleteable',
|
||||||
|
/** 代码块存在绑定关系 */
|
||||||
|
BIND = 'bind',
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user