浏览代码

通信拷贝

CzRger 3 月之前
父节点
当前提交
a59e2be91e
共有 2 个文件被更改,包括 353 次插入16 次删除
  1. 9 9
      src/views/form/business-model/index.vue
  2. 344 7
      src/views/form/business-model/test.vue

文件差异内容过多而无法显示
+ 9 - 9
src/views/form/business-model/index.vue


+ 344 - 7
src/views/form/business-model/test.vue

@@ -2,10 +2,10 @@
   <div class="p-4">
     <div>
       一级表单onConfirmIframe接收参数:msgData
-      JSON字符串,包含wfIds-拼接ID、wfStrs-拼接ID查询到的命名、wfList-选择的数组
+      Object,包含wfIds-拼接ID、wfStrs-拼接ID查询到的命名、wfList-选择的数组
     </div>
     <div>
-      二级表单getFormIframeData初始化:JSON字符串,wfList-回显用的数组,无需回显的话,传空数组[]
+      二级表单getFormIframeData初始化:Array,wfList-回显用的数组,无需回显的话,传空数组[]
     </div>
     <template
       v-for="(item, index) in [
@@ -95,6 +95,341 @@ const state: any = reactive({
     show: false,
     transfer: {},
   },
+  mock: {
+    formItem: {
+      descriptionConfig: {
+        position: 'label',
+        richText: '',
+      },
+      field: 'SZJYFW',
+      aliasTitle: '',
+      isContainsChildField: true,
+      mode: 'horizontal',
+      span: 3,
+      labelWidth: '100',
+      state: 'normal',
+      required: false,
+      requiredMessage: '',
+      prepend: '',
+      append: '',
+      isShowLabel: true,
+      fieldList: [],
+      defaultValueConfig: {
+        channel: '',
+        type: '',
+        targetField: '',
+        description: '',
+        formatter: '',
+        innerFormatter: '',
+      },
+      rules: [],
+      roles: [],
+      unFormDisabled: false,
+      optionsProps: [
+        {
+          name: 'multiple',
+          propType: 'boolean',
+          description: '多选',
+          defaultValue: false,
+        },
+      ],
+      props: [
+        {
+          name: 'maxlength',
+          propType: 'number',
+          description: '请输入字数上限',
+          defaultValue: null,
+        },
+        {
+          name: 'placeholder',
+          propType: 'string',
+          description: '占位提示',
+          defaultValue: '请输入',
+        },
+        {
+          name: 'showPassword',
+          propType: 'boolean',
+          description: '密码模式',
+          defaultValue: false,
+        },
+        {
+          name: 'disabled',
+          propType: 'boolean',
+          description: '是否禁用',
+          defaultValue: false,
+        },
+        {
+          name: 'clearable',
+          propType: 'boolean',
+          description: '是否可以清除',
+          defaultValue: true,
+        },
+        {
+          name: 'autosize',
+          propType: 'boolean',
+          description: '自适应大小',
+          defaultValue: false,
+        },
+        {
+          name: 'autocomplete',
+          propType: 'string',
+          description: '自动补全',
+          defaultValue: 'off',
+        },
+        {
+          name: 'readonly',
+          propType: 'boolean',
+          description: '只读模式',
+          defaultValue: false,
+        },
+        {
+          name: 'autofocus',
+          propType: 'boolean',
+          description: '自动聚焦',
+          defaultValue: false,
+        },
+        {
+          name: 'multiple',
+          propType: 'boolean',
+          description: '多选',
+          defaultValue: false,
+        },
+        {
+          name: 'show-all-levels',
+          propType: 'boolean',
+          description: '级联是否显示所有路径',
+          defaultValue: true,
+        },
+      ],
+      children: null,
+      watcher: {},
+      onChange: {
+        type: 'api',
+        api: {},
+        functionBody: '',
+        page: {},
+        newWindow: {},
+        rules: [
+          {
+            condition: null,
+            validate: [],
+            fields: [],
+          },
+        ],
+      },
+      onInput: {
+        type: 'api',
+        api: {},
+        functionBody: '',
+        page: {},
+        newWindow: {},
+        rules: [
+          {
+            condition: null,
+            validate: [],
+            fields: [],
+          },
+        ],
+      },
+      onBlur: {
+        type: 'api',
+        api: {},
+        functionBody: '',
+        page: {},
+        newWindow: {},
+        rules: [
+          {
+            condition: null,
+            validate: [],
+            fields: [],
+          },
+        ],
+      },
+      onClick: {
+        type: 'page',
+        api: {
+          showLoading: false,
+          loadingText: '',
+          config: {},
+          headers: [],
+          params: [],
+          fields: [],
+          body: {},
+          hasBefore: false,
+          fieldFunctionBody: '',
+        },
+        functionBody: '',
+        page: {
+          iframeUrlType: 'static',
+          useApi: false,
+          apis: {
+            config: {},
+            headers: [],
+            params: [],
+          },
+          pageApi: {
+            config: {},
+            headers: [],
+            params: [],
+            fieldFunctionBody: '',
+          },
+          iframeUrl:
+            ' https://wssp.hainan.gov.cn/window-form/business-model/form?haveOrNo=0',
+          fieldFunctionBody:
+            'handao89757(data,formData,ctx){\n    console.log("二级页面数据data:",data)\n}',
+          beforeFunctionBody: '',
+          iframeTitle: '无存储经营二级页面数据',
+        },
+        rules: [
+          {
+            condition: null,
+            validate: [],
+            fields: [],
+          },
+        ],
+        newWindow: {},
+        triggerStaging: false,
+      },
+      display: {
+        condition: '',
+        rules: [],
+        type: 'display',
+      },
+      disabledStatusConfig: {
+        condition: '',
+        rules: [],
+      },
+      requiredStatusConfig: {
+        condition: '',
+        rules: [],
+      },
+      dataSource: {},
+      condition: {
+        type: '',
+        value: '',
+      },
+      position: '',
+      handler: [],
+      canShare: false,
+      scanner: false,
+      shared: false,
+      title: '设置经营范围',
+      text: '按钮',
+      type: 'primary',
+      componentName: 'button',
+      componentType: '__button__',
+      id: '15ff0a80c8724195818434948bf5198e',
+      tableConfig: {
+        handler: [],
+        showOperation: true,
+      },
+      styleConfig: {},
+    },
+    formData: {
+      applyUnit: '',
+      contact: '',
+      contactPhone: '',
+      applyDate: '',
+      enterpriseName: '',
+      address_WB: '',
+      address: '',
+      fr_corpType: '',
+      unifiedSocialCreditCode: '',
+      fr_lxdh: '',
+      fr_fax: '',
+      fr_zone: '',
+      managerContact: '',
+      managerPhone: '',
+      contactsName: '',
+      contactsPhone: '',
+      fr_cyrs: '',
+      fr_tsgzrs: '',
+      fr_jycsdz: '',
+      fr_jycscq: '',
+      fr_ccssdz: '',
+      fr_ccssccwz: '',
+      fr_ccsssfzdwxy: '',
+      fr_ccsscq: '',
+      modeOfOperation: '',
+      SZJYFW: '',
+      modeOfOperation1: '',
+      AN2: '',
+      modeOfOperation2: '',
+      AN3: '',
+      modeOfOperation3: '',
+      AN4: '',
+      modeOfOperation4: '',
+      AN5: '',
+      modeOfOperation5: '',
+      AN6: '',
+      modeOfOperation6: '',
+      JDHXP: [],
+      YZBWXHXP: [],
+      YZDHXP: [],
+      QTWXHXP: [],
+      ZB1: [],
+      ZB2: [],
+      organizeId: '',
+      sendOrganizeId: '',
+      organize: '',
+      licenceIssuingAuthority: '',
+      businessLicenseSendDate: '',
+      isSystemOrganize: '1',
+      effectiveStartTime: '',
+      effectiveEndTime: '',
+      effectiveContinueTime: '',
+      businessScope_WB: '',
+      businessScope: '',
+    },
+    userData: {
+      applyUid: null,
+      applyName: null,
+      applyTelNo: null,
+      applyCardType: null,
+      applyCardNo: null,
+      isAgent: null,
+      address: null,
+      applyType: null,
+      legalMan: null,
+      legalCardNo: null,
+      legalCardType: null,
+      legalRepresentName: null,
+      legalRepresentCardType: null,
+      legalRepresentCardNo: null,
+      certificateSno: null,
+      corpType: null,
+      phone: null,
+      channel: 'TEST',
+      role: 'person',
+      extend: null,
+    },
+    payload: {
+      userData: {
+        applyUid: null,
+        applyName: null,
+        applyTelNo: null,
+        applyCardType: null,
+        applyCardNo: null,
+        isAgent: null,
+        address: null,
+        applyType: null,
+        legalMan: null,
+        legalCardNo: null,
+        legalCardType: null,
+        legalRepresentName: null,
+        legalRepresentCardType: null,
+        legalRepresentCardNo: null,
+        certificateSno: null,
+        corpType: null,
+        phone: null,
+        channel: 'TEST',
+        role: 'person',
+        extend: null,
+      },
+      rowScope: {},
+    },
+    apis: {},
+  },
 })
 const ref_iframe = ref()
 const iframeUrlCpt = computed(
@@ -112,10 +447,12 @@ const onIframeInit = () => {
     ref_iframe.value.contentWindow.postMessage(
       {
         type: 'getFormIframeData',
-        data: {
-          formItem: '一级表单formItem',
-          wfList: JSON.stringify(state[state.detail.transfer.key].wfList),
-        },
+        data: JSON.parse(
+          JSON.stringify({
+            ...state.mock,
+            wfList: state[state.detail.transfer.key].wfList,
+          }),
+        ),
       },
       '*',
     )
@@ -131,7 +468,7 @@ onMounted(() => {
       console.log('二级表单发送提交消息,onConfirmIframe')
       console.log(data.data)
       const { formItem, msgData } = data.data
-      const { wfIds, wfList, wfStrs } = JSON.parse(msgData)
+      const { wfIds, wfList, wfStrs } = msgData
       state[state.detail.transfer.key].wfStrs = wfStrs
       state[state.detail.transfer.key].wfIds = wfIds
       state[state.detail.transfer.key].wfList = wfList