mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-11 22:09:47 +08:00
style(editor): 事件配置样式调整
This commit is contained in:
parent
5a345575c4
commit
2d5afb1646
@ -6,6 +6,7 @@
|
|||||||
class="select"
|
class="select"
|
||||||
:config="selectConfig"
|
:config="selectConfig"
|
||||||
:model="model"
|
:model="model"
|
||||||
|
:size="size"
|
||||||
@change="onParamsChangeHandler"
|
@change="onParamsChangeHandler"
|
||||||
></m-form-container>
|
></m-form-container>
|
||||||
<!-- 查看/编辑按钮 -->
|
<!-- 查看/编辑按钮 -->
|
||||||
@ -89,9 +90,7 @@ watch(
|
|||||||
|
|
||||||
const selectConfig = {
|
const selectConfig = {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
text: '代码块',
|
|
||||||
name: props.name,
|
name: props.name,
|
||||||
labelWidth: '80px',
|
|
||||||
options: () => {
|
options: () => {
|
||||||
if (codeDsl.value) {
|
if (codeDsl.value) {
|
||||||
return map(codeDsl.value, (value, key) => ({
|
return map(codeDsl.value, (value, key) => ({
|
||||||
|
@ -68,7 +68,6 @@ const getParamItemsConfig = ([dataSourceId, medthodName]: [Id, string] = ['', ''
|
|||||||
if (!paramStatements) return [];
|
if (!paramStatements) return [];
|
||||||
|
|
||||||
return paramStatements.map((paramState: CodeParamStatement) => ({
|
return paramStatements.map((paramState: CodeParamStatement) => ({
|
||||||
labelWidth: '100px',
|
|
||||||
text: paramState.name,
|
text: paramState.name,
|
||||||
...paramState,
|
...paramState,
|
||||||
}));
|
}));
|
||||||
@ -106,9 +105,7 @@ const methodsOptions = computed(
|
|||||||
|
|
||||||
const cascaderConfig = computed(() => ({
|
const cascaderConfig = computed(() => ({
|
||||||
type: 'cascader',
|
type: 'cascader',
|
||||||
text: '数据源方法',
|
|
||||||
name: props.name,
|
name: props.name,
|
||||||
labelWidth: '80px',
|
|
||||||
options: methodsOptions.value,
|
options: methodsOptions.value,
|
||||||
onChange: (formState: any, dataSourceMethod: [Id, string]) => {
|
onChange: (formState: any, dataSourceMethod: [Id, string]) => {
|
||||||
setParamsConfig(dataSourceMethod, formState);
|
setParamsConfig(dataSourceMethod, formState);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
:size="size"
|
:size="size"
|
||||||
:config="actionsConfig"
|
:config="actionsConfig"
|
||||||
:model="cardItem"
|
:model="cardItem"
|
||||||
|
:label-width="config.labelWidth || '100px'"
|
||||||
@change="onChangeHandler"
|
@change="onChangeHandler"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
@ -106,7 +107,6 @@ const actionTypeConfig = computed(() => {
|
|||||||
const defaultActionTypeConfig = {
|
const defaultActionTypeConfig = {
|
||||||
name: 'actionType',
|
name: 'actionType',
|
||||||
text: '联动类型',
|
text: '联动类型',
|
||||||
labelWidth: '80px',
|
|
||||||
type: 'select',
|
type: 'select',
|
||||||
defaultValue: ActionType.COMP,
|
defaultValue: ActionType.COMP,
|
||||||
options: () => [
|
options: () => [
|
||||||
@ -139,7 +139,6 @@ const targetCompConfig = computed(() => {
|
|||||||
const defaultTargetCompConfig = {
|
const defaultTargetCompConfig = {
|
||||||
name: 'to',
|
name: 'to',
|
||||||
text: '联动组件',
|
text: '联动组件',
|
||||||
labelWidth: '80px',
|
|
||||||
type: 'ui-select',
|
type: 'ui-select',
|
||||||
display: (mForm: FormState, { model }: { model: Record<any, any> }) => model.actionType === ActionType.COMP,
|
display: (mForm: FormState, { model }: { model: Record<any, any> }) => model.actionType === ActionType.COMP,
|
||||||
};
|
};
|
||||||
@ -151,7 +150,6 @@ const compActionConfig = computed(() => {
|
|||||||
const defaultCompActionConfig = {
|
const defaultCompActionConfig = {
|
||||||
name: 'method',
|
name: 'method',
|
||||||
text: '动作',
|
text: '动作',
|
||||||
labelWidth: '80px',
|
|
||||||
type: 'select',
|
type: 'select',
|
||||||
display: (mForm: FormState, { model }: { model: Record<any, any> }) => model.actionType === ActionType.COMP,
|
display: (mForm: FormState, { model }: { model: Record<any, any> }) => model.actionType === ActionType.COMP,
|
||||||
options: (mForm: FormState, { model }: any) => {
|
options: (mForm: FormState, { model }: any) => {
|
||||||
@ -171,7 +169,7 @@ const compActionConfig = computed(() => {
|
|||||||
const codeActionConfig = computed(() => {
|
const codeActionConfig = computed(() => {
|
||||||
const defaultCodeActionConfig: CodeSelectColConfig = {
|
const defaultCodeActionConfig: CodeSelectColConfig = {
|
||||||
type: 'code-select-col',
|
type: 'code-select-col',
|
||||||
labelWidth: 0,
|
text: '代码块',
|
||||||
name: 'codeId',
|
name: 'codeId',
|
||||||
disabled: () => !codeBlockService?.getEditStatus(),
|
disabled: () => !codeBlockService?.getEditStatus(),
|
||||||
display: (mForm, { model }) => model.actionType === ActionType.CODE,
|
display: (mForm, { model }) => model.actionType === ActionType.CODE,
|
||||||
@ -183,8 +181,8 @@ const codeActionConfig = computed(() => {
|
|||||||
const dataSourceActionConfig = computed(() => {
|
const dataSourceActionConfig = computed(() => {
|
||||||
const defaultDataSourceActionConfig: DataSourceMethodSelectConfig = {
|
const defaultDataSourceActionConfig: DataSourceMethodSelectConfig = {
|
||||||
type: 'data-source-method-select',
|
type: 'data-source-method-select',
|
||||||
|
text: '数据源方法',
|
||||||
name: 'dataSourceMethod',
|
name: 'dataSourceMethod',
|
||||||
labelWidth: 0,
|
|
||||||
display: (mForm, { model }) => model.actionType === ActionType.DATA_SOURCE,
|
display: (mForm, { model }) => model.actionType === ActionType.DATA_SOURCE,
|
||||||
};
|
};
|
||||||
return { ...defaultDataSourceActionConfig, ...props.config.dataSourceActionConfig };
|
return { ...defaultDataSourceActionConfig, ...props.config.dataSourceActionConfig };
|
||||||
@ -235,6 +233,7 @@ const actionsConfig = computed(() => ({
|
|||||||
name: 'actions',
|
name: 'actions',
|
||||||
expandAll: true,
|
expandAll: true,
|
||||||
enableToggleMode: false,
|
enableToggleMode: false,
|
||||||
|
titlePrefix: '动作',
|
||||||
items: [
|
items: [
|
||||||
actionTypeConfig.value,
|
actionTypeConfig.value,
|
||||||
targetCompConfig.value,
|
targetCompConfig.value,
|
||||||
|
@ -3,14 +3,12 @@
|
|||||||
.fullWidth {
|
.fullWidth {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.m-form-panel .el-card__body {
|
|
||||||
padding: 10px 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.event-select-code {
|
.event-select-code {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.m-form-panel {
|
.m-form-panel {
|
||||||
margin: 10px 0px;
|
margin: 10px 0px;
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Segoe WPC, Segoe UI,
|
|
||||||
Microsoft YaHei, sans-serif;
|
|
||||||
|
|
||||||
&-content {
|
&-content {
|
||||||
height: calc(100% - #{$--nav-height});
|
height: calc(100% - #{$--nav-height});
|
||||||
|
@ -206,6 +206,7 @@ export const eventTabConfig: TabPaneConfig = {
|
|||||||
{
|
{
|
||||||
name: 'events',
|
name: 'events',
|
||||||
src: 'component',
|
src: 'component',
|
||||||
|
labelWidth: '100px',
|
||||||
type: 'event-select',
|
type: 'event-select',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user