simple-frame-unit 1.0.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/.env.dev +14 -0
- package/CHANGELOG.md +9 -0
- package/README.md +24 -0
- package/dist/ed-frame-vue.common.1.js +11046 -0
- package/dist/ed-frame-vue.common.1.js.map +1 -0
- package/dist/ed-frame-vue.common.2.js +1715 -0
- package/dist/ed-frame-vue.common.2.js.map +1 -0
- package/dist/ed-frame-vue.common.js +53427 -0
- package/dist/ed-frame-vue.common.js.map +1 -0
- package/dist/ed-frame-vue.umd.1.js +11046 -0
- package/dist/ed-frame-vue.umd.1.js.map +1 -0
- package/dist/ed-frame-vue.umd.2.js +1715 -0
- package/dist/ed-frame-vue.umd.2.js.map +1 -0
- package/dist/ed-frame-vue.umd.js +53437 -0
- package/dist/ed-frame-vue.umd.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.1.js +17 -0
- package/dist/ed-frame-vue.umd.min.1.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.2.js +4 -0
- package/dist/ed-frame-vue.umd.min.2.js.map +1 -0
- package/dist/ed-frame-vue.umd.min.js +470 -0
- package/dist/ed-frame-vue.umd.min.js.map +1 -0
- package/import.easydata.js +46 -0
- package/lib/CHANGELOG.md +18 -0
- package/lib/README.md +27 -0
- package/lib/api/ds/index.js +124 -0
- package/lib/api/easyData.js +90 -0
- package/lib/api/easyform/easyForm.js +32 -0
- package/lib/api/index.js +61 -0
- package/lib/api/interface/index.js +32 -0
- package/lib/api/system.js +20 -0
- package/lib/index.js +80 -0
- package/lib/packages/BasicTemplate/EasyDataTemplate.vue +189 -0
- package/lib/packages/BasicTemplate/Props.js +64 -0
- package/lib/packages/BasicTemplate/components/TemplateComp.vue +263 -0
- package/lib/packages/BasicTemplate/components/TemplateViews.vue +292 -0
- package/lib/packages/BasicTemplate/hooks/business.js +74 -0
- package/lib/packages/BasicTemplate/hooks/getFormData.js +89 -0
- package/lib/packages/BasicTemplate/hooks/queryFormData.js +194 -0
- package/lib/packages/BasicTemplate/hooks/submitForm.js +53 -0
- package/lib/packages/BasicTemplate/hooks/useEmits.js +15 -0
- package/lib/packages/BasicTemplate/hooks/validate.js +42 -0
- package/lib/packages/EasyDataForm/EasyDataForm.vue +597 -0
- package/lib/packages/EasyDataForm/Props.js +22 -0
- package/lib/packages/EasyDataForm/components/FormItem.vue +228 -0
- package/lib/packages/EasyDataForm/hooks/useChosePopup.js +85 -0
- package/lib/packages/EasyDataForm/hooks/useEmits.js +19 -0
- package/lib/packages/EasyDataForm/hooks/useForm.js +169 -0
- package/lib/packages/EasyDataForm/hooks/useUpload.js +168 -0
- package/lib/packages/EasyDataList/EasyDataList.vue +348 -0
- package/lib/packages/EasyDataList/Props.js +116 -0
- package/lib/packages/EasyDataList/components/BasicModal.vue +150 -0
- package/lib/packages/EasyDataList/components/FormAction.vue +63 -0
- package/lib/packages/EasyDataList/hooks/useEmits.js +30 -0
- package/lib/packages/EasyDataList/hooks/useForm.js +62 -0
- package/lib/packages/EasyDataList/hooks/useTable.js +314 -0
- package/lib/packages/EasyDataTable/EasyDataTable.vue +233 -0
- package/lib/packages/EasyDataView/EasyDataView.vue +105 -0
- package/lib/packages/EdRichPreview/index.js +32 -0
- package/lib/packages/EdRichText/index.vue +167 -0
- package/lib/packages/EdRichText/replaceUrl.js +49 -0
- package/lib/packages/components/FileView.vue +97 -0
- package/lib/packages/index.js +11 -0
- package/lib/packages/mixins/EasyDataMixins.js +133 -0
- package/lib/packages/mixins/useTable.jsx +130 -0
- package/lib/pages/DataSource/index.js +8 -0
- package/lib/pages/DataSource/src/components/ControlViews/BaseProps.js +103 -0
- package/lib/pages/DataSource/src/components/ControlViews/control.js +1089 -0
- package/lib/pages/DataSource/src/components/ControlViews/index.vue +301 -0
- package/lib/pages/DataSource/src/components/TableOperationModal.vue +225 -0
- package/lib/pages/DataSource/src/components/TablePropsModal.vue +367 -0
- package/lib/pages/DataSource/src/components/ViewPropsModal.vue +737 -0
- package/lib/pages/DataSource/src/components/modal/ChooseDict.vue +119 -0
- package/lib/pages/DataSource/src/hooks/useTable.js +138 -0
- package/lib/pages/DataSource/src/index.vue +431 -0
- package/lib/pages/Interface/index.js +8 -0
- package/lib/pages/Interface/src/components/InterfaceCall.vue +73 -0
- package/lib/pages/Interface/src/components/InterfaceDepend.vue +299 -0
- package/lib/pages/Interface/src/components/InterfaceFee.vue +131 -0
- package/lib/pages/Interface/src/components/InterfaceMessage.vue +878 -0
- package/lib/pages/Interface/src/components/InterfaceMock.vue +203 -0
- package/lib/pages/Interface/src/components/InterfaceParam.vue +308 -0
- package/lib/pages/Interface/src/components/InterfaceRepeat.vue +281 -0
- package/lib/pages/Interface/src/components/InterfaceVariable.vue +31 -0
- package/lib/pages/Interface/src/index.vue +216 -0
- package/lib/pages/Template/index.js +8 -0
- package/lib/pages/Template/src/components/DefineModal.vue +524 -0
- package/lib/pages/Template/src/components/TemplatePreview.vue +109 -0
- package/lib/pages/Template/src/components/model/AddDialog.vue +60 -0
- package/lib/pages/Template/src/components/model/TemplatePreview2.vue +101 -0
- package/lib/pages/Template/src/hooks/index.js +3 -0
- package/lib/pages/Template/src/hooks/useEmits.js +64 -0
- package/lib/pages/Template/src/index.vue +124 -0
- package/lib/popup/index.js +8 -0
- package/lib/popup/src/DataSourceChoose.vue +44 -0
- package/lib/popup/src/DataSourceViewIdChoose.vue +67 -0
- package/lib/popup/src/DictChoose.vue +104 -0
- package/lib/popup/src/InterfaceChoose.vue +46 -0
- package/lib/popup/src/OrgChoose.vue +121 -0
- package/lib/popup/src/RoleChoose.vue +101 -0
- package/lib/popup/src/TemplateChoose.vue +43 -0
- package/lib/popup/src/UserChoose.vue +161 -0
- package/lib/popup//347/273/204/344/273/266/345/274/200/345/217/221/350/247/204/350/214/203.md +25 -0
- package/lib/style/custom.scss +126 -0
- package/lib/style/deep.scss +109 -0
- package/lib/style/index.scss +4 -0
- package/lib/utils/MapLoader.js +48 -0
- package/lib/utils/dateUtils.js +58 -0
- package/lib/utils/index.js +8 -0
- package/lib/utils/setting.js +25 -0
- package/lib/utils/sortable/index.js +3784 -0
- package/lib/utils/useBusiness.js +212 -0
- package/lib/utils/utils.js +588 -0
- package/package.json +77 -0
- package/src/App.vue +12 -0
- package/src/assets/Vue.png +0 -0
- package/src/assets/avatar.png +0 -0
- package/src/assets/images/bg.png +0 -0
- package/src/assets/images/logo-bills.png +0 -0
- package/src/assets/images/pic.png +0 -0
- package/src/assets/images/weplus-logo.png +0 -0
- package/src/assets/marker.png +0 -0
- package/src/assets/styles/common.scss +359 -0
- package/src/assets/styles/ele-docs.css +3278 -0
- package/src/assets/styles/fonts/icomoon.eot +0 -0
- package/src/assets/styles/fonts/icomoon.svg +14 -0
- package/src/assets/styles/fonts/icomoon.ttf +0 -0
- package/src/assets/styles/fonts/icomoon.woff +0 -0
- package/src/assets/styles/fonts/style.css +39 -0
- package/src/assets/styles/higtlightEle.css +84 -0
- package/src/assets/svg/code.svg +7 -0
- package/src/assets/svg/password.svg +1 -0
- package/src/components/Popups/DiyCompDictChoose.vue +112 -0
- package/src/components/Popups/index.js +28 -0
- package/src/components/ed-base-vue/global/variable.js +8 -0
- package/src/components/ed-base-vue/index.js +81 -0
- package/src/components/ed-base-vue/package/EdCard/index.js +7 -0
- package/src/components/ed-base-vue/package/EdCard/src/index.vue +87 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/AceConfig.js +71 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/Editor.vue +137 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/Toolbar.vue +68 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/index.vue +119 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/AceEditor/webpack-resolver.js +51 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/Toolbar.vue +57 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/config.js +64 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/Codemirror/index.vue +309 -0
- package/src/components/ed-base-vue/package/EdCodeEditor/src/EdCodeEditor.vue +238 -0
- package/src/components/ed-base-vue/package/EdDate/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDate/src/index.js +50 -0
- package/src/components/ed-base-vue/package/EdDescriptions/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/EdDescriptions.vue +46 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/EdDescriptionsItem.js +20 -0
- package/src/components/ed-base-vue/package/EdDescriptions/src/Props.js +20 -0
- package/src/components/ed-base-vue/package/EdDialog/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDialog/src/EdDialog.vue +138 -0
- package/src/components/ed-base-vue/package/EdDialog/src/Props.js +91 -0
- package/src/components/ed-base-vue/package/EdDialog/src/components/DialogFooter.vue +42 -0
- package/src/components/ed-base-vue/package/EdDialog/src/components/DialogWrapper.vue +53 -0
- package/src/components/ed-base-vue/package/EdDrawer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/DrawerFooter.vue +41 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/EdDrawer.vue +150 -0
- package/src/components/ed-base-vue/package/EdDrawer/src/props.js +71 -0
- package/src/components/ed-base-vue/package/EdFlow/index.js +8 -0
- package/src/components/ed-base-vue/package/EdFlow/src/EdFlowItem.vue +733 -0
- package/src/components/ed-base-vue/package/EdFlow/src/index.vue +148 -0
- package/src/components/ed-base-vue/package/EdForm/index.js +8 -0
- package/src/components/ed-base-vue/package/EdForm/src/EdForm.vue +172 -0
- package/src/components/ed-base-vue/package/EdForm/src/Props.js +33 -0
- package/src/components/ed-base-vue/package/EdForm/src/components/EdFormItem.vue +34 -0
- package/src/components/ed-base-vue/package/EdIcons/index.js +8 -0
- package/src/components/ed-base-vue/package/EdIcons/src/hooks/Icons.js +406 -0
- package/src/components/ed-base-vue/package/EdIcons/src/hooks/Icons1.js +830 -0
- package/src/components/ed-base-vue/package/EdIcons/src/index.vue +13 -0
- package/src/components/ed-base-vue/package/EdImage/index.js +8 -0
- package/src/components/ed-base-vue/package/EdImage/src/index.vue +28 -0
- package/src/components/ed-base-vue/package/EdInputArray/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputArray/src/Props.js +26 -0
- package/src/components/ed-base-vue/package/EdInputArray/src/index.vue +97 -0
- package/src/components/ed-base-vue/package/EdInputColor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputColor/src/InputColor.vue +81 -0
- package/src/components/ed-base-vue/package/EdInputMap/index.js +9 -0
- package/src/components/ed-base-vue/package/EdInputMap/src/EdInputMap.vue +246 -0
- package/src/components/ed-base-vue/package/EdInputMap/src/EdInputMapProps.js +6 -0
- package/src/components/ed-base-vue/package/EdInputPop/index.js +13 -0
- package/src/components/ed-base-vue/package/EdInputPop/src/EdInputPop.vue +144 -0
- package/src/components/ed-base-vue/package/EdInputPop/src/Props.js +48 -0
- package/src/components/ed-base-vue/package/EdInputTable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdInputTable/src/EdInputTable.vue +368 -0
- package/src/components/ed-base-vue/package/EdInputTable/src/Fetch.js +40 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/index.js +13 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/EdJsonEditor.vue +198 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/img/jsoneditor-icons.svg +749 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/jsoneditor.css +2031 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/assets/plus.svg +1 -0
- package/src/components/ed-base-vue/package/EdJsonEditor/src/hooks.js +63 -0
- package/src/components/ed-base-vue/package/EdJsonViewer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdJsonViewer/src/EdJsonViewer.vue +44 -0
- package/src/components/ed-base-vue/package/EdLable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdLable/src/index.vue +34 -0
- package/src/components/ed-base-vue/package/EdLink/index.js +8 -0
- package/src/components/ed-base-vue/package/EdLink/src/index.vue +43 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/index.js +15 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/EdMarkEditor.vue +368 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/extra-function.js +538 -0
- package/src/components/ed-base-vue/package/EdMarkEditor/src/highlight.js +95 -0
- package/src/components/ed-base-vue/package/EdTable/index.js +8 -0
- package/src/components/ed-base-vue/package/EdTable/src/EdTable.vue +240 -0
- package/src/components/ed-base-vue/package/EdTable/src/Props.js +97 -0
- package/src/components/ed-base-vue/package/EdTable/src/components/TableColumnItem.js +24 -0
- package/src/components/ed-base-vue/package/EdTable/src/components/TablePagination.vue +73 -0
- package/src/components/ed-base-vue/package/EdTableEditor/index.js +8 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/EdTableEditor.vue +282 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/Props.js +107 -0
- package/src/components/ed-base-vue/package/EdTableEditor/src/hooks/validate.js +90 -0
- package/src/components/ed-base-vue/package/EdUpload/index.js +8 -0
- package/src/components/ed-base-vue/package/EdUpload/src/Props.js +90 -0
- package/src/components/ed-base-vue/package/EdUpload/src/index.vue +88 -0
- package/src/components/ed-base-vue/package/EdViewer/index.js +8 -0
- package/src/components/ed-base-vue/package/EdViewer/src/EdViewer.vue +310 -0
- package/src/components/ed-base-vue/package/EdWangEditor/index.js +14 -0
- package/src/components/ed-base-vue/package/EdWangEditor/src/EdWangEditor.vue +127 -0
- package/src/components/ed-base-vue/package/ExtendSlot.js +12 -0
- package/src/components/ed-base-vue/package/OptionSlot.js +65 -0
- package/src/components/ed-base-vue/plugin/Message/index.js +2 -0
- package/src/components/ed-base-vue/plugin/Message/src/main.js +91 -0
- package/src/components/ed-base-vue/plugin/Message/src/main.vue +253 -0
- package/src/components/ed-base-vue/plugin/print/index.js +156 -0
- package/src/components/ed-base-vue/plugin/sortable/index.js +3784 -0
- package/src/components/ed-base-vue/style/custom.scss +107 -0
- package/src/components/ed-base-vue/style/deep.scss +100 -0
- package/src/components/ed-base-vue/style/index.scss +4 -0
- package/src/components/ed-base-vue/tools/date-format.js +315 -0
- package/src/components/ed-base-vue/tools/utils.js +124 -0
- package/src/layouts/components/AppMain.vue +17 -0
- package/src/layouts/components/Header.vue +256 -0
- package/src/layouts/components/Logo.vue +56 -0
- package/src/layouts/components/Navbar.vue +169 -0
- package/src/layouts/components/SideBar.vue +107 -0
- package/src/layouts/components/index.js +5 -0
- package/src/layouts/index.vue +57 -0
- package/src/main.js +42 -0
- package/src/request/config.js +6 -0
- package/src/request/index.js +85 -0
- package/src/request/request.js +147 -0
- package/src/router/index.js +65 -0
- package/src/router/modules/baseRouter.js +43 -0
- package/src/router/modules/easydata.js +49 -0
- package/src/views/base/BaseRichPreview.vue +23 -0
- package/src/views/base/BaseRichText.vue +28 -0
- package/src/views/base/EdFormView.vue +54 -0
- package/src/views/base/EdTable.vue +98 -0
- package/src/views/base/inputTable.vue +103 -0
- package/src/views/easydata/Interface.vue +3 -0
- package/src/views/easydata/dataSource.vue +13 -0
- package/src/views/easydata/dataSourceView.vue +71 -0
- package/src/views/easydata/templateDemo.vue +89 -0
- package/src/views/easydata/templateInfo.vue +13 -0
- package/src/views/index.vue +17 -0
- package/src/views/login.vue +208 -0
- package/src/views/redirect.vue +15 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-loading="loading">
|
|
3
|
+
<el-table ref="ElTable" style="width: 100%" v-bind="bindTableProps()" v-on="$listeners"
|
|
4
|
+
@row-click="handlerRowClick">
|
|
5
|
+
<!-- 索引列 -->
|
|
6
|
+
<slot name="indexColumn">
|
|
7
|
+
<!-- 索引列 - 单选 -->
|
|
8
|
+
<el-table-column v-if="isRadio" :type="indexType" align="center" width="50">
|
|
9
|
+
<template v-slot:default="scope">
|
|
10
|
+
<el-radio v-model="radioVal" :label="scope.row"></el-radio>
|
|
11
|
+
</template>
|
|
12
|
+
</el-table-column>
|
|
13
|
+
|
|
14
|
+
<!-- 索引列 - 多选、索引值 -->
|
|
15
|
+
<el-table-column v-if="isDefault" :type="indexType" align="center" width="50"></el-table-column>
|
|
16
|
+
|
|
17
|
+
<!-- 索引列 - 自定义 -->
|
|
18
|
+
<el-table-column v-if="isCustom" :type="indexType" align="center" width="50">
|
|
19
|
+
<template v-slot:default="scope">
|
|
20
|
+
<slot name="customRow" v-bind="scope"></slot>
|
|
21
|
+
</template>
|
|
22
|
+
</el-table-column>
|
|
23
|
+
</slot>
|
|
24
|
+
|
|
25
|
+
<!-- 默认列 -->
|
|
26
|
+
<el-table-column v-for="(column, index) in tableColumns" :key="index" v-bind="column">
|
|
27
|
+
<template v-slot:default="scope">
|
|
28
|
+
<slot :name="slotName(column)" v-bind="scope">
|
|
29
|
+
<table-column-item :scope="scope"></table-column-item>
|
|
30
|
+
</slot>
|
|
31
|
+
</template>
|
|
32
|
+
</el-table-column>
|
|
33
|
+
|
|
34
|
+
<!-- 操作列 -->
|
|
35
|
+
<el-table-column v-if="$scopedSlots.hasOwnProperty('operate') && isOperate" :fixed="operateFixed"
|
|
36
|
+
:minWidth="minWidth" align="center" label="操作">
|
|
37
|
+
<template v-slot:default="scope">
|
|
38
|
+
<slot name="operate" v-bind="scope"></slot>
|
|
39
|
+
</template>
|
|
40
|
+
</el-table-column>
|
|
41
|
+
</el-table>
|
|
42
|
+
|
|
43
|
+
<table-pagination v-if="pagination" ref="TablePagination" :pagination.sync="pagination"
|
|
44
|
+
@change="handlePaginationChange"></table-pagination>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import props, {TableProps} from './Props'
|
|
50
|
+
import TablePagination from "./components/TablePagination";
|
|
51
|
+
import TableColumnItem from "./components/TableColumnItem";
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 统一的表格组件
|
|
55
|
+
* - 示例
|
|
56
|
+
*
|
|
57
|
+
* ```vue
|
|
58
|
+
* <ed-table ref="ElsTable" v-model="elsTableData" :columns="elsTableColumns" :pagination="elsTablePagination">
|
|
59
|
+
* </ed-table>
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* [](./EdTableProps.md ':include')
|
|
63
|
+
*
|
|
64
|
+
* [](./EdTableBasicProps.md ':include')
|
|
65
|
+
*/
|
|
66
|
+
export default {
|
|
67
|
+
name: "EdTable",
|
|
68
|
+
components: {TablePagination, TableColumnItem},
|
|
69
|
+
props: props,
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
// 查询条件参数
|
|
73
|
+
tableColumns: [],
|
|
74
|
+
radioVal: "",
|
|
75
|
+
minWidth: this.operateWidth
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
watch: {
|
|
79
|
+
columns: {
|
|
80
|
+
deep: true,
|
|
81
|
+
immediate: true,
|
|
82
|
+
handler(newVal, oldVal) {
|
|
83
|
+
if (newVal && newVal !== oldVal) {
|
|
84
|
+
//在最后添加操作栏列
|
|
85
|
+
this.tableColumns = newVal.map(t => this.bindTableColumnProps(t));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
data: {
|
|
90
|
+
deep: true,
|
|
91
|
+
immediate: true,
|
|
92
|
+
handler(newVal, oldVal) {
|
|
93
|
+
if (newVal && newVal !== oldVal && newVal.length === 0) {
|
|
94
|
+
this.$emit('update:loading', false)
|
|
95
|
+
}
|
|
96
|
+
if (newVal && newVal !== oldVal && newVal.length > 0) {
|
|
97
|
+
this.$emit('update:loading', false)
|
|
98
|
+
|
|
99
|
+
// 主动设置操作栏宽度
|
|
100
|
+
this.$nextTick(() => {
|
|
101
|
+
this.$refs.ElTable.doLayout()
|
|
102
|
+
if (this.operateWidth === 140) {
|
|
103
|
+
let dom = this.$el.querySelectorAll('.operation')[0]
|
|
104
|
+
if (dom && Object.prototype.hasOwnProperty.call(dom.dataset, 'width')) {
|
|
105
|
+
this.minWidth = dom.dataset.width
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
computed: {
|
|
114
|
+
/**
|
|
115
|
+
* @private
|
|
116
|
+
* 处理索引列的类型
|
|
117
|
+
* @returns {string}
|
|
118
|
+
*/
|
|
119
|
+
indexType() {
|
|
120
|
+
return this.columnType === 'radio' ? 'index' : this.columnType
|
|
121
|
+
},
|
|
122
|
+
// 是否单选
|
|
123
|
+
isRadio() {
|
|
124
|
+
return this.columnType && this.columnType === 'radio'
|
|
125
|
+
},
|
|
126
|
+
// 是否多选,索引
|
|
127
|
+
isDefault() {
|
|
128
|
+
return this.columnType && (this.columnType === 'index' || this.columnType === "selection")
|
|
129
|
+
},
|
|
130
|
+
// 是否使用索引列插槽
|
|
131
|
+
isCustom() {
|
|
132
|
+
let slots = Object.assign({}, this.$slots, this.$scopedSlots)
|
|
133
|
+
return this.columnType && Object.keys(slots).includes("customRow")
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
methods: {
|
|
137
|
+
/**
|
|
138
|
+
* @private
|
|
139
|
+
* 动态插槽
|
|
140
|
+
* @returns {function(*): *}
|
|
141
|
+
*/
|
|
142
|
+
slotName(column) {
|
|
143
|
+
const name = column.prop.includes('.') ? column.prop.split('.').pop() : column.prop;
|
|
144
|
+
return Object.prototype.hasOwnProperty.call(column, 'scopedSlots') ? column.scopedSlots : name + 'Column';
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @name bindTableProps
|
|
149
|
+
* @return {{}}
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
bindTableProps() {
|
|
153
|
+
let props = {}
|
|
154
|
+
let $props = Object.assign({}, this.$attrs, this.$props);
|
|
155
|
+
Object.keys($props).map(key => {
|
|
156
|
+
if (Object.prototype.hasOwnProperty.call(TableProps, key)) {
|
|
157
|
+
props[key] = $props[key]
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
props.data = this.data;
|
|
161
|
+
return props
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @name bindTableColumnProps
|
|
166
|
+
* @param col
|
|
167
|
+
* @return Object
|
|
168
|
+
* @private
|
|
169
|
+
*/
|
|
170
|
+
bindTableColumnProps(col) {
|
|
171
|
+
return {
|
|
172
|
+
align: 'center',
|
|
173
|
+
minWidth: 120,
|
|
174
|
+
showOverflowTooltip: true,
|
|
175
|
+
...col,
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @name handlePaginationChange
|
|
181
|
+
* @param e
|
|
182
|
+
* @description 页码改变
|
|
183
|
+
* @private
|
|
184
|
+
*/
|
|
185
|
+
handlePaginationChange(e) {
|
|
186
|
+
this.$emit('change', {pagination: e})
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @name handlerRowClick
|
|
192
|
+
* @param row
|
|
193
|
+
* @param column
|
|
194
|
+
* @param event
|
|
195
|
+
* @description 当某一行被点击时会触发该事件
|
|
196
|
+
*/
|
|
197
|
+
handlerRowClick(row, column, event) {
|
|
198
|
+
this.radioVal = row
|
|
199
|
+
this.$emit('row-click', row, column, event)
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @name setCurrentRow
|
|
204
|
+
* @param row
|
|
205
|
+
* @desc 用于单选表格,设定某一行为选中行,如果调用时不加参数,则会取消目前高亮行的选中状态。
|
|
206
|
+
*/
|
|
207
|
+
setCurrentRow(row) {
|
|
208
|
+
this.radioVal = row
|
|
209
|
+
this.$refs.ElTable.setCurrentRow(row);
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @name toggleRowSelection
|
|
214
|
+
* @param row
|
|
215
|
+
* @param selected
|
|
216
|
+
* @desc 用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中)
|
|
217
|
+
*/
|
|
218
|
+
toggleRowSelection(row, selected) {
|
|
219
|
+
this.$refs.ElTable.toggleRowSelection(row, selected);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
</script>
|
|
224
|
+
<style lang="scss" scoped>
|
|
225
|
+
::v-deep {
|
|
226
|
+
.el-scrollbar__wrap {
|
|
227
|
+
overflow-x: hidden;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.el-radio {
|
|
231
|
+
margin-left: 6px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.el-radio .el-radio__label {
|
|
235
|
+
display: none;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
</style>
|
|
240
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EdTable通用属性
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* EdTable通用属性
|
|
6
|
+
*/
|
|
7
|
+
export const TableProps = {
|
|
8
|
+
// table 数据数组
|
|
9
|
+
data: {type: Array, default: () => []},
|
|
10
|
+
// 列的宽度是否自撑开
|
|
11
|
+
fit: {type: Boolean, default: true},
|
|
12
|
+
// table 高度
|
|
13
|
+
height: {type: [String, Number]},
|
|
14
|
+
// 是否带有纵向边框
|
|
15
|
+
border: {type: Boolean, default: true},
|
|
16
|
+
// Table 的尺寸 medium / small / mini
|
|
17
|
+
size: {type: String},
|
|
18
|
+
// 是否要高亮当前行
|
|
19
|
+
highlightCurrentRow: {type: Boolean, default: true},
|
|
20
|
+
// 是否为斑马纹 table
|
|
21
|
+
stripe: {type: Boolean, default: false},
|
|
22
|
+
// Table 的最大高度。合法的值为数字或者单位为 px 的高度。
|
|
23
|
+
maxHeight: {type: [String, Number]},
|
|
24
|
+
// 是否显示表头
|
|
25
|
+
showHeader: {type: Boolean, default: true},
|
|
26
|
+
// 当前行的 key,只写属性
|
|
27
|
+
currentRowKey: {type: [String, Number]},
|
|
28
|
+
// 行的 className 的回调方法,也可以使用字符串为所有行设置一个固定的 className。
|
|
29
|
+
rowClassName: { type: Function },
|
|
30
|
+
// 行的 style 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style。
|
|
31
|
+
rowStyle: { type: [Function, Object] },
|
|
32
|
+
// 单元格的 className 的回调方法,也可以使用字符串为所有单元格设置一个固定的 className。
|
|
33
|
+
cellClassName: { type: [Function, String] },
|
|
34
|
+
// 单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有单元格设置一样的 Style。
|
|
35
|
+
cellStyle: { type: [Function, Object] },
|
|
36
|
+
// 表头行的 className 的回调方法,也可以使用字符串为所有表头行设置一个固定的 className。
|
|
37
|
+
headerRowClassName: { type: [Function, String] },
|
|
38
|
+
// 表头行的 style 的回调方法,也可以使用一个固定的 Object 为所有表头行设置一样的 Style。
|
|
39
|
+
headerRowStyle: {type: [Function, Object]},
|
|
40
|
+
// 表头单元格的 className 的回调方法,也可以使用字符串为所有表头单元格设置一个固定的 className。
|
|
41
|
+
headerCellClassName: {type: [Function, String]},
|
|
42
|
+
// 表头单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有表头单元格设置一样的 Style。
|
|
43
|
+
headerCellStyle: {type: [Function, Object]},
|
|
44
|
+
// 行数据的 Key,用来优化 Table 的渲染;在使用 reserve-selection 功能与显示树形数据时,该属性是必填的。
|
|
45
|
+
rowKey: {type: [Function, String]},
|
|
46
|
+
// 空数据时显示的文本内容,也可以通过 slot="empty" 设置
|
|
47
|
+
emptyText: {type: String},
|
|
48
|
+
// 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效
|
|
49
|
+
defaultExpandAll: {type: Boolean, default: false},
|
|
50
|
+
// 可以通过该属性设置 Table 目前的展开行,需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。
|
|
51
|
+
expandRowKeys: { type: Array },
|
|
52
|
+
// 默认的排序列的 prop 和顺序。它的prop属性指定默认的排序的列,order指定默认排序的顺序
|
|
53
|
+
defaultSort: { type: Object },
|
|
54
|
+
// tooltip effect 属性 | dark/light
|
|
55
|
+
tooltipEffect: { type: String },
|
|
56
|
+
// 是否在表尾显示合计行
|
|
57
|
+
showSummary: {type: Boolean, default: false},
|
|
58
|
+
// 合计行第一列的文本
|
|
59
|
+
sumText: {type: String},
|
|
60
|
+
// 自定义的合计计算方法
|
|
61
|
+
summaryMethod: { type: Function },
|
|
62
|
+
// 合并行或列的计算方法
|
|
63
|
+
spanMethod: { type: Function },
|
|
64
|
+
// 在多选表格中,当仅有部分行被选中时,点击表头的多选框时的行为。若为 true,则选中所有行;若为 false,则取消选择所有行
|
|
65
|
+
selectOnIndeterminate: {type: Boolean, default: true},
|
|
66
|
+
// 展示树形数据时,树节点的缩进
|
|
67
|
+
indent: {type: Number, default: 16},
|
|
68
|
+
// 是否懒加载子节点数据
|
|
69
|
+
lazy: {type: Boolean, default: true},
|
|
70
|
+
// 加载子节点数据的函数,lazy 为 true 时生效,函数第二个参数包含了节点的层级信息
|
|
71
|
+
load: { type: Function },
|
|
72
|
+
// 渲染嵌套数据的配置选项
|
|
73
|
+
treeProps: {type: Object}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* EdTable组件属性
|
|
78
|
+
*/
|
|
79
|
+
export default {
|
|
80
|
+
// 是否显示操作区域
|
|
81
|
+
isOperate: {type: Boolean, default: true},
|
|
82
|
+
// 操作区域宽度
|
|
83
|
+
operateWidth: {type: [String, Number], default: 140},
|
|
84
|
+
// 对应列的类型 selection 多选 | index 索引值 | expand 可展开 | radio 单选
|
|
85
|
+
columnType: {type: String},
|
|
86
|
+
// 表格列的配置描述
|
|
87
|
+
columns: {type: Array, default: () => []},
|
|
88
|
+
// 分页数据
|
|
89
|
+
pagination: {type: [Boolean, Object]},
|
|
90
|
+
//加载进度
|
|
91
|
+
loading: {type: Boolean, default: true},
|
|
92
|
+
// 操作栏是否固定
|
|
93
|
+
operateFixed: {type: [Boolean, String], default: false},
|
|
94
|
+
|
|
95
|
+
// element table props
|
|
96
|
+
...TableProps
|
|
97
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import lodashGet from 'lodash/get'
|
|
2
|
+
import {isVNode} from "../../../../tools/utils";
|
|
3
|
+
export default {
|
|
4
|
+
props: {
|
|
5
|
+
scope: {
|
|
6
|
+
type: Object,
|
|
7
|
+
require: true
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
render(h, context) {
|
|
11
|
+
let {row, $index, column} = this.scope
|
|
12
|
+
let value = lodashGet(row, column.property)
|
|
13
|
+
if(value === undefined || value === null){
|
|
14
|
+
value = ""
|
|
15
|
+
}
|
|
16
|
+
if(column.formatter){
|
|
17
|
+
// 获取值
|
|
18
|
+
const VNode = column.formatter(row, column, value, $index)
|
|
19
|
+
return isVNode(this, VNode) ? VNode : h('span', VNode);
|
|
20
|
+
}else {
|
|
21
|
+
return h('span', value)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pagination">
|
|
3
|
+
<el-pagination :current-page="pagination.current"
|
|
4
|
+
:page-size="pagination.pageSize"
|
|
5
|
+
:page-sizes="pagination.pageSizes"
|
|
6
|
+
:total="pagination.total"
|
|
7
|
+
layout="total, sizes, prev, pager, next, jumper"
|
|
8
|
+
@size-change="handleSizeChange"
|
|
9
|
+
@current-change="handleCurrentChange"
|
|
10
|
+
@prev-click="handlePrevClick"
|
|
11
|
+
@next-click="handleNextClick"></el-pagination>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: "TablePagination",
|
|
18
|
+
data() {
|
|
19
|
+
return {}
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
pagination: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => {
|
|
25
|
+
return {
|
|
26
|
+
current: 1,
|
|
27
|
+
pageSize: 10,
|
|
28
|
+
total: 0,
|
|
29
|
+
pageSizes: [10, 20, 30]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
// pageSize 改变时会触发
|
|
36
|
+
handleSizeChange(e) {
|
|
37
|
+
this.pagination.pageSize = e
|
|
38
|
+
console.log(e)
|
|
39
|
+
this.$emit('update:pagination', this.pagination)
|
|
40
|
+
this.$emit('change', this.pagination)
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
// 页码
|
|
44
|
+
handleCurrentChange(e) {
|
|
45
|
+
this.pagination.current = e
|
|
46
|
+
this.$emit('update:pagination', this.pagination)
|
|
47
|
+
this.$emit('change', this.pagination)
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
// 上一页
|
|
51
|
+
handlePrevClick(e) {
|
|
52
|
+
console.log(e)
|
|
53
|
+
this.pagination.current = e
|
|
54
|
+
this.$emit('update:pagination', this.pagination)
|
|
55
|
+
this.$emit('change', this.pagination)
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
// 下一页
|
|
59
|
+
handleNextClick(e) {
|
|
60
|
+
this.pagination.current = e
|
|
61
|
+
this.$emit('update:pagination', this.pagination)
|
|
62
|
+
this.$emit('change', this.pagination)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style scoped>
|
|
69
|
+
.pagination {
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: flex-end;
|
|
72
|
+
}
|
|
73
|
+
</style>
|