centaline-data-driven 1.2.26 → 1.2.29
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/build/centaline/centaline.path.js +1 -0
- package/package.json +1 -1
- package/src/Form.vue +5 -20
- package/src/SearchList.vue +3 -3
- package/src/centaline/css/common.css +3 -0
- package/src/centaline/dialogList/src/dialog.vue +3 -3
- package/src/centaline/dynamicD/src/dynamicD.vue +3 -0
- package/src/centaline/dynamicDetail/src/dynamicContactList.vue +39 -12
- package/src/centaline/dynamicFile/src/dynamicFile.vue +16 -3
- package/src/centaline/dynamicForm/src/dynamicForm.vue +1 -2
- package/src/centaline/dynamicL/src/dynamicL.vue +2 -2
- package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchListTable.vue +1 -1
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +1 -1
- package/src/centaline/dynamicSosTt/index.js +14 -0
- package/src/centaline/dynamicSosTt/src/dynamicSosTt.vue +283 -0
- package/src/centaline/loader/src/ctl/ContactList.js +122 -28
- package/src/centaline/loader/src/ctl/D.js +3 -0
- package/src/centaline/loader/src/ctl/Router.js +30 -0
- package/src/centaline/loader/src/ctl/SosTt.js +146 -0
- package/src/centaline/loader/src/ctl/lib/Enum.js +28 -0
- package/src/centaline/loader/src/ctl/lib/LibFunction.js +10 -1
- package/src/centaline/loader/src/ctl.js +1 -0
- package/src/main.js +1 -1
- package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -7,6 +7,7 @@ const paths = {
|
|
|
7
7
|
"dynamicMt": "./src/centaline/dynamicMt/index.js",//多行文本组件
|
|
8
8
|
"dynamicSo": "./src/centaline/dynamicSo/index.js",//单选下拉菜单
|
|
9
9
|
"dynamicSos": "./src/centaline/dynamicSos/index.js",//单选搜索下拉菜单
|
|
10
|
+
"dynamicSosTt": "./src/centaline/dynamicSosTt/index.js",//电话号码编辑框
|
|
10
11
|
"dynamicT": "./src/centaline/dynamicT/index.js",//文本input组件
|
|
11
12
|
"dynamicL": "./src/centaline/dynamicL/index.js",//文本label组件
|
|
12
13
|
"dynamicTags": "./src/centaline/dynamicTags/index.js",//多选搜索下拉菜单组件
|
package/package.json
CHANGED
package/src/Form.vue
CHANGED
|
@@ -1,40 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app-form" class="data-driven" style="width:100%;height:100%;overflow:auto">
|
|
3
|
-
|
|
3
|
+
<ct-form :api="'/api/third-dept-tran/transaction/detail'" :apiParam="apiParam"></ct-form>
|
|
4
|
+
<!-- <ct-form :api="'/PropertyPublish/getLayoutOfNew'" :apiParam="apiParam"></ct-form> -->
|
|
4
5
|
<!-- <ct-form :source="formdata.content" :apiParam="apiParam"></ct-form> -->
|
|
5
6
|
<!--:api="'FormSample/formdata'"-->
|
|
6
7
|
<!--<ct-form :source="formdata.content"></ct-form>-->
|
|
7
8
|
<!--<ct-form :api="'/api/form/formdata/contractDetail'" :apiParam="apiParam"></ct-form>-->
|
|
8
9
|
<!--<ct-form :api="'api/Form/formdata'"></ct-form>-->
|
|
9
|
-
<!-- <ct-form :api="'/forminfo/readDetail'" :apiParam="apiParam"></ct-form> -->
|
|
10
|
-
<!-- <ct-form :api="'PropertyKey/getLayoutOfNew'" :apiParam="apiParam"></ct-form> -->
|
|
11
|
-
<ct-form :api="'PropertyDuty/getLayoutOfClearDuty'" :apiParam="para"></ct-form>
|
|
12
|
-
<!-- <ct-form :api="'/api/distribution/transaction/add'" :apiParam="apiParam"></ct-form> -->
|
|
13
10
|
<ct-dialog-list></ct-dialog-list>
|
|
14
11
|
</div>
|
|
15
12
|
</template>
|
|
16
13
|
|
|
17
14
|
<script>
|
|
18
15
|
export default {
|
|
19
|
-
name: '
|
|
16
|
+
name: 'App',
|
|
20
17
|
data() {
|
|
21
18
|
return {
|
|
22
|
-
// apiParam: {originalTraId: "
|
|
19
|
+
// apiParam: {originalTraId: "1475658732246241281", actionType: 2, chanceID: "1"} ,
|
|
20
|
+
apiParam: {originalTraId: "1475658732246241281", actionType: 3, pageTitle: "成交报告", pageOnly: true} ,
|
|
23
21
|
// apiParam: {headerParam: {}, urlParam: {contractID: "06cad32e-4d0d-4b6f-bd24-16a28629a550", actionType: "0"}}
|
|
24
22
|
// apiParam: {SN: "13557_132", UserID: "wuhan3"},
|
|
25
|
-
// apiParam: {actionType: 3,formId: "2c12649f-09c5-4aa9-8011-b6d1c7b56a41"} ,
|
|
26
|
-
// apiParam: {chanceID: "1", actionType: 2} ,
|
|
27
|
-
// apiParam: {worklistID: "1494206747714392064", actionType: 2}
|
|
28
|
-
para: {propertyID: "1", actionType: 2}
|
|
29
|
-
// apiParam: {
|
|
30
|
-
// actionType: 2,
|
|
31
|
-
// agentId: "1450283160825425922",
|
|
32
|
-
// estateId: "B6E6B3D8-FDF2-4AF8-91E6-B348D637E993",
|
|
33
|
-
// pageOnly: true,
|
|
34
|
-
// pageStyle: 2,
|
|
35
|
-
// propertyId: "14102015-0736-9265-205A-451687BF7062",
|
|
36
|
-
// relProId: "1475708315466829833",
|
|
37
|
-
// }
|
|
38
23
|
}
|
|
39
24
|
},
|
|
40
25
|
methods: {
|
package/src/SearchList.vue
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div id="app-search" style="height:100%;position: fixed;">
|
|
3
3
|
<!-- <ct-searchlist :searchConditionApi="'/api/third-dept-tran/tran-list/layout'" :searchDataApi="'/api/third-dept-tran/tran-list'"></ct-searchlist> -->
|
|
4
4
|
|
|
5
|
-
<ct-searchlist :searchConditionApi="'/PropertyRETList/getLayoutOfSearch'" :searchDataApi="'/PropertyRETList/getListOfSearchModel'" :searchCategoryApi="'/PropertyRETList/getLayoutOfSearchCategory'"></ct-searchlist>
|
|
6
|
-
|
|
5
|
+
<!-- <ct-searchlist :searchConditionApi="'/PropertyRETList/getLayoutOfSearch'" :searchDataApi="'/PropertyRETList/getListOfSearchModel'" :searchCategoryApi="'/PropertyRETList/getLayoutOfSearchCategory'"></ct-searchlist> -->
|
|
6
|
+
<ct-searchlist :searchConditionApi="'/PropertyPublishLogList/getLayoutOfSearch'" :searchDataApi="'/PropertyPublishLogList/getListOfSearchModel'"></ct-searchlist>
|
|
7
7
|
|
|
8
8
|
<!-- <ct-searchlist :searchConditionApi="'/PropertyRETList/getLayoutOfSearch'"
|
|
9
9
|
:searchDataApi="'/PropertyRETList/getListOfSearchModel'"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
data() {
|
|
25
25
|
return {
|
|
26
26
|
//para: { agentId: "1424932685198864386", estateId: "L201402181627000007233", estateName: "271医院宿舍区", pageOnly: "true", pageTitle: "销控房源列表" }
|
|
27
|
-
para: {}
|
|
27
|
+
para: {publishID: "1503900718229229568"}
|
|
28
28
|
// para: {paramKey: "PropertyStatusID", code: "002.001", name: "盘源状态", paramName: "盘源状态"}
|
|
29
29
|
}
|
|
30
30
|
},
|
|
@@ -149,10 +149,10 @@
|
|
|
149
149
|
if(item.attrs.height){
|
|
150
150
|
ph=parseInt(item.attrs.height.replace('px',''));
|
|
151
151
|
}
|
|
152
|
-
if(self.vmodel.pane && self.vmodel.pane.$el.
|
|
153
|
-
item.attrs.height=(self.vmodel.pane.$el.
|
|
152
|
+
if(self.vmodel.pane && self.vmodel.pane.$el.clientHeight<ph){
|
|
153
|
+
item.attrs.height=(self.vmodel.pane.$el.clientHeight-40)+'px';
|
|
154
154
|
}
|
|
155
|
-
// console.log(document.body.
|
|
155
|
+
// console.log(document.body.clientHeight);可见区域高度
|
|
156
156
|
// console.log(item.attrs.height)
|
|
157
157
|
return h('div', {
|
|
158
158
|
style: {
|
|
@@ -51,6 +51,9 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
dateBlur(event) {
|
|
54
|
+
if(this.model.attrs && this.model.attrs.type && this.model.attrs.type=='month'){
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
54
57
|
var text = event.$el.querySelector("input").value;
|
|
55
58
|
text = text.replace('-', '').replace('/', '').replace('\\', '');
|
|
56
59
|
var nowDate = new Date();
|
|
@@ -63,8 +63,10 @@
|
|
|
63
63
|
v-for="(column,colIndex) in model.dataFieldcolumns" :key="colIndex"
|
|
64
64
|
v-if="tdShow(column, row)"
|
|
65
65
|
:rowspan="tdRowspan(column, row)"
|
|
66
|
+
:colspan="tdColspan(column, row)"
|
|
66
67
|
class="ct-td"
|
|
67
68
|
:class="[colHasWidth[colIndex],model.tdClass,
|
|
69
|
+
row.flagRow?'ct-td3':null,
|
|
68
70
|
colIndex === leftShadow?'shadowLeft':null,
|
|
69
71
|
colIndex === rightShadow?'shadowRight':null,
|
|
70
72
|
column.fixed === 'left'?'left-fixation':null,
|
|
@@ -72,8 +74,12 @@
|
|
|
72
74
|
column.fixed === 'right'?'right-fixation':null]"
|
|
73
75
|
v-bind="column.attrs">
|
|
74
76
|
<!--操作列-->
|
|
75
|
-
<div v-if="
|
|
76
|
-
|
|
77
|
+
<div v-if="row.flagRow" :class="column.autoRowHeight ? 'lineFeedCell':'cell'">
|
|
78
|
+
{{row.descNewRow}}
|
|
79
|
+
</div>
|
|
80
|
+
<div v-else-if="column.id==='operation' && row.rowHiddenColumns==undefined" class="div_allinline" :class="column.autoRowHeight ? 'lineFeedCell':'cell'">
|
|
81
|
+
<ct-tablecurrency v-for="(router,rowRouterIndex) in model.rowRouter" :key="rowRouterIndex"
|
|
82
|
+
v-if="!router.rightField || row[router.rightField] == 1" :isOperationalColumn="true"
|
|
77
83
|
:router="router" :colValue="router.label" :rowData="row" @click="rolRouterClickHandler">
|
|
78
84
|
</ct-tablecurrency>
|
|
79
85
|
</div>
|
|
@@ -83,7 +89,7 @@
|
|
|
83
89
|
</ct-tablecurrency>
|
|
84
90
|
<!--正常的列-->
|
|
85
91
|
<div v-else-if="typeof column.template === 'undefined'" :class="column.autoRowHeight ? 'lineFeedCell':'cell'">
|
|
86
|
-
{{row[column.id]}}
|
|
92
|
+
{{row.rowHiddenColumns && row.rowHiddenColumns.includes(column.id)?"":row[column.id]}}
|
|
87
93
|
</div>
|
|
88
94
|
</td>
|
|
89
95
|
</tr>
|
|
@@ -149,13 +155,30 @@
|
|
|
149
155
|
});
|
|
150
156
|
this.model.scripts.formData = this.model.formData;
|
|
151
157
|
this.model.scripts.formData.formTable = this.model;
|
|
158
|
+
this.model.setHiddenRow();
|
|
152
159
|
console.log(this.model);
|
|
153
160
|
},
|
|
154
161
|
lookOwner(router) {
|
|
155
162
|
var self = this;
|
|
156
|
-
var submitData=
|
|
157
|
-
|
|
163
|
+
var submitData={
|
|
164
|
+
action: router.action,
|
|
165
|
+
para: {
|
|
166
|
+
searchFields: null,
|
|
167
|
+
pageAttribute: { pageIndex: 1 },
|
|
168
|
+
flagSearch: true
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
submitData.para.searchFields=router.getSearchPara();
|
|
172
|
+
submitData.para.searchFields.fields.push({
|
|
173
|
+
fieldName1: 'flagLookFromButton',
|
|
174
|
+
groupName: 'flagLookFromButton',
|
|
175
|
+
operation: 1,
|
|
176
|
+
searchDataType: 3,
|
|
177
|
+
searchValue1: '1',
|
|
178
|
+
});
|
|
179
|
+
router.doSearch(submitData, (res) => {
|
|
158
180
|
if (res.rtnCode === 200) {
|
|
181
|
+
res.apiRouter=self.apiRouter;
|
|
159
182
|
self.loaderObj.ContactList(res,null,self.load);
|
|
160
183
|
self.flagLook = true;
|
|
161
184
|
}
|
|
@@ -205,6 +228,12 @@
|
|
|
205
228
|
|
|
206
229
|
return '';
|
|
207
230
|
},
|
|
231
|
+
tdColspan(column, row) {
|
|
232
|
+
if (row.colspan !== 0) {
|
|
233
|
+
return row.colspan;
|
|
234
|
+
}
|
|
235
|
+
return '';
|
|
236
|
+
},
|
|
208
237
|
tdShow(column, row) {
|
|
209
238
|
if (!column.show) {
|
|
210
239
|
return false;
|
|
@@ -215,6 +244,10 @@
|
|
|
215
244
|
return false;
|
|
216
245
|
}
|
|
217
246
|
|
|
247
|
+
if(row.flagRow && row.columnShow!==column.id){
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
|
|
218
251
|
return true;
|
|
219
252
|
},
|
|
220
253
|
rolRouterClickHandler(field, rowData) {
|
|
@@ -222,13 +255,7 @@
|
|
|
222
255
|
field.submitListField.forEach((k) => {
|
|
223
256
|
submitData[k] = rowData[k];
|
|
224
257
|
});
|
|
225
|
-
|
|
226
|
-
let action = field.action;
|
|
227
|
-
if (field.actionField) {
|
|
228
|
-
action = rowData[field.actionField];
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
this.routerClickHandler(field, submitData, action);
|
|
258
|
+
this.routerClickHandler(field, submitData, null);
|
|
232
259
|
},
|
|
233
260
|
fieldClickHandler(field) {
|
|
234
261
|
var self = this;
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
<span class="cover-list-item-span" v-if="model.lock||model.paramName">
|
|
35
35
|
<!--锁定-->
|
|
36
36
|
<span v-if="model.lock || !file.rightEdit" class="el-dropdown-link">
|
|
37
|
-
|
|
37
|
+
<span style="width:80px;height:26px;display: inline-flex"> {{file.mediaLabelName}}</span>
|
|
38
38
|
</span>
|
|
39
39
|
<!--复杂分类-->
|
|
40
40
|
<span v-else-if="model.isComplexClassify" class="el-dropdown-link" @click="classifyFormClickHandle(file)">
|
|
41
|
-
|
|
41
|
+
<span style="width:80px;height:26px;display: inline-flex"> {{file.mediaLabelName}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
|
42
42
|
</span>
|
|
43
43
|
<!--简单分类-->
|
|
44
44
|
<el-dropdown v-else class="el-upload-list__item-preview" trigger="click" placement="top" @command="classifySelectedClickHandle">
|
|
45
45
|
<span class="el-dropdown-link" @click="classifyClickHandle">
|
|
46
|
-
|
|
46
|
+
<span style="width:80px;height:26px;display: inline-flex"> {{file.mediaLabelName}}</span><i class="el-icon-arrow-down el-icon--right"></i>
|
|
47
47
|
</span>
|
|
48
48
|
<el-dropdown-menu slot="dropdown" class="el-upload-list__item-preview">
|
|
49
49
|
<el-dropdown-item v-for="(option, index) in model.optionModel.options" :key="index" :command="{option:option,file:file}">
|
|
@@ -331,6 +331,19 @@
|
|
|
331
331
|
background-color: #544f48;
|
|
332
332
|
opacity: 0.8;
|
|
333
333
|
}
|
|
334
|
+
.ct-file .el-dropdown-link{
|
|
335
|
+
cursor: pointer;
|
|
336
|
+
color: #fff;
|
|
337
|
+
position: relative;
|
|
338
|
+
width: 100px;
|
|
339
|
+
height: 26px;
|
|
340
|
+
display: inline-block;
|
|
341
|
+
}
|
|
342
|
+
.el-icon--right {
|
|
343
|
+
position: absolute;
|
|
344
|
+
right: 5px;
|
|
345
|
+
top: 6px;
|
|
346
|
+
}
|
|
334
347
|
.ct-file .cover-list-item-span-delete {
|
|
335
348
|
position: inherit;
|
|
336
349
|
bottom: 160px;
|
|
@@ -554,8 +554,7 @@
|
|
|
554
554
|
},
|
|
555
555
|
getFormObj(){
|
|
556
556
|
let formData=this.model.getFormObj();
|
|
557
|
-
if(this.$route && this.$route.query && this.$route.query.pageStyle)
|
|
558
|
-
{
|
|
557
|
+
if(this.$route && this.$route.query && this.$route.query.pageStyle){
|
|
559
558
|
return Object.assign(formData,{'pageStyle':this.$route.query.pageStyle});
|
|
560
559
|
}
|
|
561
560
|
return formData;
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
</el-input>
|
|
13
13
|
<span v-if="model.sufLabel" style="width:auto" class="spanMessage">{{model.sufLabel}}</span> -->
|
|
14
14
|
<div class="el-input el-input--mini el-input-group el-input-group--prepend el-input--suffix showLabel lableinput">
|
|
15
|
-
<div class="el-input-group__prepend">
|
|
16
|
-
<div
|
|
15
|
+
<div v-if="model.showLabel && model.label" class="el-input-group__prepend">
|
|
16
|
+
<div slot="prepend" class="" :class="[model.labelClass]">
|
|
17
17
|
{{model.label}}
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
:prop="col.id" :label="col.name" :min-width="col.width">
|
|
20
20
|
</el-table-column>
|
|
21
21
|
</el-table>
|
|
22
|
-
<div style="margin-top: 20px;
|
|
22
|
+
<div style="margin-top: 20px;width: 100%;display: inline-block;height: 30px;margin-bottom: 10px;">
|
|
23
23
|
<el-input v-if="jumpBtnName" size="mini" v-model="jumpStr" placeholder="定位" style="width:150px"></el-input>
|
|
24
24
|
<el-button v-if="jumpBtnName" size="mini" @click="jumpClickHandler()">{{jumpBtnName}}</el-button>
|
|
25
25
|
<el-button v-if="filterBtnName" size="mini" @click="filterClickHandler()" style="margin-left: 0px;">{{filterBtnName}}</el-button>
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
</ct-tablecurrency>
|
|
114
114
|
|
|
115
115
|
<!--正常的列-->
|
|
116
|
-
<div v-else-if="typeof column.template === 'undefined'" :class="column.autoRowHeight ? 'lineFeedCell':'cell'">
|
|
116
|
+
<div v-else-if="typeof column.template === 'undefined'" :class="column.autoRowHeight ? 'lineFeedCell':'cell'" :style="column.style ? column.style:''">
|
|
117
117
|
{{row[column.id]}}
|
|
118
118
|
</div>
|
|
119
119
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import dynamicSosTt from './src/dynamicSosTt';
|
|
2
|
+
import api from '../api/index'
|
|
3
|
+
|
|
4
|
+
dynamicSosTt.install = function (Vue) {
|
|
5
|
+
Vue.component(dynamicSosTt.name, dynamicSosTt);
|
|
6
|
+
|
|
7
|
+
Vue.use(api);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
11
|
+
window.Vue.use(dynamicSosTt);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default dynamicSosTt;
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="field-top">
|
|
3
|
+
<div style="width:100%;display:flex">
|
|
4
|
+
<div style="flex:1;" class="ct-so" :class="[(focus || showDrop)?'isfocus':'',model.attrs.size?'ct-so-'+model.attrs.size:''
|
|
5
|
+
]" @mouseover="mouseOverHandle" @mouseout="mouseOutHandle">
|
|
6
|
+
<div :class="[model.showLabel?'el-input-group el-input-group--prepend':'',!valid?'inputError':'']">
|
|
7
|
+
<div v-if="model.showLabel && model.label" class="el-input-group__prepend" :class="[model.labelClass]">
|
|
8
|
+
{{model.label}}
|
|
9
|
+
</div>
|
|
10
|
+
<el-popover ref="pop" placement="bottom-start" v-model="showDrop" :class="[model.showLabel?'showLabel':'']" :trigger="(!model.paramName || model.lock)? 'manual' : 'click'">
|
|
11
|
+
<div>
|
|
12
|
+
<div>
|
|
13
|
+
<el-input ref="searchInput" :size="model.attrs.size" suffix-icon="el-icon-search" v-model="searchText" @input="searchInputHandle"></el-input>
|
|
14
|
+
</div>
|
|
15
|
+
<ctSelectOptionVertical :model="model" @click="selectOption($event)"></ctSelectOptionVertical>
|
|
16
|
+
</div>
|
|
17
|
+
<input slot="reference" v-bind="model.attrs" readonly="readonly" v-model="model.text" :placeholder="soPlaceholder"
|
|
18
|
+
ref="ct-input" :style="{height:inputHeight + 'px','line-height':inputLineHeight + 'px'}"
|
|
19
|
+
@focus="focusHandle" @blur="blurHandle" @click="clickHandle" @input="inputHandler($event)" @change="changeHandler($event)"
|
|
20
|
+
:disabled="model.lock" :class="model.lock ? 'ct-is-disabled' : 'ct-input_inner'" />
|
|
21
|
+
</el-popover>
|
|
22
|
+
<span v-if="!model.lock" class="el-input__suffix" @click="clickHandle" :class="[model.attrs.size?'el-input--'+model.attrs.size:'']">
|
|
23
|
+
<span v-if="showClear === false" class="el-input__suffix-inner">
|
|
24
|
+
<i class="el-select__caret el-input__icon el-icon-arrow-up" :class="{'is-reverse':showDrop}"></i>
|
|
25
|
+
</span>
|
|
26
|
+
<span v-if="showClear === true" class="el-input__suffix-inner ct-close">
|
|
27
|
+
<i class="el-select__caret el-input__icon el-icon-circle-close is-show-close" @click="clearClickHandle($event)"></i>
|
|
28
|
+
</span>
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div style="width:40%; margin-left:10px;">
|
|
33
|
+
<el-input :title="model.lock?model.value1:''" :type="model.inputType" v-model="model.value1" v-bind="model.attrs" @input="inputHandler($event);isShowClear()" @change="changeHandler($event)"
|
|
34
|
+
class="ct-flex-div-input max-input" :class="[model.showLabel?'showLabel':'',!valid?'inputError':'']" :disabled="model.lock" :rows="model.rows"
|
|
35
|
+
:readonly="model.readonly" :show-password="model.isPassword" autocomplete="on" :maxlength="model.max" :show-word-limit="model.showWordLimit"
|
|
36
|
+
@keyup.enter.native="search()">
|
|
37
|
+
</el-input>
|
|
38
|
+
</div>
|
|
39
|
+
<span v-if="model.sufLabel" class="spanMessage ct-flex-div-span">{{model.sufLabel}}</span>
|
|
40
|
+
<transition name="el-fade-in">
|
|
41
|
+
<span v-show="!valid" class="errorMessage">
|
|
42
|
+
{{validMessage}}
|
|
43
|
+
</span>
|
|
44
|
+
</transition>
|
|
45
|
+
<div v-if="!model.lock && model.popupSearchListType === 1">
|
|
46
|
+
<el-button v-if="!model.moreActionBtnName" size="mini" class="h26" type="primary" icon="el-icon-search" @click="popupSearchListHandle"></el-button>
|
|
47
|
+
<el-button v-else size="mini" type="primary" class="h26" @click="popupSearchListHandle">{{model.moreActionBtnName}}</el-button>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
import dynamicElement from '../../mixins/dynamicElement'
|
|
55
|
+
import selectOption from '../../selectOption/src/selectOption'
|
|
56
|
+
import ctSelectOptionVertical from '../../selectOption/src/selectOptionVertical'
|
|
57
|
+
export default {
|
|
58
|
+
name: 'ct-sosTt',
|
|
59
|
+
mixins: [dynamicElement],
|
|
60
|
+
components: {
|
|
61
|
+
'ctSelectOption': selectOption,
|
|
62
|
+
'ctSelectOptionVertical': ctSelectOptionVertical
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
api: String,
|
|
66
|
+
vmodel: Object,
|
|
67
|
+
popShow: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
data() {
|
|
73
|
+
return {
|
|
74
|
+
focus: false,
|
|
75
|
+
showDrop: false,
|
|
76
|
+
inputHeight: 26,
|
|
77
|
+
showClear: false,
|
|
78
|
+
searchText: ""
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
created() {
|
|
82
|
+
if (typeof this.vmodel === 'undefined') {
|
|
83
|
+
this.model = this.loaderObj.SosTt(this.source);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.model = this.vmodel;
|
|
87
|
+
}
|
|
88
|
+
this.$watch('model.value', (n, o) => {
|
|
89
|
+
if (typeof this.model.child !== 'undefined') {
|
|
90
|
+
this.model.child.value = this.model.child.defaultValue || '';
|
|
91
|
+
this.model.child.text = this.model.child.defaultText || '';
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
this.inputHeight = this.inputLineHeight;
|
|
95
|
+
},
|
|
96
|
+
computed: {
|
|
97
|
+
soPlaceholder: {
|
|
98
|
+
get: function () {
|
|
99
|
+
if (this.model.value !== '') {
|
|
100
|
+
return '';
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
return this.model.attrs.placeholder;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
set: function (v) {
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
inputLineHeight: {
|
|
111
|
+
get: function () {
|
|
112
|
+
switch (this.model.attrs.size) {
|
|
113
|
+
case 'mini':
|
|
114
|
+
return 26;
|
|
115
|
+
case 'small':
|
|
116
|
+
return 32;
|
|
117
|
+
case 'medium':
|
|
118
|
+
return 36;
|
|
119
|
+
default:
|
|
120
|
+
return 40;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
optionColSpan: function () {
|
|
125
|
+
return parseInt(24 / this.model.optionColCount);
|
|
126
|
+
},
|
|
127
|
+
optionRowCount: function () {
|
|
128
|
+
return parseInt(this.model.options.length % this.model.optionColCount > 0 ? (this.model.options.length / this.model.optionColCount) + 1 : this.model.options.length / this.model.optionColCount);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
mounted() {
|
|
132
|
+
var self = this;
|
|
133
|
+
this.$nextTick(function () {
|
|
134
|
+
var dropdown = self.$refs["pop"];
|
|
135
|
+
self.$watch('model.options', function (newVal, oldVal) {
|
|
136
|
+
self.$nextTick(() => {
|
|
137
|
+
if (typeof dropdown.popperJS !== 'undefined' && dropdown.popperJS) {
|
|
138
|
+
dropdown.popperJS.destroy();
|
|
139
|
+
dropdown.popperJS = null;
|
|
140
|
+
dropdown.updatePopper();
|
|
141
|
+
}
|
|
142
|
+
self.$refs["searchInput"].$el.querySelector("input").focus();
|
|
143
|
+
});
|
|
144
|
+
}, { deep: true, immediate: true });
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
methods: {
|
|
148
|
+
getOptions: function () {
|
|
149
|
+
var self = this;
|
|
150
|
+
this.model.getOptions(this.api, self.searchText);
|
|
151
|
+
},
|
|
152
|
+
soChange: function () {
|
|
153
|
+
var self = this;
|
|
154
|
+
if (typeof this.model.child !== 'undefined') {
|
|
155
|
+
this.model.child.value = this.model.child.defaultValue || '';
|
|
156
|
+
this.model.child.text = this.model.child.defaultText || '';
|
|
157
|
+
}
|
|
158
|
+
var currentOption = this.model.options.find((value) => {
|
|
159
|
+
return self.model.value === value[self.model.optionAttrs.value];
|
|
160
|
+
});
|
|
161
|
+
if (currentOption) {
|
|
162
|
+
this.model.text =currentOption[self.model.optionAttrs.label];
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
this.model.text = '';
|
|
166
|
+
}
|
|
167
|
+
this.inputHandler(self.model.value);
|
|
168
|
+
this.changeHandler(self.model.value);
|
|
169
|
+
if(this.model.autoSearch) this.$emit('click');
|
|
170
|
+
},
|
|
171
|
+
focusHandle: function () {
|
|
172
|
+
this.$set(this, 'focus', true);
|
|
173
|
+
},
|
|
174
|
+
blurHandle: function () {
|
|
175
|
+
this.$set(this, 'focus', false);
|
|
176
|
+
},
|
|
177
|
+
clickHandle: function () {
|
|
178
|
+
if (this.model.lock) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
if (this.model.paramName) {
|
|
182
|
+
this.$set(this, 'showDrop', !this.showDrop);
|
|
183
|
+
if (this.showDrop) {
|
|
184
|
+
this.getOptions();
|
|
185
|
+
}
|
|
186
|
+
this.focusHandle();
|
|
187
|
+
}
|
|
188
|
+
else if (this.model.popupSearchListType === 1) {
|
|
189
|
+
this.popupSearchListHandle();
|
|
190
|
+
}
|
|
191
|
+
else if ((this.model.popupSearchListType === 0)) {
|
|
192
|
+
this.$message.warning("请配置参数paramName1");
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
popupSearchListHandle: function () {
|
|
196
|
+
var self = this;
|
|
197
|
+
|
|
198
|
+
self.$emit('popupSearchList', true, self.model, self.model.moreActionRouter, (option) => {
|
|
199
|
+
if (option) {
|
|
200
|
+
self.model.value = option[self.model.optionAttrs.value];
|
|
201
|
+
self.model.text = option[self.model.optionAttrs.label];
|
|
202
|
+
self.model.options.push(option);
|
|
203
|
+
|
|
204
|
+
self.soChange();
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
},
|
|
208
|
+
getOptionText: function (value) {
|
|
209
|
+
var self = this;
|
|
210
|
+
var option = this.model.options.find((v) => { return v[self.model.optionAttrs.value] === value });
|
|
211
|
+
if (option) {
|
|
212
|
+
return option[self.model.optionAttrs.label];
|
|
213
|
+
} else {
|
|
214
|
+
return value;
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
getOptionSelect(value) {
|
|
218
|
+
if (this.model.value === value) {
|
|
219
|
+
return "danger";
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
return "success";
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
selectOption(value) {
|
|
226
|
+
if (this.model.value === value) {
|
|
227
|
+
this.$set(this, 'showDrop', false);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
this.model.value = value;
|
|
232
|
+
}
|
|
233
|
+
this.soChange();
|
|
234
|
+
this.$set(this, 'showDrop', false);
|
|
235
|
+
},
|
|
236
|
+
mouseOverHandle: function () {
|
|
237
|
+
if (this.model.value !== '' && this.model.clearable) {
|
|
238
|
+
this.$set(this, 'showClear', true);
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
mouseOutHandle: function () {
|
|
242
|
+
this.$set(this, 'showClear', false);
|
|
243
|
+
},
|
|
244
|
+
//不能共用的数据校验
|
|
245
|
+
selfValidExcute: function (eventName) {
|
|
246
|
+
if (this.required == true && this.model.value1 == "") {
|
|
247
|
+
this.valid = false;
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
return true;
|
|
251
|
+
},
|
|
252
|
+
clearClickHandle: function (event) {
|
|
253
|
+
this.model.value = '';
|
|
254
|
+
this.soChange();
|
|
255
|
+
event.stopPropagation();
|
|
256
|
+
},
|
|
257
|
+
isShowClear() {
|
|
258
|
+
if (this.model.value1 !== '' && this.model.clearable) {
|
|
259
|
+
this.$set(this, 'showClear', true);
|
|
260
|
+
} else {
|
|
261
|
+
this.$set(this, 'showClear', false);
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
searchInputHandle: function () {
|
|
265
|
+
var currentSeatch = this.searchText;
|
|
266
|
+
this.searchTickControl(currentSeatch);
|
|
267
|
+
},
|
|
268
|
+
searchTickControl: function (search) {
|
|
269
|
+
var self = this;
|
|
270
|
+
setTimeout(function () {
|
|
271
|
+
if (search === self.searchText) {
|
|
272
|
+
self.getOptions(self.searchText);
|
|
273
|
+
}
|
|
274
|
+
}, self.model.searchTick);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
</script>
|
|
279
|
+
<style>
|
|
280
|
+
.h26{
|
|
281
|
+
height: 26px;
|
|
282
|
+
}
|
|
283
|
+
</style>
|