vue-super-crud 1.7.1 → 1.7.2
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/.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,331 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div
|
3
|
-
class="code-format"
|
4
|
-
:class="{ hover: hovering }"
|
5
|
-
@mouseenter="hovering = true"
|
6
|
-
@mouseleave="hovering = false"
|
7
|
-
>
|
8
|
-
<div class="source" :class="{ source_height: sourceHeight }">
|
9
|
-
<slot name="source"></slot>
|
10
|
-
</div>
|
11
|
-
<div class="meta" ref="meta">
|
12
|
-
<div class="description" v-if="$slots.desc">
|
13
|
-
<slot name="desc"></slot>
|
14
|
-
</div>
|
15
|
-
<div class="highlight">
|
16
|
-
<slot></slot>
|
17
|
-
</div>
|
18
|
-
</div>
|
19
|
-
<div
|
20
|
-
class="code-format-control"
|
21
|
-
ref="control"
|
22
|
-
:class="{ 'is-fixed': fixedControl }"
|
23
|
-
@click="isExpanded = !isExpanded"
|
24
|
-
>
|
25
|
-
<transition name="arrow-slide">
|
26
|
-
<i :class="[iconClass, { hovering: hovering }]"></i>
|
27
|
-
</transition>
|
28
|
-
<transition name="text-slide">
|
29
|
-
<span v-show="hovering">{{ controlText }}</span>
|
30
|
-
</transition>
|
31
|
-
<div class="control-button-container">
|
32
|
-
<el-button
|
33
|
-
v-show="isExpanded"
|
34
|
-
ref="copyButton"
|
35
|
-
size="small"
|
36
|
-
type="text"
|
37
|
-
class="control-button copy-button"
|
38
|
-
@click.stop="copyCode"
|
39
|
-
>复制代码</el-button
|
40
|
-
>
|
41
|
-
</div>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
</template>
|
45
|
-
|
46
|
-
<script>
|
47
|
-
export default {
|
48
|
-
name: "CodeFormat",
|
49
|
-
props: {
|
50
|
-
sourceHeight: {
|
51
|
-
type: Boolean,
|
52
|
-
default: false,
|
53
|
-
},
|
54
|
-
},
|
55
|
-
data() {
|
56
|
-
return {
|
57
|
-
qrCodeDialog: false,
|
58
|
-
hovering: false,
|
59
|
-
isExpanded: false,
|
60
|
-
fixedControl: false,
|
61
|
-
scrollParent: null,
|
62
|
-
currentWidth: 0,
|
63
|
-
};
|
64
|
-
},
|
65
|
-
computed: {
|
66
|
-
lang() {
|
67
|
-
return this.$route.path.split("/")[1];
|
68
|
-
},
|
69
|
-
iconClass() {
|
70
|
-
return this.isExpanded ? "el-icon-caret-top" : "el-icon-caret-bottom";
|
71
|
-
},
|
72
|
-
controlText() {
|
73
|
-
return this.isExpanded ? "隐藏代码" : "显示代码";
|
74
|
-
},
|
75
|
-
codeArea() {
|
76
|
-
return this.$el.getElementsByClassName("meta")[0];
|
77
|
-
},
|
78
|
-
},
|
79
|
-
watch: {
|
80
|
-
isExpanded(val) {
|
81
|
-
this.setCodeAreaHeight();
|
82
|
-
if (!val) {
|
83
|
-
this.fixedControl = false;
|
84
|
-
// this.$refs.control.style.left = '0'
|
85
|
-
this.removeScrollHandler();
|
86
|
-
return;
|
87
|
-
}
|
88
|
-
setTimeout(() => {
|
89
|
-
this.scrollParent = window;
|
90
|
-
this.scrollParent &&
|
91
|
-
this.scrollParent.addEventListener("scroll", this.scrollHandler);
|
92
|
-
this.scrollHandler();
|
93
|
-
this.setFixedWidth();
|
94
|
-
}, 200);
|
95
|
-
},
|
96
|
-
},
|
97
|
-
mounted() {
|
98
|
-
const observer = new ResizeObserver(() => {
|
99
|
-
this.currentWidth = Math.round(this.$el.getBoundingClientRect().width);
|
100
|
-
});
|
101
|
-
observer.observe(this.$el);
|
102
|
-
},
|
103
|
-
beforeDestroy() {
|
104
|
-
this.removeScrollHandler();
|
105
|
-
},
|
106
|
-
methods: {
|
107
|
-
setFixedWidth() {
|
108
|
-
this.$el.querySelector(
|
109
|
-
".code-format-control"
|
110
|
-
).style.width = `${this.currentWidth}px`;
|
111
|
-
},
|
112
|
-
getCodeAreaHeight() {
|
113
|
-
if (this.$el.getElementsByClassName("description").length > 0) {
|
114
|
-
return (
|
115
|
-
this.$el.getElementsByClassName("description")[0].clientHeight +
|
116
|
-
this.$el.getElementsByClassName("highlight")[0].clientHeight +
|
117
|
-
20
|
118
|
-
);
|
119
|
-
}
|
120
|
-
return this.$el.getElementsByClassName("highlight")[0].clientHeight;
|
121
|
-
},
|
122
|
-
setCodeAreaHeight() {
|
123
|
-
this.codeArea.style.height = this.isExpanded
|
124
|
-
? `${this.getCodeAreaHeight() + 1}px`
|
125
|
-
: "0";
|
126
|
-
},
|
127
|
-
copyCode() {
|
128
|
-
const pre = this.$el.querySelectorAll("pre")[0];
|
129
|
-
pre.setAttribute("contenteditable", "true");
|
130
|
-
pre.focus();
|
131
|
-
document.execCommand("selectAll", false, null);
|
132
|
-
const copied = document.execCommand("copy");
|
133
|
-
if (copied) {
|
134
|
-
pre.removeAttribute("contenteditable");
|
135
|
-
this.$message.success("复制成功!");
|
136
|
-
} else {
|
137
|
-
this.$message.error("复制失败!");
|
138
|
-
}
|
139
|
-
},
|
140
|
-
scrollHandler() {
|
141
|
-
const { top, bottom, left } = this.$refs.meta.getBoundingClientRect();
|
142
|
-
this.fixedControl =
|
143
|
-
bottom > document.documentElement.clientHeight &&
|
144
|
-
top + 44 <= document.documentElement.clientHeight;
|
145
|
-
// this.$refs.control.style.left = this.fixedControl ? `${left}px` : '0'
|
146
|
-
},
|
147
|
-
removeScrollHandler() {
|
148
|
-
this.scrollParent &&
|
149
|
-
this.scrollParent.removeEventListener("scroll", this.scrollHandler);
|
150
|
-
},
|
151
|
-
},
|
152
|
-
};
|
153
|
-
</script>
|
154
|
-
<style lang="scss">
|
155
|
-
.code-format {
|
156
|
-
border: solid 1px #ebebeb;
|
157
|
-
border-radius: 3px;
|
158
|
-
transition: 0.2s;
|
159
|
-
&.hover {
|
160
|
-
box-shadow: 0 0 8px 0 rgba(232, 237, 250, 0.6),
|
161
|
-
0 2px 4px 0 rgba(232, 237, 250, 0.5);
|
162
|
-
}
|
163
|
-
code {
|
164
|
-
font-family: Menlo, Monaco, Consolas, Courier, monospace;
|
165
|
-
}
|
166
|
-
.demo-button {
|
167
|
-
float: right;
|
168
|
-
}
|
169
|
-
.source {
|
170
|
-
padding: 15px;
|
171
|
-
}
|
172
|
-
.source_height {
|
173
|
-
height: 600px;
|
174
|
-
}
|
175
|
-
.meta {
|
176
|
-
background-color: #fafafa;
|
177
|
-
border-top: solid 1px #eaeefb;
|
178
|
-
overflow: hidden;
|
179
|
-
height: 0;
|
180
|
-
transition: height 0.5s;
|
181
|
-
}
|
182
|
-
.description {
|
183
|
-
padding: 20px;
|
184
|
-
box-sizing: border-box;
|
185
|
-
border: solid 1px #ebebeb;
|
186
|
-
border-radius: 3px;
|
187
|
-
font-size: 14px;
|
188
|
-
line-height: 22px;
|
189
|
-
color: #666;
|
190
|
-
word-break: break-word;
|
191
|
-
margin: 10px !important;
|
192
|
-
background-color: #fff;
|
193
|
-
p {
|
194
|
-
margin: 0;
|
195
|
-
line-height: 26px;
|
196
|
-
}
|
197
|
-
code {
|
198
|
-
color: #5e6d82;
|
199
|
-
background-color: #e6effb;
|
200
|
-
margin: 0 4px;
|
201
|
-
display: inline-block;
|
202
|
-
padding: 1px 5px;
|
203
|
-
font-size: 12px;
|
204
|
-
border-radius: 3px;
|
205
|
-
height: 18px;
|
206
|
-
line-height: 18px;
|
207
|
-
}
|
208
|
-
}
|
209
|
-
.highlight {
|
210
|
-
pre {
|
211
|
-
margin: 0;
|
212
|
-
}
|
213
|
-
code.hljs {
|
214
|
-
margin: 0;
|
215
|
-
border: none;
|
216
|
-
max-height: none;
|
217
|
-
border-radius: 0;
|
218
|
-
&::before {
|
219
|
-
content: none;
|
220
|
-
}
|
221
|
-
}
|
222
|
-
}
|
223
|
-
.code-format-control {
|
224
|
-
z-index: 1;
|
225
|
-
border-top: solid 1px #eaeefb;
|
226
|
-
height: 44px;
|
227
|
-
box-sizing: border-box;
|
228
|
-
background-color: #fff;
|
229
|
-
border-bottom-left-radius: 4px;
|
230
|
-
border-bottom-right-radius: 4px;
|
231
|
-
text-align: center;
|
232
|
-
margin-top: -1px;
|
233
|
-
color: #d3dce6;
|
234
|
-
cursor: pointer;
|
235
|
-
position: relative;
|
236
|
-
&.is-fixed {
|
237
|
-
position: fixed;
|
238
|
-
bottom: 0;
|
239
|
-
width: 1068px;
|
240
|
-
z-index: 1;
|
241
|
-
}
|
242
|
-
i {
|
243
|
-
font-size: 16px;
|
244
|
-
line-height: 44px;
|
245
|
-
transition: 0.3s;
|
246
|
-
&.hovering {
|
247
|
-
transform: translateX(-40px);
|
248
|
-
}
|
249
|
-
}
|
250
|
-
> span {
|
251
|
-
position: absolute;
|
252
|
-
transform: translateX(-30px);
|
253
|
-
font-size: 14px;
|
254
|
-
line-height: 44px;
|
255
|
-
transition: 0.3s;
|
256
|
-
display: inline-block;
|
257
|
-
}
|
258
|
-
&:hover {
|
259
|
-
color: #409eff;
|
260
|
-
background-color: #f9fafc;
|
261
|
-
}
|
262
|
-
& .text-slide-enter,
|
263
|
-
& .text-slide-leave-active {
|
264
|
-
opacity: 0;
|
265
|
-
transform: translateX(10px);
|
266
|
-
}
|
267
|
-
.qr_code {
|
268
|
-
line-height: 26px;
|
269
|
-
position: absolute;
|
270
|
-
top: 0;
|
271
|
-
left: 0;
|
272
|
-
font-size: 14px;
|
273
|
-
padding-left: 15px;
|
274
|
-
padding-right: 25px;
|
275
|
-
}
|
276
|
-
.control-button {
|
277
|
-
line-height: 26px;
|
278
|
-
position: absolute;
|
279
|
-
top: 0;
|
280
|
-
right: 0;
|
281
|
-
font-size: 14px;
|
282
|
-
padding-left: 5px;
|
283
|
-
padding-right: 25px;
|
284
|
-
}
|
285
|
-
}
|
286
|
-
@media (max-width: 1500px) {
|
287
|
-
.code-format-control {
|
288
|
-
&.is-fixed {
|
289
|
-
width: 916px;
|
290
|
-
}
|
291
|
-
}
|
292
|
-
}
|
293
|
-
@media (max-width: 1300px) {
|
294
|
-
.code-format-control {
|
295
|
-
&.is-fixed {
|
296
|
-
width: 840px;
|
297
|
-
}
|
298
|
-
}
|
299
|
-
}
|
300
|
-
@media (max-width: 1200px) {
|
301
|
-
.code-format-control {
|
302
|
-
&.is-fixed {
|
303
|
-
width: 770px;
|
304
|
-
}
|
305
|
-
}
|
306
|
-
}
|
307
|
-
table {
|
308
|
-
margin: 0;
|
309
|
-
display: table;
|
310
|
-
}
|
311
|
-
th,
|
312
|
-
td,
|
313
|
-
tr {
|
314
|
-
border: 0;
|
315
|
-
}
|
316
|
-
}
|
317
|
-
.el-popper {
|
318
|
-
table {
|
319
|
-
margin: 0;
|
320
|
-
display: table;
|
321
|
-
}
|
322
|
-
th,
|
323
|
-
td,
|
324
|
-
tr {
|
325
|
-
border: 0;
|
326
|
-
}
|
327
|
-
tr:nth-child(2n) {
|
328
|
-
background: none;
|
329
|
-
}
|
330
|
-
}
|
331
|
-
</style>
|
@@ -1,68 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud :search.sync="searchForm" :options="options" :data="data">
|
4
|
-
</sc-crud>
|
5
|
-
</div>
|
6
|
-
</template>
|
7
|
-
|
8
|
-
<script>
|
9
|
-
/***
|
10
|
-
* date 匹配到的全局配置对象
|
11
|
-
*
|
12
|
-
*date: {
|
13
|
-
comp: {
|
14
|
-
name: "el-date-picker",
|
15
|
-
type: "date",
|
16
|
-
valueFormat: "yyyy-MM-dd",
|
17
|
-
},
|
18
|
-
}
|
19
|
-
* * */
|
20
|
-
export default {
|
21
|
-
data() {
|
22
|
-
return {
|
23
|
-
searchForm: {},
|
24
|
-
options: {
|
25
|
-
renderColumns: [
|
26
|
-
{ prop: "name", label: "昵称" },
|
27
|
-
{
|
28
|
-
prop: "username",
|
29
|
-
label: "姓名",
|
30
|
-
},
|
31
|
-
{
|
32
|
-
prop: "createTime",
|
33
|
-
label: "模板复用示例",
|
34
|
-
presetType: "date", // 使用模板
|
35
|
-
},
|
36
|
-
{
|
37
|
-
prop: "createTime",
|
38
|
-
label: "不使用模板,效果与模板等价",
|
39
|
-
comp: {
|
40
|
-
name: "el-date-picker",
|
41
|
-
type: "date",
|
42
|
-
valueFormat: "yyyy-MM-dd",
|
43
|
-
},
|
44
|
-
},
|
45
|
-
],
|
46
|
-
},
|
47
|
-
data: [
|
48
|
-
{
|
49
|
-
createTime: "2018-06-02",
|
50
|
-
createUser: 94,
|
51
|
-
id: 56,
|
52
|
-
idNumber: "8",
|
53
|
-
name: "识间华中张认",
|
54
|
-
password: "sed laboris",
|
55
|
-
phone: "18157668675",
|
56
|
-
gender: "男",
|
57
|
-
age: 20,
|
58
|
-
status: 35,
|
59
|
-
updateTime: "2018-09-08 16:33:19",
|
60
|
-
updateUser: 58,
|
61
|
-
username: "石洋",
|
62
|
-
},
|
63
|
-
],
|
64
|
-
};
|
65
|
-
},
|
66
|
-
methods: {},
|
67
|
-
};
|
68
|
-
</script>
|
@@ -1,73 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div>
|
3
|
-
<sc-crud :search.sync="searchForm" :options="options" :data="data">
|
4
|
-
</sc-crud>
|
5
|
-
</div>
|
6
|
-
</template>
|
7
|
-
|
8
|
-
<script>
|
9
|
-
/***
|
10
|
-
* "testCodeTemplate" 匹配到的配置对象
|
11
|
-
* @param {Object} item - 当前配置对象
|
12
|
-
*
|
13
|
-
*testCodeTemplate: (item) => ({
|
14
|
-
search: {
|
15
|
-
comp: {
|
16
|
-
name: item.searchCompName,
|
17
|
-
type: item.SearchCompType,
|
18
|
-
},
|
19
|
-
},
|
20
|
-
form: {
|
21
|
-
comp: {
|
22
|
-
name: item.formCompName,
|
23
|
-
},
|
24
|
-
},
|
25
|
-
formatter: (row) => row[item.prop] + "自定义格式化",
|
26
|
-
}),
|
27
|
-
* * */
|
28
|
-
export default {
|
29
|
-
data() {
|
30
|
-
return {
|
31
|
-
searchForm: {},
|
32
|
-
options: {
|
33
|
-
rowEdit: true,
|
34
|
-
searchHeader: true,
|
35
|
-
renderColumns: [
|
36
|
-
{
|
37
|
-
prop: "name",
|
38
|
-
label: "昵称",
|
39
|
-
presetType: "testCodeTemplate",
|
40
|
-
searchCompName: "el-select",
|
41
|
-
formCompName: "el-select",
|
42
|
-
},
|
43
|
-
{
|
44
|
-
prop: "username",
|
45
|
-
label: "姓名",
|
46
|
-
presetType: "testCodeTemplate",
|
47
|
-
searchCompName: "el-input",
|
48
|
-
formCompName: "el-input",
|
49
|
-
},
|
50
|
-
],
|
51
|
-
},
|
52
|
-
data: [
|
53
|
-
{
|
54
|
-
createTime: "2018-06-02 12:28:47",
|
55
|
-
createUser: 94,
|
56
|
-
id: 56,
|
57
|
-
idNumber: "8",
|
58
|
-
name: "识间华中张认",
|
59
|
-
password: "sed laboris",
|
60
|
-
phone: "18157668675",
|
61
|
-
gender: "男",
|
62
|
-
age: 20,
|
63
|
-
status: 35,
|
64
|
-
updateTime: "2018-09-08 16:33:19",
|
65
|
-
updateUser: 58,
|
66
|
-
username: "石洋",
|
67
|
-
},
|
68
|
-
],
|
69
|
-
};
|
70
|
-
},
|
71
|
-
methods: {},
|
72
|
-
};
|
73
|
-
</script>
|
@@ -1,160 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<sc-form v-model="form" :options="options"> </sc-form>
|
3
|
-
</template>
|
4
|
-
|
5
|
-
<script>
|
6
|
-
export default {
|
7
|
-
data() {
|
8
|
-
// 非全局组件示例
|
9
|
-
this.CustomComponent = {
|
10
|
-
render: (h) => {
|
11
|
-
return h("div", "自定义组件");
|
12
|
-
},
|
13
|
-
};
|
14
|
-
|
15
|
-
return {
|
16
|
-
options: {
|
17
|
-
renderColumns: [
|
18
|
-
// 1. Select选择器示例
|
19
|
-
{
|
20
|
-
prop: "type",
|
21
|
-
label: "下拉选择",
|
22
|
-
comp: {
|
23
|
-
name: "el-select",
|
24
|
-
multiple: true,
|
25
|
-
// 动态属性配置
|
26
|
-
bind: (scope) => ({
|
27
|
-
disabled: scope.row.status === "disabled",
|
28
|
-
}),
|
29
|
-
// 子组件配置
|
30
|
-
children: [
|
31
|
-
{ name: "el-option", label: "类型1", value: "1" },
|
32
|
-
{ name: "el-option", label: "类型2", value: "2" },
|
33
|
-
],
|
34
|
-
// 事件处理
|
35
|
-
on: {
|
36
|
-
change: (val, scope) => {
|
37
|
-
console.log("选择值:", val);
|
38
|
-
console.log("当前行:", scope.row);
|
39
|
-
},
|
40
|
-
},
|
41
|
-
},
|
42
|
-
},
|
43
|
-
|
44
|
-
// 2. Input输入框示例
|
45
|
-
{
|
46
|
-
prop: "name",
|
47
|
-
label: "输入框",
|
48
|
-
comp: {
|
49
|
-
name: "el-input",
|
50
|
-
// 直接属性配置
|
51
|
-
clearable: true,
|
52
|
-
maxlength: 20,
|
53
|
-
"show-word-limit": true,
|
54
|
-
// 插槽配置
|
55
|
-
slots: {
|
56
|
-
prefix: () => <i class="el-icon-search" />,
|
57
|
-
suffix: () => <i class="el-icon-date" />,
|
58
|
-
},
|
59
|
-
// 事件监听
|
60
|
-
on: {
|
61
|
-
input: (val, scope) => {
|
62
|
-
console.log("输入值:", val);
|
63
|
-
},
|
64
|
-
focus: (event, scope) => {
|
65
|
-
console.log("获得焦点");
|
66
|
-
},
|
67
|
-
},
|
68
|
-
},
|
69
|
-
},
|
70
|
-
|
71
|
-
// 3. Radio单选组示例
|
72
|
-
{
|
73
|
-
prop: "gender",
|
74
|
-
label: "单选组",
|
75
|
-
comp: {
|
76
|
-
name: "el-radio-group",
|
77
|
-
// 动态生成选项
|
78
|
-
children: (scope) => {
|
79
|
-
const options = [
|
80
|
-
{ label: "男", value: "male" },
|
81
|
-
{ label: "女", value: "female" },
|
82
|
-
];
|
83
|
-
return options.map((item) => ({
|
84
|
-
name: "el-radio",
|
85
|
-
label: item.value,
|
86
|
-
children: item.label,
|
87
|
-
}));
|
88
|
-
},
|
89
|
-
// 组件挂载后的回调
|
90
|
-
mounted: (scope, ref) => {
|
91
|
-
console.log("单选组已挂载:", ref);
|
92
|
-
},
|
93
|
-
},
|
94
|
-
},
|
95
|
-
|
96
|
-
// 4. 自定义组件示例
|
97
|
-
{
|
98
|
-
prop: "custom",
|
99
|
-
label: "自定义组件",
|
100
|
-
comp: {
|
101
|
-
name: this.CustomComponent,
|
102
|
-
// 自定义属性
|
103
|
-
customProp: "自定义值",
|
104
|
-
// 原生事件
|
105
|
-
nativeOn: {
|
106
|
-
click: () => {
|
107
|
-
console.log("点击自定义组件");
|
108
|
-
},
|
109
|
-
},
|
110
|
-
},
|
111
|
-
},
|
112
|
-
|
113
|
-
// 5. 级联选择器示例
|
114
|
-
{
|
115
|
-
prop: "region",
|
116
|
-
label: "地区选择",
|
117
|
-
comp: {
|
118
|
-
name: "el-cascader",
|
119
|
-
// 属性配置
|
120
|
-
options: [
|
121
|
-
{
|
122
|
-
value: "zhejiang",
|
123
|
-
label: "浙江",
|
124
|
-
children: [
|
125
|
-
{
|
126
|
-
value: "hangzhou",
|
127
|
-
label: "杭州",
|
128
|
-
},
|
129
|
-
],
|
130
|
-
},
|
131
|
-
],
|
132
|
-
// 条件属性
|
133
|
-
bind: (scope) => ({
|
134
|
-
disabled: !scope.row.type,
|
135
|
-
placeholder: `请选择${scope.item.label}`,
|
136
|
-
}),
|
137
|
-
// 值变化事件
|
138
|
-
on: {
|
139
|
-
change: (value, scope) => {
|
140
|
-
console.log("选择的地区:", value);
|
141
|
-
},
|
142
|
-
},
|
143
|
-
},
|
144
|
-
},
|
145
|
-
],
|
146
|
-
},
|
147
|
-
// 表格数据
|
148
|
-
form: {
|
149
|
-
id: 1,
|
150
|
-
type: ["1"],
|
151
|
-
name: "测试数据",
|
152
|
-
gender: "male",
|
153
|
-
custom: "",
|
154
|
-
region: ["zhejiang", "hangzhou"],
|
155
|
-
status: "normal",
|
156
|
-
},
|
157
|
-
};
|
158
|
-
},
|
159
|
-
};
|
160
|
-
</script>
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<sc-crud :options="options" :data="data"> </sc-crud>
|
3
|
-
</template>
|
4
|
-
|
5
|
-
<script>
|
6
|
-
export default {
|
7
|
-
data() {
|
8
|
-
return {
|
9
|
-
options: {
|
10
|
-
renderColumns: [
|
11
|
-
{ prop: "name", label: "昵称" },
|
12
|
-
{
|
13
|
-
prop: "username",
|
14
|
-
label: "姓名",
|
15
|
-
formatter: (row) => row.username + " formatter",
|
16
|
-
},
|
17
|
-
{
|
18
|
-
prop: "gender",
|
19
|
-
label: "性别",
|
20
|
-
html: true,
|
21
|
-
formatter: (row) => {
|
22
|
-
return `<span style="color:red">${row.gender}</span>`;
|
23
|
-
},
|
24
|
-
},
|
25
|
-
],
|
26
|
-
},
|
27
|
-
data: [
|
28
|
-
{
|
29
|
-
createTime: "2018-06-02 12:28:47",
|
30
|
-
createUser: 94,
|
31
|
-
id: 56,
|
32
|
-
idNumber: "8",
|
33
|
-
name: "识间华中张认",
|
34
|
-
password: "sed laboris",
|
35
|
-
phone: "18157668675",
|
36
|
-
gender: "男",
|
37
|
-
age: 20,
|
38
|
-
status: 35,
|
39
|
-
updateTime: "2018-09-08 16:33:19",
|
40
|
-
updateUser: 58,
|
41
|
-
username: "石洋",
|
42
|
-
},
|
43
|
-
],
|
44
|
-
};
|
45
|
-
},
|
46
|
-
};
|
47
|
-
</script>
|
48
|
-
|
49
|
-
<style lang="scss" scoped></style>
|