| | |
| | | */ |
| | | export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let setting = config.setting || {} |
| | | let columns = config.columns || [] |
| | | let appMenus = [] |
| | |
| | | } |
| | | ] |
| | | |
| | | let getTabs = (list) => { |
| | | return list.filter(item => { |
| | | if (item.type !== 'tabs') return false |
| | | |
| | | item.children = item.children.map(cell => { |
| | | cell.children = getTabs(cell.children) |
| | | return cell |
| | | }) |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | if (type === 'editable') { |
| | | opentypes = [ |
| | | { |
| | | value: 'excelIn', |
| | | text: Formdict['model.form.excelIn'] |
| | | }, { |
| | | value: 'excelOut', |
| | | text: Formdict['model.form.excelOut'] |
| | | } |
| | | ] |
| | | } |
| | | |
| | | let tabs = getTabs(JSON.parse(JSON.stringify(modules))) |
| | | |
| | | let pageTemps = [ |
| | | { value: 'billprint', text: '单据打印' }, |
| | | { value: 'pay', text: Formdict['model.pay'] }, |
| | |
| | | |
| | | let funTypes = [ |
| | | { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, |
| | | { value: 'print', text: '标签打印' } |
| | | { value: 'print', text: '标签打印' }, |
| | | { value: 'closetab', text: '标签关闭' }, |
| | | ] |
| | | |
| | | if (isApp) { |
| | | pageTemps = [ |
| | | // { value: 'page', text: '菜单' }, |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | { value: 'billprint', text: '单据打印' }, |
| | | { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | funTypes = [ |
| | | { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, |
| | | ] |
| | | appMenus = sessionStorage.getItem('appMenus') |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | } catch { |
| | | } catch (e) { |
| | | appMenus = [] |
| | | } |
| | | } else { |
| | |
| | | funTypes = [ |
| | | { value: 'mkBinding', text: '开通扫码登录' }, |
| | | { value: 'mkUnBinding', text: '用户解绑' }, |
| | | { value: 'scan', text: '扫一扫' }, |
| | | { value: 'reAuth', text: '重新授权' }, |
| | | { value: 'goBack', text: '返回' }, |
| | | ] |
| | | pageTemps = [ |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | // { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | } else { |
| | | pageTemps = [ |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | { value: 'billprint', text: '单据打印' }, |
| | | { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | funTypes = [ |
| | | { value: 'changeuser', text: Formdict['header.form.func.changeuser'] }, |
| | | ] |
| | | opentypes = opentypes.filter(item => item.value !== 'tab') |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | let refresh = [] |
| | | if (sessionStorage.getItem('editMenuType') === 'popview') { // 弹窗标签 |
| | | if (viewType === 'popview') { // 弹窗标签 |
| | | opentypes = opentypes.filter(item => item.value !== 'popview' && item.value !== 'funcbutton') |
| | | refresh.push({ |
| | | value: 'popclose', |
| | |
| | | options: opentypes |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | type: 'select', |
| | | key: 'funcType', |
| | | label: Formdict['header.form.funcType'], |
| | | initVal: card.funcType || '', |
| | |
| | | }, { |
| | | value: 'mainline', |
| | | text: '刷新上级组件 - 行' |
| | | }, { |
| | | value: !appType ? 'closetab' : 'goback', |
| | | text: !appType ? '关闭标签' : '返回(上一个页面)' |
| | | }, |
| | | ...refresh] |
| | | }, |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'mcascader', |
| | | type: 'cascader', |
| | | key: 'syncComponent', |
| | | label: '同步刷新', |
| | | label: '刷新组件', |
| | | initVal: card.syncComponent || [], |
| | | tooltip: '执行成功后,需要同步刷新的组件', |
| | | required: false, |
| | | options: modules |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'switchTab', |
| | | label: '切换标签', |
| | | initVal: card.switchTab || [], |
| | | tooltip: '执行成功后,需要切换的标签页', |
| | | required: false, |
| | | options: tabs |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'refreshTab', |
| | | label: '刷新菜单', |
| | | initVal: card.refreshTab || [], |
| | | tooltip: '执行成功后或标签关闭时,需要同步刷新的菜单', |
| | | required: false, |
| | | forbid: isApp || viewType === 'popview', |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: 'cascader', |
| | | key: 'linkmenu', |
| | | label: Formdict['model.form.linkmenu'], |
| | | initVal: card.linkmenu || [], |
| | | required: true, |
| | | forbid: isApp, |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: !appType ? 'cascader' : 'select', |
| | | key: 'openmenu', |
| | | label: '打开菜单', |
| | | tooltip: '执行成功后需要打开的菜单。', |
| | | initVal: card.openmenu || '', |
| | | forbid: appType !== 'pc' && appType !== 'mob', |
| | | initVal: card.openmenu || (!appType ? [] : ''), |
| | | required: false, |
| | | allowClear: true, |
| | | options: appMenus |
| | | options: appType === 'mob' ? [...appMenus, {value: 'goback', text: '返回'}] : (appType === 'pc' ? appMenus : menulist), |
| | | forbid: viewType === 'popview' |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | label: '返回值', |
| | | tooltip: '执行成功后的返回值。', |
| | | initVal: card.output || '', |
| | | forbid: appType !== 'pc' && appType !== 'mob', |
| | | required: false |
| | | required: false, |
| | | forbid: viewType === 'popview' |
| | | }, |
| | | { |
| | | type: 'radio', |