ocpview-plus 0.0.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/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/efviewplus.min.esm.js +99954 -0
- package/dist/efviewplus.min.js +142 -0
- package/dist/locale/lang.js +1 -0
- package/dist/locale/zh-CN.js +1 -0
- package/dist/locale/zh-TW.js +1 -0
- package/dist/locale/zh-UG.js +1 -0
- package/dist/style.css +9 -0
- package/dist/styles/efviewplus.css +1 -0
- package/package.json +144 -0
- package/src/components/base/controlbase.vue +191 -0
- package/src/components/base/controlbox.vue +102 -0
- package/src/components/base/index.js +3 -0
- package/src/components/base/load.js +20 -0
- package/src/components/base/probase.js +220 -0
- package/src/components/base/size.js +78 -0
- package/src/components/billbox/billbox.vue +68 -0
- package/src/components/billbox/index.js +2 -0
- package/src/components/cascaderbox/cascaderbox.vue +184 -0
- package/src/components/cascaderbox/index.js +2 -0
- package/src/components/checkbox/checkbox.vue +76 -0
- package/src/components/checkbox/checkgroupbox.vue +104 -0
- package/src/components/checkbox/index.js +3 -0
- package/src/components/colorbox/colorbox.vue +44 -0
- package/src/components/colorbox/index.js +2 -0
- package/src/components/combobox/combobox.vue +220 -0
- package/src/components/combobox/index.js +2 -0
- package/src/components/conditionbox/conditionbase.vue +195 -0
- package/src/components/conditionbox/conditionbox.vue +63 -0
- package/src/components/conditionbox/conditionfilterbox.vue +477 -0
- package/src/components/conditionbox/conditionselectorbox.vue +237 -0
- package/src/components/conditionbox/index.js +5 -0
- package/src/components/conditionbox/queryconditionbox.vue +26 -0
- package/src/components/conditionbox/queryconditionboxbase.vue +124 -0
- package/src/components/conditionbox/searchconditionbox.vue +114 -0
- package/src/components/conditionbox/searchgrid.vue +391 -0
- package/src/components/datebox/datebox.vue +129 -0
- package/src/components/datebox/daterangebox.vue +155 -0
- package/src/components/datebox/index.js +3 -0
- package/src/components/form/baseform.vue +677 -0
- package/src/components/form/detailsbox.vue +487 -0
- package/src/components/form/formbox.vue +29 -0
- package/src/components/form/formcardbox.vue +268 -0
- package/src/components/form/formcardgroupbox.vue +252 -0
- package/src/components/form/formcompro.js +19 -0
- package/src/components/form/formdetail.vue +129 -0
- package/src/components/form/formdetailtwo.vue +302 -0
- package/src/components/form/index.js +8 -0
- package/src/components/form/toolanchor.js +46 -0
- package/src/components/form/workform.vue +168 -0
- package/src/components/grid/basegrid.vue +1061 -0
- package/src/components/grid/editgrid.vue +51 -0
- package/src/components/grid/editgridbase.vue +947 -0
- package/src/components/grid/editgridcard.vue +193 -0
- package/src/components/grid/expandrow.vue +137 -0
- package/src/components/grid/index.js +6 -0
- package/src/components/grid/viewgrid.vue +122 -0
- package/src/components/grid/viewgridbase.vue +1284 -0
- package/src/components/icon/common-icon.vue +53 -0
- package/src/components/icon/eicon.vue +29 -0
- package/src/components/icon/icons.vue +42 -0
- package/src/components/icon/index.js +2 -0
- package/src/components/label/index.js +3 -0
- package/src/components/label/showtext.vue +95 -0
- package/src/components/load/loadcartoon.vue +228 -0
- package/src/components/map/index.js +2 -0
- package/src/components/map/mapbox.vue +348 -0
- package/src/components/masterplate/appendix.vue +586 -0
- package/src/components/masterplate/approval.vue +803 -0
- package/src/components/masterplate/base.vue +985 -0
- package/src/components/masterplate/billasyncimport.vue +614 -0
- package/src/components/masterplate/billconditionbox.vue +224 -0
- package/src/components/masterplate/billconditionsbox.vue +427 -0
- package/src/components/masterplate/billdetailform.vue +990 -0
- package/src/components/masterplate/billimport.vue +263 -0
- package/src/components/masterplate/billquerygrid.vue +316 -0
- package/src/components/masterplate/billsinglegrid.vue +234 -0
- package/src/components/masterplate/birtreport.vue +185 -0
- package/src/components/masterplate/detailbtntoolbar.vue +311 -0
- package/src/components/masterplate/detailsbox.vue +386 -0
- package/src/components/masterplate/editgridcard.vue +222 -0
- package/src/components/masterplate/editgridcard2.vue +109 -0
- package/src/components/masterplate/formcard.vue +106 -0
- package/src/components/masterplate/formcardgroupbox.vue +168 -0
- package/src/components/masterplate/formdetailtwo.vue +356 -0
- package/src/components/masterplate/gridcolset.vue +227 -0
- package/src/components/masterplate/index.js +23 -0
- package/src/components/masterplate/layouttemplate.vue +33 -0
- package/src/components/masterplate/leftlistrightdetails.vue +474 -0
- package/src/components/masterplate/leftlistrightlist.vue +465 -0
- package/src/components/masterplate/lefttreerightdetails.vue +619 -0
- package/src/components/masterplate/levelreport.vue +510 -0
- package/src/components/masterplate/listbtntoolbar.vue +257 -0
- package/src/components/masterplate/listdetails.vue +769 -0
- package/src/components/masterplate/operlog.vue +272 -0
- package/src/components/masterplate/options.vue +110 -0
- package/src/components/masterplate/page.vue +102 -0
- package/src/components/masterplate/promptmessage.vue +74 -0
- package/src/components/masterplate/querybar.vue +490 -0
- package/src/components/masterplate/report.vue +357 -0
- package/src/components/masterplate/rowbtntoolbar.vue +126 -0
- package/src/components/masterplate/simpletree.vue +129 -0
- package/src/components/masterplate/simpleviewgrid.vue +144 -0
- package/src/components/mychart/bar/bar.vue +202 -0
- package/src/components/mychart/basechart.vue +190 -0
- package/src/components/mychart/complexmychart/barline.vue +154 -0
- package/src/components/mychart/gauge/gauge.vue +83 -0
- package/src/components/mychart/index.js +9 -0
- package/src/components/mychart/line/line.vue +202 -0
- package/src/components/mychart/liquidfill/liquidfill.vue +109 -0
- package/src/components/mychart/pie/pie.vue +96 -0
- package/src/components/mychart/radar/radar.vue +122 -0
- package/src/components/mychart/scatter/scatter.vue +76 -0
- package/src/components/numberbox/append.js +11 -0
- package/src/components/numberbox/index.js +3 -0
- package/src/components/numberbox/numberbox.vue +303 -0
- package/src/components/numberbox/numberrangebox.vue +423 -0
- package/src/components/picturebox/filebox.vue +365 -0
- package/src/components/picturebox/index.js +3 -0
- package/src/components/picturebox/picturebox.vue +541 -0
- package/src/components/picturebox/uploadbox.vue +164 -0
- package/src/components/poptagbox/index.js +2 -0
- package/src/components/poptagbox/poptagbox.vue +389 -0
- package/src/components/poptextbox/index.js +2 -0
- package/src/components/poptextbox/poptextbox.vue +601 -0
- package/src/components/radiobox/index.js +2 -0
- package/src/components/radiobox/radiogroupbox.vue +76 -0
- package/src/components/richtextbox/editor.vue +150 -0
- package/src/components/richtextbox/index.js +2 -0
- package/src/components/richtextbox/richtextbox.vue +448 -0
- package/src/components/textbox/index.js +2 -0
- package/src/components/textbox/textbox.vue +98 -0
- package/src/components/timebox/index.js +2 -0
- package/src/components/timebox/timebox.vue +76 -0
- package/src/components/toolbar/ebutton.vue +169 -0
- package/src/components/toolbar/index.js +3 -0
- package/src/components/toolbar/toolbar.vue +446 -0
- package/src/components/tree/basetree.vue +725 -0
- package/src/components/tree/index.js +3 -0
- package/src/components/tree/treedata.vue +51 -0
- package/src/components/tree/treedatabase.vue +189 -0
- package/src/components/upload/billimport.vue +233 -0
- package/src/components/upload/index.js +2 -0
- package/src/components/videobox/index.js +2 -0
- package/src/components/videobox/uploadbox.vue +148 -0
- package/src/components/videobox/videobox.vue +503 -0
- package/src/components/wrichtextbox/editor.vue +219 -0
- package/src/components/wrichtextbox/index.js +2 -0
- package/src/components/wrichtextbox/wrichtextbox.vue +63 -0
- package/src/index.js +215 -0
- package/src/locale/format.js +51 -0
- package/src/locale/index.js +63 -0
- package/src/locale/lang/zh-CN.js +123 -0
- package/src/locale/lang/zh-TW.js +114 -0
- package/src/locale/lang/zh-UG.js +115 -0
- package/src/locale/lang.js +15 -0
- package/src/method/case/case.js +1180 -0
- package/src/method/config/queryconfig.js +24 -0
- package/src/method/const/const.js +815 -0
- package/src/method/index.js +8 -0
- package/src/static/excel/exportexcel.js +627 -0
- package/src/static/iview/coustom.js +463 -0
- package/src/store/index.js +19 -0
- package/src/store/modules/app.js +53 -0
- package/src/styles/README.md +3 -0
- package/src/styles/common.less +75 -0
- package/src/styles/components/anchor.less +74 -0
- package/src/styles/components/approval.less +136 -0
- package/src/styles/components/button.less +208 -0
- package/src/styles/components/card.less +51 -0
- package/src/styles/components/content.less +38 -0
- package/src/styles/components/font.less +314 -0
- package/src/styles/components/form.less +72 -0
- package/src/styles/components/iconfont/fonts/iconfont.less +1376 -0
- package/src/styles/components/iconfont/fonts/iconfont.svg +699 -0
- package/src/styles/components/iconfont/fonts/iconfont.ttf +0 -0
- package/src/styles/components/iconfont/fonts/iconfont.woff +0 -0
- package/src/styles/components/iconfont/fonts/iconfont.woff2 +0 -0
- package/src/styles/components/index.less +16 -0
- package/src/styles/components/input.less +290 -0
- package/src/styles/components/modal.less +203 -0
- package/src/styles/components/page.less +340 -0
- package/src/styles/components/select.less +361 -0
- package/src/styles/components/steps.less +367 -0
- package/src/styles/components/table.less +544 -0
- package/src/styles/components/tabs.less +249 -0
- package/src/styles/components/upload.less +83 -0
- package/src/styles/custom.less +67 -0
- package/src/styles/index.less +6 -0
- package/src/styles/pack.less +6 -0
- package/src/utils/EfuMessenger.js +155 -0
- package/src/utils/assist.js +353 -0
- package/src/utils/index.js +1 -0
- package/src/utils/random_str.js +10 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<template v-if="modeltype==='upload'">
|
|
4
|
+
<Modal title="上传文件" v-model="showUpload" class-name="vertical-center-modal—bill" :footer-hide="true">
|
|
5
|
+
<div class="demo-spin-col-bill">
|
|
6
|
+
<RadioGroup v-if="showType" v-model="type" style="margin-bottom:24px">
|
|
7
|
+
<Radio v-for="(item,index) in myConfig.typeData" :key="index" :label="item.code">
|
|
8
|
+
<span>{{item.name}}</span>
|
|
9
|
+
</Radio>
|
|
10
|
+
</RadioGroup>
|
|
11
|
+
<div style="height:220px;background-color: #F5F7FA;border:1px #DCDFE6 dashed">
|
|
12
|
+
<Row type="flex" justify="center" >
|
|
13
|
+
<Col style="margin-top:30px;margin-bottom:10px">
|
|
14
|
+
<Icon custom="iconfont icon-custom-excel" size="60" />
|
|
15
|
+
</Col>
|
|
16
|
+
</Row>
|
|
17
|
+
<Row type="flex" justify="center">
|
|
18
|
+
<Col>
|
|
19
|
+
<Input v-model="name" style="width:150px;" :border="false" placeholder="(支持xls、xlsx格式)" clearable disabled/>
|
|
20
|
+
</Col>
|
|
21
|
+
</Row>
|
|
22
|
+
<Row type="flex" justify="center" :gutter="10">
|
|
23
|
+
<Col>
|
|
24
|
+
<Upload ref="upload"
|
|
25
|
+
:before-upload="handleUpload"
|
|
26
|
+
accept=".xlsx,.xls"
|
|
27
|
+
:format="myConfig.fileType"
|
|
28
|
+
:on-format-error="handleFormatError"
|
|
29
|
+
:on-success="handleSuccess"
|
|
30
|
+
:show-upload-list="false"
|
|
31
|
+
:action="url">
|
|
32
|
+
<Button style="width:150px;">选择文件</Button>
|
|
33
|
+
</Upload>
|
|
34
|
+
</Col>
|
|
35
|
+
</Row>
|
|
36
|
+
</div>
|
|
37
|
+
<Spin v-show="loading" fix>
|
|
38
|
+
<Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
|
|
39
|
+
<div>导入中</div>
|
|
40
|
+
</Spin>
|
|
41
|
+
</div>
|
|
42
|
+
</Modal>
|
|
43
|
+
</template>
|
|
44
|
+
<template v-if="modeltype === 'down'">
|
|
45
|
+
<Modal v-model="showUpload" title="选择模版" @on-ok="downTemplate" class-name="vertical-center-modal—bill">
|
|
46
|
+
<RadioGroup v-model="type">
|
|
47
|
+
<Radio v-for="(item,index) in myConfig.typeData" :key="index" :label="item.code">
|
|
48
|
+
<span>{{item.name}}</span>
|
|
49
|
+
</Radio>
|
|
50
|
+
</RadioGroup>
|
|
51
|
+
</Modal>
|
|
52
|
+
</template>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
<script>
|
|
56
|
+
export default {
|
|
57
|
+
name:'mbillimport',
|
|
58
|
+
data () {
|
|
59
|
+
return {
|
|
60
|
+
myConfig:{
|
|
61
|
+
typeData:[],
|
|
62
|
+
fileType:['xlsx','xls'],
|
|
63
|
+
setImportUrl:null
|
|
64
|
+
},
|
|
65
|
+
initConfig:{
|
|
66
|
+
typeData:[],
|
|
67
|
+
fileType:['xlsx','xls'],
|
|
68
|
+
setImportUrl:null
|
|
69
|
+
},
|
|
70
|
+
file: null,
|
|
71
|
+
name:'',
|
|
72
|
+
type:'',
|
|
73
|
+
showType:false,
|
|
74
|
+
showUpload:false,
|
|
75
|
+
modeltype:'upload',
|
|
76
|
+
param:{},
|
|
77
|
+
curlUrl:'',
|
|
78
|
+
loading:false,
|
|
79
|
+
downMethod:'exportTemplate',
|
|
80
|
+
importMethod:'import'
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
props:{
|
|
84
|
+
config: {
|
|
85
|
+
type:Object,
|
|
86
|
+
default () {
|
|
87
|
+
return {};
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
} ,
|
|
91
|
+
computed:{
|
|
92
|
+
filename(){
|
|
93
|
+
if (this.name) {
|
|
94
|
+
return this.name;
|
|
95
|
+
} else {
|
|
96
|
+
return '(支持xls、xlsx格式)';
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
url() {
|
|
100
|
+
let url = this.curlUrl;
|
|
101
|
+
let para = this.$Method.copy(this.param);
|
|
102
|
+
if (this.showType) {
|
|
103
|
+
if (this.myConfig.typeData.length > 0) {
|
|
104
|
+
if (this.type) {
|
|
105
|
+
para.billmoduleid = para.billmoduleid+'_' + this.type;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return url+'¶m=' +encodeURI(JSON.stringify(para));
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
methods: {
|
|
113
|
+
init () {
|
|
114
|
+
this.myConfig = Object.assign({},this.initConfig, this.config);
|
|
115
|
+
if (this.myConfig.typeData && this.myConfig.typeData.length > 0) {
|
|
116
|
+
this.showType = true;
|
|
117
|
+
this.type = this.myConfig.typeData[0].code;
|
|
118
|
+
}
|
|
119
|
+
if (this.myConfig.importMethod) {
|
|
120
|
+
this.importMethod = this.myConfig.importMethod;
|
|
121
|
+
}
|
|
122
|
+
if (this.myConfig.downMethod) {
|
|
123
|
+
this.downMethod = this.myConfig.downMethod;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
setModeltype(value) {
|
|
127
|
+
this.modeltype = value;
|
|
128
|
+
},
|
|
129
|
+
setShowUpload(flag) {
|
|
130
|
+
if (flag) {
|
|
131
|
+
this.init ();
|
|
132
|
+
}
|
|
133
|
+
this.showUpload = flag;
|
|
134
|
+
},
|
|
135
|
+
setUrl(url,method,param) {
|
|
136
|
+
if (url) {
|
|
137
|
+
url = url.replace('rest', this.importMethod);
|
|
138
|
+
}
|
|
139
|
+
let self = this;
|
|
140
|
+
this.curlUrl = this.getResturl(url,method,{},self);
|
|
141
|
+
if (this.myConfig.setImportUrl) {
|
|
142
|
+
this.curlUrl = this.myConfig.setImportUrl(this.curlUrl,'import');
|
|
143
|
+
}
|
|
144
|
+
Object.assign(this.param, param);
|
|
145
|
+
|
|
146
|
+
if (this.myConfig.typeData.length > 1) {
|
|
147
|
+
if (!this.type) {
|
|
148
|
+
this.type = this.myConfig.typeData[0].code;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
setDownUrl(url,param) {
|
|
153
|
+
if (url) {
|
|
154
|
+
url = url.replace('rest', this.downMethod);
|
|
155
|
+
}
|
|
156
|
+
let self = this;
|
|
157
|
+
this.curlUrl = this.getResturl(url,null,{},self);
|
|
158
|
+
if (this.myConfig.typeData.length > 1) {
|
|
159
|
+
this.param = param;
|
|
160
|
+
this.type = this.myConfig.typeData[0].code;
|
|
161
|
+
this.showUpload = true;
|
|
162
|
+
} else {
|
|
163
|
+
let temp = this.curlUrl +'¶m=' +encodeURI(JSON.stringify(param));
|
|
164
|
+
if (this.myConfig.setImportUrl) {
|
|
165
|
+
temp = this.myConfig.setImportUrl(temp,'down');
|
|
166
|
+
}
|
|
167
|
+
window.open(temp,'_self');
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
handleUpload (file) {
|
|
171
|
+
if (!this.checkFormat(file)) {
|
|
172
|
+
this.handleFormatError(file);
|
|
173
|
+
this.file = null;
|
|
174
|
+
this.name = '';
|
|
175
|
+
return false;
|
|
176
|
+
} else {
|
|
177
|
+
this.file = file;
|
|
178
|
+
this.name = file.name;
|
|
179
|
+
this.upload();
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
182
|
+
},
|
|
183
|
+
checkFormat(file) {
|
|
184
|
+
const _file_format = file.name.split('.').pop().toLocaleLowerCase();
|
|
185
|
+
const checked = this.myConfig.fileType.some(item => item.toLocaleLowerCase() === _file_format);
|
|
186
|
+
return checked;
|
|
187
|
+
},
|
|
188
|
+
upload () {
|
|
189
|
+
if (!this.name) {
|
|
190
|
+
this.file = null;
|
|
191
|
+
}
|
|
192
|
+
if (this.file !== null) {
|
|
193
|
+
this.loading = true;
|
|
194
|
+
this.$refs.upload.post(this.file);
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
handleFormatError (file) {
|
|
198
|
+
let type = this.myConfig.fileType.join(',');
|
|
199
|
+
this.alert('文件[' + file.name + ']的格式不正确,请上传格式为(' + type + ')的文件');
|
|
200
|
+
},
|
|
201
|
+
handleSuccess(res) {
|
|
202
|
+
if (res && Number(res.returncode) !== 0) {
|
|
203
|
+
this.showUpload = false;
|
|
204
|
+
this.file = null;
|
|
205
|
+
this.name = '';
|
|
206
|
+
this.alert(res.data);
|
|
207
|
+
} else {
|
|
208
|
+
this.showUpload = false;
|
|
209
|
+
this.file = null;
|
|
210
|
+
this.name = '';
|
|
211
|
+
if (this.myConfig.importSuccess) {
|
|
212
|
+
this.myConfig.importSuccess(res);
|
|
213
|
+
} else {
|
|
214
|
+
if (this.$parent.doImportSuccess) {
|
|
215
|
+
this.$parent.doImportSuccess();
|
|
216
|
+
}
|
|
217
|
+
this.alert(res.elapsed,'导入成功');
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
this.loading = false;
|
|
221
|
+
|
|
222
|
+
},
|
|
223
|
+
downTemplate() {
|
|
224
|
+
if (this.type) {
|
|
225
|
+
let param = this.$Method.copy(this.param);
|
|
226
|
+
if (param.billmoduleid) {
|
|
227
|
+
param.billmoduleid = param.billmoduleid + '_' + this.type;
|
|
228
|
+
let temp = this.url +'¶m=' +encodeURI(JSON.stringify(param));
|
|
229
|
+
window.open(temp,'_self');
|
|
230
|
+
this.showUpload = false;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
</script>
|
|
238
|
+
<style lang="less" scoped>
|
|
239
|
+
.ivu-modal-wrap.vertical-center-modal—bill .ivu-modal-header{
|
|
240
|
+
border-bottom:none;
|
|
241
|
+
border-radius:10px;
|
|
242
|
+
}
|
|
243
|
+
.ivu-modal-wrap.vertical-center-modal—bill .ivu-modal-body{
|
|
244
|
+
padding-top: 8px;
|
|
245
|
+
padding-right: 28px;
|
|
246
|
+
padding-bottom: 32px;
|
|
247
|
+
padding-left: 28px;
|
|
248
|
+
}
|
|
249
|
+
.demo-spin-icon-load{
|
|
250
|
+
animation: ani-demo-spin 1s linear infinite;
|
|
251
|
+
}
|
|
252
|
+
@keyframes ani-demo-spin {
|
|
253
|
+
from { transform: rotate(0deg);}
|
|
254
|
+
50% { transform: rotate(180deg);}
|
|
255
|
+
to { transform: rotate(360deg);}
|
|
256
|
+
}
|
|
257
|
+
.demo-spin-col-bill{
|
|
258
|
+
position: relative;
|
|
259
|
+
}
|
|
260
|
+
</style>
|
|
261
|
+
<style>
|
|
262
|
+
|
|
263
|
+
</style>
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div >
|
|
3
|
+
<Card :padding="0" dis-hover :bordered="false" style="background:#fff;padding:14px 16px 14px 16px">
|
|
4
|
+
<div ref="toolbar" style="padding-bottom:14px">
|
|
5
|
+
<QueryBar :config="myConfig.queryConfig" :dictData="dictData" :moduleMethod="moduleMethod" @conditionAction="conditionAction" @doAction="doAction"/>
|
|
6
|
+
</div>
|
|
7
|
+
<Card class="billquerygrid" :padding="0" :bordered="false" dis-hover>
|
|
8
|
+
<Dropdown trigger="custom" :visible="colsetFlag" style="position:absolute;z-index:99;right:15px;top:1px;padding:7.5px; background-color: #F5F7FA;" placement="bottom-end" :transfer="transferFlag" @on-clickoutside="closeColset">
|
|
9
|
+
<Tooltip placement="top">
|
|
10
|
+
<template #content>
|
|
11
|
+
<div>
|
|
12
|
+
<span style="font-size:12px"> 表头设计 </span>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
<p style="cursor:pointer;" @click.stop="openColSet">
|
|
16
|
+
<Icon custom="iconfont icon-custom-colset" style="margin-top: 4px;" size="16" color="#515a6e"/>
|
|
17
|
+
</p>
|
|
18
|
+
</Tooltip>
|
|
19
|
+
<template #list>
|
|
20
|
+
<DropdownMenu>
|
|
21
|
+
<GridColSet ref="gridcol" :config="myConfig.gridConfig" @doAction="doAction" />
|
|
22
|
+
</DropdownMenu>
|
|
23
|
+
</template>
|
|
24
|
+
</Dropdown>
|
|
25
|
+
<SimpleViewGrid v-if="reset" ref="grid" :config="changeGridConfig" :dictData="dictData" @dbclick="dbclick" />
|
|
26
|
+
</Card>
|
|
27
|
+
</Card>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
|
|
33
|
+
import elementResizeDetectorMaker from 'element-resize-detector';
|
|
34
|
+
import QueryBar from './querybar.vue';
|
|
35
|
+
import GridColSet from './gridcolset.vue';
|
|
36
|
+
import { resolveComponent } from 'vue';
|
|
37
|
+
export default {
|
|
38
|
+
name:'mbillquerygrid',
|
|
39
|
+
components:{QueryBar,GridColSet},
|
|
40
|
+
data () {
|
|
41
|
+
return {
|
|
42
|
+
myConfig:{
|
|
43
|
+
},
|
|
44
|
+
changeGridConfig:{},
|
|
45
|
+
reset:true,
|
|
46
|
+
rowBtnData:[],
|
|
47
|
+
transferFlag:false,
|
|
48
|
+
colsetFlag:false,
|
|
49
|
+
operateFlag:false,
|
|
50
|
+
enablePermissions:true,
|
|
51
|
+
actionConfig:{},
|
|
52
|
+
initRefresh:true,
|
|
53
|
+
gridCol:[]
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
props:{
|
|
57
|
+
config: {
|
|
58
|
+
type:Object,
|
|
59
|
+
default:null
|
|
60
|
+
},
|
|
61
|
+
dictData: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default:null
|
|
64
|
+
},
|
|
65
|
+
moduleMethod:{
|
|
66
|
+
type:Array,
|
|
67
|
+
default: () => {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
created () {
|
|
73
|
+
this.myConfig = Object.assign({},this.myConfig, this.config);
|
|
74
|
+
this.myConfig.gridConfig.headStyle='';
|
|
75
|
+
this.myConfig.gridConfig.showCondition = false;
|
|
76
|
+
this.myConfig.gridConfig.overrideData = this.gridOverrideData;
|
|
77
|
+
this.myConfig.gridConfig.onSelectionChange = this.gridOnSelectionChange;
|
|
78
|
+
this.myConfig.gridConfig.resources = this.config.resources;
|
|
79
|
+
this.myConfig.gridConfig.height = 1;
|
|
80
|
+
this.myConfig.gridConfig.adjustHeight = 5;
|
|
81
|
+
this.myConfig.gridConfig.showBorder = true;
|
|
82
|
+
this.myConfig.gridConfig.showStripe = true;
|
|
83
|
+
this.myConfig.gridConfig.method = this.config.classPrefix + '.search';
|
|
84
|
+
this.myConfig.gridConfig.response = this.config.response;
|
|
85
|
+
this.myConfig.gridConfig.generalOrientation = true;
|
|
86
|
+
this.myConfig.gridConfig.pageSize="small";
|
|
87
|
+
this.myConfig.gridConfig.items.forEach(el => {
|
|
88
|
+
if (el.type !== 'CheckBox') {
|
|
89
|
+
if (el.tooltip === undefined) {
|
|
90
|
+
el.tooltip = true;
|
|
91
|
+
}
|
|
92
|
+
if (el.resizable === undefined) {
|
|
93
|
+
el.resizable = true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
if (this.myConfig.gridConfig.initRefresh !== undefined) {
|
|
98
|
+
this.initRefresh = this.myConfig.gridConfig.initRefresh;
|
|
99
|
+
}
|
|
100
|
+
if (this.myConfig.enablePermissions !== undefined) {
|
|
101
|
+
this.enablePermissions = this.myConfig.enablePermissions;
|
|
102
|
+
}
|
|
103
|
+
if (this.myConfig.rowBtnData) {
|
|
104
|
+
this.rowBtnData = this.$Method.copy(this.myConfig.rowBtnData);
|
|
105
|
+
}
|
|
106
|
+
if (this.rowBtnData.length > 0) {
|
|
107
|
+
this.initRowBtn();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
this.myConfig.queryConfig = {};
|
|
111
|
+
this.myConfig.queryConfig.curHelpUrl = this.config.curHelpUrl;
|
|
112
|
+
this.myConfig.queryConfig.items = this.$Method.copy(this.myConfig.gridConfig.items);
|
|
113
|
+
this.myConfig.queryConfig.modulecode = this.config.modulecode;
|
|
114
|
+
this.myConfig.queryConfig.enablePermissions = this.enablePermissions;
|
|
115
|
+
if (this.myConfig.btnData) {
|
|
116
|
+
this.myConfig.queryConfig.btnData = this.myConfig.btnData;
|
|
117
|
+
}
|
|
118
|
+
if (this.myConfig.addDataflag) {
|
|
119
|
+
this.myConfig.queryConfig.addDataflag = this.myConfig.addDataflag;
|
|
120
|
+
}
|
|
121
|
+
if (this.myConfig.usercustominfo) {
|
|
122
|
+
if (this.myConfig.usercustominfo.filterscene) {
|
|
123
|
+
this.myConfig.queryConfig.sceneData = this.$Method.copy(this.myConfig.usercustominfo.filterscene);
|
|
124
|
+
}
|
|
125
|
+
if (this.myConfig.usercustominfo.colset) {
|
|
126
|
+
this.gridCol = JSON.parse(this.$Method.copy(this.myConfig.usercustominfo.colset)) ;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
this.setChangeGridConfig();
|
|
131
|
+
},
|
|
132
|
+
methods: {
|
|
133
|
+
initRowBtn () {
|
|
134
|
+
if (this.enablePermissions) {
|
|
135
|
+
let btns = [];
|
|
136
|
+
this.moduleMethod.forEach(el => {
|
|
137
|
+
let btn = this.rowBtnData.find(el2 => el.name === el2.name);
|
|
138
|
+
if (btn) {
|
|
139
|
+
btns.push(btn);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
this.rowBtnData = btns;
|
|
143
|
+
}
|
|
144
|
+
if (this.rowBtnData.length > 0) {
|
|
145
|
+
this.actionConfig.label = '操作';
|
|
146
|
+
this.actionConfig.key = 'actionbtn';
|
|
147
|
+
this.actionConfig.align = 'center';
|
|
148
|
+
this.actionConfig.render = this.actionRender;
|
|
149
|
+
this.actionConfig.fixed= 'right';
|
|
150
|
+
if (this.rowBtnData.length > 3) {
|
|
151
|
+
this.actionConfig.width = 200;
|
|
152
|
+
} else {
|
|
153
|
+
this.actionConfig.width = 68 * this.rowBtnData.length;
|
|
154
|
+
}
|
|
155
|
+
this.myConfig.gridConfig.items.push(this.actionConfig);
|
|
156
|
+
this.operateFlag = true;
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
actionRender (h, params) {
|
|
160
|
+
return h('div', [
|
|
161
|
+
h(resolveComponent('RowBtnToolbar'), {
|
|
162
|
+
config:{items:this.rowBtnData},
|
|
163
|
+
onDoAction: (val) => {
|
|
164
|
+
val.rowinfo = params;
|
|
165
|
+
this.$emit('doAction',val);
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
]);
|
|
169
|
+
},
|
|
170
|
+
doAction (obj) {
|
|
171
|
+
if (obj.name === 'saveGridCol') {
|
|
172
|
+
this.gridCol = this.$Method.copy(obj.para);
|
|
173
|
+
this.colsetFlag = false;
|
|
174
|
+
this.setChangeGridConfig();
|
|
175
|
+
this.reset = false;
|
|
176
|
+
this.$nextTick(() => {
|
|
177
|
+
this.reset = true;
|
|
178
|
+
this.$nextTick(() => {
|
|
179
|
+
this.refurbish();
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
} else if (obj.name === 'closeGridCol') {
|
|
183
|
+
this.colsetFlag = false;
|
|
184
|
+
return;
|
|
185
|
+
} else {
|
|
186
|
+
if (obj.name !== 'saveScene') {
|
|
187
|
+
obj.para = this.$refs.grid.getSelection();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
this.$emit('doAction', obj);
|
|
191
|
+
},
|
|
192
|
+
gridOverrideData (data) {
|
|
193
|
+
let self = this;
|
|
194
|
+
if (data && data.length > 0) {
|
|
195
|
+
this.$nextTick(() => {
|
|
196
|
+
let index = 0;
|
|
197
|
+
if (self.ph_key) {
|
|
198
|
+
let culIndex = data.findIndex(el => el[self.myConfig.gridConfig.bindSearchParam]=== self.ph_key);
|
|
199
|
+
if (culIndex > -1) {
|
|
200
|
+
index = culIndex;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if(this.$refs.grid) {
|
|
204
|
+
this.$refs.grid.setRowHighlight(index,true);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return data;
|
|
209
|
+
},
|
|
210
|
+
gridOnSelectionChange(rows) {
|
|
211
|
+
let obj = {};
|
|
212
|
+
obj.name = 'gridSelectionChange';
|
|
213
|
+
obj.para = rows;
|
|
214
|
+
this.$emit('doAction', obj);
|
|
215
|
+
},
|
|
216
|
+
clearData () {
|
|
217
|
+
this.$refs.quick.clearData();
|
|
218
|
+
this.refurbish();
|
|
219
|
+
},
|
|
220
|
+
refurbish (para) {
|
|
221
|
+
if (!para) {
|
|
222
|
+
para = {};
|
|
223
|
+
}
|
|
224
|
+
this.$refs.grid.clearSearchBeforeSearchParam();
|
|
225
|
+
this.$refs.grid.setSearchBeforeSearchParam(para);
|
|
226
|
+
this.$refs.grid.refurbish();
|
|
227
|
+
},
|
|
228
|
+
getGrid () {
|
|
229
|
+
return this.$refs.grid;
|
|
230
|
+
},
|
|
231
|
+
getBtnToolbar() {
|
|
232
|
+
return this.$refs.btn;
|
|
233
|
+
},
|
|
234
|
+
getQuick () {
|
|
235
|
+
return this.$refs.quick;
|
|
236
|
+
},
|
|
237
|
+
dbclick (e) {
|
|
238
|
+
let obj = {};
|
|
239
|
+
obj.name ='gridDbClick';
|
|
240
|
+
obj.para = e;
|
|
241
|
+
this.ph_key = obj.para[this.myConfig.gridConfig.bindSearchParam];
|
|
242
|
+
this.$emit('doAction', obj);
|
|
243
|
+
},
|
|
244
|
+
setPhkey(value) {
|
|
245
|
+
this.ph_key = value;
|
|
246
|
+
},
|
|
247
|
+
quickChagne () {
|
|
248
|
+
this.refurbish();
|
|
249
|
+
},
|
|
250
|
+
setOutsideHeight() {
|
|
251
|
+
let height = this.$refs.toolbar.offsetHeight + 30;
|
|
252
|
+
this.$refs.grid.setOutsideHeight(height);
|
|
253
|
+
},
|
|
254
|
+
openColSet() {
|
|
255
|
+
this.colsetFlag = true;
|
|
256
|
+
},
|
|
257
|
+
closeColset() {
|
|
258
|
+
this.colsetFlag = false;
|
|
259
|
+
},
|
|
260
|
+
setChangeGridConfig() {
|
|
261
|
+
this.changeGridConfig = this.$Method.copy(this.myConfig.gridConfig);
|
|
262
|
+
let isFixed = false;
|
|
263
|
+
if (this.gridCol.length > 0) {
|
|
264
|
+
let items = [];
|
|
265
|
+
this.gridCol.forEach(el => {
|
|
266
|
+
if(el.name && el.visible) {
|
|
267
|
+
let tmp = this.myConfig.gridConfig.items.find(el2 => el.name === el2.name || el.name === el2.sname);
|
|
268
|
+
if (tmp) {
|
|
269
|
+
let tmp2 = this.$Method.copy(tmp);
|
|
270
|
+
if (el.fixed) {
|
|
271
|
+
tmp2.fixed = 'left';
|
|
272
|
+
if (!isFixed) {
|
|
273
|
+
isFixed = true;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
items.push(tmp2);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
if (this.operateFlag) {
|
|
281
|
+
items.push(this.actionConfig);
|
|
282
|
+
}
|
|
283
|
+
this.changeGridConfig.fixedIndex = isFixed;
|
|
284
|
+
this.changeGridConfig.items = items;
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
conditionAction(action) {
|
|
288
|
+
if (action.name === 'condition_search' || action.name === 'condition_searchFilter') {
|
|
289
|
+
this.refurbish(action.para);
|
|
290
|
+
}
|
|
291
|
+
if (action.name === 'condition_clear') {
|
|
292
|
+
this.refurbish();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
},
|
|
297
|
+
mounted () {
|
|
298
|
+
this.observer = elementResizeDetectorMaker();
|
|
299
|
+
if (this.$refs.toolbar) {
|
|
300
|
+
this.observer.listenTo(this.$refs.toolbar, this.setOutsideHeight);
|
|
301
|
+
}
|
|
302
|
+
if (this.initRefresh) {
|
|
303
|
+
this.refurbish();
|
|
304
|
+
}
|
|
305
|
+
if (this.gridCol.length > 0) {
|
|
306
|
+
this.$refs.gridcol.setData(this.gridCol);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
},
|
|
310
|
+
beforeUnmount() {
|
|
311
|
+
if (this.$refs.toolbar) {
|
|
312
|
+
this.observer.removeListener(this.$refs.toolbar, this.setOutsideHeight);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
</script>
|