king
2025-01-27 2b639156302123d4490f03ec02385c4750d1fa11
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -1,5 +1,5 @@
import React from 'react'
import { btnClasses } from '@/utils/option.js'
import { btnClasses, modalClasses } from '@/utils/option.js'
/**
 * @description 获取按钮表单配置信息
@@ -17,6 +17,11 @@
  let menulist = []
  let type = ''
  let alltype = config.type + '_' + config.subtype
  columns = columns.map(item => ({
    value: item.field,
    text: `${item.label}(${item.field})`
  }))
  if (card.eleType === 'button') {
    type = 'card'
@@ -182,6 +187,9 @@
    } else {
      appMenus = []
    }
    // if (appType === 'mob') {
    //   appMenus.push({value: 'sign', text: '签名(系统页)'})
    // }
    appMenus.push({value: 'goback', text: '返回(上一页)'})
  } else {
    menulist = sessionStorage.getItem('fstMenuList')
@@ -206,11 +214,14 @@
      { value: 'mkBinding', text: '开通扫码登录' },
      { value: 'mkUnBinding', text: '用户解绑' },
      { value: 'mkUnsubscribe', text: '注销账户' },
      { value: 'reAuth', text: '切换系统(清空缓存-小程序)' },
      { value: 'reAuth', text: '切换授权码 / 小程序清空缓存' },
      { value: 'reSystem', text: '切换系统' },
      { value: 'clearCache', text: '清空本地配置' },
      { value: 'copyurl', text: '复制链接地址' },
      { value: 'expPdf', text: '导出PDF' },
      { value: 'shareLink', text: '分享链接' },
      { value: 'openLocation', text: '打开地图'},
      { value: 'wxPublicAuth', text: '微信公众号授权'},
      { value: 'logout', text: '退出' },
      { value: 'goBack', text: '返回' },
    ]
@@ -319,7 +330,7 @@
  }
  let width = card.width || (card.width === 0 ? 0 : 12)
  if (/x/.test(card.width)) {
  if (card.width && /x/.test(card.width)) {
    width = +width.replace(/x/, '.5')
  }
@@ -351,6 +362,16 @@
    if (typeof(card.openmenu) !== 'string') {
      card.openmenu = ''
    }
  }
  if (card.syncComponents && card.syncComponents[0] && Array.isArray(card.syncComponents[0])) {
    card.syncComponents = card.syncComponents.map((item, i) => {
      return {
        syncComId: item,
        label: '',
        uuid: 'fixed' + i
      }
    })
  }
  let forms = [
@@ -797,7 +818,7 @@
      key: 'execError',
      label: '失败后',
      initVal: card.execError || 'never',
      tooltip: refresh.length ? '执行刷新源组件时,请在源按钮(弹窗按钮)中设置关闭后刷新那一项,注:此时会同步刷新当前组件和上级组件-行。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。返回信息(@retmsg)特殊标识:@close_tab@ 执行(关闭标签-管理系统);@close_popup@ 执行(关闭弹窗);@goback@ 执行(返回上一页-子应用)。' : '选择刷新行时,如果选择多条数据会刷新组件;选择刷新行 / 组件时,如果当前行数据不存在会刷新组件。注:上级组件在数据源中添加。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。返回信息(@retmsg)特殊标识:@close_tab@ 执行(关闭标签-管理系统);@close_popup@ 执行(关闭弹窗);@goback@ 执行(返回上一页-子应用)。',
      tooltip: refresh.length ? '执行刷新源组件时,请在源按钮(弹窗按钮)中设置关闭后刷新那一项,注:此时会同步刷新当前组件和上级组件-行。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。返回信息(@retmsg)特殊标识:@close_tab@ 执行(关闭标签-管理系统);@close_popup@ 执行(关闭弹窗);@goback@ 执行(返回上一页-子应用);@open_target_menu@ 可执行打开菜单。' : '选择刷新行时,如果选择多条数据会刷新组件;选择刷新行 / 组件时,如果当前行数据不存在会刷新组件。注:上级组件在数据源中添加。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。返回信息(@retmsg)特殊标识:@close_tab@ 执行(关闭标签-管理系统);@close_popup@ 执行(关闭弹窗);@goback@ 执行(返回上一页-子应用);@open_target_menu@ 可执行打开菜单。',
      required: true,
      options: [{
        value: 'never',
@@ -832,6 +853,10 @@
        value: 'never',
        text: '不刷新'
      }, {
        value: 'line',
        text: '刷新行',
        $disabled: !['table_normaltable', 'table_editable', 'table_basetable', 'card_datacard', 'card_dualdatacard'].includes(alltype)
      }, {
        value: 'grid',
        text: '刷新当前组件'
      }, {
@@ -855,6 +880,25 @@
        value: 'false',
        text: '不重置'
      }]
    },
    {
      type: 'select',
      key: 'nameField',
      label: '位置名字段',
      initVal: card.nameField || '',
      tooltip: '打开地图时可展示位置名与详细地址,请绑定数据源字段集,经纬度请使用latitude、longitude且经纬度不可为空。',
      required: false,
      allowClear: true,
      options: columns
    },
    {
      type: 'select',
      key: 'addressField',
      label: '地址字段',
      initVal: card.addressField || '',
      required: false,
      allowClear: true,
      options: columns
    },
    {
      type: 'radio',
@@ -1045,10 +1089,26 @@
      options: menulist
    },
    {
      type: 'radio',
      key: 'urlPar',
      label: 'URL变量',
      initVal: card.urlPar || 'false',
      tooltip: '刷新菜单时是否清除URL变量。',
      required: false,
      options: [{
        value: 'true',
        text: '清空'
      }, {
        value: 'false',
        text: '不清空'
      }],
      forbid: isApp || viewType === 'popview',
    },
    {
      type: !appType ? 'cascader' : 'select',
      key: 'openmenu',
      label: '打开菜单',
      tooltip: '执行成功后需要打开的菜单。',
      tooltip: '执行成功后(或失败时返回@open_target_menu@)需要打开的菜单。',
      initVal: card.openmenu || (!appType ? [] : ''),
      help: appType === 'mob' || appType === 'pc' ? '可返回上一页。' : null,
      extendName: 'MenuNo',
@@ -1151,10 +1211,7 @@
      required: false,
      allowClear: true,
      forbid: position !== 'line',
      options: columns.map(item => ({
        value: item.field,
        text: `${item.label}(${item.field})`
      }))
      options: columns
    },
    {
      type: 'radio',
@@ -1371,10 +1428,7 @@
      initVal: card.controlField || '',
      required: true,
      allowClear: true,
      options: columns.map(item => ({
        value: item.field,
        text: `${item.label}(${item.field})`
      }))
      options: columns
    },
    {
      type: 'text',
@@ -1390,21 +1444,6 @@
      initVal: card.reason || '',
      required: false
    },
    // {
    //   type: 'radio',
    //   key: 'formCache',
    //   label: '表单缓存',
    //   initVal: card.formCache || 'false',
    //   tooltip: '主要用于数据修改后,更新相关表单的选项,清空缓存后表单再次打开时数据会重新加载。',
    //   required: false,
    //   options: [{
    //     value: 'false',
    //     text: '不清空'
    //   }, {
    //     value: 'clear',
    //     text: '清空'
    //   }]
    // },
    {
      type: 'radio',
      key: 'hidden',
@@ -1440,10 +1479,68 @@
      initVal: card.permission || 'true',
      required: false,
      options: [
        {value: 'true', text: '继承菜单'},
        {value: 'true', text: '继承组件'},
        {value: 'false', text: '禁用'},
      ],
      forbid: viewType === 'popview'
    },
    {
      type: 'radio',
      key: 'extBtn',
      label: '扩展按钮',
      initVal: card.extBtn || 'false',
      tooltip: '点击扩展按钮时,变量 mk_submit_type 将被赋值。',
      required: false,
      options: [
        {value: 'true', text: '启用'},
        {value: 'false', text: '禁用'},
      ],
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      key: 'extValue',
      label: '扩展值',
      initVal: card.extValue || '',
      required: true,
      readonly: false,
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      key: 'extLabel',
      label: '扩展名称',
      initVal: card.extLabel || '',
      required: true,
      readonly: false,
      forbid: appType === 'mob'
    },
    {
      type: 'select',
      key: 'extStyle',
      label: '扩展样式',
      initVal: card.extStyle || '',
      required: false,
      options: modalClasses,
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      key: 'confLabel',
      label: '确定名称',
      initVal: card.confLabel || '',
      required: false,
      readonly: false,
      forbid: appType === 'mob'
    },
    {
      type: 'select',
      key: 'confStyle',
      label: '确定样式',
      initVal: card.confStyle || '',
      required: false,
      options: modalClasses,
      forbid: appType === 'mob'
    },
    {
      type: 'splitLine',
@@ -1553,6 +1650,14 @@
        value: 'single',
        text: '逐条请求'
      }]
    },
    {
      type: 'number',
      key: 'execInterval',
      label: '执行间隔',
      initVal: card.execInterval || 0,
      tooltip: '两次请求的时间间隔(单位毫秒)。',
      required: false
    },
    {
      type: 'radio',
@@ -1797,6 +1902,11 @@
        apps.push({value: item.appId, text: item.appName})
      }
    })
  }
  let width = card.width || (card.width === 0 ? 0 : 12)
  if (card.width && /x/.test(card.width)) {
    width = +width.replace(/x/, '.5')
  }
  let forms = [
@@ -2211,7 +2321,7 @@
      key: 'execError',
      label: '失败后',
      initVal: card.execError || 'never',
      tooltip: refresh.length ? '执行刷新源组件时,请在源按钮(弹窗按钮)中设置关闭后刷新哪一项,注:此时会同步刷新当前组件和上级组件-行。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。返回信息(@retmsg)特殊标识:@close_tab@ 执行(关闭标签-管理系统);@close_popup@ 执行(关闭弹窗);@goback@ 执行(返回上一页-子应用)。' : '选择刷新行时,如果选择多条数据会刷新组件;选择刷新行 / 组件时,如果当前行数据不存在会刷新组件。注:上级组件在数据源中添加。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。返回信息(@retmsg)特殊标识:@close_tab@ 执行(关闭标签-管理系统);@close_popup@ 执行(关闭弹窗);@goback@ 执行(返回上一页-子应用)。',
      tooltip: refresh.length ? '执行刷新源组件时,请在源按钮(弹窗按钮)中设置关闭后刷新哪一项,注:此时会同步刷新当前组件和上级组件-行。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。返回信息(@retmsg)特殊标识:@close_tab@ 执行(关闭标签-管理系统);@close_popup@ 执行(关闭弹窗);@goback@ 执行(返回上一页-子应用);@open_target_menu@ 可执行打开菜单。' : '选择刷新行时,如果选择多条数据会刷新组件;选择刷新行 / 组件时,如果当前行数据不存在会刷新组件。注:上级组件在数据源中添加。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。返回信息(@retmsg)特殊标识:@close_tab@ 执行(关闭标签-管理系统);@close_popup@ 执行(关闭弹窗);@goback@ 执行(返回上一页-子应用);@open_target_menu@ 可执行打开菜单。',
      required: true,
      options: [{
        value: 'never',
@@ -2243,6 +2353,9 @@
      options: [{
        value: 'never',
        text: '不刷新'
      }, {
        value: 'line',
        text: '刷新行'
      }, {
        value: 'grid',
        text: '刷新当前组件'
@@ -2320,18 +2433,18 @@
      tooltip: '分享时对用户的提示信息。',
      required: false
    },
    // {
    //   type: 'number',
    //   key: 'width',
    //   min: 1,
    //   max: 24,
    //   precision: 0,
    //   label: '宽度',
    //   initVal: card.width || 12,
    //   tooltip: '栅格布局,每行等分为24列。',
    //   forbid: card.eleType !== 'button',
    //   required: true
    // },
    {
      type: 'number',
      key: 'width',
      min: 0,
      max: 24,
      precision: 1,
      label: '宽度',
      initVal: width,
      tooltip: '栅格布局,每行等分为24列。为 0 时宽度自适应。可设置半列即.5。',
      forbid: position !== 'line',
      required: true
    },
    {
      type: 'radio',
      key: 'show',
@@ -2410,10 +2523,26 @@
      options: menulist
    },
    {
      type: 'radio',
      key: 'urlPar',
      label: 'URL变量',
      initVal: card.urlPar || 'false',
      tooltip: '刷新菜单时是否清除URL变量。',
      required: false,
      options: [{
        value: 'true',
        text: '清空'
      }, {
        value: 'false',
        text: '不清空'
      }],
      forbid: viewType === 'popview',
    },
    {
      type: 'cascader',
      key: 'openmenu',
      label: '打开菜单',
      tooltip: '执行成功后需要打开的菜单。',
      tooltip: '执行成功后(或失败时返回@open_target_menu@)需要打开的菜单。',
      initVal: card.openmenu || [],
      extendName: 'MenuNo',
      required: false,
@@ -2645,21 +2774,6 @@
      initVal: card.reason || '',
      required: false
    },
    // {
    //   type: 'radio',
    //   key: 'formCache',
    //   label: '表单缓存',
    //   initVal: card.formCache || 'false',
    //   tooltip: '主要用于数据修改后,更新相关表单的选项,清空缓存后表单再次打开时数据会重新加载。',
    //   required: false,
    //   options: [{
    //     value: 'false',
    //     text: '不清空'
    //   }, {
    //     value: 'clear',
    //     text: '清空'
    //   }]
    // },
    {
      type: 'radio',
      key: 'hidden',
@@ -2702,6 +2816,58 @@
    },
    {
      type: 'radio',
      key: 'extBtn',
      label: '扩展按钮',
      initVal: card.extBtn || 'false',
      tooltip: '点击扩展按钮时,变量 mk_submit_type 将被赋值。',
      required: false,
      options: [
        {value: 'true', text: '启用'},
        {value: 'false', text: '禁用'},
      ],
    },
    {
      type: 'text',
      key: 'extValue',
      label: '扩展值',
      initVal: card.extValue || '',
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'extLabel',
      label: '扩展名称',
      initVal: card.extLabel || '',
      required: true,
      readonly: false
    },
    {
      type: 'select',
      key: 'extStyle',
      label: '扩展样式',
      initVal: card.extStyle || '',
      required: false,
      options: modalClasses
    },
    {
      type: 'text',
      key: 'confLabel',
      label: '确定名称',
      initVal: card.confLabel || '',
      required: false,
      readonly: false
    },
    {
      type: 'select',
      key: 'confStyle',
      label: '确定样式',
      initVal: card.confStyle || '',
      required: false,
      options: modalClasses
    },
    {
      type: 'radio',
      key: 'execType',
      label: '请求方式',
      initVal: card.execType || 'multi',
@@ -2716,6 +2882,14 @@
      }]
    },
    {
      type: 'number',
      key: 'execInterval',
      label: '执行间隔',
      initVal: card.execInterval || 0,
      tooltip: '两次请求的时间间隔(单位毫秒)。',
      required: false
    },
    {
      type: 'radio',
      key: 'progress',
      label: '进度提示',