king
2021-05-08 6afdec0062dacbded57e166230eb22cc55ced0c1
src/templates/comtableconfig/source.jsx
@@ -1,77 +1,69 @@
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 = {
    version: '1.0',
    type: 'system',
    Template: 'CommonTable',
    enabled: false,
    easyCode: '',
    setting: {
      actionfixed: false,
      columnfixed: false,
      tableName: '',
      tableType: 'checkbox',
      primaryKey: '',
      orderColumn: '',
      dataresource: ''
      order: '',
      dataresource: '',
      interType: 'system',
      sysInterface: 'false',
      innerFunc: '',
      interface: '',
      outerFunc: '',
      onload: 'true'
    },
    tables: [],
    search: [
      {
        origin: true,
        id: 0,
        uuid: Utils.getuuid(),
        label: 'text',
        label: 'label',
        field: '',
        initval: '',
        type: 'text',
        resourceType: '0',
        setAll: 'false',
        options: [],
        dataSource: '',
        linkField: '',
        valueField: '',
        valueText: '',
        orderBy: '',
        orderType: 'asc',
        match: 'like',
        display: 'dropdown'
      }, {
        origin: true,
        id: 1,
        uuid: Utils.getuuid(),
        label: 'select',
        label: 'label',
        field: '',
        initval: '',
        type: 'select',
        resourceType: '0',
        setAll: 'false',
        options: [],
        dataSource: '',
        linkField: '',
        valueField: '',
        valueText: '',
        orderBy: '',
        orderType: 'asc',
        match: 'equal',
        display: 'dropdown'
      }, {
        origin: true,
        id: 2,
        uuid: Utils.getuuid(),
        label: 'date',
        label: 'label',
        field: '',
        initval: '',
        type: 'date',
        resourceType: '0',
        setAll: 'false',
        options: [],
        dataSource: '',
        linkField: '',
        valueField: '',
        valueText: '',
        orderBy: '',
        orderType: 'asc',
        match: 'greater',
        display: 'dropdown'
@@ -80,95 +72,54 @@
    action: [
      {
        origin: true,
        id: 0,
        uuid: Utils.getuuid(),
        label: 'add',
        intertype: 'inner',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        callbackFunc: '',
        intertype: 'system',
        Ot: 'notRequired',
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        pageTemplate: '',
        url: '',
        icon: 'plus',
        class: 'green'
        class: 'green',
        verify: null
      }, {
        origin: true,
        id: 1,
        uuid: Utils.getuuid(),
        label: 'update',
        intertype: 'inner',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        callbackFunc: '',
        intertype: 'system',
        Ot: 'requiredSgl',
        position: 'grid',
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        pageTemplate: '',
        url: '',
        icon: 'form',
        class: 'purple'
        class: 'purple',
        verify: null
      }, {
        origin: true,
        id: 2,
        uuid: Utils.getuuid(),
        label: 'delete',
        intertype: 'inner',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        callbackFunc: '',
        intertype: 'system',
        Ot: 'required',
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'prompt',
        pageTemplate: '',
        url: '',
        icon: 'delete',
        class: 'red'
      }, {
        origin: true,
        id: 3,
        uuid: Utils.getuuid(),
        label: 'freeze',
        intertype: 'inner',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        callbackFunc: '',
        Ot: 'requiredOnce',
        position: 'toolbar',
        OpenType: 'exec',
        pageTemplate: '',
        url: '',
        icon: '',
        class: 'default'
        class: 'red',
        verify: null
      }
    ],
    columns: [
      {
        origin: true,
        id: 0,
        uuid: Utils.getuuid(),
        Align: 'left',
        label: 'fieldName1',
        label: 'label',
        field: '',
        Hide: 'false',
        IsSort: 'true',
@@ -176,10 +127,9 @@
        Width: 120
      }, {
        origin: true,
        id: 1,
        uuid: Utils.getuuid(),
        Align: 'left',
        label: 'fieldName2',
        label: 'label',
        field: '',
        Hide: 'false',
        IsSort: 'true',
@@ -187,10 +137,9 @@
        Width: 120
      }, {
        origin: true,
        id: 2,
        uuid: Utils.getuuid(),
        Align: 'left',
        label: 'fieldName3',
        label: 'label',
        field: '',
        Hide: 'false',
        IsSort: 'true',
@@ -198,54 +147,113 @@
        Width: 120
      }, {
        origin: true,
        id: 3,
        uuid: Utils.getuuid(),
        Align: 'left',
        label: 'fieldName4',
        label: 'label',
        field: '',
        Hide: 'false',
        IsSort: 'true',
        type: 'text',
        Width: 120
      }
    ]
    ],
    gridBtn: {
      display: false,
      Align: 'center',
      IsSort: 'false',
      uuid: Utils.getuuid(),
      label: CommonDict['model.operation'],
      type: 'action',
      style: 'button',
      show: 'horizontal',
      Width: 120
    },
    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: ''
        }
      ]
    }],
    expand: false,
    charts: [{
      uuid: Utils.getuuid(),
      label: '',
      title: '',
      chartType: 'table',
      icon: 'table',
      Hide: 'false',
      blacklist: []
    }]
  }
  searchItems = [
    {
      type: 'search',
      label: '文本框',
      label: CommonDict['model.form.text'],
      subType: 'text',
      url: ''
    },
    {
      type: 'search',
      label: '下拉框',
      label: CommonDict['model.form.select'],
      subType: 'select',
      url: ''
    },
    {
      type: 'search',
      label: '时间框(天)',
      label: CommonDict['model.form.multiselect'],
      subType: 'multiselect',
      url: ''
    },
    {
      type: 'search',
      label: CommonDict['model.form.link'],
      subType: 'link',
      url: ''
    },
    {
      type: 'search',
      label: CommonDict['model.form.dateday'],
      subType: 'date',
      url: ''
    },
    {
      type: 'search',
      label: '时间框(周)',
      label: CommonDict['model.form.dateweek'],
      subType: 'dateweek',
      url: ''
    },
    {
      type: 'search',
      label: '时间框(月)',
      label: CommonDict['model.form.datemonth'],
      subType: 'datemonth',
      url: ''
    },
    {
      type: 'search',
      label: '时间框(区间)',
      label: CommonDict['model.form.daterange'],
      subType: 'daterange',
      url: ''
    },
    {
      type: 'search',
      label: CommonDict['model.form.dategroup'],
      subType: 'group',
      url: ''
    }
  ]
@@ -253,50 +261,56 @@
  actionItems = [
    {
      type: 'action',
      label: CommonDict['header.form.popform'],
      label: CommonDict['model.form.popform'],
      subType: 'pop',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.popview'],
      subType: 'popview',
      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.tab'],
      label: CommonDict['model.form.excelIn'],
      subType: 'excelIn',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['model.form.excelOut'],
      subType: 'excelOut',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['model.form.popview'],
      subType: 'popview',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['model.form.tab'],
      subType: 'tab',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.blank'],
      subType: 'blank',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.newpage.inner'],
      label: CommonDict['model.form.newpage'],
      subType: 'innerpage',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.newpage.outer'],
      subType: 'outerpage',
      label: CommonDict['model.form.funcbutton'],
      subType: 'funcbutton',
      url: ''
    }
  ]
@@ -304,15 +318,53 @@
  columnItems = [
    {
      type: 'columns',
      label: CommonDict['header.form.text'],
      label: CommonDict['model.form.text'],
      subType: 'text',
      url: ''
    },
    {
      type: 'columns',
      label: CommonDict['header.form.picture'],
      label: CommonDict['model.form.number'],
      subType: 'number',
      url: ''
    },
    {
      type: 'columns',
      label: CommonDict['model.form.picture'],
      subType: 'picture',
      url: ''
    },
    {
      type: 'columns',
      label: CommonDict['model.form.href'],
      subType: 'link',
      url: ''
    },
    {
      type: 'columns',
      label: CommonDict['model.form.textarea'],
      subType: 'textarea',
      url: ''
    },
    {
      type: 'columns',
      label: CommonDict['model.form.colspan'],
      subType: 'colspan',
      url: ''
    },
    {
      type: 'columns',
      label: '序号',
      subType: 'index',
      url: ''
    }
  ]
  tabItems = [
    {
      type: 'tabs',
      label: CommonDict['model.menu.tab.subtable'],
      subType: 'SubTable',
    }
  ]
}