refactor(editor): 导出ErrorType类型以便业务方使用

This commit is contained in:
parisma 2022-09-19 15:26:34 +08:00 committed by jia000
parent c3b502254b
commit ff3adbb1d0
2 changed files with 13 additions and 6 deletions

View File

@ -61,15 +61,10 @@ import { flattenDeep, forIn, isEmpty, values } from 'lodash-es';
import Icon from '../../../components/Icon.vue';
import type { CodeBlockContent, Services } from '../../../type';
import { CodeDslList, EditorMode, ListState } from '../../../type';
import { CodeDslList, EditorMode, ErrorType, ListState } from '../../../type';
import codeBlockEditor from './CodeBlockEditor.vue';
enum ErrorType {
UNDELETEABLE = 'undeleteable',
BIND = 'bind',
}
const props = defineProps<{
customError?: (id: string, errorType: ErrorType) => any;
}>();

View File

@ -346,14 +346,26 @@ export enum EditorMode {
}
export type CompRelation = {
/** 代码块绑定关系组件id-代码块id数组 */
[compId: string | number]: string[];
};
export interface CodeDslList {
/** 代码块id */
id: string;
/** 代码块名称 */
name: string;
/** 代码块函数内容 */
content: any;
}
export interface ListState {
/** 代码块列表 */
codeList: CodeDslList[];
}
export enum ErrorType {
/** 代码块存在于不可删除列表中 */
UNDELETEABLE = 'undeleteable',
/** 代码块存在绑定关系 */
BIND = 'bind',
}