11 changed files with 3792 additions and 1858 deletions
			
			
		- 
					2build/optimize.ts
 - 
					7package.json
 - 
					5269pnpm-lock.yaml
 - 
					2public/serverConfig.json
 - 
					2src/layout/index.vue
 - 
					14src/layout/theme/index.ts
 - 
					2src/main.ts
 - 
					6src/plugins/vxe-table/index.scss
 - 
					113src/plugins/vxe-table/index.ts
 - 
					91src/style/dark.scss
 - 
					6src/style/index.scss
 
						
							
						
						
							5269
	
						
						pnpm-lock.yaml
						
							File diff suppressed because it is too large
							
							
								
									View File
								
							
						
					
				File diff suppressed because it is too large
							
							
								
									View File
								
							
						@ -1,6 +0,0 @@ | 
			
		|||||
@import "vxe-table/styles/variable.scss"; | 
				 | 
			
		||||
@import "vxe-table/styles/modules.scss"; | 
				 | 
			
		||||
 | 
				 | 
			
		||||
i { | 
				 | 
			
		||||
  border-color: initial; | 
				 | 
			
		||||
} | 
				 | 
			
		||||
@ -1,113 +0,0 @@ | 
			
		|||||
import "xe-utils"; | 
				 | 
			
		||||
import "./index.scss"; | 
				 | 
			
		||||
import XEUtils from "xe-utils"; | 
				 | 
			
		||||
import { App, unref } from "vue"; | 
				 | 
			
		||||
import { i18n } from "@/plugins/i18n"; | 
				 | 
			
		||||
import zh from "vxe-table/lib/locale/lang/zh-CN"; | 
				 | 
			
		||||
import en from "vxe-table/lib/locale/lang/en-US"; | 
				 | 
			
		||||
 | 
				 | 
			
		||||
import { | 
				 | 
			
		||||
  // 核心
 | 
				 | 
			
		||||
  VXETable, | 
				 | 
			
		||||
  // 表格功能
 | 
				 | 
			
		||||
  Icon, | 
				 | 
			
		||||
  Filter, | 
				 | 
			
		||||
  Edit, | 
				 | 
			
		||||
  Menu, | 
				 | 
			
		||||
  Export, | 
				 | 
			
		||||
  Keyboard, | 
				 | 
			
		||||
  Validator, | 
				 | 
			
		||||
  // 可选组件
 | 
				 | 
			
		||||
  Column, | 
				 | 
			
		||||
  Colgroup, | 
				 | 
			
		||||
  Grid, | 
				 | 
			
		||||
  Tooltip, | 
				 | 
			
		||||
  Toolbar, | 
				 | 
			
		||||
  Pager, | 
				 | 
			
		||||
  Form, | 
				 | 
			
		||||
  FormItem, | 
				 | 
			
		||||
  FormGather, | 
				 | 
			
		||||
  Checkbox, | 
				 | 
			
		||||
  CheckboxGroup, | 
				 | 
			
		||||
  Radio, | 
				 | 
			
		||||
  RadioGroup, | 
				 | 
			
		||||
  RadioButton, | 
				 | 
			
		||||
  Switch, | 
				 | 
			
		||||
  Input, | 
				 | 
			
		||||
  Select, | 
				 | 
			
		||||
  Optgroup, | 
				 | 
			
		||||
  Option, | 
				 | 
			
		||||
  Textarea, | 
				 | 
			
		||||
  Button, | 
				 | 
			
		||||
  Modal, | 
				 | 
			
		||||
  List, | 
				 | 
			
		||||
  Pulldown, | 
				 | 
			
		||||
  // 表格
 | 
				 | 
			
		||||
  Table | 
				 | 
			
		||||
} from "vxe-table"; | 
				 | 
			
		||||
 | 
				 | 
			
		||||
// 全局默认参数
 | 
				 | 
			
		||||
VXETable.setup({ | 
				 | 
			
		||||
  size: "medium", | 
				 | 
			
		||||
  version: 0, | 
				 | 
			
		||||
  zIndex: 1002, | 
				 | 
			
		||||
  table: { | 
				 | 
			
		||||
    // 自动监听父元素的变化去重新计算表格
 | 
				 | 
			
		||||
    autoResize: true, | 
				 | 
			
		||||
    // 鼠标移到行是否要高亮显示
 | 
				 | 
			
		||||
    highlightHoverRow: true | 
				 | 
			
		||||
  }, | 
				 | 
			
		||||
  input: { | 
				 | 
			
		||||
    clearable: true | 
				 | 
			
		||||
  }, | 
				 | 
			
		||||
  i18n: (key, args) => { | 
				 | 
			
		||||
    return unref(i18n.global.locale) === "zh" | 
				 | 
			
		||||
      ? XEUtils.toFormatString(XEUtils.get(zh, key), args) | 
				 | 
			
		||||
      : XEUtils.toFormatString(XEUtils.get(en, key), args); | 
				 | 
			
		||||
  }, | 
				 | 
			
		||||
  translate(key) { | 
				 | 
			
		||||
    const NAMESPACED = ["el.", "buttons."]; | 
				 | 
			
		||||
    if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) { | 
				 | 
			
		||||
      return i18n.global.t.call(i18n.global.locale, key); | 
				 | 
			
		||||
    } | 
				 | 
			
		||||
    return key; | 
				 | 
			
		||||
  } | 
				 | 
			
		||||
}); | 
				 | 
			
		||||
 | 
				 | 
			
		||||
export function useTable(app: App) { | 
				 | 
			
		||||
  app | 
				 | 
			
		||||
    .use(Icon) | 
				 | 
			
		||||
    .use(Filter) | 
				 | 
			
		||||
    .use(Edit) | 
				 | 
			
		||||
    .use(Menu) | 
				 | 
			
		||||
    .use(Export) | 
				 | 
			
		||||
    .use(Keyboard) | 
				 | 
			
		||||
    .use(Validator) | 
				 | 
			
		||||
    // 可选组件
 | 
				 | 
			
		||||
    .use(Column) | 
				 | 
			
		||||
    .use(Colgroup) | 
				 | 
			
		||||
    .use(Grid) | 
				 | 
			
		||||
    .use(Tooltip) | 
				 | 
			
		||||
    .use(Toolbar) | 
				 | 
			
		||||
    .use(Pager) | 
				 | 
			
		||||
    .use(Form) | 
				 | 
			
		||||
    .use(FormItem) | 
				 | 
			
		||||
    .use(FormGather) | 
				 | 
			
		||||
    .use(Checkbox) | 
				 | 
			
		||||
    .use(CheckboxGroup) | 
				 | 
			
		||||
    .use(Radio) | 
				 | 
			
		||||
    .use(RadioGroup) | 
				 | 
			
		||||
    .use(RadioButton) | 
				 | 
			
		||||
    .use(Switch) | 
				 | 
			
		||||
    .use(Input) | 
				 | 
			
		||||
    .use(Select) | 
				 | 
			
		||||
    .use(Optgroup) | 
				 | 
			
		||||
    .use(Option) | 
				 | 
			
		||||
    .use(Textarea) | 
				 | 
			
		||||
    .use(Button) | 
				 | 
			
		||||
    .use(Modal) | 
				 | 
			
		||||
    .use(List) | 
				 | 
			
		||||
    .use(Pulldown) | 
				 | 
			
		||||
    // 安装表格
 | 
				 | 
			
		||||
    .use(Table); | 
				 | 
			
		||||
} | 
				 | 
			
		||||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue