king
2025-02-05 125517c3e09320afa84a9e19a084d56c8ec3317e
src/utils/option.js
@@ -1,13 +1,7 @@
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import nortable from '@/assets/img/normaltable.jpg'
import mainsubtable from '@/assets/img/mainsubtable.jpg'
import treepage from '@/assets/img/treepage.jpg'
import calendar from '@/assets/img/calendar.jpg'
import customImg from '@/assets/img/custom.jpg'
import newpage from '@/assets/img/newpage.jpg'
import rolemanage from '@/assets/img/rolemanage.jpg'
const _dict =  sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
// 表单校验规则
export const formRule = {
@@ -17,8 +11,6 @@
    formMessage: '最多@max个字符。', // 文本表单最大提示
    numbermsg: '请输入数字!',
    lettermsg: '请输入字母!',
    letternummsg: '请输入数字或字母!',
    quotemsg: '不可使用英文状态的单引号!',
    funcname: '请输入数字、字母、汉字以及_'
  },
  field: { // 字段名
@@ -52,30 +44,8 @@
export const sysTemps = [
  {
    title: '基础表格',
    type: 'CommonTable',
    type: 'BaseTable',
    url: nortable,
    baseconfig: '',
    isSystem: true
  },
  {
    title: '主子表表格',
    type: 'CommonTable',
    url: mainsubtable,
    baseconfig: '',
    isSystem: true,
    isSubtable: true
  },
  {
    title: '树形页面',
    type: 'TreePage',
    url: treepage,
    baseconfig: '',
    isSystem: true
  },
  {
    title: '日历',
    type: 'CalendarPage',
    url: calendar,
    baseconfig: '',
    isSystem: true
  },
@@ -87,39 +57,50 @@
    isSystem: true
  },
  {
    title: '外部页面',
    type: 'NewPage',
    url: newpage,
    baseconfig: '',
    isSystem: true
  },
  {
    title: '角色权限分配',
    type: 'RolePermission',
    url: rolemanage,
    isSystem: true,
    hidden: true
  },
  {
    title: '外部页面',
    type: 'NewPage',
    url: customImg,
    baseconfig: '',
    isSystem: true
  }
]
// 图表色系
export const chartColors = ['rgb(91, 143, 249)', 'rgb(90, 216, 166)', 'rgb(93, 112, 146)', 'rgb(246, 189, 22)', 'rgb(232, 100, 82)', 'rgb(109, 200, 236)', 'rgb(148, 95, 185)', 'rgb(246, 189, 22)', 'rgb(205, 221, 253)', 'rgb(248, 208, 203)']
export const chartColors = ['rgb(91, 143, 249)', 'rgb(90, 216, 166)', 'rgb(93, 112, 146)', 'rgb(246, 189, 22)', 'rgb(232, 100, 82)', 'rgb(109, 200, 236)', 'rgb(148, 95, 185)', 'rgb(205, 221, 253)', 'rgb(248, 208, 203)', 'rgb(145, 213, 255)', 'rgb(211, 173, 247)']
// 日期默认值选择范围
export const dateOptions = {
  date: [
    {value: '', text: _dict['model.empty']},
    {value: '', text: '空'},
    {value: '0', text: '今天'},
    {value: 1, text: '昨天'},
    {value: 2, text: '前天'},
    {value: 3, text: '前三天'},
    {value: 7, text: '前七天'},
    {value: 30, text: '前30天'},
    {value: 90, text: '前90天'},
    {value: 7300, text: '前20年'},
    {value: -1, text: '明天'},
    {value: -2, text: '后天'}
    {value: -2, text: '后天'},
    {value: -3, text: '后三天'},
    {value: -7, text: '后七天'},
    {value: -30, text: '后30天'},
    {value: -90, text: '后90天'},
    {value: -180, text: '后半年'},
    {value: -365, text: '后1年'},
    {value: -1095, text: '后3年'},
    {value: -1825, text: '后5年'},
    {value: -3650, text: '后10年'},
    {value: -7300, text: '后20年'},
  ],
  dateweek: [
    {value: '', text: _dict['model.empty']},
    {value: '', text: '空'},
    {value: '0', text: '本周'},
    {value: 1, text: '上周'},
    {value: 3, text: '前三周'},
@@ -127,7 +108,7 @@
    {value: -1, text: '下周'}
  ],
  datemonth: [
    {value: '', text: _dict['model.empty']},
    {value: '', text: '空'},
    {value: '0', text: '本月'},
    {value: 1, text: '上月'},
    {value: 3, text: '前三月'},
@@ -135,33 +116,53 @@
    {value: -1, text: '下月'}
  ],
  daterange: [
    {value: '', text: _dict['model.empty']},
    {value: '', text: '空'},
    {value: '[0, 0]', text: '今天'},
    {value: '[1, 1]', text: '昨天'},
    {value: '[3, 0]', text: '近三天'},
    {value: '[7, 0]', text: '近七天'},
    {value: '[30, 0]', text: '近30天'},
    {value: '[90, 0]', text: '近90天'},
    {value: '[7, -7]', text: '前后七天'},
    {value: '[30, -30]', text: '前后30天'},
    {value: '[90, -90]', text: '前后90天'},
    {value: '[180, -180]', label: '前后180天'},
    {value: '[365, -365]', label: '前后365天'},
    {value: '[-1, -1]', text: '明天'},
    {value: '[-2, -2]', text: '后天'}
    {value: '[-2, -2]', text: '后天'},
    {value: 'week', text: '本周'},
    {value: 'month', text: '本月'},
    {value: 'lastMonth', text: '上月'},
    {value: 'year', text: '本年'},
    {value: 'lastYear', text: '上年'},
  ],
  datetime: [
    {value: '', text: _dict['model.empty']},
    {value: '0', text: '今天'},
    {value: '', text: '空'},
    {value: '0', text: '当前'},
    {value: 1, text: '昨天'},
    {value: 3, text: '前三天'},
    {value: 7, text: '前七天'},
    {value: 30, text: '前30天'},
    {value: 90, text: '前90天'},
    {value: 7300, text: '前20年'},
    {value: -1, text: '明天'},
    {value: -2, text: '后天'}
    {value: -2, text: '后天'},
    {value: -3, text: '后三天'},
    {value: -7, text: '后七天'},
    {value: -30, text: '后30天'},
    {value: -90, text: '后90天'},
    {value: -180, text: '后半年'},
    {value: -365, text: '后1年'},
    {value: -1095, text: '后3年'},
    {value: -1825, text: '后5年'},
    {value: -3650, text: '后10年'},
    {value: -7300, text: '后20年'},
  ]
}
// 匹配规则
export const matchReg = {
  text: [{
  class1: [{
    value: 'like',
    text: 'like'
  }, {
@@ -170,25 +171,43 @@
  }, {
    value: '=',
    text: '='
  }],
  multiselect: [{
    value: 'like',
    text: 'like'
  }, {
    value: 'not like',
    text: 'not like'
    value: '>',
    text: '>'
  }, {
    value: '<',
    text: '<'
  }, {
    value: '>=',
    text: '>='
  }, {
    value: '<=',
    text: '<='
  }],
  select: [{
  class2: [{
    value: '=',
    text: '='
  }, {
    value: '>',
    text: '>'
  }, {
    value: '<',
    text: '<'
  }, {
    value: '>=',
    text: '>='
  }, {
    value: '<=',
    text: '<='
  }],
  class3: [{
    value: 'like',
    text: 'like'
  }, {
    value: 'not like',
    text: 'not like'
  }],
  date: [{
  class4: [{
    value: '>=',
    text: '>='
  }, {
@@ -198,21 +217,21 @@
    value: '=',
    text: '='
  }],
  datemonth: [{
  class5: [{
    value: 'between',
    text: 'between'
  }],
  daterange: [{
  class6: [{
    value: 'between',
    text: 'between'
  }, {
    value: '=',
    text: '='
  }]
}
// 按钮图标集
export const btnIcons = [{
  value: '',
  text: '无'
}, {
  value: 'plus',
  text: 'plus'
}, {
@@ -284,6 +303,9 @@
}, {
  value: 'double-left',
  text: 'double-left'
}, {
  value: 'search',
  text: 'search'
}]
// 按钮颜色集
@@ -341,7 +363,7 @@
}]
// 按钮颜色集
export const btnCustomClasses = [{
export const modalClasses = [{
  value: 'primary',
  text: '蓝色'
}, {
@@ -357,17 +379,26 @@
  value: 'green',
  text: '绿色'
}, {
  value: 'dgreen',
  text: '深绿色'
}, {
  value: 'purple',
  text: '紫色'
}, {
  value: 'cyan',
  text: '青色'
  value: 'border-primary',
  text: '白底蓝框'
}, {
  value: 'gray',
  text: '灰色'
  value: 'border-yellow',
  text: '白底黄框'
}, {
  value: 'border-orange',
  text: '白底橙框'
}, {
  value: 'border-danger',
  text: '白底红框'
}, {
  value: 'border-green',
  text: '白底绿框'
}, {
  value: 'border-purple',
  text: '白底紫框'
}]
export const calendarColors = [
@@ -473,16 +504,16 @@
  'blue-8': '#0050b3',
  'blue-9': '#003a8c',
  'blue-10': '#002766',
  'geekblue-1': '#f0f5ff',
  'geekblue-2': '#d6e4ff',
  'geekblue-3': '#adc6ff',
  'geekblue-4': '#85a5ff',
  'geekblue-5': '#597ef7',
  'geekblue-6': '#2f54eb',
  'geekblue-7': '#1d39c4',
  'geekblue-8': '#10239e',
  'geekblue-9': '#061178',
  'geekblue-10': '#030852',
  'geekblue-1': '#f0f6ff',
  'geekblue-2': '#dee9ff',
  'geekblue-3': '#b5ccff',
  'geekblue-4': '#8cadff',
  'geekblue-5': '#638aff',
  'geekblue-6': '#3860f4',
  'geekblue-7': '#2544cf',
  'geekblue-8': '#162ca8',
  'geekblue-9': '#0a1882',
  'geekblue-10': '#060e5c',
  'purple-1': '#f9f0ff',
  'purple-2': '#efdbff',
  'purple-3': '#d3adf7',
@@ -673,86 +704,39 @@
    'up',
    'left',
    'right',
    'caret-up',
    'caret-down',
    'caret-left',
    'caret-right',
    'download',
    'upload',
    'step-backward',
    'step-forward',
    'fast-backward',
    'fast-forward',
    'shrink',
    'arrows-alt',
    'up-circle',
    'down-circle',
    'left-circle',
    'right-circle',
    'double-right',
    'double-left',
    'vertical-left',
    'vertical-right',
    'vertical-align-top',
    'vertical-align-middle',
    'vertical-align-bottom',
    'forward',
    'backward',
    'rollback',
    'enter',
    'retweet',
    'swap',
    'swap-left',
    'swap-right',
    'play-circle',
    'up-square',
    'down-square',
    'left-square',
    'right-square',
    'login',
    'logout',
    'menu-fold',
    'menu-unfold',
    'border-bottom',
    'border-horizontal',
    'border-inner',
    'border-outer',
    'border-left',
    'border-right',
    'border-top',
    'border-verticle',
    'pic-center',
    'pic-left',
    'pic-right',
    'radius-bottomleft',
    'radius-bottomright',
    'radius-upleft',
    'radius-upright',
    'search',
    'fullscreen',
    'fullscreen-exit'
    'fullscreen-exit',
  ],
  hint: [
    'question',
    'question-circle',
    'plus',
    'plus-circle',
    'pause',
    'pause-circle',
    'minus',
    'minus-circle',
    'plus-square',
    'minus-square',
    'info',
    'question',
    'question-circle',
    'info-circle',
    'exclamation',
    'exclamation-circle',
    'close',
    'close-circle',
    'close-square',
    'check',
    'check-circle',
    'check-square',
    'clock-circle',
    'warning',
    'issues-close',
    'stop'
  ],
  edit: [
@@ -762,33 +746,14 @@
    'scissor',
    'delete',
    'snippets',
    'diff',
    'highlight',
    'align-center',
    'align-left',
    'align-right',
    'bg-colors',
    'bold',
    'italic',
    'underline',
    'strikethrough',
    'redo',
    'undo',
    'zoom-in',
    'zoom-out',
    'font-colors',
    'font-size',
    'line-height',
    'dash',
    'small-dash',
    'sort-ascending',
    'sort-descending',
    'drag',
    'ordered-list',
    'unordered-list',
    'radius-setting',
    'column-width',
    'column-height'
    'sort-descending'
  ],
  data: [
    'area-chart',
@@ -797,66 +762,12 @@
    'dot-chart',
    'line-chart',
    'radar-chart',
    'heat-map',
    'fall',
    'rise',
    'stock',
    'box-plot',
    'fund',
    'sliders'
  ],
  trademark: [
    'android',
    'apple',
    'windows',
    'ie',
    'chrome',
    'github',
    'aliwangwang',
    'dingding',
    'weibo-square',
    'weibo-circle',
    'taobao-circle',
    'html5',
    'weibo',
    'twitter',
    'wechat',
    'youtube',
    'alipay-circle',
    'taobao',
    'skype',
    'qq',
    'medium-workmark',
    'gitlab',
    'medium',
    'linkedin',
    'google-plus',
    'dropbox',
    'facebook',
    'codepen',
    'code-sandbox',
    'amazon',
    'google',
    'codepen-circle',
    'alipay',
    'ant-design',
    'ant-cloud',
    'aliyun',
    'zhihu',
    'slack',
    'slack-square',
    'behance',
    'behance-square',
    'dribbble',
    'dribbble-square',
    'instagram',
    'yuque',
    'alibaba',
    'yahoo',
    'reddit',
    'sketch'
  ],
  normal: [
    'user',
    'account-book',
    'alert',
    'api',
@@ -864,42 +775,22 @@
    'audio',
    'bank',
    'bell',
    'book',
    'scan',
    'bug',
    'bulb',
    'calculator',
    'build',
    'calendar',
    'camera',
    'car',
    'carry-out',
    'cloud',
    'code',
    'compass',
    'contacts',
    'container',
    'control',
    'credit-card',
    'crown',
    'customer-service',
    'dashboard',
    'ellipsis',
    'more',
    'database',
    'dislike',
    'environment',
    'experiment',
    'eye-invisible',
    'eye',
    'file-add',
    'file-excel',
    'file-exclamation',
    'file-image',
    'file-markdown',
    'file-pdf',
    'file-ppt',
    'file-text',
    'file-unknown',
    'file-word',
    'file-zip',
    'file',
    'filter',
    'fire',
@@ -907,41 +798,143 @@
    'folder-add',
    'folder',
    'folder-open',
    'frown',
    'funnel-plot',
    'gift',
    'hdd',
    'heart',
    'home',
    'hourglass',
    'idcard',
    'insurance',
    'interaction',
    'layout',
    'like',
    'lock',
    'mail',
    'medicine-box',
    'meh',
    'message',
    'mobile',
    'phone',
    'picture',
    'red-envelope',
    'setting',
    'tool',
    'smile',
    'star',
    'thunderbolt',
    'trophy',
    'unlock',
    'barcode',
    'key',
    'man',
    'woman',
    'team',
    'poweroff',
    'search',
    'shopping-cart',
    'link'
    'link',
    'aim',
    'apartment',
    'appstore-add',
    'audio-mute',
    'audit',
    'bars',
    'block',
    'book',
    'bulb',
    'border',
    'number',
    'branches',
    'build',
    'calculator',
    'car',
    'carry-out',
    'ci',
    'clear',
    'cloud-download',
    'cloud-server',
    'cloud-sync',
    'cloud-upload',
    'cluster',
    'code',
    'coffee',
    'comment',
    'compress',
    'control',
    'copyright',
    'crown',
    'delete-column',
    'delete-row',
    'delivered-procedure',
    'deployment-unit',
    'desktop',
    'disconnect',
    'dollar',
    'euro',
    'expand',
    'export',
    'file-add',
    'file-done',
    'file-image',
    'file-pdf',
    'file-ppt',
    'file-text',
    'file-unknown',
    'file-word',
    'file-zip',
    'fork',
    'frown',
    'funnel-plot',
    'gateway',
    'gif',
    'gift',
    'global',
    'gold',
    'import',
    'laptop',
    'loading',
    'medicine-box',
    'meh',
    'menu',
    'paper-clip',
    'partition',
    'pay-circle',
    'printer',
    'pushpin',
    'qrcode',
    'reload',
    'rest',
    'robot',
    'rotate-left',
    'rotate-right',
    'safety-certificate',
    'save',
    'send',
    'shake',
    'share-alt',
    'shop',
    'shopping',
    'sound',
    'sync',
    'tag',
    'tags',
    'trademark',
    'trophy',
    'usb',
    'user-add',
    'user-delete',
    'user-switch',
    'video-camera',
    'wifi',
    'table',
    'apple',
    'dingding',
    'weibo',
    'wechat',
    'taobao',
    'qq',
    'alipay',
  ]
}
export const queryTableSql = 'select TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t'
export const queryTableSql = 'select top 999999 TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t order by TbName'
export const queryPrintSql = `select ID,Images,PrintTempNO+PrintTempName as PN from sPrintTemplate
  where appkey= @appkey@ and Deleted=0 and typechartwo='web_print'
  union select ID,Images,a.PrintTempNO+PrintTempName as PN
  from (select * from sPrintTemplate where appkey= '' and Deleted=0 and typechartwo='web_print') a
  left join (select PrintTempNO from sPrintTemplate where appkey= @appkey@ and Deleted=0 ) b
  on a.PrintTempNO=b.PrintTempNO
  left join (select Srcid from sPrintTemplate_Log where appkey='' and apicode= @appkey@ and Deleted=0 ) c
  on a.ID=c.Srcid where b.PrintTempNO is null and c.Srcid is null`