fuchengshen
2022-07-09 3a25c05b5ab837714f30469cdcb1e2a77d8d7f6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/**
 * 统一导出公共组件, 按需初始化ant-design-vue
 * @copyright 火星科技 mars3d.cn
 * @author 木遥 2022-01-01
 */
import { App } from "vue"
import MarsSelect from "./mars-select/index.vue"
import MarsButton from "./mars-button/index.vue"
import MarsInput from "./mars-input/index.vue"
import MarsTextarea from "./mars-textarea/index.vue"
import MarsInputNumber from "./mars-input-number/index.vue"
import MarsInputGroup from "./mars-input-group/index.vue"
import MarsDatePicker from "./mars-date-picker/index.vue"
import MarsRangePicker from "./mars-range-picker/index.vue"
import MarsColorPicker from "./mars-color-picker"
import MarsIcon from "./mars-icon/index.vue"
import MarsSwitch from "./mars-switch/index.vue"
import MarsDialog from "./mars-dialog/index.vue"
import MarsSlider from "./mars-slider/index.vue"
import MarsPannel from "./mars-pannel/index.vue"
import MarsDropDown from "./mars-dropdown"
import MarsGui from "./mars-gui/index.vue"
import MarsTable from "./mars-table/index.vue"
 
import MarsMessage, { $message as marsMessage } from "./mars-message"
import MarsAlert, { $alert as marsAlert } from "./mars-alert/"
import MarsNotify, { $notify as marsNotify } from "./mars-notify"
import MarsLoading, { $hideLoading as marsHideLoading, $showLoading as marsShowLoading } from "./mars-loading"
import MarsTree from "./mars-tree"
import {
  AutoComplete,
  Button,
  Cascader,
  Checkbox,
  Col,
  Collapse,
  Divider,
  Dropdown,
  Form,
  Input,
  InputNumber,
  DatePicker,
  Select,
  List,
  Menu,
  Modal,
  PageHeader,
  Popover,
  Progress,
  Pagination,
  Radio,
  Row,
  Slider,
  Space,
  Spin,
  Switch,
  Table,
  Tabs,
  Tooltip,
  Tree,
  Typography,
  Upload,
  Card,
  Image,
  Empty
} from "ant-design-vue"
 
import "./mars-echarts"
 
import "./index.less"
import "./function.less"
 
export const $alert = (window.$alert = marsAlert)
export const $notify = (window.$notify = marsNotify)
export const $message = (window.$message = marsMessage)
export const $hideLoading = (window.$hideLoading = marsHideLoading)
export const $showLoading = (window.$showLoading = marsShowLoading)
 
const components = [
  MarsSelect,
  MarsButton,
  MarsInput,
  MarsInputGroup,
  MarsInputNumber,
  MarsDatePicker,
  MarsRangePicker,
  MarsColorPicker,
  MarsTree,
  MarsDropDown,
  MarsIcon,
  MarsDialog,
  MarsPannel,
  MarsTextarea,
  MarsSwitch,
  MarsSlider,
  MarsGui,
  MarsTable
]
 
let marsUIConfig: Record<string, any>
 
export const getConfig = () => {
  return marsUIConfig
}
 
export default function (app: App, config: Record<string, any> = {}): App {
  marsUIConfig = config
  app.use(AutoComplete)
  app.use(Row)
  app.use(Cascader)
  app.use(Col)
  app.use(Collapse)
  app.use(Button)
  app.use(Select)
  app.use(List)
  app.use(Form)
  app.use(Input)
  app.use(InputNumber)
  app.use(DatePicker)
  app.use(Dropdown)
  app.use(Checkbox)
  app.use(Radio)
  app.use(Switch)
  app.use(Space)
  app.use(Slider)
  app.use(Table)
  app.use(Tree)
  app.use(Upload)
  app.use(Progress)
  app.use(PageHeader)
  app.use(Menu)
  app.use(Popover)
  app.use(Spin)
  app.use(Modal)
  app.use(Typography)
  app.use(Tabs)
  app.use(Tooltip)
  app.use(Divider)
  app.use(Card)
  app.use(Image)
  app.use(Pagination)  
  app.use(Table)
  app.use(Empty)
  
 
  components.forEach((comp) => {
    app.component(comp.name, comp)
  })
  // MarsMessage(app)
  // MarsAlert(app)
  // MarsNotify(app)
  // MarsLoading(app)
  return app
}