diff --git a/src/views/demo/form-design/components/VFormDesign/components/ComponentProps.vue b/src/views/demo/form-design/components/VFormDesign/components/ComponentProps.vue index 893dcc8d..9b12abaf 100644 --- a/src/views/demo/form-design/components/VFormDesign/components/ComponentProps.vue +++ b/src/views/demo/form-design/components/VFormDesign/components/ComponentProps.vue @@ -135,16 +135,22 @@ :useWrapper="false" @ok="handleSubmit" > -
-
- +
+
+
-
- - - +
+
@@ -180,7 +186,7 @@ import { IBaseFormAttrs } from '../config/formItemPropsConfig'; import { getOutKeyList } from '@/api/formdesign/index'; import { BasicModal, useModal } from '@/components/Modal'; - import { formItemPropsScript, addBreakLines } from '../../VFormDesign/config/formItemPropsScript'; + import { formItemPropsScript } from '../../VFormDesign/config/formItemPropsScript'; export default defineComponent({ name: 'ComponentProps', @@ -434,7 +440,6 @@ }); // 脚本 const formContent: any = ref(''); - const description = addBreakLines(formItemPropsScript); // 脚本窗口 const [buttonScriptModal, { openModal, closeModal }] = useModal(); // 点击脚本按钮 @@ -495,7 +500,7 @@ fetch, BasicModal, formContent, - description, + formItemPropsScript, buttonScriptModal, openModal, closeModal, @@ -505,3 +510,23 @@ }, }); + + diff --git a/src/views/demo/form-design/components/VFormDesign/components/FormProps.vue b/src/views/demo/form-design/components/VFormDesign/components/FormProps.vue index 064c46c2..e5562cf6 100644 --- a/src/views/demo/form-design/components/VFormDesign/components/FormProps.vue +++ b/src/views/demo/form-design/components/VFormDesign/components/FormProps.vue @@ -113,16 +113,22 @@ :width="1000" @ok="handleSubmit" > -
-
- +
+
+
-
- - - +
+
@@ -130,7 +136,7 @@ + + diff --git a/src/views/demo/form-design/components/VFormDesign/config/formItemPropsScript.ts b/src/views/demo/form-design/components/VFormDesign/config/formItemPropsScript.ts index 985bf4c0..ce8a4fff 100644 --- a/src/views/demo/form-design/components/VFormDesign/config/formItemPropsScript.ts +++ b/src/views/demo/form-design/components/VFormDesign/config/formItemPropsScript.ts @@ -1,8 +1,8 @@ -export const formItemPropsScript = ` +export const formItemPropsScript = `脚本参数说明 // 获取表单是新增还是编辑 -var isUpdate = utils.isUpdate(); +let update = utils.isUpdate(); // 组件变更数据 -var data = utils.data(); +let data = utils.data(); // 数据设置 // 获取主表数据 @@ -20,7 +20,6 @@ subTableList.value = addChildValue('组件的字段标识', '旧value', '新valu // 删除子表数据 subTableList.value = deleteChildValue('组件的字段标识', 'value'); - // 组件设置 // 设置组件为隐藏 formColumns.value = utils.setHide('组件的字段标识', false); @@ -38,7 +37,7 @@ formColumns.value = utils.setRequired('组件的字段标识', false); // 功能设置 // 提示消息 utils.message('提示信息', '提示类型'); -提示类型:success(成功)、error(错误)、warn(警告)、info(默认)\ +提示类型:success(成功)、error(错误)、warn(警告)、info(默认) // 获取登录者信息 var loginUser = utils.loginUser(); loginUser返回值为{ account: 账号, name: 姓名 } @@ -59,10 +58,3 @@ url:api地址, params:参数 let resPut = await utils.httpPut(url, params); url:api地址, params:参数 `; - -export function addBreakLines(text: string): string { - // 根据换行符分割文本为行 - const lines = text.split(/\r?\n/); - // 在每行后面添加 - return lines.map((line) => line + '
').join(''); -}