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,234 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Card :padding="0" dis-hover :bordered="false" :style="'background:#fff;height:' + clientHeight +'px'">
|
|
3
|
+
<div ref="head">
|
|
4
|
+
<Card :padding="0" style="padding-top:14px;padding-left:16px;padding-right:16px;border-radius:0px;" :bordered="false" dis-hover>
|
|
5
|
+
<ListBtnToolbar ref="menutoolbar" :config="menuToolbar" :moduleMethod="moduleMethod" @doAction="doAction"/>
|
|
6
|
+
<Divider style="margin-top:16px;margin-bottom:0px;" />
|
|
7
|
+
</Card>
|
|
8
|
+
</div>
|
|
9
|
+
<Card :padding="0" :bordered="false" dis-hover style="padding-top:0px;padding-left:16px;padding-right:16px;">
|
|
10
|
+
<EditGridCardS ref="grid" :config="myConfig.gridConfig" :dictData="dictData" />
|
|
11
|
+
</Card>
|
|
12
|
+
</Card>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import ListBtnToolbar from './listbtntoolbar.vue';
|
|
17
|
+
import EditGridCardS from './editgridcard.vue';
|
|
18
|
+
export default {
|
|
19
|
+
name:'mbillsinglegrid',
|
|
20
|
+
components:{ListBtnToolbar,EditGridCardS},
|
|
21
|
+
data () {
|
|
22
|
+
return {
|
|
23
|
+
myConfig:{
|
|
24
|
+
billKey:'ph_key',
|
|
25
|
+
searchParam:{}
|
|
26
|
+
},
|
|
27
|
+
menuToolbar:{}
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
props:{
|
|
31
|
+
config: {
|
|
32
|
+
type:Object,
|
|
33
|
+
default:null
|
|
34
|
+
},
|
|
35
|
+
dictData: {
|
|
36
|
+
type: Object,
|
|
37
|
+
default:null
|
|
38
|
+
},
|
|
39
|
+
moduleMethod:{
|
|
40
|
+
type:Array,
|
|
41
|
+
default: () => {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
computed: {
|
|
47
|
+
clientHeight () {
|
|
48
|
+
return this.$Store.state.app.clientHeight;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
created () {
|
|
52
|
+
this.myConfig = Object.assign({},this.myConfig, this.config);
|
|
53
|
+
this.myConfig.gridConfig.headStyle='';
|
|
54
|
+
this.myConfig.gridConfig.showCondition = false;
|
|
55
|
+
this.myConfig.gridConfig.showAddBtn = false;
|
|
56
|
+
this.myConfig.gridConfig.showDelBatchBtn = false;
|
|
57
|
+
this.myConfig.gridConfig.onSelectionChange = this.gridOnSelectionChange;
|
|
58
|
+
this.myConfig.gridConfig.height = 1;
|
|
59
|
+
this.myConfig.gridConfig.width = 1;
|
|
60
|
+
this.myConfig.gridConfig.adjustHeight = 0;
|
|
61
|
+
this.myConfig.gridConfig.adjustWidth = 0;
|
|
62
|
+
this.myConfig.gridConfig.modetype = '2';
|
|
63
|
+
this.myConfig.gridConfig.showTitle = false;
|
|
64
|
+
this.myConfig.gridConfig.showPage = false;
|
|
65
|
+
this.myConfig.gridConfig.generalOrientation = true;
|
|
66
|
+
|
|
67
|
+
if (this.myConfig.gridConfig.pageSizeNum === undefined) {
|
|
68
|
+
this.myConfig.gridConfig.pageSizeNum = 20;
|
|
69
|
+
}
|
|
70
|
+
this.myConfig.gridConfig.items.forEach(el => {
|
|
71
|
+
if (el.type !== 'CheckBox') {
|
|
72
|
+
if (el.tooltip === undefined) {
|
|
73
|
+
el.tooltip = true;
|
|
74
|
+
}
|
|
75
|
+
if (el.resizable === undefined) {
|
|
76
|
+
el.resizable = true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
if (this.myConfig.menuToolbar && this.myConfig.menuToolbar.items) {
|
|
81
|
+
this.menuToolbar = this.$Method.copy(this.myConfig.menuToolbar);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
doMenuToolbar() {
|
|
86
|
+
if (this.$refs.menutoolbar) {
|
|
87
|
+
this.$refs.menutoolbar.setAllReadOnly(true);
|
|
88
|
+
this.$refs.menutoolbar.setReadOnly('addData',false);
|
|
89
|
+
this.$refs.menutoolbar.setReadOnly('editData',false);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
doAction(obj) {
|
|
93
|
+
const method = obj.name;
|
|
94
|
+
const methodBefore = method + 'Before';
|
|
95
|
+
const methodAfter = method + 'After';
|
|
96
|
+
if (obj.name === 'addData' || obj.name === 'editData') {
|
|
97
|
+
let flag = true;
|
|
98
|
+
if (this.$parent[methodBefore]) {
|
|
99
|
+
flag = this.$parent[methodBefore](obj);
|
|
100
|
+
}
|
|
101
|
+
if (flag) {
|
|
102
|
+
if (obj.name === 'addData') {
|
|
103
|
+
this.$refs.grid.setReadOnly(false);
|
|
104
|
+
this.$refs.menutoolbar.setAllReadOnly(true);
|
|
105
|
+
this.$refs.menutoolbar.setReadOnly('saveData', false);
|
|
106
|
+
if (flag !== true) {
|
|
107
|
+
this.$refs.grid.addRow(flag);
|
|
108
|
+
} else {
|
|
109
|
+
this.$refs.grid.addRow();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
if (obj.name === 'editData') {
|
|
114
|
+
this.$refs.grid.setReadOnly(false);
|
|
115
|
+
this.$refs.menutoolbar.setReadOnly('editData', true);
|
|
116
|
+
this.$refs.menutoolbar.setReadOnly('saveData', false);
|
|
117
|
+
}
|
|
118
|
+
if (this.$parent[methodAfter]) {
|
|
119
|
+
this.$parent[methodAfter]();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
if (obj.name === 'saveData') {
|
|
124
|
+
let flag = this.checkValidate();
|
|
125
|
+
if (flag) {
|
|
126
|
+
this.alert('必填项不允许为空');
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
obj.para = this.$refs.grid.getChangeData();
|
|
130
|
+
}
|
|
131
|
+
obj.onOk = this.onOk;
|
|
132
|
+
let flag = true;
|
|
133
|
+
if (this.$parent[methodBefore]) {
|
|
134
|
+
flag = this.$parent[methodBefore](obj);
|
|
135
|
+
}
|
|
136
|
+
if (!flag) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (obj.name === 'delData') {
|
|
140
|
+
let text = '删除';
|
|
141
|
+
obj.para = this.$refs.grid.getSelection();
|
|
142
|
+
let self = this;
|
|
143
|
+
self.$Modal.confirm({
|
|
144
|
+
title:'确认',
|
|
145
|
+
content:'是否确认' + text + '数据?',
|
|
146
|
+
onOk:() => {
|
|
147
|
+
obj.para.forEach(el => {
|
|
148
|
+
if (obj.name === 'delData') {
|
|
149
|
+
el.flag = 'D';
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
this.$emit('doAction', obj);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
} else {
|
|
156
|
+
this.$emit('doAction', obj);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
onOk(action, data) {
|
|
161
|
+
if (action.name === 'saveData') {
|
|
162
|
+
this.refurbish();
|
|
163
|
+
this.$refs.menutoolbar.setReadOnly('editData', false);
|
|
164
|
+
this.$refs.menutoolbar.setReadOnly('saveData', true);
|
|
165
|
+
}
|
|
166
|
+
if (action.name === 'delData') {
|
|
167
|
+
this.refurbish();
|
|
168
|
+
this.$refs.menutoolbar.setAllReadOnly(false);
|
|
169
|
+
this.$refs.menutoolbar.setReadOnly('saveData', true);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
refurbish () {
|
|
173
|
+
this.loading = true;
|
|
174
|
+
let self = this;
|
|
175
|
+
self.data = [];
|
|
176
|
+
let para = {};
|
|
177
|
+
if (this.myConfig.gridConfig.searchParam) {
|
|
178
|
+
para = Object.assign({},{}, this.myConfig.gridConfig.searchParam);
|
|
179
|
+
}
|
|
180
|
+
if (!para.page_size) {
|
|
181
|
+
para.page_size = '99999';
|
|
182
|
+
}
|
|
183
|
+
self.asyncPost(self.myConfig.resources,self.myConfig.classPrefix+ '.' + 'search' ,para,function(data) {
|
|
184
|
+
let curlData = [];
|
|
185
|
+
if (data && data[self.myConfig.response]) {
|
|
186
|
+
curlData = self.$Method.copy(data[self.myConfig.response])
|
|
187
|
+
}
|
|
188
|
+
if (self.$parent.setBillData) {
|
|
189
|
+
curlData = self.$parent.setBillData(curlData);
|
|
190
|
+
}
|
|
191
|
+
self.data = curlData;
|
|
192
|
+
self.$refs.grid.setData(self.data);
|
|
193
|
+
self.$refs.grid.setReadOnly(true);
|
|
194
|
+
self.loading = false;
|
|
195
|
+
},function() {
|
|
196
|
+
self.loading = false;
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
checkValidate () {
|
|
200
|
+
return this.$refs.grid.checkValidate();
|
|
201
|
+
},
|
|
202
|
+
getGrid () {
|
|
203
|
+
return this.$refs.grid;
|
|
204
|
+
},
|
|
205
|
+
onOpenChange(value) {
|
|
206
|
+
this.setGridHeight(value);
|
|
207
|
+
},
|
|
208
|
+
setGridHeight() {
|
|
209
|
+
let height = this.clientHeight - this.$refs.head.offsetHeight;
|
|
210
|
+
this.$refs.grid.setCalHeight(height);
|
|
211
|
+
},
|
|
212
|
+
gridOnSelectionChange(rows) {
|
|
213
|
+
let obj = {};
|
|
214
|
+
obj.name = 'gridOnSelectionChange';
|
|
215
|
+
obj.para = rows;
|
|
216
|
+
if (rows.length > 0) {
|
|
217
|
+
this.$refs.menutoolbar.setReadOnly('delData',false);
|
|
218
|
+
} else {
|
|
219
|
+
this.$refs.menutoolbar.setReadOnly('delData',true);
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
getChangeData() {
|
|
223
|
+
return this.$refs.grid.getChangeData();
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
mounted () {
|
|
227
|
+
this.doMenuToolbar();
|
|
228
|
+
this.setGridHeight();
|
|
229
|
+
this.refurbish();
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
</script>
|
|
234
|
+
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Card :padding="0" dis-hover :bordered="false" :style="'background:#fff;height:' + clientHeight +'px'">
|
|
3
|
+
<div ref="toolbarcard" >
|
|
4
|
+
<Card :padding="0" style="padding-top:14px;padding-left:16px;padding-right:16px;border-radius:0px;" :bordered="false" dis-hover>
|
|
5
|
+
<ListBtnToolbar ref="menutoolbar" :config="menuToolbar" :moduleMethod="moduleMethod" @doAction="doAction"/>
|
|
6
|
+
<Divider style="margin-top:16px;margin-bottom:0px;" />
|
|
7
|
+
</Card>
|
|
8
|
+
</div>
|
|
9
|
+
<div ref="formcard">
|
|
10
|
+
<Card :padding="0" dis-hover :bordered="false" style="padding-left:14px;padding-right:14px;padding-top:0px;padding-bottom:0px">
|
|
11
|
+
<Formcards ref="form" :config="myConfig.formConfig" :dictData="dictData"/>
|
|
12
|
+
</Card>
|
|
13
|
+
</div>
|
|
14
|
+
<div style="padding:14px 16px;">
|
|
15
|
+
<iframe v-if="resert" ref="birtreport" :src="iframeUrl" frameborder="0" style="width: 100%;border:1px solid #DCDFE6" :height="currentHeight" allowtransparency="true" @load="load"></iframe>
|
|
16
|
+
</div>
|
|
17
|
+
</Card>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import ListBtnToolbar from './listbtntoolbar.vue';
|
|
22
|
+
import Formcards from './formcard.vue';
|
|
23
|
+
import elementResizeDetectorMaker from 'element-resize-detector';
|
|
24
|
+
export default {
|
|
25
|
+
name:'mreport',
|
|
26
|
+
components:{ListBtnToolbar,Formcards},
|
|
27
|
+
data () {
|
|
28
|
+
return {
|
|
29
|
+
myConfig:{
|
|
30
|
+
titleType:2,
|
|
31
|
+
divStyle:'padding:5px',
|
|
32
|
+
title:'查询条件'
|
|
33
|
+
},
|
|
34
|
+
menuToolbar:{},
|
|
35
|
+
gridToolbar:{},
|
|
36
|
+
frontBtn: [{
|
|
37
|
+
name:'searchData',text:'查询',icon:'custom-search'
|
|
38
|
+
},{
|
|
39
|
+
name:'clearData',text:'清除',icon:'custom-clean'
|
|
40
|
+
}],
|
|
41
|
+
birtUrl:'',
|
|
42
|
+
iframeUrl:'',
|
|
43
|
+
resert:true,
|
|
44
|
+
outsideheight:0
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
props:{
|
|
48
|
+
config: {
|
|
49
|
+
type:Object,
|
|
50
|
+
default:null
|
|
51
|
+
},
|
|
52
|
+
dictData: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default:null
|
|
55
|
+
},
|
|
56
|
+
moduleMethod:{
|
|
57
|
+
type:Array,
|
|
58
|
+
default: () => {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
clientHeight () {
|
|
65
|
+
return this.$Store.state.app.clientHeight;
|
|
66
|
+
},
|
|
67
|
+
currentHeight () {
|
|
68
|
+
let curlheight = this.$Store.state.app.clientHeight - this.outsideheight - 30;
|
|
69
|
+
return curlheight;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
created () {
|
|
73
|
+
this.myConfig = Object.assign({},this.myConfig, this.config);
|
|
74
|
+
this.myConfig.formConfig.titleType = this.myConfig.titleType;
|
|
75
|
+
if (this.myConfig.formConfig.title === undefined) {
|
|
76
|
+
this.myConfig.formConfig.title = this.myConfig.title;
|
|
77
|
+
}
|
|
78
|
+
if (this.myConfig.menuToolbar && this.myConfig.menuToolbar.items) {
|
|
79
|
+
this.menuToolbar = this.$Method.copy(this.myConfig.menuToolbar);
|
|
80
|
+
}
|
|
81
|
+
if (!this.menuToolbar.items) {
|
|
82
|
+
this.menuToolbar.items = [];
|
|
83
|
+
}
|
|
84
|
+
let frontBtn = []
|
|
85
|
+
this.frontBtn.forEach(el => {
|
|
86
|
+
let index = this.menuToolbar.items.findIndex(el2 => el2.name === el);
|
|
87
|
+
if (index === -1) {
|
|
88
|
+
frontBtn.push(el);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
this.menuToolbar.items = frontBtn.concat(this.menuToolbar.items);
|
|
92
|
+
this.menuToolbar.mainButton = 'searchData';
|
|
93
|
+
this.menuToolbar.mainButtonText ='查询';
|
|
94
|
+
this.menuToolbar.ignoreModule = ['searchData','clearData'];
|
|
95
|
+
this.setReportUrl();
|
|
96
|
+
},
|
|
97
|
+
methods: {
|
|
98
|
+
doAction (obj) {
|
|
99
|
+
const method = obj.name;
|
|
100
|
+
if (this.$parent[method]) {
|
|
101
|
+
this.$parent[method]();
|
|
102
|
+
} else {
|
|
103
|
+
if (this[method]) {
|
|
104
|
+
this[method]();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
clearData () {
|
|
109
|
+
this.$refs.form.clearData();
|
|
110
|
+
this.resert = false;
|
|
111
|
+
this.iframeUrl = '';
|
|
112
|
+
},
|
|
113
|
+
searchData() {
|
|
114
|
+
this.$refs.form.checkValidate();
|
|
115
|
+
let flag = this.$refs.form.isError();
|
|
116
|
+
if (flag) {
|
|
117
|
+
this.alert('必填项不允许为空');
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
let data = this.$refs.form.getData();
|
|
121
|
+
|
|
122
|
+
let url = this.birtUrl + '&__masterpage=true&__showtitle=false&__format=html&__page=1';
|
|
123
|
+
let paramurl = '';
|
|
124
|
+
for (let key in data) {
|
|
125
|
+
if (data[key]) {
|
|
126
|
+
paramurl += '&' + key + '=' + data[key];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//url拼上__userid,__postid ,增加数据范围
|
|
130
|
+
let userid = this.$Method.getUrlParam('userid');
|
|
131
|
+
if (userid != null && userid != '') {
|
|
132
|
+
paramurl += '&__userid=' + userid;
|
|
133
|
+
}
|
|
134
|
+
let postid = this.$Method.getUrlParam('postid');
|
|
135
|
+
if (postid != null && postid != '') {
|
|
136
|
+
paramurl += '&__postid=' + postid;
|
|
137
|
+
}
|
|
138
|
+
paramurl += '&__accesstime=' + new Date().getTime();
|
|
139
|
+
|
|
140
|
+
url = encodeURI(url + paramurl);
|
|
141
|
+
this.iframeUrl = url;
|
|
142
|
+
this.resert = false;
|
|
143
|
+
this.$nextTick(() => {
|
|
144
|
+
this.resert = true;
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
refurbish () {
|
|
148
|
+
this.searchData();
|
|
149
|
+
},
|
|
150
|
+
getForm () {
|
|
151
|
+
return this.$refs.form;
|
|
152
|
+
},
|
|
153
|
+
load() {
|
|
154
|
+
if (this.myConfig.onLoad) {
|
|
155
|
+
let iframe = this.$refs.birtreport.$el;
|
|
156
|
+
this.myConfig.onLoad(iframe);
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
setReportUrl() {
|
|
160
|
+
this.birtUrl = '';
|
|
161
|
+
if (!this.birtUrl) {
|
|
162
|
+
if (this.$parent.getReportConfig) {
|
|
163
|
+
this.birtUrl = this.$parent.getReportConfig();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
setGridHeight() {
|
|
168
|
+
let height = this.$refs.toolbarcard.offsetHeight + this.$refs.formcard.offsetHeight;
|
|
169
|
+
this.outsideheight = height;
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
mounted () {
|
|
173
|
+
this.observer = elementResizeDetectorMaker();
|
|
174
|
+
if (this.$refs.formcard) {
|
|
175
|
+
this.observer.listenTo(this.$refs.formcard, this.setGridHeight);
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
beforeUnmount() {
|
|
179
|
+
if (this.$refs.formcard) {
|
|
180
|
+
this.observer.removeListener(this.$refs.formcard, this.setGridHeight);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
</script>
|
|
185
|
+
|