olp-table 5.3.1 → 5.3.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/.env.build +1 -0
- package/README.md +26 -0
- package/babel.config.js +5 -0
- package/jsconfig.json +22 -0
- package/{olp-table.common.js → olp-table/olp-table.common.js} +5 -5
- package/{olp-table.umd.js → olp-table/olp-table.umd.js} +5 -5
- package/{olp-table.umd.min.js → olp-table/olp-table.umd.min.js} +3 -3
- package/package.json +92 -12
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/rmMode.bat +1 -0
- package/src/App.vue +199 -0
- package/src/api/crud.js +22 -0
- package/src/api/dist.js +6 -0
- package/src/assets/iconfont/iconfont.css +20 -0
- package/src/assets/iconfont/iconfont.json +16 -0
- package/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/assets/iconfont/iconfont.woff +0 -0
- package/src/assets/iconfont/iconfont.woff2 +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/auto-height/index.vue +75 -0
- package/src/components/codemirror-tag.vue +100 -0
- package/src/components/lazy-load-select.vue +107 -0
- package/src/components/ol-dialog-excel.vue +112 -0
- package/src/components/ol-dialog-import.vue +304 -0
- package/src/components/ol-dialog-json.vue +82 -0
- package/src/components/ol-dialog-table.vue +81 -0
- package/src/components/ol-dialog-upload-file.vue +208 -0
- package/src/components/ol-dict-tag.vue +271 -0
- package/src/components/ol-select-dom.vue +71 -0
- package/src/components/ol-table-filter.vue +28 -0
- package/src/components/ol-table-render.vue +44 -0
- package/src/components/ol-table-select.vue +150 -0
- package/src/components/pinia-init.vue +18 -0
- package/src/components/table/model/ModelMixins.js +43 -0
- package/src/components/table/model/model-index.vue +121 -0
- package/src/components/table/model/ot-left-right.vue +18 -0
- package/src/components/table/model/ot-left-tree-right-table.scss +14 -0
- package/src/components/table/model/ot-left-tree-right-table.vue +41 -0
- package/src/components/table/model/ot-top-1-bottom-2.vue +39 -0
- package/src/components/table/model/ot-top-2-bottom-1.vue +38 -0
- package/src/components/table/model/ot-top-2-bottom-2.vue +38 -0
- package/src/components/table/model/ot-top-bottom.vue +18 -0
- package/src/components/table/model/splitpanesModel.css +22 -0
- package/src/components/table/model/splitpanesModel.vue +54 -0
- package/src/components/table/ol-form/index.vue +537 -0
- package/src/components/table/ol-form-v3/index.vue +455 -0
- package/src/components/table/ol-main-form-sub-table/index.vue +601 -0
- package/src/components/table/ol-pager/index.vue +46 -0
- package/src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue +233 -0
- package/src/components/table/ol-table/components/ol-table-column-config/index.vue +145 -0
- package/src/components/table/ol-table/components/ol-table-column-dict-color/index.vue +88 -0
- package/src/components/table/ol-table/index.vue +232 -0
- package/src/components/table/ol-table-operate/index.vue +61 -0
- package/src/components/table/ol-table-search/index.vue +17 -0
- package/src/components/table/ol-table-tool-btn/index.vue +60 -0
- package/src/components/tree/components/o-tree.vue +289 -0
- package/src/components/tree/index.vue +46 -0
- package/src/components/v-component/index.vue +43 -0
- package/src/config/dev-config.js +5 -0
- package/src/config/prod-config.js +5 -0
- package/src/config/shared-config.js +20 -0
- package/src/data.js +9378 -0
- package/src/directives/permission/hasPermi.js +63 -0
- package/src/directives/permission/hasRole.js +30 -0
- package/src/main.js +55 -0
- package/src/mixins/VTMixin/DefaultMethods.js +749 -0
- package/src/mixins/VTMixin/OTMixinBody.js +105 -0
- package/src/mixins/VTMixin/OTMixinBodyFooter.js +93 -0
- package/src/mixins/VTMixin/OTMixinBodyMethods.js +420 -0
- package/src/mixins/VTMixin/OTMixinColumnMethod.js +450 -0
- package/src/mixins/VTMixin/OTMixinInitMethod.js +130 -0
- package/src/mixins/VTMixin/OTMixinPager.js +38 -0
- package/src/mixins/VTMixin/OTMixinSortable.js +43 -0
- package/src/mixins/VTMixin/index.js +18 -0
- package/src/package/index.js +20 -0
- package/src/plugins/axios.js +61 -0
- package/src/store/dict.js +76 -0
- package/src/store/dictType.js +52 -0
- package/src/store/permi.js +45 -0
- package/src/styles/common.scss +37 -0
- package/src/styles/index.scss +48 -0
- package/src/styles/theme.scss +32 -0
- package/src/utils/AESCRUDUtils.js +87 -0
- package/src/utils/DateUtils.js +35 -0
- package/src/utils/ExcelUtil.js +159 -0
- package/src/utils/TableSortUtil.js +91 -0
- package/src/utils/columnProp.js +3 -0
- package/src/utils/groupCompute.js +68 -0
- package/src/utils/http/httpFactory.js +92 -0
- package/src/utils/http/httpFactory2.js +79 -0
- package/src/utils/http/httpUtil.js +123 -0
- package/src/utils/http/httpUtils.js +38 -0
- package/src/utils/loadStyle.js +14 -0
- package/src/utils/message.js +56 -0
- package/src/utils/object.js +80 -0
- package/src/utils/security/TokenUtil.js +19 -0
- package/src/utils/tree.js +54 -0
- package/src/utils/util.js +127 -0
- package/src/views/Test/index.vue +77 -0
- package/src/views/Test/index2.vue +33 -0
- package/src/views/components/btn-config/index.vue +202 -0
- package/src/views/components/option-config/index.vue +192 -0
- package/src/views/db/chineseToEnglish.vue +127 -0
- package/src/views/db/filed.vue +395 -0
- package/src/views/db/index.vue +192 -0
- package/src/views/db/preview/index.vue +139 -0
- package/src/views/db/preview/left.vue +204 -0
- package/src/views/db/preview/right.vue +466 -0
- package/src/views/groupTable/index.vue +137 -0
- package/src/views/groupTable/ol-table-column-config/columnIndex.vue +194 -0
- package/src/views/groupTable/ol-table-column-config/index.vue +92 -0
- package/src/views/table/add-or-edit/config/base-config/index.vue +539 -0
- package/src/views/table/add-or-edit/config/base-config/table-form.vue +333 -0
- package/src/views/table/add-or-edit/config/column-config/header-config.vue +475 -0
- package/src/views/table/add-or-edit/config/column-config/index.vue +790 -0
- package/src/views/table/add-or-edit/config/data/column.js +218 -0
- package/src/views/table/add-or-edit/config/data/crud.js +122 -0
- package/src/views/table/add-or-edit/config/data/events.js +109 -0
- package/src/views/table/add-or-edit/config/data/method.js +127 -0
- package/src/views/table/add-or-edit/config/data/option.js +725 -0
- package/src/views/table/add-or-edit/config/data/page.js +79 -0
- package/src/views/table/add-or-edit/config/field-config/filed-config-table.vue +42 -0
- package/src/views/table/add-or-edit/config/field-config/index.vue +91 -0
- package/src/views/table/add-or-edit/config/form-config/index.vue +1179 -0
- package/src/views/table/add-or-edit/config/index.vue +376 -0
- package/src/views/table/add-or-edit/config/initFormObject.js +25 -0
- package/src/views/table/add-or-edit/config/script-config/LeftMeun.vue +71 -0
- package/src/views/table/add-or-edit/config/script-config/index.vue +70 -0
- package/src/views/table/add-or-edit/config/table-config/btn-config.vue +340 -0
- package/src/views/table/add-or-edit/config/table-config/btn-sort.vue +132 -0
- package/src/views/table/add-or-edit/config/table-config/index.vue +446 -0
- package/src/views/table/add-or-edit/configOld/dataTags/filed-config-table-model.vue +41 -0
- package/src/views/table/add-or-edit/configOld/dataTags/filed-config.vue +74 -0
- package/src/views/table/add-or-edit/configOld/dataTags/index.vue +439 -0
- package/src/views/table/add-or-edit/configOld/dataTags/set-table-sql.vue +79 -0
- package/src/views/table/add-or-edit/configOld/dataTags/table-on-config.vue +74 -0
- package/src/views/table/add-or-edit/configOld/index.vue +127 -0
- package/src/views/table/add-or-edit/configOld/tableTags/columnConfig.js +5 -0
- package/src/views/table/add-or-edit/configOld/tableTags/index.vue +353 -0
- package/src/views/table/add-or-edit/configOld/tableTags/operation-but-config.vue +75 -0
- package/src/views/table/add-or-edit/configOld/tableTags/tool-but-config.vue +92 -0
- package/src/views/table/add-or-edit/index.vue +201 -0
- package/src/views/table/add-or-edit/themeModel/index.vue +53 -0
- package/src/views/table/add-or-edit/themeModel/init-model-table.vue +48 -0
- package/src/views/table/add-or-edit/themeModel/init-model.vue +81 -0
- package/src/views/table/add-or-edit/themeModel/left-right.vue +24 -0
- package/src/views/table/add-or-edit/themeModel/left-tree-right-table.vue +75 -0
- package/src/views/table/add-or-edit/themeModel/olTableSearchModelMixins.js +42 -0
- package/src/views/table/add-or-edit/themeModel/splitpanesThemeModel.vue +49 -0
- package/src/views/table/add-or-edit/themeModel/top-1-bottom-2.vue +29 -0
- package/src/views/table/add-or-edit/themeModel/top-2-bottom-1.vue +32 -0
- package/src/views/table/add-or-edit/themeModel/top-2-bottom-2.vue +32 -0
- package/src/views/table/add-or-edit/themeModel/top-bottom.vue +14 -0
- package/src/views/table/index.vue +43 -0
- package/src/views/table/index2.vue +199 -0
- package/src/views/table/preview/index.vue +29 -0
- package/src/views/tree/components/config-core-data.vue +85 -0
- package/src/views/tree/components/config-core-table.vue +362 -0
- package/src/views/tree/components/config-core-tree/data/events.js +95 -0
- package/src/views/tree/components/config-core-tree/data/option.js +88 -0
- package/src/views/tree/components/config-core-tree/data/prop.js +28 -0
- package/src/views/tree/components/config-core-tree/index.vue +181 -0
- package/src/views/tree/components/config-core.vue +42 -0
- package/src/views/tree/components/form-config/index.vue +967 -0
- package/src/views/tree/index.vue +424 -0
- package/vue.config.js +44 -0
- /package/{demo.html → olp-table/demo.html} +0 -0
- /package/{fonts → olp-table/fonts}/iconfont.1720006583309.7e4906d9.woff +0 -0
- /package/{fonts → olp-table/fonts}/iconfont.1720006583309.947a27f0.ttf +0 -0
- /package/{olp-table.css → olp-table/olp-table.css} +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-Dialog v-model="show" :title="title" :width="600" show-footer>
|
|
3
|
+
<template #default>
|
|
4
|
+
<el-form :model="form" label-width="80px">
|
|
5
|
+
<el-form-item label="选择数据" prop="selectData" :span="24">
|
|
6
|
+
<olDictTag code="select_data" type="radio" border="true" v-model="form.selectData"/>
|
|
7
|
+
</el-form-item>
|
|
8
|
+
<el-form-item label="选择字段" prop="selectField" :span="24">
|
|
9
|
+
<vxe-grid style="width: 100%" ref='xGrid' v-bind="gridOptions"/>
|
|
10
|
+
</el-form-item>
|
|
11
|
+
</el-form>
|
|
12
|
+
</template>
|
|
13
|
+
<template #footer>
|
|
14
|
+
<vxe-button @click="cancelEvent">取消</vxe-button>
|
|
15
|
+
<vxe-button status="primary" @click="confirmEvent">立即导出</vxe-button>
|
|
16
|
+
</template>
|
|
17
|
+
</el-Dialog>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
import {get} from "@/utils/http/httpUtils";
|
|
21
|
+
import {getDateTime} from "@/utils/DateUtils";
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
name: 'olDialogExcel',
|
|
25
|
+
inject: ['http'],
|
|
26
|
+
props: {
|
|
27
|
+
title: {
|
|
28
|
+
default: '导出数据'
|
|
29
|
+
},
|
|
30
|
+
name: {
|
|
31
|
+
default: undefined
|
|
32
|
+
},
|
|
33
|
+
selectData: {
|
|
34
|
+
default: '1'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
gridOptions: {
|
|
40
|
+
border: true,
|
|
41
|
+
keepSource: true,
|
|
42
|
+
showOverflow: true,
|
|
43
|
+
loading: false,
|
|
44
|
+
height: 330,
|
|
45
|
+
align: 'left',
|
|
46
|
+
scrollX: {enabled: true, gt: 15},
|
|
47
|
+
scrollY: {enabled: true, gt: 0},
|
|
48
|
+
columnConfig: {
|
|
49
|
+
resizable: true
|
|
50
|
+
},
|
|
51
|
+
rowConfig: {
|
|
52
|
+
useKey: true,
|
|
53
|
+
keyField: 'id',
|
|
54
|
+
},
|
|
55
|
+
expandConfig: {
|
|
56
|
+
labelField: 'seq'
|
|
57
|
+
},
|
|
58
|
+
editConfig: {
|
|
59
|
+
trigger: 'click',
|
|
60
|
+
mode: 'row',
|
|
61
|
+
showStatus: true,
|
|
62
|
+
},
|
|
63
|
+
checkboxConfig: {
|
|
64
|
+
labelField: 'title',
|
|
65
|
+
reserve: true,
|
|
66
|
+
highlight: true,
|
|
67
|
+
range: true,
|
|
68
|
+
checkAll: true
|
|
69
|
+
},
|
|
70
|
+
columns: [
|
|
71
|
+
{
|
|
72
|
+
type: 'checkbox',
|
|
73
|
+
title: '全部字段',
|
|
74
|
+
// width: 330
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
toolbarConfig: {},
|
|
78
|
+
data: [],
|
|
79
|
+
url: '/online/tableConfigColumn/queryByParentId',
|
|
80
|
+
},
|
|
81
|
+
show: false,
|
|
82
|
+
form: {selectData: ''}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
methods: {
|
|
86
|
+
init(id) {
|
|
87
|
+
this.gridOptions.loading = true
|
|
88
|
+
get(this.http, this.gridOptions.url, {id: id}, true).then(res => {
|
|
89
|
+
this.gridOptions.data = res
|
|
90
|
+
this.gridOptions.loading = false
|
|
91
|
+
})
|
|
92
|
+
},
|
|
93
|
+
cancelEvent() {
|
|
94
|
+
this.show = false
|
|
95
|
+
},
|
|
96
|
+
confirmEvent() {
|
|
97
|
+
let columns = this.$refs.xGrid.getCheckboxRecords(true);
|
|
98
|
+
let exportParam = {
|
|
99
|
+
selectData: this.form.selectData,
|
|
100
|
+
columns: columns,
|
|
101
|
+
name: this.name || getDateTime(98)
|
|
102
|
+
}
|
|
103
|
+
this.$emit('emits', {m: 'exportData', v: {exportParam: exportParam, cancelEvent: this.cancelEvent}})
|
|
104
|
+
}, open({id, selectData}) {
|
|
105
|
+
this.form.selectData = selectData
|
|
106
|
+
this.show= true
|
|
107
|
+
this.init(id)
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
}
|
|
112
|
+
</script>
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-Dialog v-model="show" :title="title" :width="width" :center="center" :draggable="draggable" show-footer>
|
|
3
|
+
<template #default>
|
|
4
|
+
<el-form :model="formData" ref="formRef" label-width="80px" class="el-form-globals">
|
|
5
|
+
<el-row>
|
|
6
|
+
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
|
7
|
+
<div class="static-content-item">
|
|
8
|
+
<el-upload
|
|
9
|
+
ref="uploadRef"
|
|
10
|
+
:action="formData.action"
|
|
11
|
+
:headers="formData.headers"
|
|
12
|
+
:show-file-list="false"
|
|
13
|
+
:on-success="onChange"
|
|
14
|
+
>
|
|
15
|
+
<el-button>上传预览
|
|
16
|
+
<el-icon class="el-icon--right">
|
|
17
|
+
<Upload/>
|
|
18
|
+
</el-icon>
|
|
19
|
+
</el-button>
|
|
20
|
+
</el-upload>
|
|
21
|
+
</div>
|
|
22
|
+
</el-col>
|
|
23
|
+
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
|
24
|
+
<div class="static-content-item">
|
|
25
|
+
<el-button @click="submit">立即上传
|
|
26
|
+
<el-icon class="el-icon--right">
|
|
27
|
+
<Upload/>
|
|
28
|
+
</el-icon>
|
|
29
|
+
</el-button>
|
|
30
|
+
</div>
|
|
31
|
+
</el-col>
|
|
32
|
+
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
|
33
|
+
<div class="static-content-item">
|
|
34
|
+
<el-button @click="download">下载模板
|
|
35
|
+
<el-icon class="el-icon--right">
|
|
36
|
+
<Download/>
|
|
37
|
+
</el-icon>
|
|
38
|
+
</el-button>
|
|
39
|
+
</div>
|
|
40
|
+
</el-col>
|
|
41
|
+
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
|
42
|
+
<div class="static-content-item">
|
|
43
|
+
<el-button :disabled="formData.disabled" :class="formData.selected_but"
|
|
44
|
+
@click="batchRemove">批量删除
|
|
45
|
+
<el-icon class="el-icon--right">
|
|
46
|
+
<Delete/>
|
|
47
|
+
</el-icon>
|
|
48
|
+
</el-button>
|
|
49
|
+
</div>
|
|
50
|
+
</el-col>
|
|
51
|
+
<el-col :xs="24" :sm="8" :md="8" :lg="8">
|
|
52
|
+
<el-form-item label="校验唯一" prop="uniCode">
|
|
53
|
+
<el-select v-model="formData.uniCode" @change="handleChange" class="full-width-input" clearable>
|
|
54
|
+
<el-option v-for="(item, index) in gridOptions.columns.filter(o=>o.field)" :key="index"
|
|
55
|
+
:label="item.title"
|
|
56
|
+
:value="item.title" :disabled="item.disabled"></el-option>
|
|
57
|
+
</el-select>
|
|
58
|
+
</el-form-item>
|
|
59
|
+
</el-col>
|
|
60
|
+
</el-row>
|
|
61
|
+
<el-row>
|
|
62
|
+
<vxe-grid style="width: 100%" ref='xGrid' v-bind="gridOptions" @checkboxChange="selectRowChange"
|
|
63
|
+
@checkboxAll="selectRowChange"/>
|
|
64
|
+
</el-row>
|
|
65
|
+
</el-form>
|
|
66
|
+
</template>
|
|
67
|
+
<template #footer>
|
|
68
|
+
<vxe-button @click="close">关闭</vxe-button>
|
|
69
|
+
</template>
|
|
70
|
+
</el-Dialog>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script>
|
|
74
|
+
import {useMessage} from "@/utils/message";
|
|
75
|
+
import {get, request} from "@/utils/http/httpUtils";
|
|
76
|
+
import {exportExcel} from "@/utils/ExcelUtil";
|
|
77
|
+
import {storeDict} from "@/store/dict";
|
|
78
|
+
|
|
79
|
+
const dict = storeDict();
|
|
80
|
+
const message = useMessage() // 消息弹窗
|
|
81
|
+
export default {
|
|
82
|
+
name: 'olDialogImport',
|
|
83
|
+
inject: ['http'],
|
|
84
|
+
props: {
|
|
85
|
+
title: {
|
|
86
|
+
default: '导入数据'
|
|
87
|
+
},
|
|
88
|
+
name: {
|
|
89
|
+
default: '导入数据'
|
|
90
|
+
},
|
|
91
|
+
width: {
|
|
92
|
+
default: 800
|
|
93
|
+
},
|
|
94
|
+
draggable: {
|
|
95
|
+
default: true
|
|
96
|
+
},
|
|
97
|
+
center: {
|
|
98
|
+
default: false
|
|
99
|
+
},
|
|
100
|
+
selectData: {
|
|
101
|
+
default: '1'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
data() {
|
|
105
|
+
return {
|
|
106
|
+
form: {selectData: ''},
|
|
107
|
+
tableConfigId: '',
|
|
108
|
+
show: '',
|
|
109
|
+
formData: {},
|
|
110
|
+
gridOptions: {
|
|
111
|
+
border: true,
|
|
112
|
+
keepSource: true,
|
|
113
|
+
showOverflow: true,
|
|
114
|
+
loading: false,
|
|
115
|
+
height: 330,
|
|
116
|
+
align: 'left',
|
|
117
|
+
scrollX: {enabled: true, gt: 15},
|
|
118
|
+
scrollY: {enabled: true, gt: 0},
|
|
119
|
+
columnConfig: {
|
|
120
|
+
resizable: true
|
|
121
|
+
},
|
|
122
|
+
rowConfig: {
|
|
123
|
+
useKey: true,
|
|
124
|
+
keyField: 'id',
|
|
125
|
+
},
|
|
126
|
+
expandConfig: {
|
|
127
|
+
labelField: 'seq'
|
|
128
|
+
},
|
|
129
|
+
editConfig: {
|
|
130
|
+
trigger: 'click',
|
|
131
|
+
mode: 'row',
|
|
132
|
+
showStatus: true,
|
|
133
|
+
},
|
|
134
|
+
checkboxConfig: {
|
|
135
|
+
labelField: 'title',
|
|
136
|
+
reserve: true,
|
|
137
|
+
highlight: true,
|
|
138
|
+
range: true,
|
|
139
|
+
checkAll: false
|
|
140
|
+
},
|
|
141
|
+
columns: [],
|
|
142
|
+
data: [],
|
|
143
|
+
toolbarConfig: {},
|
|
144
|
+
initColumns: [
|
|
145
|
+
{type: 'checkbox', width: 50, fixed: 'left'},
|
|
146
|
+
{type: 'seq', title: '序号', width: 50, fixed: 'left'}
|
|
147
|
+
],
|
|
148
|
+
url: '/online/tableConfigColumn/queryByParentId',
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
methods: {
|
|
153
|
+
submit() {
|
|
154
|
+
if (!this.gridOptions.data || this.gridOptions.data.length == 0) return message.error('导入数据为空!')
|
|
155
|
+
let params = this.getParams();
|
|
156
|
+
this.gridOptions.loading = true
|
|
157
|
+
request(this.http, {
|
|
158
|
+
url: '/online/crud/batchSave',
|
|
159
|
+
method: 'post',
|
|
160
|
+
data: params,
|
|
161
|
+
timeout: 1000 * 90 * 90
|
|
162
|
+
}, false, false).then(({msg}) => {
|
|
163
|
+
message.success(msg)
|
|
164
|
+
}).finally(() => {
|
|
165
|
+
this.gridOptions.loading = false;
|
|
166
|
+
this.show = false
|
|
167
|
+
this.$emit('emits', {m: 'query'})
|
|
168
|
+
})
|
|
169
|
+
},
|
|
170
|
+
open({id}) {
|
|
171
|
+
this.show = true
|
|
172
|
+
this.tableConfigId = id
|
|
173
|
+
this.gridOptions.data = []
|
|
174
|
+
this.init(id)
|
|
175
|
+
},
|
|
176
|
+
handleChange(title) {
|
|
177
|
+
let que = [];
|
|
178
|
+
for (let j = 0; j < this.gridOptions.data.length; j++) {
|
|
179
|
+
let data = this.gridOptions.data[j];
|
|
180
|
+
if (j == 0) {
|
|
181
|
+
que.push(data[title])
|
|
182
|
+
break
|
|
183
|
+
}
|
|
184
|
+
let index = que.index0f(data[title]);
|
|
185
|
+
if (index != -1) {
|
|
186
|
+
return message.warn('第' + (j + 1) + '行-第' + (index + 1) + '行数据不唯-:' + data[title])
|
|
187
|
+
|
|
188
|
+
}
|
|
189
|
+
que.push(data[title])
|
|
190
|
+
}
|
|
191
|
+
message.success(title + '无重复数据!');
|
|
192
|
+
},
|
|
193
|
+
selectRowChange() {
|
|
194
|
+
this.formData.disabled = this.$refs.xGrid.getCheckboxRecords(true).length == 0
|
|
195
|
+
this.formData.selected_but = this.formData.disabled ? 'unselected_but' : 'selected_but'
|
|
196
|
+
},
|
|
197
|
+
batchRemove() {
|
|
198
|
+
let records = this.$refs.xGrid.getCheckboxRecords(true);
|
|
199
|
+
if (!records || records.length == 0) return message.error('未选中数据!')
|
|
200
|
+
this.$refs.xGrid.removeCheckboxRow()
|
|
201
|
+
},
|
|
202
|
+
getParams() {
|
|
203
|
+
return {
|
|
204
|
+
tableConfigId: this.tableConfigId,
|
|
205
|
+
columnAndValueListMap: this.getDataByDict(this.gridOptions.data)
|
|
206
|
+
}
|
|
207
|
+
}, onChange({data}) {
|
|
208
|
+
data = this.getDataByTitle(data)
|
|
209
|
+
this.gridOptions.data = data
|
|
210
|
+
},
|
|
211
|
+
getDataByTitle(data) {
|
|
212
|
+
if (data && data.length >= 1) {
|
|
213
|
+
let rows = []
|
|
214
|
+
data.map(row => {
|
|
215
|
+
let obj = {}
|
|
216
|
+
for (let key in row) {
|
|
217
|
+
this.gridOptions.columns.forEach((item) => {
|
|
218
|
+
if (item.title == key) {
|
|
219
|
+
obj[item.field] = row[key]
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
}
|
|
223
|
+
rows.push(obj)
|
|
224
|
+
})
|
|
225
|
+
return rows
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
getDataByDict(data) {
|
|
229
|
+
if (data && data.length >= 1) {
|
|
230
|
+
let rows = []
|
|
231
|
+
data.map(row => {
|
|
232
|
+
let obj = {}
|
|
233
|
+
for (let key in row) {
|
|
234
|
+
this.gridOptions.columns.forEach((item) => {
|
|
235
|
+
if (item.field == key) {
|
|
236
|
+
obj[item.field] = this.getRowValue(item.dictCode, row[key])
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
}
|
|
240
|
+
rows.push(obj)
|
|
241
|
+
})
|
|
242
|
+
return rows
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
download() {
|
|
246
|
+
exportExcel({
|
|
247
|
+
data: [],
|
|
248
|
+
name: '模板下载',
|
|
249
|
+
columns: this.gridOptions.columns,
|
|
250
|
+
option: {align: 'center'}
|
|
251
|
+
})
|
|
252
|
+
},
|
|
253
|
+
init(id) {
|
|
254
|
+
this.gridOptions.loading = true
|
|
255
|
+
get(this.http, this.gridOptions.url, {id: id}, true).then(res => {
|
|
256
|
+
for (const data of res) {
|
|
257
|
+
data.width = 100
|
|
258
|
+
}
|
|
259
|
+
res.push(...this.gridOptions.initColumns)
|
|
260
|
+
this.gridOptions.columns = res
|
|
261
|
+
this.gridOptions.loading = false
|
|
262
|
+
})
|
|
263
|
+
},
|
|
264
|
+
getRowValue(dictCode, val) {
|
|
265
|
+
if (dictCode) {
|
|
266
|
+
return this.getDictValueByCode(dictCode, val);
|
|
267
|
+
}
|
|
268
|
+
return val
|
|
269
|
+
},
|
|
270
|
+
getDictValueByCode(dictCode, val) {
|
|
271
|
+
for (const option of dict.val(dictCode)) {
|
|
272
|
+
if (option.label == val) {
|
|
273
|
+
return option
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return val
|
|
277
|
+
},
|
|
278
|
+
close() {
|
|
279
|
+
this.show = false
|
|
280
|
+
}
|
|
281
|
+
}, created() {
|
|
282
|
+
this.formData = {
|
|
283
|
+
action: this.http.axios().defaults.baseURL + '/online/crud/upload',
|
|
284
|
+
uniCode: '',
|
|
285
|
+
headers: this.http.axios().defaults.headers,
|
|
286
|
+
disabled: true,
|
|
287
|
+
selected_but: 'unselected_but'
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
</script>
|
|
292
|
+
<style lang="less" scoped>
|
|
293
|
+
.el-form-item__content {
|
|
294
|
+
display: flow;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.selected_but {
|
|
298
|
+
background-color: #f56c6c;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.unselected_but {
|
|
302
|
+
background-color: #fbcccc;
|
|
303
|
+
}
|
|
304
|
+
</style>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-dialog
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
width="500px"
|
|
6
|
+
v-model="show"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
:modal-append-to-body="false"
|
|
9
|
+
@open="onOpen"
|
|
10
|
+
@close="onClose"
|
|
11
|
+
>
|
|
12
|
+
<JsonViewer :style="{
|
|
13
|
+
minHeight: mainRowHeight,
|
|
14
|
+
maxHeight: mainRowHeight,
|
|
15
|
+
overflow: 'auto',
|
|
16
|
+
fontSize: `${fontSize}px`,
|
|
17
|
+
fontWeight: fontWeight,
|
|
18
|
+
}"
|
|
19
|
+
:boxed="false"
|
|
20
|
+
:sort="false"
|
|
21
|
+
:expanded="true"
|
|
22
|
+
:copyable="true"
|
|
23
|
+
:show-array-index="false"
|
|
24
|
+
:show-double-quotes="true"
|
|
25
|
+
expand-depth="20"
|
|
26
|
+
:value="values"/>
|
|
27
|
+
</el-dialog>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
// 引入组件
|
|
33
|
+
import JsonViewer from "vue-json-viewer";
|
|
34
|
+
import "vue-json-viewer/style.css";//引入插件样式
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: 'olDialogJson',
|
|
38
|
+
components: {
|
|
39
|
+
JsonViewer,
|
|
40
|
+
},
|
|
41
|
+
props: {
|
|
42
|
+
modelValue: {
|
|
43
|
+
required: false
|
|
44
|
+
},
|
|
45
|
+
item: {
|
|
46
|
+
required: false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
data() {
|
|
50
|
+
return {
|
|
51
|
+
show: true,
|
|
52
|
+
fontSize: '',
|
|
53
|
+
fontWeight: '',
|
|
54
|
+
mainRowHeight: '',
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
computed: {
|
|
58
|
+
values: {
|
|
59
|
+
get() {
|
|
60
|
+
return this.modelValue ? this.getJson(this.modelValue) : '';
|
|
61
|
+
},
|
|
62
|
+
set(value) {
|
|
63
|
+
this.$emit('update:modelValue', value);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
onOpen() {
|
|
69
|
+
|
|
70
|
+
},
|
|
71
|
+
onClose() {
|
|
72
|
+
|
|
73
|
+
},
|
|
74
|
+
getJson(val) {
|
|
75
|
+
if (typeof val === 'string') {
|
|
76
|
+
return JSON.parse(val);
|
|
77
|
+
}
|
|
78
|
+
return val;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog v-model="show" :title="title" :width="width" :fullscreen="fullscreen" top="5vh" show-footer append-to-body>
|
|
3
|
+
<div style="height: 75vh; overflow-y: auto;">
|
|
4
|
+
<!--表单开始-->
|
|
5
|
+
<!-- <el-scrollbar class="content-wrapper">-->
|
|
6
|
+
<model-index ref="table" v-if="show && uuid" :http="https" :uuid="uuid" style="height: calc(100% - 50px)"/>
|
|
7
|
+
<!-- </el-scrollbar>-->
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
<template #footer>
|
|
11
|
+
<vxe-button @click="cancelEvent">取消</vxe-button>
|
|
12
|
+
<vxe-button status="primary" @click="ok">确认</vxe-button>
|
|
13
|
+
</template>
|
|
14
|
+
</el-dialog>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
|
|
18
|
+
import ModelIndex from "@/components/table/model/model-index.vue";
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'olDialogTable',
|
|
22
|
+
components: {ModelIndex},
|
|
23
|
+
inject: ['http'],
|
|
24
|
+
props: {
|
|
25
|
+
name: {
|
|
26
|
+
default: undefined
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
title: undefined,
|
|
32
|
+
show: false,
|
|
33
|
+
uuid: undefined,
|
|
34
|
+
fullscreen: false,
|
|
35
|
+
width: '80%',
|
|
36
|
+
js: undefined,
|
|
37
|
+
style: 'height:70vh',
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
computed: {
|
|
41
|
+
https() {
|
|
42
|
+
return this.http;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
init({uuid, title, width, height,fullscreen,js}) {
|
|
47
|
+
this.show = true
|
|
48
|
+
this.uuid = uuid;
|
|
49
|
+
this.js = js;
|
|
50
|
+
if (width) {
|
|
51
|
+
this.width = width;
|
|
52
|
+
}
|
|
53
|
+
this.title = title;
|
|
54
|
+
this.fullscreen = fullscreen == true;
|
|
55
|
+
if (height) {
|
|
56
|
+
this.style = 'height:' + height + "px";
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
ok() {
|
|
60
|
+
this.$emit('emits',{js:this.js,v:this.$refs.table.$refs.tableModel.getSelectRows()});
|
|
61
|
+
},
|
|
62
|
+
cancelEvent() {
|
|
63
|
+
this.show = false
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
<style scoped>
|
|
69
|
+
.content-wrapper {
|
|
70
|
+
max-height: 60vh;
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
padding-right: 12px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:deep(.content-wrapper)::-webkit-scrollbar {
|
|
76
|
+
width: 6px;
|
|
77
|
+
}
|
|
78
|
+
/deep/ .el-dialog__body {
|
|
79
|
+
max-height: calc(100vh - 200px);
|
|
80
|
+
}
|
|
81
|
+
</style>
|