Forráskód Böngészése

表单设计器内的国际化配置 接入系统国际化

kagg886 1 hónapja
szülő
commit
569d059d23

+ 5 - 3
src/views/flow/flowForm/list/component/detail.vue

@@ -6,7 +6,7 @@
         <h4>{{ t('message.flowForm.detailTitle') }}</h4>
       </template>
       <div class="form-create-show">
-        <FormCreate :option="detailData.option" :rule="detailData.rule" />
+        <FormCreate :option="detailData.option" :rule="detailData.rule" :locale="locale"/>
       </div>
     </el-drawer>
   </div>
@@ -24,7 +24,8 @@
     FlowFormEditState
   } from "/@/views/flow/flowForm/list/component/model"
   import {setConfAndFields2} from "/@/utils/formCreate";
-  formCreate.component(FcEditor)
+
+	formCreate.component(FcEditor)
   //获取 formCreate 组件
   const FormCreate = formCreate.$form();
   export default defineComponent({
@@ -40,7 +41,7 @@
     },
     setup(props,{emit}) {
       const {proxy} = <any>getCurrentInstance()
-      const { t } = useI18n()
+      const { t,locale } = useI18n()
       const formRef = ref<HTMLElement | null>(null);
       const menuRef = ref();
       const detailData = ref({
@@ -113,6 +114,7 @@
         return {
           proxy,
           t,
+					locale,
           openDialog,
           closeDialog,
           onCancel,

+ 5 - 0
src/views/flow/flowForm/list/component/formDesign.vue

@@ -53,6 +53,11 @@ const { flow_form_status } = proxy.useDict('flow_form_status')
 const config = {
 	//控制字段ID输入框能否输入
 	fieldReadonly: false,
+	localeOptions: [
+		{ value: 'zh-cn', label: '简体中文' },
+		{ value: 'en', label: 'English' },
+		{ value: 'zh-tw', label: '繁體中文' },
+	],
 }
 /** 处理保存按钮 */
 const designer = ref()