king
2022-09-22 c33ac9ddcdbed91bd2267bed2a96199441806a04
src/templates/formtabconfig/source.jsx
@@ -1,215 +1,162 @@
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/comtable.js'
import enUS from '@/locales/en-US/comtable.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
const CommonDict = (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS
const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
class CommonTableBaseData {
  baseConfig = {
    type: 'formTab',
    Template: 'FormTab',
    enabled: false,
    setting: {
      tableName: '',
      primaryKey: '',
      dataresource: '',
      interType: 'inner',
      innerFunc: '',
      interface: '',
      outerFunc: '',
      subtabs: []
      datatype: 'query',
      cols: '2',
      width: 90
    },
    tables: [],
    search: [
    groups: [
      {
        origin: true,
        isDefault: true,
        uuid: Utils.getuuid(),
        label: 'label',
        field: '',
        initval: '',
        type: 'text',
        resourceType: '0',
        setAll: 'false',
        options: [],
        dataSource: '',
        linkField: '',
        valueField: '',
        valueText: '',
        orderBy: '',
        orderType: 'asc',
        match: 'like',
        display: 'dropdown'
      }, {
        origin: true,
        uuid: Utils.getuuid(),
        label: 'label',
        field: '',
        initval: '',
        type: 'select',
        resourceType: '0',
        setAll: 'false',
        options: [],
        dataSource: '',
        linkField: '',
        valueField: '',
        valueText: '',
        orderBy: '',
        orderType: 'asc',
        match: 'equal',
        display: 'dropdown'
      }, {
        origin: true,
        uuid: Utils.getuuid(),
        label: 'label',
        field: '',
        initval: '',
        type: 'date',
        resourceType: '0',
        setAll: 'false',
        options: [],
        dataSource: '',
        linkField: '',
        valueField: '',
        valueText: '',
        orderBy: '',
        orderType: 'asc',
        match: 'greater',
        display: 'dropdown'
        sort: 101,
        sublist: [
          {
            origin: true,
            uuid: Utils.getuuid(),
            label: 'label',
            field: '',
            initval: '',
            type: 'text',
            resourceType: '0',
            options: [],
            orderType: 'asc'
          }, {
            origin: true,
            uuid: Utils.getuuid(),
            label: 'label',
            field: '',
            initval: '',
            type: 'select',
            resourceType: '0',
            options: [],
            orderType: 'asc'
          }, {
            origin: true,
            uuid: Utils.getuuid(),
            label: 'label',
            field: '',
            initval: '',
            type: 'date',
            resourceType: '0',
            options: [],
            orderType: 'asc'
          }
        ]
      }
    ],
    action: [
      {
        origin: true,
        btnType: 'confirm',
        uuid: Utils.getuuid(),
        label: 'add',
        intertype: 'inner',
        label: '确定',
        intertype: 'system',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        sqlType: '',
        callbackFunc: '',
        Ot: 'notRequired',
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        pageTemplate: '',
        url: '',
        icon: 'plus',
        class: 'green',
        OpenType: 'exec',
        icon: '',
        class: 'border-primary',
        verify: null
      }, {
        origin: true,
        btnType: 'cancel',
        uuid: Utils.getuuid(),
        label: 'update',
        intertype: 'inner',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        sqlType: '',
        callbackFunc: '',
        Ot: 'requiredSgl',
        position: 'grid',
        label: '关闭',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        OpenType: 'exec',
        pageTemplate: '',
        url: '',
        icon: 'form',
        class: 'purple',
        verify: null
      }, {
        origin: true,
        uuid: Utils.getuuid(),
        label: 'delete',
        intertype: 'inner',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        sqlType: '',
        callbackFunc: '',
        Ot: 'required',
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'prompt',
        pageTemplate: '',
        url: '',
        icon: 'delete',
        class: 'red',
        verify: null
        icon: '',
        class: 'border-danger'
      }
    ],
    tabs: [
      {
        origin: true,          // 是否为示例
        groupId: 'tabs',
        uuid: Utils.getuuid(),
        label: 'tab1',
        icon: '',
        type: 'SubTable',
        linkTab: '',
        subtabs: [],
        supMenu: ''
      },
      {
        origin: true,
        groupId: 'tabs',
        uuid: Utils.getuuid(),
        label: 'tab2',
        icon: '',
        type: 'SubTable',
        linkTab: '',
        subtabs: [],
        supMenu: ''
      }
    ],
    tabgroups: ['tabs']
    tabgroups: [{
      uuid: 'tabs',
      sublist: [
        {
          origin: true,          // 是否为示例
          uuid: Utils.getuuid(),
          label: 'tab1',
          type: 'SubTable',
          linkTab: '',
          supMenu: ''
        },
        {
          origin: true,
          uuid: Utils.getuuid(),
          label: 'tab2',
          type: 'SubTable',
          linkTab: '',
          supMenu: ''
        }
      ]
    }]
  }
  searchItems = [
    {
      type: 'search',
      label: '文本框',
      label: '文本',
      subType: 'text',
      url: ''
    },
    {
      type: 'search',
      label: '下拉框',
      label: '数字',
      subType: 'number',
      url: ''
    },
    {
      type: 'search',
      label: '下拉选择',
      subType: 'select',
      url: ''
    },
    {
      type: 'search',
      label: '时间框(天)',
      label: '文件上传',
      subType: 'fileupload',
      url: ''
    },
    {
      type: 'search',
      label: '时间(天)',
      subType: 'date',
      url: ''
    },
    {
      type: 'search',
      label: '时间框(周)',
      subType: 'dateweek',
      url: ''
    },
    {
      type: 'search',
      label: '时间框(月)',
      label: '时间(月)',
      subType: 'datemonth',
      url: ''
    },
    {
      type: 'search',
      label: '时间框(区间)',
      subType: 'daterange',
      label: '时间(秒)',
      subType: 'datetime',
      url: ''
    },
    {
      type: 'search',
      label: '多行文本',
      subType: 'textarea',
      url: ''
    }
  ]
@@ -217,62 +164,14 @@
  actionItems = [
    {
      type: 'action',
      label: CommonDict['header.form.popform'],
      subType: 'pop',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.prompt'],
      label: CommonDict['model.form.prompt'],
      subType: 'prompt',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.exec'],
      label: CommonDict['model.form.exec'],
      subType: 'exec',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.excelIn'],
      subType: 'excelIn',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.excelOut'],
      subType: 'excelOut',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.popview'],
      subType: 'popview',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.tab'],
      subType: 'tab',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.blank'],
      subType: 'blank',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.newpage.inner'],
      subType: 'innerpage',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.newpage.outer'],
      subType: 'outerpage',
      url: ''
    }
  ]
@@ -280,7 +179,7 @@
  tabItems = [
    {
      type: 'tabs',
      label: CommonDict['header.menu.tab.subtable'],
      label: CommonDict['model.menu.tab.subtable'],
      subType: 'SubTable',
    }
  ]