olp-table 5.3.0 → 5.3.1
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/package.json +12 -81
- package/.env.build +0 -1
- package/README.md +0 -26
- package/babel.config.js +0 -5
- package/jsconfig.json +0 -22
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
- package/rmMode.bat +0 -1
- package/src/App.vue +0 -199
- package/src/api/crud.js +0 -22
- package/src/api/dist.js +0 -6
- package/src/assets/iconfont/iconfont.css +0 -20
- package/src/assets/iconfont/iconfont.json +0 -16
- 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 +0 -75
- package/src/components/codemirror-tag.vue +0 -100
- package/src/components/lazy-load-select.vue +0 -107
- package/src/components/ol-dialog-excel.vue +0 -112
- package/src/components/ol-dialog-import.vue +0 -304
- package/src/components/ol-dialog-json.vue +0 -82
- package/src/components/ol-dialog-table.vue +0 -81
- package/src/components/ol-dialog-upload-file.vue +0 -208
- package/src/components/ol-dict-tag.vue +0 -271
- package/src/components/ol-select-dom.vue +0 -71
- package/src/components/ol-table-filter.vue +0 -28
- package/src/components/ol-table-render.vue +0 -44
- package/src/components/ol-table-select.vue +0 -150
- package/src/components/pinia-init.vue +0 -18
- package/src/components/table/model/ModelMixins.js +0 -43
- package/src/components/table/model/model-index.vue +0 -121
- package/src/components/table/model/ot-left-right.vue +0 -18
- package/src/components/table/model/ot-left-tree-right-table.scss +0 -14
- package/src/components/table/model/ot-left-tree-right-table.vue +0 -41
- package/src/components/table/model/ot-top-1-bottom-2.vue +0 -39
- package/src/components/table/model/ot-top-2-bottom-1.vue +0 -38
- package/src/components/table/model/ot-top-2-bottom-2.vue +0 -38
- package/src/components/table/model/ot-top-bottom.vue +0 -18
- package/src/components/table/model/splitpanesModel.css +0 -22
- package/src/components/table/model/splitpanesModel.vue +0 -54
- package/src/components/table/ol-form/index.vue +0 -537
- package/src/components/table/ol-form-v3/index.vue +0 -455
- package/src/components/table/ol-main-form-sub-table/index.vue +0 -601
- package/src/components/table/ol-pager/index.vue +0 -46
- package/src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue +0 -233
- package/src/components/table/ol-table/components/ol-table-column-config/index.vue +0 -145
- package/src/components/table/ol-table/components/ol-table-column-dict-color/index.vue +0 -88
- package/src/components/table/ol-table/index.vue +0 -232
- package/src/components/table/ol-table-operate/index.vue +0 -61
- package/src/components/table/ol-table-search/index.vue +0 -17
- package/src/components/table/ol-table-tool-btn/index.vue +0 -60
- package/src/components/tree/components/o-tree.vue +0 -289
- package/src/components/tree/index.vue +0 -46
- package/src/components/v-component/index.vue +0 -43
- package/src/config/dev-config.js +0 -5
- package/src/config/prod-config.js +0 -5
- package/src/config/shared-config.js +0 -20
- package/src/data.js +0 -9378
- package/src/directives/permission/hasPermi.js +0 -63
- package/src/directives/permission/hasRole.js +0 -30
- package/src/main.js +0 -55
- package/src/mixins/VTMixin/DefaultMethods.js +0 -749
- package/src/mixins/VTMixin/OTMixinBody.js +0 -105
- package/src/mixins/VTMixin/OTMixinBodyFooter.js +0 -93
- package/src/mixins/VTMixin/OTMixinBodyMethods.js +0 -420
- package/src/mixins/VTMixin/OTMixinColumnMethod.js +0 -450
- package/src/mixins/VTMixin/OTMixinInitMethod.js +0 -130
- package/src/mixins/VTMixin/OTMixinPager.js +0 -38
- package/src/mixins/VTMixin/OTMixinSortable.js +0 -43
- package/src/mixins/VTMixin/index.js +0 -18
- package/src/package/index.js +0 -20
- package/src/plugins/axios.js +0 -61
- package/src/store/dict.js +0 -76
- package/src/store/dictType.js +0 -52
- package/src/store/permi.js +0 -45
- package/src/styles/common.scss +0 -37
- package/src/styles/index.scss +0 -48
- package/src/styles/theme.scss +0 -32
- package/src/utils/AESCRUDUtils.js +0 -87
- package/src/utils/DateUtils.js +0 -35
- package/src/utils/ExcelUtil.js +0 -159
- package/src/utils/TableSortUtil.js +0 -91
- package/src/utils/columnProp.js +0 -3
- package/src/utils/groupCompute.js +0 -68
- package/src/utils/http/httpFactory.js +0 -92
- package/src/utils/http/httpFactory2.js +0 -79
- package/src/utils/http/httpUtil.js +0 -123
- package/src/utils/http/httpUtils.js +0 -38
- package/src/utils/loadStyle.js +0 -14
- package/src/utils/message.js +0 -56
- package/src/utils/object.js +0 -80
- package/src/utils/security/TokenUtil.js +0 -19
- package/src/utils/tree.js +0 -54
- package/src/utils/util.js +0 -127
- package/src/views/Test/index.vue +0 -77
- package/src/views/Test/index2.vue +0 -33
- package/src/views/components/btn-config/index.vue +0 -202
- package/src/views/components/option-config/index.vue +0 -192
- package/src/views/db/chineseToEnglish.vue +0 -127
- package/src/views/db/filed.vue +0 -395
- package/src/views/db/index.vue +0 -192
- package/src/views/db/preview/index.vue +0 -139
- package/src/views/db/preview/left.vue +0 -204
- package/src/views/db/preview/right.vue +0 -466
- package/src/views/groupTable/index.vue +0 -137
- package/src/views/groupTable/ol-table-column-config/columnIndex.vue +0 -194
- package/src/views/groupTable/ol-table-column-config/index.vue +0 -92
- package/src/views/table/add-or-edit/config/base-config/index.vue +0 -539
- package/src/views/table/add-or-edit/config/base-config/table-form.vue +0 -333
- package/src/views/table/add-or-edit/config/column-config/header-config.vue +0 -475
- package/src/views/table/add-or-edit/config/column-config/index.vue +0 -790
- package/src/views/table/add-or-edit/config/data/column.js +0 -218
- package/src/views/table/add-or-edit/config/data/crud.js +0 -122
- package/src/views/table/add-or-edit/config/data/events.js +0 -109
- package/src/views/table/add-or-edit/config/data/method.js +0 -127
- package/src/views/table/add-or-edit/config/data/option.js +0 -725
- package/src/views/table/add-or-edit/config/data/page.js +0 -79
- package/src/views/table/add-or-edit/config/field-config/filed-config-table.vue +0 -42
- package/src/views/table/add-or-edit/config/field-config/index.vue +0 -91
- package/src/views/table/add-or-edit/config/form-config/index.vue +0 -1179
- package/src/views/table/add-or-edit/config/index.vue +0 -376
- package/src/views/table/add-or-edit/config/initFormObject.js +0 -25
- package/src/views/table/add-or-edit/config/script-config/LeftMeun.vue +0 -71
- package/src/views/table/add-or-edit/config/script-config/index.vue +0 -70
- package/src/views/table/add-or-edit/config/table-config/btn-config.vue +0 -340
- package/src/views/table/add-or-edit/config/table-config/btn-sort.vue +0 -132
- package/src/views/table/add-or-edit/config/table-config/index.vue +0 -446
- package/src/views/table/add-or-edit/configOld/dataTags/filed-config-table-model.vue +0 -41
- package/src/views/table/add-or-edit/configOld/dataTags/filed-config.vue +0 -74
- package/src/views/table/add-or-edit/configOld/dataTags/index.vue +0 -439
- package/src/views/table/add-or-edit/configOld/dataTags/set-table-sql.vue +0 -79
- package/src/views/table/add-or-edit/configOld/dataTags/table-on-config.vue +0 -74
- package/src/views/table/add-or-edit/configOld/index.vue +0 -127
- package/src/views/table/add-or-edit/configOld/tableTags/columnConfig.js +0 -5
- package/src/views/table/add-or-edit/configOld/tableTags/index.vue +0 -353
- package/src/views/table/add-or-edit/configOld/tableTags/operation-but-config.vue +0 -75
- package/src/views/table/add-or-edit/configOld/tableTags/tool-but-config.vue +0 -92
- package/src/views/table/add-or-edit/index.vue +0 -201
- package/src/views/table/add-or-edit/themeModel/index.vue +0 -53
- package/src/views/table/add-or-edit/themeModel/init-model-table.vue +0 -48
- package/src/views/table/add-or-edit/themeModel/init-model.vue +0 -81
- package/src/views/table/add-or-edit/themeModel/left-right.vue +0 -24
- package/src/views/table/add-or-edit/themeModel/left-tree-right-table.vue +0 -75
- package/src/views/table/add-or-edit/themeModel/olTableSearchModelMixins.js +0 -42
- package/src/views/table/add-or-edit/themeModel/splitpanesThemeModel.vue +0 -49
- package/src/views/table/add-or-edit/themeModel/top-1-bottom-2.vue +0 -29
- package/src/views/table/add-or-edit/themeModel/top-2-bottom-1.vue +0 -32
- package/src/views/table/add-or-edit/themeModel/top-2-bottom-2.vue +0 -32
- package/src/views/table/add-or-edit/themeModel/top-bottom.vue +0 -14
- package/src/views/table/index.vue +0 -43
- package/src/views/table/index2.vue +0 -199
- package/src/views/table/preview/index.vue +0 -29
- package/src/views/tree/components/config-core-data.vue +0 -85
- package/src/views/tree/components/config-core-table.vue +0 -362
- package/src/views/tree/components/config-core-tree/data/events.js +0 -95
- package/src/views/tree/components/config-core-tree/data/option.js +0 -88
- package/src/views/tree/components/config-core-tree/data/prop.js +0 -28
- package/src/views/tree/components/config-core-tree/index.vue +0 -181
- package/src/views/tree/components/config-core.vue +0 -42
- package/src/views/tree/components/form-config/index.vue +0 -967
- package/src/views/tree/index.vue +0 -424
- package/vue.config.js +0 -44
- /package/{olp-table/demo.html → demo.html} +0 -0
- /package/{olp-table/fonts → fonts}/iconfont.1720006583309.7e4906d9.woff +0 -0
- /package/{olp-table/fonts → fonts}/iconfont.1720006583309.947a27f0.ttf +0 -0
- /package/{olp-table/olp-table.common.js → olp-table.common.js} +0 -0
- /package/{olp-table/olp-table.css → olp-table.css} +0 -0
- /package/{olp-table/olp-table.umd.js → olp-table.umd.js} +0 -0
- /package/{olp-table/olp-table.umd.min.js → olp-table.umd.min.js} +0 -0
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog v-model="show" :title="title"
|
|
3
|
-
:width="800" show-footer @close="close">
|
|
4
|
-
<template #default>
|
|
5
|
-
<div v-loading="loading">
|
|
6
|
-
<el-upload
|
|
7
|
-
ref="uploadRef"
|
|
8
|
-
v-model:file-list="fileList"
|
|
9
|
-
:multiple="multiple"
|
|
10
|
-
:on-change="onchange"
|
|
11
|
-
:auto-upload="false">
|
|
12
|
-
<template #trigger>
|
|
13
|
-
<el-button type="primary" ref="selectFiles">选择文件</el-button>
|
|
14
|
-
</template>
|
|
15
|
-
<template #tip>
|
|
16
|
-
<div class="el-upload__tip">
|
|
17
|
-
当前文件:<span style="color: red">{{ fileList.length }}个</span>
|
|
18
|
-
,已成功上传:<span style="color: green">{{ okIndex }}个</span>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
<template #file="{file}">
|
|
22
|
-
<div style="padding: 6px;font-size: 15px;border-bottom:1px solid #caced0">
|
|
23
|
-
{{ file.name }}
|
|
24
|
-
<span style="float: right">
|
|
25
|
-
{{ file.percentCompleted ? file.percentCompleted : '未上传' }}
|
|
26
|
-
<el-button type="primary" size="small" @click="uploadFile(getFile(file.uid))">上传</el-button>
|
|
27
|
-
<el-button type="danger" size="small" @click="fileList.splice(getFile(file.uid),1)"
|
|
28
|
-
v-if="file.percentCompleted == '上传失败'">删除</el-button>
|
|
29
|
-
<el-tooltip
|
|
30
|
-
class="box-item"
|
|
31
|
-
effect="dark"
|
|
32
|
-
:content="file.message"
|
|
33
|
-
placement="right"
|
|
34
|
-
>
|
|
35
|
-
<el-button v-if="file.message" size="small">原因</el-button>
|
|
36
|
-
</el-tooltip>
|
|
37
|
-
</span>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
</el-upload>
|
|
41
|
-
</div>
|
|
42
|
-
</template>
|
|
43
|
-
<template #footer>
|
|
44
|
-
<el-button @click="close">返回</el-button>
|
|
45
|
-
<el-button type="primary" @click="uploadFile" :loading="loading">全部上传</el-button>
|
|
46
|
-
</template>
|
|
47
|
-
</el-dialog>
|
|
48
|
-
</template>
|
|
49
|
-
|
|
50
|
-
<script>
|
|
51
|
-
|
|
52
|
-
import {upload} from "@/utils/http/httpUtils";
|
|
53
|
-
import {useMessage} from "@/utils/message";
|
|
54
|
-
|
|
55
|
-
export default {
|
|
56
|
-
name: 'olDialogUploadFile',
|
|
57
|
-
inject: ['http'],
|
|
58
|
-
data() {
|
|
59
|
-
return {
|
|
60
|
-
title: '上传文件',
|
|
61
|
-
show: false,
|
|
62
|
-
fileList: [],
|
|
63
|
-
okIndex: 0,
|
|
64
|
-
multiple: true,
|
|
65
|
-
loading: true,
|
|
66
|
-
url: '',
|
|
67
|
-
autoClose: false,
|
|
68
|
-
query: false,
|
|
69
|
-
js: '',
|
|
70
|
-
okFileInfos: [],
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
methods: {
|
|
74
|
-
getFile(uid) {
|
|
75
|
-
for (let i = 0; i < this.fileList.length; i++) {
|
|
76
|
-
if (this.fileList[i].uid == uid) {
|
|
77
|
-
return i;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
onchange(file, fileList) {
|
|
82
|
-
this.fileList = fileList;
|
|
83
|
-
if (this.multiple == false) {
|
|
84
|
-
this.uploadFile();
|
|
85
|
-
} else {
|
|
86
|
-
this.loading = false;
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
async uploadFile(index) {
|
|
90
|
-
if (this.fileList.length == 0) {
|
|
91
|
-
useMessage().error("请选择文件!");
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
let length = this.fileList.length;
|
|
95
|
-
let i = 0;
|
|
96
|
-
let thIndex = index == undefined || typeof index !== 'number' ? 0 : index;
|
|
97
|
-
console.info("thIndex", thIndex);
|
|
98
|
-
this.loading = true;
|
|
99
|
-
while (i < length) {
|
|
100
|
-
let file = this.fileList[thIndex];
|
|
101
|
-
console.info(file.name + "上传中...", file);
|
|
102
|
-
file.percentCompleted = 0;
|
|
103
|
-
const formData = new FormData();
|
|
104
|
-
formData.append('files', file.raw);
|
|
105
|
-
//调用文件上传接口
|
|
106
|
-
await upload(this.http, this.url, formData, progressEvent => {
|
|
107
|
-
const percentCompleted = Math.round((progressEvent.loaded * 100) /
|
|
108
|
-
progressEvent.total)
|
|
109
|
-
file.percentCompleted = percentCompleted + "%";
|
|
110
|
-
}).then(({code, msg, data}) => {
|
|
111
|
-
if (code === 200 || code === 0) {
|
|
112
|
-
this.okFileInfos.push(
|
|
113
|
-
{
|
|
114
|
-
name: file.name,
|
|
115
|
-
path: data?.path,
|
|
116
|
-
configId: data?.configId,
|
|
117
|
-
suffix:this.getFileExtension(file.name)
|
|
118
|
-
});
|
|
119
|
-
this.okIndex++;
|
|
120
|
-
this.fileList.splice(thIndex, 1)
|
|
121
|
-
} else {
|
|
122
|
-
file.percentCompleted = "上传失败";
|
|
123
|
-
file.message = msg;
|
|
124
|
-
thIndex++;
|
|
125
|
-
}
|
|
126
|
-
}).catch(error => {
|
|
127
|
-
thIndex++;
|
|
128
|
-
// 上传失败处理逻辑
|
|
129
|
-
console.error('上传失败', error);
|
|
130
|
-
});
|
|
131
|
-
// if (index != undefined) {
|
|
132
|
-
// break
|
|
133
|
-
// }
|
|
134
|
-
i++;
|
|
135
|
-
}
|
|
136
|
-
this.loading = false;
|
|
137
|
-
if (this.okIndex === 0) {
|
|
138
|
-
useMessage().error("上传失败!")
|
|
139
|
-
} else {
|
|
140
|
-
// console.info('上传成功文件:', this.okFileInfos);
|
|
141
|
-
useMessage().success("上传成功!")
|
|
142
|
-
if (this.autoClose || this.multiple == false) {
|
|
143
|
-
this.close();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
getFileExtension(filename) {
|
|
148
|
-
// 检查字符串是否有效
|
|
149
|
-
if (typeof filename !== 'string') {
|
|
150
|
-
return '';
|
|
151
|
-
}
|
|
152
|
-
// 使用 lastIndexOf 和 substring 方法提取后缀
|
|
153
|
-
const lastDotIndex = filename.lastIndexOf('.');
|
|
154
|
-
// 如果找不到点,返回空字符串,表示没有后缀
|
|
155
|
-
if (lastDotIndex === -1) {
|
|
156
|
-
return '';
|
|
157
|
-
}
|
|
158
|
-
// 提取并返回后缀名(不包括点)
|
|
159
|
-
return filename.substring(lastDotIndex + 1);
|
|
160
|
-
},
|
|
161
|
-
close() {
|
|
162
|
-
let args = {
|
|
163
|
-
js: this.js,
|
|
164
|
-
v: this.okFileInfos,
|
|
165
|
-
}
|
|
166
|
-
if (this.okIndex !== 0 && this.query) {
|
|
167
|
-
args.m = 'query'
|
|
168
|
-
}
|
|
169
|
-
// console.info("关闭上传文件窗口!!!!!!!!", args);
|
|
170
|
-
this.$emit("emits", args);
|
|
171
|
-
|
|
172
|
-
this.show = false;
|
|
173
|
-
},
|
|
174
|
-
init(obj) {
|
|
175
|
-
this.okFileInfos = [];
|
|
176
|
-
this.fileList = [];
|
|
177
|
-
this.okIndex = 0;
|
|
178
|
-
let {url, title, autoClose, multiple, query, js} = obj;
|
|
179
|
-
if (!url) {
|
|
180
|
-
url = obj;
|
|
181
|
-
}
|
|
182
|
-
if (!url) {
|
|
183
|
-
useMessage().error("请填写上传文件url!");
|
|
184
|
-
return
|
|
185
|
-
}
|
|
186
|
-
this.query = query != false;
|
|
187
|
-
this.js = js;
|
|
188
|
-
this.show = true;
|
|
189
|
-
this.url = url;
|
|
190
|
-
this.title = title ? title : this.title;
|
|
191
|
-
this.autoClose = autoClose != undefined ? autoClose : this.autoClose;
|
|
192
|
-
this.multiple = multiple != undefined ? multiple : this.multiple;
|
|
193
|
-
this.$nextTick(() => {
|
|
194
|
-
this.$refs.selectFiles.$el.click();
|
|
195
|
-
setTimeout(() => {
|
|
196
|
-
this.loading = false;
|
|
197
|
-
}, 300)
|
|
198
|
-
})
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
</script>
|
|
203
|
-
<style lang="less" scoped>
|
|
204
|
-
/deep/ .el-upload-list {
|
|
205
|
-
overflow-x: auto;
|
|
206
|
-
height: 300px;
|
|
207
|
-
}
|
|
208
|
-
</style>
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-radio-group v-model="value" @change="change" v-if="props.type == 'radio'">
|
|
3
|
-
<el-radio v-for="item in options" :label="item[props.label]" :value-key="props.value"
|
|
4
|
-
:value="item[props.value]" :border="props.border">{{ item.label }}
|
|
5
|
-
</el-radio>
|
|
6
|
-
</el-radio-group>
|
|
7
|
-
<el-checkbox-group v-model="value" @change="change" v-else-if="props.type == 'checkbox'">
|
|
8
|
-
<el-checkbox v-for="item in options" :label="item[props.label]" :value-key="props.value"
|
|
9
|
-
:value="item[props.value]" :border="props.border">{{ item.label }}
|
|
10
|
-
</el-checkbox>
|
|
11
|
-
</el-checkbox-group>
|
|
12
|
-
<el-select ref="dictTag" v-else v-model="value" :placeholder="placeholder"
|
|
13
|
-
:clearable="props.clearable"
|
|
14
|
-
v-bind="$attrs"
|
|
15
|
-
:loading="loading"
|
|
16
|
-
@clear="clear"
|
|
17
|
-
@change="change"
|
|
18
|
-
@visible-change="visibleChange"
|
|
19
|
-
:filter-method="filterMethod"
|
|
20
|
-
filterable>
|
|
21
|
-
<el-option v-for="item in options" :label="item[props.label]" :value-key="props.value"
|
|
22
|
-
:value="item[props.value]"></el-option>
|
|
23
|
-
</el-select>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script scope setup>
|
|
27
|
-
import {nextTick, ref, defineProps, defineEmits, onMounted, defineExpose, watch, inject} from 'vue'
|
|
28
|
-
|
|
29
|
-
import {storeDictType} from "@/store/dictType";
|
|
30
|
-
import {storeDict} from "@/store/dict";
|
|
31
|
-
import {initDictTag} from "@/api/dist";
|
|
32
|
-
|
|
33
|
-
const http = inject("http")
|
|
34
|
-
const dict = storeDict();
|
|
35
|
-
const dictType = storeDictType();
|
|
36
|
-
const props = defineProps({
|
|
37
|
-
border: {default: false, type: Boolean},
|
|
38
|
-
type: {default: 'select'},
|
|
39
|
-
code: {},
|
|
40
|
-
like: {},
|
|
41
|
-
placeholder: {default: '可搜索'},
|
|
42
|
-
clearable: {default: true, type: Boolean},
|
|
43
|
-
modelValue: {required: true},
|
|
44
|
-
dictType: {default: false, type: Boolean},
|
|
45
|
-
label: {default: 'dictLabel'},
|
|
46
|
-
value: {default: 'dictValue'},
|
|
47
|
-
orderBy: {default: undefined, type: Array},
|
|
48
|
-
groupBy: {default: undefined, type: Array},
|
|
49
|
-
whereAnd: {default: []},
|
|
50
|
-
whereOr: {default: []},
|
|
51
|
-
//[{String key:''value:'',type:''}]//type 查询类型 默认等于1--> 1:= 2:!= 3: > 4:< 5: >= 6: <= 7:like '%value' 8:like '%value%' 9:like 'value%'
|
|
52
|
-
disabledInit: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
required: false,
|
|
55
|
-
default: false
|
|
56
|
-
},
|
|
57
|
-
data: {default: []}
|
|
58
|
-
})
|
|
59
|
-
const loading = ref(false)
|
|
60
|
-
const ex = ref(0)
|
|
61
|
-
const value = ref(undefined)
|
|
62
|
-
watch(() => props.modelValue, () => {
|
|
63
|
-
if (props.type == 'checkbox') {
|
|
64
|
-
value.value = Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue + '']
|
|
65
|
-
} else {
|
|
66
|
-
value.value = props.modelValue + ''
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
deep: true // 开启深度监听
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
const getValue = () => {
|
|
73
|
-
if (!props.modelValue) {
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
if (props.type == 'checkbox') {
|
|
77
|
-
return Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue + '']
|
|
78
|
-
} else {
|
|
79
|
-
return props.modelValue + ''
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const options = ref([]);
|
|
84
|
-
let optionsBk = ref([]);
|
|
85
|
-
const isDictTable = ref(false);
|
|
86
|
-
onMounted(() => {
|
|
87
|
-
dict.init(http)
|
|
88
|
-
dictType.init(http)
|
|
89
|
-
if (!props.disabledInit) {
|
|
90
|
-
nextTick(() => {
|
|
91
|
-
init();
|
|
92
|
-
value.value = getValue()
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
function doFilterMethod(o) {
|
|
98
|
-
if (optionsBk.value.length == 0) {
|
|
99
|
-
optionsBk.value = options.value;
|
|
100
|
-
}
|
|
101
|
-
let data = optionsBk.value.filter(option =>
|
|
102
|
-
option[props.label].toLowerCase().includes(o ? o.trim().toLowerCase() : '')
|
|
103
|
-
);
|
|
104
|
-
options.value = data;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function getParameter(valueData) {
|
|
108
|
-
let code = props.code.split(",");
|
|
109
|
-
let whereAnd = JSON.parse(JSON.stringify(props.whereAnd));
|
|
110
|
-
let whereOr = JSON.parse(JSON.stringify(props.whereOr));
|
|
111
|
-
let parameter = {
|
|
112
|
-
dbName: code[0],
|
|
113
|
-
tableName: code[1],
|
|
114
|
-
label: code[2],
|
|
115
|
-
value: code[3],
|
|
116
|
-
orderByStr: props.orderBy,
|
|
117
|
-
groupBy: props.groupBy,
|
|
118
|
-
whereAnd: whereAnd,
|
|
119
|
-
whereOr: whereOr
|
|
120
|
-
}
|
|
121
|
-
if (valueData) {
|
|
122
|
-
loading.value = true
|
|
123
|
-
initDictTag(http, parameter).then(data => {
|
|
124
|
-
options.value = data;
|
|
125
|
-
let existValue = data.map(item => item[props.value]);
|
|
126
|
-
let initValue = [];
|
|
127
|
-
if (props.modelValue instanceof Array) {
|
|
128
|
-
for (const modelValue of props.modelValue) {
|
|
129
|
-
if (modelValue != undefined && existValue.indexOf(modelValue) == -1) {
|
|
130
|
-
initValue.push(modelValue)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
} else {
|
|
134
|
-
if (props.modelValue != undefined && existValue.indexOf(props.modelValue) == -1) {
|
|
135
|
-
initValue.push(props.modelValue)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
value.value = props.modelValue;
|
|
139
|
-
if (initValue.length != 0) {
|
|
140
|
-
for (const modelValue of initValue) {
|
|
141
|
-
if (modelValue) {
|
|
142
|
-
parameter.whereAnd.push({key: parameter.value, value: modelValue})
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
initDictTag(http, parameter).then(data => {
|
|
146
|
-
options.value = [...options.value, ...data];
|
|
147
|
-
value.value = props.modelValue;
|
|
148
|
-
})
|
|
149
|
-
}
|
|
150
|
-
}).finally(() => {
|
|
151
|
-
loading.value = false
|
|
152
|
-
})
|
|
153
|
-
} else {
|
|
154
|
-
return parameter;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
async function filterMethod(o) {
|
|
159
|
-
|
|
160
|
-
if (isDictTable.value == false) {
|
|
161
|
-
doFilterMethod(o);
|
|
162
|
-
} else {
|
|
163
|
-
nextTick(() => {
|
|
164
|
-
ex.value++;
|
|
165
|
-
if (ex.value == 1) {
|
|
166
|
-
getParameter(true);
|
|
167
|
-
} else {
|
|
168
|
-
let parameter = getParameter();
|
|
169
|
-
if (o) {
|
|
170
|
-
parameter.whereAnd.push({key: parameter.label, value: o, type: 8})
|
|
171
|
-
if (props.like) {
|
|
172
|
-
let like = props.like.split(",");
|
|
173
|
-
for (let key of like) {
|
|
174
|
-
parameter.whereOr.push({key: key, value: o, type: 8})
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
loading.value = true
|
|
179
|
-
initDictTag(http, parameter).then(data => {
|
|
180
|
-
options.value = data;
|
|
181
|
-
}).finally(() => {
|
|
182
|
-
loading.value = false
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
})
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
async function init() {
|
|
191
|
-
if (props.code) {
|
|
192
|
-
let code = props.code.split(",");
|
|
193
|
-
//逗号分割是查询数据表
|
|
194
|
-
if (code.length < 3) {
|
|
195
|
-
//查询数据字典
|
|
196
|
-
options.value = dict.val(props.code);
|
|
197
|
-
setDefault(options.value);
|
|
198
|
-
} else {
|
|
199
|
-
isDictTable.value = true;
|
|
200
|
-
getParameter(true)
|
|
201
|
-
}
|
|
202
|
-
} else if (props.dictType) {
|
|
203
|
-
options.value = dictType.val();
|
|
204
|
-
} else {
|
|
205
|
-
options.value = props.data;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function setDefault(res) {
|
|
211
|
-
if (res == undefined || (props.value.modelValue != undefined && props.value.modelValue != "")) {
|
|
212
|
-
return
|
|
213
|
-
}
|
|
214
|
-
for (let o of res) {
|
|
215
|
-
if (o.isDefault == 1) {
|
|
216
|
-
value.value = o.dictValue.toString()
|
|
217
|
-
emits("update:modelValue", o.dictValue.toString());
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function getLabel(code) {
|
|
223
|
-
if (!code) {
|
|
224
|
-
code = value.value;
|
|
225
|
-
}
|
|
226
|
-
for (const option of this.options) {
|
|
227
|
-
if (option[props.value] == code) {
|
|
228
|
-
return option[props.label];
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
function getObj(code) {
|
|
234
|
-
if (!code) {
|
|
235
|
-
code = value.value;
|
|
236
|
-
}
|
|
237
|
-
for (const option of this.options) {
|
|
238
|
-
if (option[props.value] == code) {
|
|
239
|
-
return option;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function clear() {
|
|
245
|
-
filterMethod();
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function change(e) {
|
|
249
|
-
emits("update:modelValue", value.value == undefined ? '' : value.value)
|
|
250
|
-
emits("change", e);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function visibleChange(par) {
|
|
254
|
-
if (par) {
|
|
255
|
-
ex.value = 0;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// 子组件调用父组件
|
|
260
|
-
const emits = defineEmits(['update:modelValue', 'change']); //声明 emits
|
|
261
|
-
defineExpose({
|
|
262
|
-
init,
|
|
263
|
-
getLabel,
|
|
264
|
-
getObj,
|
|
265
|
-
})
|
|
266
|
-
</script>
|
|
267
|
-
<script>
|
|
268
|
-
export default {
|
|
269
|
-
name: "olDictTag",
|
|
270
|
-
};
|
|
271
|
-
</script>
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-date-picker
|
|
3
|
-
v-if="item.domDate"
|
|
4
|
-
v-model="localValue"
|
|
5
|
-
v-bind="item"
|
|
6
|
-
:type="item.domType"
|
|
7
|
-
style="width: 100%"
|
|
8
|
-
:value-format="item.domFormat"
|
|
9
|
-
:placeholder="item.placeholder"
|
|
10
|
-
@change="handleChange"
|
|
11
|
-
/>
|
|
12
|
-
<el-radio-group @change="handleChange" v-else-if="item.selectDom == 4" v-model="localValue" v-bind="item">
|
|
13
|
-
<!-- 修正 v-for 语法并添加 :key 绑定 -->
|
|
14
|
-
<el-radio
|
|
15
|
-
v-for="(obj, index) in item.options"
|
|
16
|
-
:key="obj.id || index"
|
|
17
|
-
:label="obj.value"
|
|
18
|
-
:value="obj.value"
|
|
19
|
-
>{{obj.label}}</el-radio>
|
|
20
|
-
</el-radio-group>
|
|
21
|
-
<el-checkbox-group @change="handleChange" v-else-if="item.selectDom == 5" v-model="localValue" v-bind="item">
|
|
22
|
-
<el-checkbox
|
|
23
|
-
v-for="(obj, index) in item.options"
|
|
24
|
-
:key="index"
|
|
25
|
-
:label="obj.label"
|
|
26
|
-
:value="obj.value"
|
|
27
|
-
> </el-checkbox>
|
|
28
|
-
</el-checkbox-group>
|
|
29
|
-
<el-select @change="handleChange" style="width: 100%" v-else-if="item.options" v-model="localValue" v-bind="item">
|
|
30
|
-
<el-option
|
|
31
|
-
v-for="(obj, index) in item.options"
|
|
32
|
-
:key="obj.id || index"
|
|
33
|
-
:label="obj.label"
|
|
34
|
-
:value="obj.value"
|
|
35
|
-
></el-option>
|
|
36
|
-
</el-select>
|
|
37
|
-
<span v-else>
|
|
38
|
-
{{ item.selectDom }}-未开发
|
|
39
|
-
</span>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<script>
|
|
43
|
-
export default {
|
|
44
|
-
name: 'olSelectDom',
|
|
45
|
-
props: {
|
|
46
|
-
modelValue: {
|
|
47
|
-
required: true
|
|
48
|
-
},
|
|
49
|
-
item: {
|
|
50
|
-
required: true
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
data() {
|
|
54
|
-
return {
|
|
55
|
-
localValue: this.modelValue
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
watch: {
|
|
59
|
-
modelValue(newValue) {
|
|
60
|
-
this.localValue = newValue;
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
methods: {
|
|
64
|
-
handleChange(newValue) {
|
|
65
|
-
this.localValue = newValue;
|
|
66
|
-
this.$emit('update:modelValue', newValue);
|
|
67
|
-
this.$emit('updateOk', newValue);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
</script>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span v-for="(option, index) in $attrs.event.column.filters" :key="index">
|
|
3
|
-
<el-input v-model="option.data" style="width: 100%;" placeholder="关键字搜索" clearable
|
|
4
|
-
@input="changeNameFilter(option)"
|
|
5
|
-
@change="changeNameFilter(option)">
|
|
6
|
-
</el-input>
|
|
7
|
-
</span>
|
|
8
|
-
</template>
|
|
9
|
-
<script>
|
|
10
|
-
export default {
|
|
11
|
-
name: 'olTableFilter',
|
|
12
|
-
methods: {
|
|
13
|
-
changeNameFilter(option) {
|
|
14
|
-
option.checked = true;
|
|
15
|
-
this.$attrs.event.$grid.updateData();
|
|
16
|
-
},
|
|
17
|
-
filterMethod({option, row, column}) {
|
|
18
|
-
if (option.data && row[column.field]) {
|
|
19
|
-
return row[column.field].indexOf(option.data) != -1
|
|
20
|
-
}
|
|
21
|
-
return true
|
|
22
|
-
}
|
|
23
|
-
},created() {
|
|
24
|
-
this.$attrs.event.column.filters= [{data: ''}]
|
|
25
|
-
this.$attrs.event.column.filterMethod = this.filterMethod;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
</script>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-date-picker
|
|
3
|
-
v-if="item.selectDom === 3 || item.selectDom === 6"
|
|
4
|
-
v-model="localValue"
|
|
5
|
-
v-bind="$attrs"
|
|
6
|
-
style="width: 100%"
|
|
7
|
-
:type="item.selectDom === 3 ? 'datetime' : 'date'"
|
|
8
|
-
:value-format="item.selectDom === 3 ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'"
|
|
9
|
-
:placeholder="item.placeholder"
|
|
10
|
-
@change="handleChange"
|
|
11
|
-
/>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
export default {
|
|
16
|
-
name: 'olSelectDom',
|
|
17
|
-
props: {
|
|
18
|
-
modelValue: {
|
|
19
|
-
type: String,
|
|
20
|
-
required: true
|
|
21
|
-
},
|
|
22
|
-
item: {
|
|
23
|
-
required: true
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
emits: ['update:modelValue'],
|
|
27
|
-
data() {
|
|
28
|
-
return {
|
|
29
|
-
localValue: this.modelValue
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
watch: {
|
|
33
|
-
modelValue(newValue) {
|
|
34
|
-
this.localValue = newValue;
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
methods: {
|
|
38
|
-
handleChange(newValue) {
|
|
39
|
-
this.localValue = newValue;
|
|
40
|
-
this.$emit('update:modelValue', newValue);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
</script>
|