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,302 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Card :padding="0">
|
|
3
|
+
<FormCardBox ref="form" :config="myConfig" :dictData="dictData" >
|
|
4
|
+
<template v-if="btnTypeValue === '1'" #btn>
|
|
5
|
+
<a v-if="!editFlag && !readOnly" href="#" @click.prevent="edit">编辑</a>
|
|
6
|
+
<a style="margin-left: 10px;" v-if="!editFlag && !readOnly" href="#" @click.prevent="del">删除</a>
|
|
7
|
+
</template>
|
|
8
|
+
<template v-else-if="btnTypeValue === '2'" #btn>
|
|
9
|
+
<a href="#" @click.prevent="del">删除</a>
|
|
10
|
+
</template>
|
|
11
|
+
<template v-else #btn>
|
|
12
|
+
<a v-if="showBtn && !btnReadOnly" href="#" @click.prevent="editStatic">编辑</a>
|
|
13
|
+
<span v-if="showBtn && btnReadOnly" >编辑 </span>
|
|
14
|
+
</template>
|
|
15
|
+
</FormCardBox>
|
|
16
|
+
<div v-if="showChildrenGrid">
|
|
17
|
+
<EditGridCard ref="grid" :config="gridConfig" :dictData="dictData"></EditGridCard>
|
|
18
|
+
</div>
|
|
19
|
+
<Row v-if="btnTypeValue === '1' && editFlag" type="flex" justify="center" align="middle" style="margin-top: 10px;margin-bottom: 10px;" :gutter="16">
|
|
20
|
+
<Col>
|
|
21
|
+
<Button type="primary" @click="save">录入完成</Button>
|
|
22
|
+
<Button style="margin-left: 20px;" @click="cancel">放弃</Button>
|
|
23
|
+
</Col>
|
|
24
|
+
</Row>
|
|
25
|
+
</Card>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import FormCardBox from './formcardbox.vue';
|
|
30
|
+
export default {
|
|
31
|
+
name:'formdetail',
|
|
32
|
+
components:{
|
|
33
|
+
FormCardBox
|
|
34
|
+
},
|
|
35
|
+
data () {
|
|
36
|
+
return {
|
|
37
|
+
editFlag:false,
|
|
38
|
+
showChildrenGrid:false,
|
|
39
|
+
girdFlag:false,
|
|
40
|
+
gridConfig:{},
|
|
41
|
+
myConfig:{},
|
|
42
|
+
readOnly:false,
|
|
43
|
+
showBtn:true,
|
|
44
|
+
btnReadOnly:false,
|
|
45
|
+
btnTypeValue:'1'
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
props:{
|
|
49
|
+
config:{
|
|
50
|
+
type:Object,
|
|
51
|
+
default:null
|
|
52
|
+
},
|
|
53
|
+
valueData:{
|
|
54
|
+
type:Object,
|
|
55
|
+
default () {
|
|
56
|
+
return {};
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
dictData: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default:null
|
|
62
|
+
},
|
|
63
|
+
index:{
|
|
64
|
+
type:String,
|
|
65
|
+
default:''
|
|
66
|
+
},
|
|
67
|
+
isAdd:{
|
|
68
|
+
type:Boolean,
|
|
69
|
+
default:false
|
|
70
|
+
},
|
|
71
|
+
btnType:{
|
|
72
|
+
type:String,
|
|
73
|
+
default:'1'
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
created () {
|
|
77
|
+
this.init();
|
|
78
|
+
},
|
|
79
|
+
methods:{
|
|
80
|
+
init () {
|
|
81
|
+
if (this.isAdd) {
|
|
82
|
+
this.editFlag = true;
|
|
83
|
+
}
|
|
84
|
+
this.myConfig = Object.assign({},this.myConfig, this.config.formConfig);
|
|
85
|
+
this.myConfig.titleType = 2;
|
|
86
|
+
this.myConfig.showBtn = false;
|
|
87
|
+
this.myConfig.showSubSpecialStyle = true;
|
|
88
|
+
if (this.config.gridConfig !== undefined && this.config.gridConfig.items && this.config.gridConfig.items.length > 0) {
|
|
89
|
+
Object.assign(this.gridConfig, this.config.gridConfig);
|
|
90
|
+
this.gridConfig.showDelRow = true;
|
|
91
|
+
this.gridConfig.operFixedFlag = false;
|
|
92
|
+
this.gridConfig.showCheckBox = false;
|
|
93
|
+
this.gridConfig.showAddBtn = true;
|
|
94
|
+
this.gridConfig.showTitle = false;
|
|
95
|
+
this.gridConfig.addBtnType = '2';
|
|
96
|
+
this.gridConfig.titleType = 2;
|
|
97
|
+
this.gridConfig.addRowBefore = this.addRowBefore;
|
|
98
|
+
this.gridConfig.delRowBefore = this.delRowBefore;
|
|
99
|
+
this.gridConfig.tableSize = 'small';
|
|
100
|
+
this.gridConfig.showBorder = false;
|
|
101
|
+
//this.gridConfig.bordered = true;
|
|
102
|
+
this.showChildrenGrid = true;
|
|
103
|
+
if (this.gridConfig.height === undefined) {
|
|
104
|
+
this.gridConfig.height = 200;
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
this.showChildrenGrid = false;
|
|
108
|
+
}
|
|
109
|
+
this.btnTypeValue = this.btnType;
|
|
110
|
+
if (this.myConfig.btnType) {
|
|
111
|
+
this.btnTypeValue = this.myConfig.btnType;
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
addRowBefore(e) {
|
|
115
|
+
if (this.config.gridConfig.addRowBefore) {
|
|
116
|
+
e.form = this.$refs.form.getData();
|
|
117
|
+
return this.config.gridConfig.addRowBefore(e);
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
},
|
|
121
|
+
delRowBefore(e) {
|
|
122
|
+
if (this.config.gridConfig.delRowBefore) {
|
|
123
|
+
e.form = this.$refs.form.getData();
|
|
124
|
+
return this.config.gridConfig.delRowBefore(e);
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
},
|
|
128
|
+
edit () {
|
|
129
|
+
this.editFlag = true;
|
|
130
|
+
if (this.$refs.form) {
|
|
131
|
+
this.$refs.form.setFormReadOnly(false);
|
|
132
|
+
}
|
|
133
|
+
if (this.$refs.grid) {
|
|
134
|
+
this.$refs.grid.setReadOnly(false);
|
|
135
|
+
}
|
|
136
|
+
let obj = {};
|
|
137
|
+
obj.name = 'editForm';
|
|
138
|
+
obj.para = {};
|
|
139
|
+
obj.para.index = this.index;
|
|
140
|
+
obj.para.formObject = this.$refs.form;
|
|
141
|
+
obj.para.form = this.$refs.form.getData();
|
|
142
|
+
if (this.$refs.grid) {
|
|
143
|
+
obj.para.gridObject = this.$refs.grid;
|
|
144
|
+
}
|
|
145
|
+
this.$emit('doAction', obj);
|
|
146
|
+
},
|
|
147
|
+
del () {
|
|
148
|
+
let obj = {};
|
|
149
|
+
obj.name = 'delForm';
|
|
150
|
+
obj.para = {};
|
|
151
|
+
obj.para.index = this.index;
|
|
152
|
+
this.$emit('doAction', obj);
|
|
153
|
+
},
|
|
154
|
+
checkValidate () {
|
|
155
|
+
this.$refs.form.checkValidate();
|
|
156
|
+
if (this.$refs.form.isError()) {
|
|
157
|
+
return true;
|
|
158
|
+
} else {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
save () {
|
|
163
|
+
this.$refs.form.checkValidate();
|
|
164
|
+
if (this.$refs.form.isError()) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
let obj = {};
|
|
168
|
+
obj.name = 'saveForm';
|
|
169
|
+
obj.para = {};
|
|
170
|
+
obj.para.index = this.index;
|
|
171
|
+
obj.para.data = this.$refs.form.getData();
|
|
172
|
+
if (this.showChildrenGrid && this.$refs.grid) {
|
|
173
|
+
if (this.$refs.grid.checkValidate()) {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
obj.para.data[this.config.gridName] = this.$refs.grid.getChangeData();
|
|
177
|
+
if (obj.para.data[this.config.gridName].length > 0 && obj.para.data.flag === undefined) {
|
|
178
|
+
obj.para.data.flag = 'U';
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (!this.isAdd) {
|
|
182
|
+
this.editFlag = false;
|
|
183
|
+
}
|
|
184
|
+
this.$emit('doAction', obj);
|
|
185
|
+
},
|
|
186
|
+
getChangeData () {
|
|
187
|
+
let data = this.$refs.form.getData();
|
|
188
|
+
if (data.flag === undefined) {
|
|
189
|
+
data.flag = 'U';
|
|
190
|
+
}
|
|
191
|
+
if (this.showChildrenGrid && this.$refs.grid) {
|
|
192
|
+
if (this.$refs.grid.checkValidate()) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
data[this.config.gridName] = this.$refs.grid.getChangeData();
|
|
196
|
+
if (data[this.config.gridName].length > 0 && data.flag === undefined) {
|
|
197
|
+
data.flag = 'U';
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return data;
|
|
201
|
+
},
|
|
202
|
+
cancel () {
|
|
203
|
+
if (!this.isAdd) {
|
|
204
|
+
this.editFlag = false;
|
|
205
|
+
}
|
|
206
|
+
this.$refs.form.setData(this.valueData);
|
|
207
|
+
this.$refs.form.setFormReadOnly(true);
|
|
208
|
+
if (this.showChildrenGrid && this.$refs.grid) {
|
|
209
|
+
this.$refs.grid.setReadOnly(true);
|
|
210
|
+
this.$refs.grid.setData(this.valueData[this.config.gridName]);
|
|
211
|
+
}
|
|
212
|
+
let obj = {};
|
|
213
|
+
obj.name = 'cancelForm';
|
|
214
|
+
this.$emit('doAction', obj);
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
setReadOnly (value) {
|
|
218
|
+
this.editFlag = !value;
|
|
219
|
+
this.readOnly = value;
|
|
220
|
+
this.$refs.form.setFormReadOnly(value);
|
|
221
|
+
if (this.showChildrenGrid && this.$refs.grid) {
|
|
222
|
+
this.$refs.grid.setReadOnly(value);
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
clearData() {
|
|
226
|
+
this.$refs.form.clearData();
|
|
227
|
+
if (this.$refs.grid) {
|
|
228
|
+
this.$refs.grid.clearData();
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
isChange () {
|
|
232
|
+
let flag = this.$refs.form.isChange();
|
|
233
|
+
if (!flag) {
|
|
234
|
+
if (this.showChildrenGrid && this.$refs.grid) {
|
|
235
|
+
flag = this.$refs.grid.isChange();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return flag;
|
|
239
|
+
},
|
|
240
|
+
setFormReadOnly(value) {
|
|
241
|
+
this.readOnly = value;
|
|
242
|
+
},
|
|
243
|
+
setData(data) {
|
|
244
|
+
this.customSetData(data);
|
|
245
|
+
},
|
|
246
|
+
getData() {
|
|
247
|
+
let data = this.$refs.form.getData();
|
|
248
|
+
if (this.showChildrenGrid && this.$refs.grid && this.config.gridName) {
|
|
249
|
+
data[this.config.gridName] = this.$refs.grid.getData();
|
|
250
|
+
}
|
|
251
|
+
return data;
|
|
252
|
+
},
|
|
253
|
+
customSetData(data) {
|
|
254
|
+
if (this.$refs.form) {
|
|
255
|
+
this.$refs.form.setData(data);
|
|
256
|
+
}
|
|
257
|
+
if (this.showChildrenGrid && this.$refs.grid) {
|
|
258
|
+
let gridData = [];
|
|
259
|
+
if (data[this.config.gridName]) {
|
|
260
|
+
gridData = data[this.config.gridName];
|
|
261
|
+
}
|
|
262
|
+
this.$refs.grid.setData(gridData);
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
editStatic() {
|
|
266
|
+
if (this.$parent && this.$parent.$parent && this.$parent.$parent.editDetails) {
|
|
267
|
+
this.$parent.$parent.editDetails();
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
setShowBtn(value) {
|
|
271
|
+
this.showBtn = value;
|
|
272
|
+
},
|
|
273
|
+
setBtnReadOnly(value) {
|
|
274
|
+
this.btnReadOnly = value;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
mounted () {
|
|
278
|
+
this.$nextTick(()=> {
|
|
279
|
+
this.customSetData(this.valueData);
|
|
280
|
+
});
|
|
281
|
+
if (this.btnType === '1') {
|
|
282
|
+
if (this.isAdd) {
|
|
283
|
+
this.setReadOnly(false);
|
|
284
|
+
} else {
|
|
285
|
+
this.setReadOnly(true);
|
|
286
|
+
}
|
|
287
|
+
} else if (this.btnType === '2') {
|
|
288
|
+
this.setReadOnly(false);
|
|
289
|
+
} else {
|
|
290
|
+
this.setReadOnly(true);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
</script>
|
|
297
|
+
<style lang="less">
|
|
298
|
+
.head-title-2{
|
|
299
|
+
padding: 7px 16px;
|
|
300
|
+
background-color:#f8f8f9
|
|
301
|
+
}
|
|
302
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import FormDetail from './formdetail.vue';
|
|
2
|
+
import FormBox from './formbox.vue';
|
|
3
|
+
import FormCardBox from './formcardbox.vue';
|
|
4
|
+
import FormCardGroupBox from './formcardgroupbox.vue';
|
|
5
|
+
import DetailsBox from './detailsbox.vue';
|
|
6
|
+
import WorkForm from './workform.vue';
|
|
7
|
+
import BaseForm from './baseform.vue';
|
|
8
|
+
export {FormBox,FormDetail,WorkForm,BaseForm,FormCardBox,FormCardGroupBox,DetailsBox};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name: 'formprobase',
|
|
3
|
+
data () {
|
|
4
|
+
return {
|
|
5
|
+
dafaultRightSpan:2,
|
|
6
|
+
dafaultLeftSpan:1,
|
|
7
|
+
rightSpan:2,
|
|
8
|
+
mainSpan:21,
|
|
9
|
+
leftSpan:1,
|
|
10
|
+
rightShowFlag:true,
|
|
11
|
+
leftShowFlag:true,
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
methods:{
|
|
15
|
+
doShowRight() {
|
|
16
|
+
this.rightShowFlag = true;
|
|
17
|
+
this.rightSpan = this.dafaultRightSpan;
|
|
18
|
+
this.mainSpan = 24 -this.rightSpan - this.toolSpan;
|
|
19
|
+
},
|
|
20
|
+
doHideRight() {
|
|
21
|
+
this.rightShowFlag = false;
|
|
22
|
+
this.rightSpan = 0;
|
|
23
|
+
this.mainSpan = 24 -this.rightSpan - this.leftSpan;
|
|
24
|
+
},
|
|
25
|
+
doShowLeft() {
|
|
26
|
+
this.leftShowFlag = true;
|
|
27
|
+
this.leftSpan = this.dafaultLeftSpan;
|
|
28
|
+
this.mainSpan = 24 -this.rightSpan - this.leftSpan;
|
|
29
|
+
},
|
|
30
|
+
doHideLeft() {
|
|
31
|
+
this.leftShowFlag = false;
|
|
32
|
+
this.leftSpan = 0;
|
|
33
|
+
this.mainSpan = 24 -this.rightSpan - this.leftSpan;
|
|
34
|
+
},
|
|
35
|
+
doAction(para) {
|
|
36
|
+
this.$emit('doAction', para);
|
|
37
|
+
},
|
|
38
|
+
changedStatus(value) {
|
|
39
|
+
this.$refs.tool.changedStatus(value);
|
|
40
|
+
},
|
|
41
|
+
gridChangedStatus(name,value) {
|
|
42
|
+
this.$refs.tool.gridChangedStatus(name,value);
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import toolAnchor from './toolanchor';
|
|
3
|
+
import comPro from './formcompro';
|
|
4
|
+
export default {
|
|
5
|
+
name: 'workform',
|
|
6
|
+
mixins: [comPro,toolAnchor],
|
|
7
|
+
data (){
|
|
8
|
+
return {
|
|
9
|
+
hackReset:true,
|
|
10
|
+
toolbarConfig:{},
|
|
11
|
+
fontplacement:'right',
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
created () {
|
|
15
|
+
this.init();
|
|
16
|
+
},
|
|
17
|
+
methods:{
|
|
18
|
+
init() {
|
|
19
|
+
if (this.config.toolbar) {
|
|
20
|
+
this.toolbarConfig = this.config.toolbar;
|
|
21
|
+
}
|
|
22
|
+
if (this.config.toolbar && this.config.toolbar.fontplacement) {
|
|
23
|
+
this.fontplacement = this.config.toolbar.fontplacement;
|
|
24
|
+
}
|
|
25
|
+
if (this.customInit) {
|
|
26
|
+
this.customInit();
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
getDetailData(name){
|
|
31
|
+
if (this.$refs[name] && this.$refs[name].length > 0) {
|
|
32
|
+
return this.$refs[name][0].getData();
|
|
33
|
+
} else {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
setDetailData(name,data){
|
|
38
|
+
if (this.$refs[name] && this.$refs[name].length > 0) {
|
|
39
|
+
this.$refs[name][0].setData(data);
|
|
40
|
+
if (data && data.length > 0) {
|
|
41
|
+
this.showDetail.push(name);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
clearDetailData() {
|
|
46
|
+
this.showDetail = [];
|
|
47
|
+
if (this.config.detail) {
|
|
48
|
+
this.config.detail.forEach(el => {
|
|
49
|
+
if (el.name && this.$refs[el.name] && this.$refs[el.name].length > 0) {
|
|
50
|
+
this.$refs[el.name][0].clearData();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
setAllDetailData(obj) {
|
|
56
|
+
this.showDetail = [];
|
|
57
|
+
if (this.config.detail) {
|
|
58
|
+
this.config.detail.forEach(el => {
|
|
59
|
+
if (el.name && obj[el.name]) {
|
|
60
|
+
this.setDetailData(el.name,obj[el.name]);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
setDetailReadOnly(value) {
|
|
67
|
+
if (this.config.detail) {
|
|
68
|
+
this.config.detail.forEach(el => {
|
|
69
|
+
if (el.name && this.$refs[el.name] && this.$refs[el.name].length > 0) {
|
|
70
|
+
this.$refs[el.name][0].setReadOnly(value);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
updateRow(name,index,obj){
|
|
76
|
+
if (this.$refs[name] && this.$refs[name].length > 0) {
|
|
77
|
+
this.$refs[name][0].updateRow(index,obj);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
getAllDetailData() {
|
|
81
|
+
let obj = {};
|
|
82
|
+
if (this.config.detail) {
|
|
83
|
+
this.config.detail.forEach(el => {
|
|
84
|
+
if (el.name) {
|
|
85
|
+
obj[el.name] = this.getDetailData(el.name);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return obj;
|
|
90
|
+
},
|
|
91
|
+
getData(){
|
|
92
|
+
const form = this.$refs.form.getData();
|
|
93
|
+
return Object.assign({},form,this.getAllDetailData());
|
|
94
|
+
},
|
|
95
|
+
clearData() {
|
|
96
|
+
//清空主表的数据与检验
|
|
97
|
+
this.$refs.form.clearData();
|
|
98
|
+
//清空明细的数据
|
|
99
|
+
this.clearDetailData();
|
|
100
|
+
|
|
101
|
+
if (this.clearCustomData) {
|
|
102
|
+
this.clearCustomData();
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
setFormReadOnly(value) {
|
|
106
|
+
//设置主表是否编辑
|
|
107
|
+
this.$refs.form.setFormReadOnly(value);
|
|
108
|
+
|
|
109
|
+
//设置明细表是否编辑
|
|
110
|
+
this.setDetailReadOnly(value);
|
|
111
|
+
|
|
112
|
+
//进行自定义操作
|
|
113
|
+
if (this.setCustomFormReadOnly) {
|
|
114
|
+
this.setCustomFormReadOnly(value);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
getValue(name) {
|
|
118
|
+
return this.$refs.form.getValue(name);
|
|
119
|
+
},
|
|
120
|
+
setValue(name,value){
|
|
121
|
+
this.$refs.form.setValue(name,value);
|
|
122
|
+
},
|
|
123
|
+
setPro(name,value) {
|
|
124
|
+
this.$refs.form.setPro(name,value);
|
|
125
|
+
},
|
|
126
|
+
getPro(name,pro) {
|
|
127
|
+
return this.$refs.getPro(name,pro);
|
|
128
|
+
},
|
|
129
|
+
setReadOnly(name,value) {
|
|
130
|
+
this.$refs.form.setReadOnly(name,value);
|
|
131
|
+
if (this.setCustomReadOnly) {
|
|
132
|
+
this.setCustomReadOnly(name,value);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
isError() {
|
|
136
|
+
return this.$refs.form.isError();
|
|
137
|
+
},
|
|
138
|
+
setData(obj){
|
|
139
|
+
//设定主表的数据
|
|
140
|
+
this.$refs.form.setData(obj);
|
|
141
|
+
|
|
142
|
+
//设定明细的数据
|
|
143
|
+
this.setAllDetailData(obj);
|
|
144
|
+
|
|
145
|
+
if (this.customSetData) {
|
|
146
|
+
this.customSetData(obj);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
checkValidate() {
|
|
150
|
+
this.$refs.form.checkValidate();
|
|
151
|
+
},
|
|
152
|
+
isChange () {
|
|
153
|
+
return this.$refs.form.isChange();
|
|
154
|
+
},
|
|
155
|
+
getChangeData() {
|
|
156
|
+
let form = this.$refs.form.getData();
|
|
157
|
+
if (this.config.detail && this.config.detail.length > 0) {
|
|
158
|
+
this.config.detail.forEach(el => {
|
|
159
|
+
if (this.$refs[el.name] && this.$refs[el.name].length > 0) {
|
|
160
|
+
form[el.name] = this.$refs[el.name][0].getChangeData();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return form;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
</script>
|