vue-super-crud 1.7.1 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -10
- package/lib/index.css +1 -1
- package/lib/super-crud.min.js +2 -2
- package/package.json +21 -16
- package/src/config/common.js +2 -1
- package/src/config/crud.js +3 -3
- package/src/index.js +4 -0
- package/src/template/formatData.js +75 -87
- package/.browserslistrc +0 -3
- package/.versionrc.json +0 -36
- package/CHANGELOG.md +0 -232
- package/babel.config.js +0 -12
- package/build/alias.js +0 -10
- package/build/build.js +0 -52
- package/build/config.js +0 -70
- package/deploy.bat +0 -14
- package/docs/.vuepress/components/button/base.vue +0 -88
- package/docs/.vuepress/components/common/code-format.vue +0 -331
- package/docs/.vuepress/components/commonConfig/presetCodeTemplate/base.vue +0 -68
- package/docs/.vuepress/components/commonConfig/presetCodeTemplate/customParams.vue +0 -73
- package/docs/.vuepress/components/commonConfig/renderType/component.vue +0 -160
- package/docs/.vuepress/components/commonConfig/renderType/formatter.vue +0 -49
- package/docs/.vuepress/components/commonConfig/renderType/render.vue +0 -91
- package/docs/.vuepress/components/commonConfig/renderType/slot.vue +0 -63
- package/docs/.vuepress/components/crud/baseUse/baseUse.vue +0 -98
- package/docs/.vuepress/components/crud/baseUse/columnAction.vue +0 -72
- package/docs/.vuepress/components/crud/baseUse/columnWidth.vue +0 -107
- package/docs/.vuepress/components/crud/baseUse/handleRow.vue +0 -65
- package/docs/.vuepress/components/crud/baseUse/height.vue +0 -82
- package/docs/.vuepress/components/crud/baseUse/index.vue +0 -54
- package/docs/.vuepress/components/crud/baseUse/loading.vue +0 -70
- package/docs/.vuepress/components/crud/baseUse/pagination.vue +0 -108
- package/docs/.vuepress/components/crud/baseUse/selection.vue +0 -114
- package/docs/.vuepress/components/crud/baseUse/summaryMethod.vue +0 -118
- package/docs/.vuepress/components/crud/baseUse/title.vue +0 -54
- package/docs/.vuepress/components/crud/baseUse/toolbar.vue +0 -69
- package/docs/.vuepress/components/crud/buttons/common.vue +0 -115
- package/docs/.vuepress/components/crud/buttons/fast.vue +0 -82
- package/docs/.vuepress/components/crud/contextMenu/base.vue +0 -72
- package/docs/.vuepress/components/crud/copy.vue +0 -52
- package/docs/.vuepress/components/crud/crudEvents/api.vue +0 -157
- package/docs/.vuepress/components/crud/crudEvents/deleteTip.vue +0 -93
- package/docs/.vuepress/components/crud/crudEvents/events.vue +0 -188
- package/docs/.vuepress/components/crud/dataSort/base.vue +0 -142
- package/docs/.vuepress/components/crud/genDynamicColumns/base.vue +0 -53
- package/docs/.vuepress/components/crud/genDynamicColumns/dynamicAndFixed.vue +0 -111
- package/docs/.vuepress/components/crud/genDynamicColumns/treeDynamic.vue +0 -68
- package/docs/.vuepress/components/crud/handleBar/handleRow.vue +0 -65
- package/docs/.vuepress/components/crud/handleBar/toolbar.vue +0 -69
- package/docs/.vuepress/components/crud/renderType/1.vue +0 -57
- package/docs/.vuepress/components/crud/renderType/2.vue +0 -63
- package/docs/.vuepress/components/crud/renderType/3.vue +0 -105
- package/docs/.vuepress/components/crud/renderType/5.vue +0 -91
- package/docs/.vuepress/components/crud/search/1.vue +0 -90
- package/docs/.vuepress/components/crud/search/2.vue +0 -78
- package/docs/.vuepress/components/crud/search/3.vue +0 -107
- package/docs/.vuepress/components/crud/search/base.vue +0 -123
- package/docs/.vuepress/components/crud/search/localSearch.vue +0 -124
- package/docs/.vuepress/components/crud/search/special.vue +0 -148
- package/docs/.vuepress/components/crud/selection/events.vue +0 -47
- package/docs/.vuepress/components/crud/selection/pagination.vue +0 -94
- package/docs/.vuepress/components/crud/selection/singleSelection.vue +0 -64
- package/docs/.vuepress/components/crud/span/base.vue +0 -69
- package/docs/.vuepress/components/crud/span/special.vue +0 -75
- package/docs/.vuepress/components/crud/summary/base.vue +0 -99
- package/docs/.vuepress/components/crud/tableEdit/addDeleteBtn.vue +0 -174
- package/docs/.vuepress/components/crud/tableEdit/cellEdit.vue +0 -194
- package/docs/.vuepress/components/crud/tableEdit/controlEdit.vue +0 -219
- package/docs/.vuepress/components/crud/tableEdit/dialog.vue +0 -172
- package/docs/.vuepress/components/crud/tableEdit/free.vue +0 -88
- package/docs/.vuepress/components/crud/tableEdit/freeColumn.vue +0 -82
- package/docs/.vuepress/components/crud/tableEdit/methods.vue +0 -154
- package/docs/.vuepress/components/crud/tableEdit/rowAction.vue +0 -107
- package/docs/.vuepress/components/crud/tableEdit/rowBatch.vue +0 -116
- package/docs/.vuepress/components/crud/tableEdit/rowClick.vue +0 -98
- package/docs/.vuepress/components/crud/validate/base.vue +0 -122
- package/docs/.vuepress/components/crud/validate/custom.vue +0 -82
- package/docs/.vuepress/components/crud/validate/regulars.vue +0 -88
- package/docs/.vuepress/components/crud/validate/relation.vue +0 -91
- package/docs/.vuepress/components/crud/validate/tree.vue +0 -82
- package/docs/.vuepress/components/dialog/baseUse/base.vue +0 -92
- package/docs/.vuepress/components/dialog/baseUse/beforeConfirm.vue +0 -78
- package/docs/.vuepress/components/dialog/baseUse/control.vue +0 -79
- package/docs/.vuepress/components/dialog/baseUse/drawer.vue +0 -59
- package/docs/.vuepress/components/dialog/baseUse/footer.vue +0 -87
- package/docs/.vuepress/components/dialog/baseUse/insertSlot.vue +0 -79
- package/docs/.vuepress/components/dict/DictLinkage.vue +0 -91
- package/docs/.vuepress/components/dict/baseUse.vue +0 -72
- package/docs/.vuepress/components/dict/component.vue +0 -82
- package/docs/.vuepress/components/dict/localDict.vue +0 -68
- package/docs/.vuepress/components/form/baseUse/base.vue +0 -48
- package/docs/.vuepress/components/form/baseUse/dataFormat.vue +0 -92
- package/docs/.vuepress/components/form/baseUse/deep.vue +0 -57
- package/docs/.vuepress/components/form/baseUse/gridLayout.vue +0 -47
- package/docs/.vuepress/components/form/baseUse/group.vue +0 -66
- package/docs/.vuepress/components/form/baseUse/hidden.vue +0 -40
- package/docs/.vuepress/components/form/baseUse/inlineLayout.vue +0 -48
- package/docs/.vuepress/components/form/baseUse/label.vue +0 -51
- package/docs/.vuepress/components/form/baseUse/tooltip.vue +0 -40
- package/docs/.vuepress/components/form/baseUse/validate.vue +0 -52
- package/docs/.vuepress/components/form/detail/base.vue +0 -78
- package/docs/.vuepress/components/form/detail/border.vue +0 -90
- package/docs/.vuepress/components/form/detail/singleDetail.vue +0 -72
- package/docs/.vuepress/components/formatData/baseUse.vue +0 -131
- package/docs/.vuepress/components/mock/index.js +0 -347
- package/docs/.vuepress/components/mockData/custom.vue +0 -69
- package/docs/.vuepress/components/mockData/example.vue +0 -290
- package/docs/.vuepress/components/positionSlot/base.vue +0 -24
- package/docs/.vuepress/components/positionSlot/form.vue +0 -71
- package/docs/.vuepress/components/positionSlot/table.vue +0 -85
- package/docs/.vuepress/components/tabs/base.vue +0 -57
- package/docs/.vuepress/components/temp.js +0 -195
- package/docs/.vuepress/config.js +0 -146
- package/docs/.vuepress/enhanceApp.js +0 -142
- package/docs/.vuepress/public/favicon.ico +0 -0
- package/docs/.vuepress/public/super.png +0 -0
- package/docs/.vuepress/styles/index.styl +0 -25
- package/docs/.vuepress/styles/palette.styl +0 -6
- package/docs/README.md +0 -14
- package/docs/guide/button/base.md +0 -31
- package/docs/guide/commonConfig/jsx.md +0 -166
- package/docs/guide/commonConfig/presetCodeTemplate.md +0 -68
- package/docs/guide/commonConfig/renderType.md +0 -181
- package/docs/guide/crud/baseUse.md +0 -120
- package/docs/guide/crud/buttons.md +0 -18
- package/docs/guide/crud/config.md +0 -217
- package/docs/guide/crud/contextMenu.md +0 -18
- package/docs/guide/crud/dataSort.md +0 -66
- package/docs/guide/crud/genDynamicColumns.md +0 -145
- package/docs/guide/crud/handleBar.md +0 -26
- package/docs/guide/crud/renderType.md +0 -4
- package/docs/guide/crud/search.md +0 -150
- package/docs/guide/crud/selection.md +0 -73
- package/docs/guide/crud/span.md +0 -98
- package/docs/guide/crud/summary.md +0 -167
- package/docs/guide/crud/tableEdit.md +0 -377
- package/docs/guide/crud/validate.md +0 -158
- package/docs/guide/dialog/baseUse.md +0 -81
- package/docs/guide/dict/baseUse.md +0 -174
- package/docs/guide/dict/component.md +0 -88
- package/docs/guide/dict/config.md +0 -44
- package/docs/guide/form/baseUse.md +0 -142
- package/docs/guide/form/detail.md +0 -38
- package/docs/guide/formatData/baseUse.md +0 -98
- package/docs/guide/formatData/config.md +0 -142
- package/docs/guide/mockData/base.md +0 -26
- package/docs/guide/positionSlot/base.md +0 -41
- package/docs/guide/question/base.md +0 -44
- package/docs/guide/start/base.md +0 -30
- package/docs/guide/tabs/base.md +0 -63
- package/examples/App.vue +0 -52
- package/examples/Layout/components/AppMain.vue +0 -40
- package/examples/Layout/components/Item.vue +0 -29
- package/examples/Layout/components/Link.vue +0 -44
- package/examples/Layout/components/SidebarItem.vue +0 -93
- package/examples/Layout/index.vue +0 -69
- package/examples/assets/logo.png +0 -0
- package/examples/favicon.ico +0 -0
- package/examples/index.html +0 -18
- package/examples/main.js +0 -54
- package/examples/router/index.js +0 -140
- package/examples/store/index.js +0 -0
- package/examples/styles/index.scss +0 -63
- package/examples/styles/sidebar.scss +0 -226
- package/examples/styles/transition.scss +0 -48
- package/examples/styles/variables.scss +0 -25
- package/examples/views/crud/base.vue +0 -68
- package/examples/views/crud/handleRow.vue +0 -84
- package/examples/views/crud/search.vue +0 -116
- package/examples/views/dashboard/index.vue +0 -244
- package/examples/views/dashboard/index1.vue +0 -234
- package/examples/views/dashboard/test.vue +0 -9
- package/examples/views/formTest/index.vue +0 -168
- package/examples/views/nested/menu1/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-1/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-2/index.vue +0 -7
- package/examples/views/nested/menu1/menu1-2/menu1-2-1/index.vue +0 -5
- package/examples/views/nested/menu1/menu1-2/menu1-2-2/index.vue +0 -5
- package/examples/views/nested/menu1/menu1-3/index.vue +0 -5
- package/examples/views/nested/menu2/index.vue +0 -5
- package/gulpfile.js +0 -84
- package/packages/button/index.vue +0 -189
- package/packages/core/components/comp.vue +0 -223
- package/packages/core/components/position.vue +0 -135
- package/packages/core/components/render.vue +0 -460
- package/packages/core/configManager.js +0 -302
- package/packages/core/create.js +0 -8
- package/packages/core/defaultRender.js +0 -64
- package/packages/core/dict/global.js +0 -10
- package/packages/core/dict/index.js +0 -432
- package/packages/core/dict/mixin.js +0 -94
- package/packages/core/event.js +0 -60
- package/packages/core/index.js +0 -6
- package/packages/core/init.js +0 -122
- package/packages/core/mock/genConfig.js +0 -228
- package/packages/core/mock/genData.js +0 -422
- package/packages/core/mock/index.js +0 -4
- package/packages/core/rules.js +0 -111
- package/packages/crud/column.vue +0 -205
- package/packages/crud/columnAction.vue +0 -207
- package/packages/crud/columnCell.vue +0 -146
- package/packages/crud/defaultColumn.vue +0 -130
- package/packages/crud/drawerColumn.vue +0 -225
- package/packages/crud/form.vue +0 -69
- package/packages/crud/index.vue +0 -564
- package/packages/crud/menuBar.vue +0 -298
- package/packages/crud/mixins/cacheHandler.js +0 -36
- package/packages/crud/mixins/calcColumnWidth.js +0 -79
- package/packages/crud/mixins/calcHeight.js +0 -105
- package/packages/crud/mixins/columnHandler.js +0 -128
- package/packages/crud/mixins/contextMenu.js +0 -98
- package/packages/crud/mixins/dataProcessor.js +0 -202
- package/packages/crud/mixins/dialog.js +0 -109
- package/packages/crud/mixins/excelHandler.js +0 -150
- package/packages/crud/mixins/exposeMethods.js +0 -107
- package/packages/crud/mixins/generateDynamicColumns.js +0 -250
- package/packages/crud/mixins/props.js +0 -38
- package/packages/crud/mixins/searchHandler.js +0 -151
- package/packages/crud/mixins/select.js +0 -359
- package/packages/crud/mixins/spanMethod.js +0 -288
- package/packages/crud/mixins/summary.js +0 -177
- package/packages/crud/mixins/tableEdit.js +0 -547
- package/packages/crud/mixins/validate.js +0 -219
- package/packages/crud/pagination.vue +0 -110
- package/packages/crud/search.vue +0 -119
- package/packages/crud/searchHeader.vue +0 -231
- package/packages/crud/selectBanner.vue +0 -138
- package/packages/crud/utils/EditState.js +0 -319
- package/packages/crud/utils/excelExport.js +0 -112
- package/packages/crud/utils/excelImport.js +0 -112
- package/packages/crud/utils/index.js +0 -98
- package/packages/dialog/dialog.js +0 -233
- package/packages/dialog/dialog.vue +0 -15
- package/packages/dialog/index.js +0 -22
- package/packages/dict/cascadeFormat.vue +0 -179
- package/packages/dict/dateFormat.vue +0 -40
- package/packages/dict/form/cascade.vue +0 -61
- package/packages/dict/form/checkbox.vue +0 -90
- package/packages/dict/form/extendMethod.js +0 -22
- package/packages/dict/form/input-base.js +0 -31
- package/packages/dict/form/input.js +0 -20
- package/packages/dict/form/radio.vue +0 -69
- package/packages/dict/form/select.vue +0 -118
- package/packages/dict/form/switch.vue +0 -75
- package/packages/dict/valueFormat.vue +0 -188
- package/packages/directive/dialog/drag.js +0 -86
- package/packages/directive/dialog/dragSize.js +0 -42
- package/packages/directive/index.js +0 -9
- package/packages/directive/insertSlot.js +0 -10
- package/packages/form/contextMenu.js +0 -192
- package/packages/form/draftDrawer.vue +0 -391
- package/packages/form/formAction.vue +0 -97
- package/packages/form/formItem.vue +0 -259
- package/packages/form/index.vue +0 -451
- package/packages/form/props.js +0 -15
- package/packages/grid/cell.vue +0 -65
- package/packages/grid/index.vue +0 -130
- package/packages/group/index.vue +0 -96
- package/packages/tabs/index.vue +0 -290
- package/packages/tooltip/index.js +0 -9
- package/packages/tooltip/tooltip.vue +0 -32
- package/packages/tooltip/tooltipComponent.js +0 -38
- package/packages/verifyInput/index.vue +0 -131
- package/styles/button.scss +0 -3
- package/styles/crud.scss +0 -425
- package/styles/dialog.scss +0 -95
- package/styles/form.scss +0 -532
- package/styles/group.scss +0 -78
- package/styles/index.scss +0 -94
- package/styles/tabs.scss +0 -139
- package/styles/verifyInput.scss +0 -56
- package/vue-jsx-sync.js +0 -90
- package/vue.config.js +0 -54
@@ -1,347 +0,0 @@
|
|
1
|
-
import dayjs from "dayjs";
|
2
|
-
|
3
|
-
// provinceData.js - 省份数据
|
4
|
-
export const provinceData = [
|
5
|
-
{ value: "11", label: "北京市" },
|
6
|
-
{ value: "12", label: "天津市" },
|
7
|
-
{ value: "13", label: "河北省" },
|
8
|
-
{ value: "31", label: "上海市" },
|
9
|
-
{ value: "32", label: "江苏省" },
|
10
|
-
{ value: "33", label: "浙江省" },
|
11
|
-
];
|
12
|
-
|
13
|
-
// cityData.js - 城市数据(按省份代码分组)
|
14
|
-
export const cityData = {
|
15
|
-
"11": [
|
16
|
-
// 北京市
|
17
|
-
{ value: "1101", label: "北京市" },
|
18
|
-
],
|
19
|
-
"12": [
|
20
|
-
// 天津市
|
21
|
-
{ value: "1201", label: "天津市" },
|
22
|
-
],
|
23
|
-
"13": [
|
24
|
-
// 河北省
|
25
|
-
{ value: "1301", label: "石家庄市" },
|
26
|
-
{ value: "1302", label: "唐山市" },
|
27
|
-
{ value: "1303", label: "秦皇岛市" },
|
28
|
-
{ value: "1304", label: "邯郸市" },
|
29
|
-
{ value: "1305", label: "邢台市" },
|
30
|
-
{ value: "1306", label: "保定市" },
|
31
|
-
{ value: "1307", label: "张家口市" },
|
32
|
-
{ value: "1308", label: "承德市" },
|
33
|
-
{ value: "1309", label: "沧州市" },
|
34
|
-
{ value: "1310", label: "廊坊市" },
|
35
|
-
{ value: "1311", label: "衡水市" },
|
36
|
-
],
|
37
|
-
"31": [
|
38
|
-
// 上海市
|
39
|
-
{ value: "3101", label: "上海市" },
|
40
|
-
],
|
41
|
-
"32": [
|
42
|
-
// 江苏省
|
43
|
-
{ value: "3201", label: "南京市" },
|
44
|
-
{ value: "3202", label: "无锡市" },
|
45
|
-
{ value: "3203", label: "徐州市" },
|
46
|
-
{ value: "3204", label: "常州市" },
|
47
|
-
{ value: "3205", label: "苏州市" },
|
48
|
-
{ value: "3206", label: "南通市" },
|
49
|
-
{ value: "3207", label: "连云港市" },
|
50
|
-
{ value: "3208", label: "淮安市" },
|
51
|
-
{ value: "3209", label: "盐城市" },
|
52
|
-
{ value: "3210", label: "扬州市" },
|
53
|
-
{ value: "3211", label: "镇江市" },
|
54
|
-
{ value: "3212", label: "泰州市" },
|
55
|
-
{ value: "3213", label: "宿迁市" },
|
56
|
-
],
|
57
|
-
"33": [
|
58
|
-
// 浙江省
|
59
|
-
{ value: "3301", label: "杭州市" },
|
60
|
-
{ value: "3302", label: "宁波市" },
|
61
|
-
{ value: "3303", label: "温州市" },
|
62
|
-
{ value: "3304", label: "嘉兴市" },
|
63
|
-
{ value: "3305", label: "湖州市" },
|
64
|
-
{ value: "3306", label: "绍兴市" },
|
65
|
-
{ value: "3307", label: "金华市" },
|
66
|
-
{ value: "3308", label: "衢州市" },
|
67
|
-
{ value: "3309", label: "舟山市" },
|
68
|
-
{ value: "3310", label: "台州市" },
|
69
|
-
{ value: "3311", label: "丽水市" },
|
70
|
-
],
|
71
|
-
"44": [
|
72
|
-
// 广东省
|
73
|
-
{ value: "4401", label: "广州市" },
|
74
|
-
{ value: "4402", label: "韶关市" },
|
75
|
-
{ value: "4403", label: "深圳市" },
|
76
|
-
{ value: "4404", label: "珠海市" },
|
77
|
-
{ value: "4405", label: "汕头市" },
|
78
|
-
{ value: "4406", label: "佛山市" },
|
79
|
-
{ value: "4407", label: "江门市" },
|
80
|
-
{ value: "4408", label: "湛江市" },
|
81
|
-
{ value: "4409", label: "茂名市" },
|
82
|
-
{ value: "4412", label: "肇庆市" },
|
83
|
-
{ value: "4413", label: "惠州市" },
|
84
|
-
{ value: "4414", label: "梅州市" },
|
85
|
-
{ value: "4415", label: "汕尾市" },
|
86
|
-
{ value: "4416", label: "河源市" },
|
87
|
-
{ value: "4417", label: "阳江市" },
|
88
|
-
{ value: "4418", label: "清远市" },
|
89
|
-
{ value: "4419", label: "东莞市" },
|
90
|
-
{ value: "4420", label: "中山市" },
|
91
|
-
{ value: "4451", label: "潮州市" },
|
92
|
-
{ value: "4452", label: "揭阳市" },
|
93
|
-
{ value: "4453", label: "云浮市" },
|
94
|
-
],
|
95
|
-
"50": [
|
96
|
-
// 重庆市
|
97
|
-
{ value: "5001", label: "重庆市" },
|
98
|
-
],
|
99
|
-
"51": [
|
100
|
-
// 四川省
|
101
|
-
{ value: "5101", label: "成都市" },
|
102
|
-
{ value: "5103", label: "自贡市" },
|
103
|
-
{ value: "5104", label: "攀枝花市" },
|
104
|
-
{ value: "5105", label: "泸州市" },
|
105
|
-
{ value: "5106", label: "德阳市" },
|
106
|
-
{ value: "5107", label: "绵阳市" },
|
107
|
-
{ value: "5108", label: "广元市" },
|
108
|
-
{ value: "5109", label: "遂宁市" },
|
109
|
-
{ value: "5110", label: "内江市" },
|
110
|
-
{ value: "5111", label: "乐山市" },
|
111
|
-
{ value: "5113", label: "南充市" },
|
112
|
-
{ value: "5114", label: "眉山市" },
|
113
|
-
{ value: "5115", label: "宜宾市" },
|
114
|
-
{ value: "5116", label: "广安市" },
|
115
|
-
{ value: "5117", label: "达州市" },
|
116
|
-
{ value: "5118", label: "雅安市" },
|
117
|
-
{ value: "5119", label: "巴中市" },
|
118
|
-
{ value: "5120", label: "资阳市" },
|
119
|
-
],
|
120
|
-
};
|
121
|
-
|
122
|
-
export const cityTreeData = [
|
123
|
-
{
|
124
|
-
value: "浙江",
|
125
|
-
label: "浙江",
|
126
|
-
children: [
|
127
|
-
{
|
128
|
-
value: "杭州",
|
129
|
-
label: "杭州",
|
130
|
-
children: [
|
131
|
-
{
|
132
|
-
value: "西湖区",
|
133
|
-
label: "西湖区",
|
134
|
-
},
|
135
|
-
{
|
136
|
-
value: "滨江区",
|
137
|
-
label: "滨江区",
|
138
|
-
},
|
139
|
-
],
|
140
|
-
},
|
141
|
-
{
|
142
|
-
value: "宁波",
|
143
|
-
label: "宁波",
|
144
|
-
children: [
|
145
|
-
{
|
146
|
-
value: "海曙区",
|
147
|
-
label: "海曙区",
|
148
|
-
},
|
149
|
-
{
|
150
|
-
value: "江北区",
|
151
|
-
label: "江北区",
|
152
|
-
},
|
153
|
-
],
|
154
|
-
},
|
155
|
-
],
|
156
|
-
},
|
157
|
-
{
|
158
|
-
value: "江苏",
|
159
|
-
label: "江苏",
|
160
|
-
children: [
|
161
|
-
{
|
162
|
-
value: "南京",
|
163
|
-
label: "南京",
|
164
|
-
children: [
|
165
|
-
{
|
166
|
-
value: "玄武区",
|
167
|
-
label: "玄武区",
|
168
|
-
},
|
169
|
-
{
|
170
|
-
value: "秦淮区",
|
171
|
-
label: "秦淮区",
|
172
|
-
},
|
173
|
-
],
|
174
|
-
},
|
175
|
-
{
|
176
|
-
value: "苏州",
|
177
|
-
label: "苏州",
|
178
|
-
},
|
179
|
-
],
|
180
|
-
},
|
181
|
-
];
|
182
|
-
|
183
|
-
// 模拟API请求函数
|
184
|
-
export const mockApi = {
|
185
|
-
// 获取所有省份
|
186
|
-
getProvinces() {
|
187
|
-
return new Promise((resolve) => {
|
188
|
-
setTimeout(() => {
|
189
|
-
console.log("getProvinces---", provinceData);
|
190
|
-
resolve({
|
191
|
-
code: 200,
|
192
|
-
data: provinceData,
|
193
|
-
message: "success",
|
194
|
-
});
|
195
|
-
}, 100);
|
196
|
-
});
|
197
|
-
},
|
198
|
-
|
199
|
-
// 根据省份代码获取城市
|
200
|
-
getCities(provinceCode) {
|
201
|
-
return new Promise((resolve, reject) => {
|
202
|
-
setTimeout(() => {
|
203
|
-
const cities = cityData[provinceCode];
|
204
|
-
console.log("cities---", cities, "code---", provinceCode);
|
205
|
-
|
206
|
-
if (cities) {
|
207
|
-
resolve({
|
208
|
-
code: 200,
|
209
|
-
data: cities,
|
210
|
-
message: "success",
|
211
|
-
});
|
212
|
-
} else {
|
213
|
-
resolve({
|
214
|
-
code: 200,
|
215
|
-
data: [],
|
216
|
-
message: "no data",
|
217
|
-
});
|
218
|
-
}
|
219
|
-
}, 100);
|
220
|
-
});
|
221
|
-
},
|
222
|
-
|
223
|
-
getList: (() => {
|
224
|
-
let cachedData = null;
|
225
|
-
const total = 33;
|
226
|
-
|
227
|
-
const generateAllData = () => {
|
228
|
-
const mockData = [];
|
229
|
-
const cities = ["北京", "上海", "广州"];
|
230
|
-
|
231
|
-
for (let i = 0; i < total; i++) {
|
232
|
-
const age = Math.floor(Math.random() * 20) + 20;
|
233
|
-
mockData.push({
|
234
|
-
id: i + 1, // 使用固定的自增ID
|
235
|
-
name: `用户${i + 1}`,
|
236
|
-
gender: i % 2 === 0 ? "男" : "女", // 使用固定规则
|
237
|
-
age: age,
|
238
|
-
is30: age > 30 ? "是" : "否",
|
239
|
-
city: cities[i % cities.length], // 循环使用城市
|
240
|
-
date: dayjs()
|
241
|
-
.subtract(i, "day") // 按顺序递减日期
|
242
|
-
.format("YYYY-MM-DD"),
|
243
|
-
status: i % 2, // 使用固定规则
|
244
|
-
});
|
245
|
-
}
|
246
|
-
return mockData;
|
247
|
-
};
|
248
|
-
|
249
|
-
return ({ pageNum, pageSize }) => {
|
250
|
-
return new Promise((resolve) => {
|
251
|
-
if (!cachedData) {
|
252
|
-
cachedData = generateAllData();
|
253
|
-
}
|
254
|
-
|
255
|
-
const start = (pageNum - 1) * pageSize;
|
256
|
-
const end = Math.min(start + pageSize, total);
|
257
|
-
|
258
|
-
setTimeout(() => {
|
259
|
-
resolve({
|
260
|
-
data: cachedData.slice(start, end),
|
261
|
-
total,
|
262
|
-
});
|
263
|
-
}, 300);
|
264
|
-
});
|
265
|
-
};
|
266
|
-
})(),
|
267
|
-
// 生成更多测试数据
|
268
|
-
|
269
|
-
// 模拟API请求函数
|
270
|
-
getDynamicData({ pageNum = 1, pageSize = 10 }) {
|
271
|
-
const generateMockData = (count) => {
|
272
|
-
const result = [];
|
273
|
-
for (let i = 0; i < count; i++) {
|
274
|
-
result.push({
|
275
|
-
materialCode: `M${String(i + 1).padStart(3, "0")}`,
|
276
|
-
materialName: `产品${i + 1}`,
|
277
|
-
materialSpec: `规格${i + 1}`,
|
278
|
-
quantityGradeName: String.fromCharCode(65 + (i % 26)), // A-Z循环
|
279
|
-
firstChildren: [
|
280
|
-
{
|
281
|
-
id: "S001",
|
282
|
-
name: "供应商1",
|
283
|
-
price: 100 + i * 10,
|
284
|
-
secondChildren: [
|
285
|
-
{
|
286
|
-
sort: 1,
|
287
|
-
productUnitPrice: 100 + i * 10,
|
288
|
-
priceFollow: i % 2 === 0 ? "Y" : "N",
|
289
|
-
priceDifference: i % 2 === 0 ? -10 : 10,
|
290
|
-
pricePercentageChange: i % 2 === 0 ? 0.1 : -0.1,
|
291
|
-
},
|
292
|
-
{
|
293
|
-
sort: 2,
|
294
|
-
productUnitPrice: 90 + i * 10,
|
295
|
-
priceFollow: i % 2 === 0 ? "N" : "Y",
|
296
|
-
priceDifference: i % 2 === 0 ? 5 : -5,
|
297
|
-
pricePercentageChange: 0.05,
|
298
|
-
},
|
299
|
-
],
|
300
|
-
},
|
301
|
-
{
|
302
|
-
id: "S002",
|
303
|
-
name: "供应商2",
|
304
|
-
price: 90 + i * 10,
|
305
|
-
secondChildren: [
|
306
|
-
{
|
307
|
-
sort: 1,
|
308
|
-
productUnitPrice: 95 + i * 10,
|
309
|
-
priceFollow: "Y",
|
310
|
-
priceDifference: -5,
|
311
|
-
pricePercentageChange: 0.05,
|
312
|
-
},
|
313
|
-
{
|
314
|
-
sort: 2,
|
315
|
-
productUnitPrice: 92 + i * 10,
|
316
|
-
priceFollow: "Y",
|
317
|
-
priceDifference: -3,
|
318
|
-
pricePercentageChange: 0.03,
|
319
|
-
},
|
320
|
-
],
|
321
|
-
},
|
322
|
-
{
|
323
|
-
id: "S003",
|
324
|
-
name: "供应商3",
|
325
|
-
price: 80 + i * 10,
|
326
|
-
},
|
327
|
-
],
|
328
|
-
});
|
329
|
-
}
|
330
|
-
return result;
|
331
|
-
};
|
332
|
-
|
333
|
-
// 扩展数据集
|
334
|
-
const allData = generateMockData(50);
|
335
|
-
return new Promise((resolve) => {
|
336
|
-
setTimeout(() => {
|
337
|
-
const start = (pageNum - 1) * pageSize;
|
338
|
-
const end = start + pageSize;
|
339
|
-
|
340
|
-
resolve({
|
341
|
-
total: allData.length,
|
342
|
-
data: allData.slice(start, end),
|
343
|
-
});
|
344
|
-
}, 300);
|
345
|
-
});
|
346
|
-
},
|
347
|
-
};
|
@@ -1,69 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<div>
|
4
|
-
{{ JSON.stringify(form) }}
|
5
|
-
</div>
|
6
|
-
<sc-form v-model="form" :options="options"> </sc-form>
|
7
|
-
</div>
|
8
|
-
</template>
|
9
|
-
|
10
|
-
<script>
|
11
|
-
export default {
|
12
|
-
data() {
|
13
|
-
return {
|
14
|
-
form: {},
|
15
|
-
};
|
16
|
-
},
|
17
|
-
computed: {
|
18
|
-
options() {
|
19
|
-
return {
|
20
|
-
renderColumns: [
|
21
|
-
{
|
22
|
-
prop: "input",
|
23
|
-
label: "整数生成",
|
24
|
-
comp: {
|
25
|
-
name: "el-input",
|
26
|
-
},
|
27
|
-
mock: ({ Random, Mock, Preset }, scope) => {
|
28
|
-
return Random.integer(1, 100);
|
29
|
-
},
|
30
|
-
},
|
31
|
-
{
|
32
|
-
prop: "image",
|
33
|
-
label: "图片生成",
|
34
|
-
comp: {
|
35
|
-
name: "el-image",
|
36
|
-
bind: ({ row }) => {
|
37
|
-
return {
|
38
|
-
src: row.image,
|
39
|
-
};
|
40
|
-
},
|
41
|
-
},
|
42
|
-
mock: ({ Random, Mock, Preset }, scope) => {
|
43
|
-
return Preset.imageUrl();
|
44
|
-
},
|
45
|
-
},
|
46
|
-
{
|
47
|
-
prop: "array",
|
48
|
-
label: "数组生成",
|
49
|
-
formatter: (row) => {
|
50
|
-
return (row.array || [])
|
51
|
-
.map((item) => {
|
52
|
-
return item?.name;
|
53
|
-
})
|
54
|
-
.join(",");
|
55
|
-
},
|
56
|
-
mock: ({ Random, Mock, Preset }, scope) => {
|
57
|
-
return Preset.array(() => {
|
58
|
-
return {
|
59
|
-
name: Random.cword(5, 10),
|
60
|
-
};
|
61
|
-
}, 10);
|
62
|
-
},
|
63
|
-
},
|
64
|
-
],
|
65
|
-
};
|
66
|
-
},
|
67
|
-
},
|
68
|
-
};
|
69
|
-
</script>
|
@@ -1,290 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<h3>表单</h3>
|
4
|
-
<sc-form v-model="form" :options="options"> </sc-form>
|
5
|
-
<h3 style="margin-top: 20px;">表格</h3>
|
6
|
-
<sc-crud :data="data" :options="crudOptions"> </sc-crud>
|
7
|
-
</div>
|
8
|
-
</template>
|
9
|
-
|
10
|
-
<script>
|
11
|
-
export default {
|
12
|
-
data() {
|
13
|
-
return {
|
14
|
-
form: {
|
15
|
-
multiSelect: [],
|
16
|
-
daterange: [],
|
17
|
-
checkbox: [],
|
18
|
-
cascader: [],
|
19
|
-
transfer: [],
|
20
|
-
},
|
21
|
-
data: [
|
22
|
-
{
|
23
|
-
id: 1,
|
24
|
-
input: "",
|
25
|
-
select: "",
|
26
|
-
},
|
27
|
-
{
|
28
|
-
id: 2,
|
29
|
-
input: "",
|
30
|
-
select: "",
|
31
|
-
},
|
32
|
-
{
|
33
|
-
id: 3,
|
34
|
-
input: "",
|
35
|
-
select: "",
|
36
|
-
},
|
37
|
-
{
|
38
|
-
id: 4,
|
39
|
-
input: "",
|
40
|
-
select: "",
|
41
|
-
},
|
42
|
-
],
|
43
|
-
};
|
44
|
-
},
|
45
|
-
computed: {
|
46
|
-
options() {
|
47
|
-
return {
|
48
|
-
renderColumns: [
|
49
|
-
// 1. 输入框类
|
50
|
-
{
|
51
|
-
prop: "input",
|
52
|
-
label: "普通输入框",
|
53
|
-
comp: {
|
54
|
-
name: "el-input",
|
55
|
-
maxlength: 20,
|
56
|
-
"show-word-limit": true,
|
57
|
-
},
|
58
|
-
},
|
59
|
-
{
|
60
|
-
prop: "input2",
|
61
|
-
label: "校验规则生成",
|
62
|
-
rules: ["email"],
|
63
|
-
},
|
64
|
-
{
|
65
|
-
prop: "textarea",
|
66
|
-
label: "文本域",
|
67
|
-
comp: {
|
68
|
-
name: "el-input",
|
69
|
-
type: "textarea",
|
70
|
-
rows: 3,
|
71
|
-
placeholder: "请输入多行文本",
|
72
|
-
},
|
73
|
-
},
|
74
|
-
{
|
75
|
-
prop: "number",
|
76
|
-
label: "数字输入框",
|
77
|
-
comp: {
|
78
|
-
name: "el-input-number",
|
79
|
-
min: 0,
|
80
|
-
max: 100,
|
81
|
-
step: 1,
|
82
|
-
},
|
83
|
-
},
|
84
|
-
|
85
|
-
// 2. 选择器类
|
86
|
-
{
|
87
|
-
prop: "select",
|
88
|
-
label: "下拉选择",
|
89
|
-
comp: {
|
90
|
-
name: "el-select",
|
91
|
-
options: [
|
92
|
-
{ label: "选项1", value: "1" },
|
93
|
-
{ label: "选项2", value: "2" },
|
94
|
-
{ label: "选项3", value: "3" },
|
95
|
-
{ label: "选项4", value: "4" },
|
96
|
-
],
|
97
|
-
},
|
98
|
-
},
|
99
|
-
{
|
100
|
-
prop: "multiSelect",
|
101
|
-
label: "多选选择器",
|
102
|
-
comp: {
|
103
|
-
name: "el-select",
|
104
|
-
multiple: true,
|
105
|
-
options: [
|
106
|
-
{ label: "选项A", value: "A" },
|
107
|
-
{ label: "选项B", value: "B" },
|
108
|
-
{ label: "选项C", value: "C" },
|
109
|
-
{ label: "选项D", value: "D" },
|
110
|
-
],
|
111
|
-
},
|
112
|
-
},
|
113
|
-
|
114
|
-
// 3. 日期时间类
|
115
|
-
{
|
116
|
-
prop: "date",
|
117
|
-
label: "日期选择",
|
118
|
-
comp: {
|
119
|
-
name: "el-date-picker",
|
120
|
-
type: "date",
|
121
|
-
valueFormat: "yyyy-MM-dd",
|
122
|
-
},
|
123
|
-
},
|
124
|
-
{
|
125
|
-
prop: "daterange",
|
126
|
-
label: "日期范围",
|
127
|
-
comp: {
|
128
|
-
name: "el-date-picker",
|
129
|
-
type: "daterange",
|
130
|
-
startPlaceholder: "开始日期",
|
131
|
-
endPlaceholder: "结束日期",
|
132
|
-
valueFormat: "yyyy-MM-dd",
|
133
|
-
},
|
134
|
-
},
|
135
|
-
{
|
136
|
-
prop: "time",
|
137
|
-
label: "时间选择",
|
138
|
-
comp: {
|
139
|
-
name: "el-time-picker",
|
140
|
-
valueFormat: "HH:mm:ss",
|
141
|
-
},
|
142
|
-
},
|
143
|
-
|
144
|
-
// 4. 单选复选类
|
145
|
-
{
|
146
|
-
prop: "radio",
|
147
|
-
label: "单选组",
|
148
|
-
comp: {
|
149
|
-
name: "el-radio-group",
|
150
|
-
options: [
|
151
|
-
{ label: "选项1", value: "1" },
|
152
|
-
{ label: "选项2", value: "2" },
|
153
|
-
{ label: "选项3", value: "3" },
|
154
|
-
{ label: "选项4", value: "4" },
|
155
|
-
],
|
156
|
-
},
|
157
|
-
},
|
158
|
-
{
|
159
|
-
prop: "checkbox",
|
160
|
-
label: "复选框组",
|
161
|
-
comp: {
|
162
|
-
name: "el-checkbox-group",
|
163
|
-
options: [
|
164
|
-
{ label: "选项A", value: "A" },
|
165
|
-
{ label: "选项B", value: "B" },
|
166
|
-
{ label: "选项C", value: "C" },
|
167
|
-
{ label: "选项D", value: "D" },
|
168
|
-
],
|
169
|
-
},
|
170
|
-
},
|
171
|
-
|
172
|
-
// 5. 级联选择器
|
173
|
-
{
|
174
|
-
prop: "cascader",
|
175
|
-
label: "级联选择",
|
176
|
-
comp: {
|
177
|
-
name: "el-cascader",
|
178
|
-
options: [
|
179
|
-
{
|
180
|
-
value: "1",
|
181
|
-
label: "一级1",
|
182
|
-
children: [
|
183
|
-
{ value: "1-1", label: "二级1-1" },
|
184
|
-
{ value: "1-2", label: "二级1-2" },
|
185
|
-
],
|
186
|
-
},
|
187
|
-
{
|
188
|
-
value: "2",
|
189
|
-
label: "一级2",
|
190
|
-
children: [
|
191
|
-
{ value: "2-1", label: "二级2-1" },
|
192
|
-
{ value: "2-2", label: "二级2-2" },
|
193
|
-
],
|
194
|
-
},
|
195
|
-
],
|
196
|
-
},
|
197
|
-
},
|
198
|
-
|
199
|
-
// 6. 开关、滑块、评分类
|
200
|
-
{
|
201
|
-
prop: "switch",
|
202
|
-
label: "开关",
|
203
|
-
comp: {
|
204
|
-
name: "el-switch",
|
205
|
-
"active-text": "开启",
|
206
|
-
"inactive-text": "关闭",
|
207
|
-
},
|
208
|
-
},
|
209
|
-
{
|
210
|
-
prop: "slider",
|
211
|
-
label: "滑块",
|
212
|
-
comp: {
|
213
|
-
name: "el-slider",
|
214
|
-
min: 0,
|
215
|
-
max: 100,
|
216
|
-
step: 10,
|
217
|
-
"show-stops": true,
|
218
|
-
},
|
219
|
-
},
|
220
|
-
{
|
221
|
-
prop: "rate",
|
222
|
-
label: "评分",
|
223
|
-
comp: {
|
224
|
-
name: "el-rate",
|
225
|
-
max: 5,
|
226
|
-
"allow-half": true,
|
227
|
-
"show-text": true,
|
228
|
-
},
|
229
|
-
},
|
230
|
-
|
231
|
-
// 7. 穿梭框
|
232
|
-
{
|
233
|
-
prop: "transfer",
|
234
|
-
label: "穿梭框",
|
235
|
-
comp: {
|
236
|
-
name: "el-transfer",
|
237
|
-
data: [
|
238
|
-
{ key: 1, label: "选项1" },
|
239
|
-
{ key: 2, label: "选项2" },
|
240
|
-
{ key: 3, label: "选项3" },
|
241
|
-
],
|
242
|
-
titles: ["待选列表", "已选列表"],
|
243
|
-
},
|
244
|
-
},
|
245
|
-
],
|
246
|
-
};
|
247
|
-
},
|
248
|
-
crudOptions() {
|
249
|
-
return {
|
250
|
-
toolbar: false,
|
251
|
-
renderColumns: [
|
252
|
-
{
|
253
|
-
prop: "id",
|
254
|
-
label: "ID",
|
255
|
-
isEdit: false,
|
256
|
-
},
|
257
|
-
{
|
258
|
-
prop: "input",
|
259
|
-
label: "普通输入框",
|
260
|
-
isEdit: true,
|
261
|
-
form: {
|
262
|
-
comp: {
|
263
|
-
name: "el-input",
|
264
|
-
maxlength: 20,
|
265
|
-
"show-word-limit": true,
|
266
|
-
},
|
267
|
-
},
|
268
|
-
},
|
269
|
-
{
|
270
|
-
prop: "select",
|
271
|
-
label: "下拉选择",
|
272
|
-
isEdit: true,
|
273
|
-
form: {
|
274
|
-
comp: {
|
275
|
-
name: "el-select",
|
276
|
-
options: [
|
277
|
-
{ label: "选项1", value: "1" },
|
278
|
-
{ label: "选项2", value: "2" },
|
279
|
-
{ label: "选项3", value: "3" },
|
280
|
-
{ label: "选项4", value: "4" },
|
281
|
-
],
|
282
|
-
},
|
283
|
-
},
|
284
|
-
},
|
285
|
-
],
|
286
|
-
};
|
287
|
-
},
|
288
|
-
},
|
289
|
-
};
|
290
|
-
</script>
|