centaline-data-driven-v3 0.0.91 → 0.0.93
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/dist/centaline-data-driven-v3.umd.js +11 -11
- package/package.json +1 -1
- package/src/assets/commonApp.css +1 -1
- package/src/components/app/Form.vue +17 -1
- package/src/components/app/TextBox.vue +11 -2
- package/src/components/app/searchScreen.vue +2 -1
- package/src/components/web/ContainerControl.vue +1 -1
- package/src/components/web/Form.vue +4 -2
- package/src/components/web/Label.vue +6 -2
- package/src/components/web/SearchScreen.vue +1 -0
- package/src/loader/src/SearchScreen.js +2 -389
- package/src/main.js +1 -1
- package/src/utils/formData.js +285 -180
- package/src/views/SearchList.vue +4 -4
package/package.json
CHANGED
package/src/assets/commonApp.css
CHANGED
|
@@ -155,6 +155,22 @@ init()
|
|
|
155
155
|
function init() {
|
|
156
156
|
showLoadingToast({ message: '', duration: 10000 });
|
|
157
157
|
loading.value = true
|
|
158
|
+
const isAndroid = /Android/i.test(navigator.userAgent);
|
|
159
|
+
if (isAndroid) {
|
|
160
|
+
// 动态检测键盘状态
|
|
161
|
+
let viewportHeight = window.innerHeight;
|
|
162
|
+
|
|
163
|
+
window.addEventListener('resize', () => {
|
|
164
|
+
const newHeight = window.innerHeight;
|
|
165
|
+
const keyboardHeight = viewportHeight - newHeight;
|
|
166
|
+
|
|
167
|
+
if (keyboardHeight > 100) { // 键盘弹出
|
|
168
|
+
document.querySelector('.button-absoluteAPP').style.bottom = `${keyboardHeight}px`;
|
|
169
|
+
} else { // 键盘收起
|
|
170
|
+
document.querySelector('.button-absoluteAPP').style.bottom = '0';
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
158
174
|
nextTick(function () {
|
|
159
175
|
if (props.drowerClose && props.drowerClose == 'open') {
|
|
160
176
|
return;
|
|
@@ -248,7 +264,7 @@ function setFormHeight() {
|
|
|
248
264
|
h2 = refForm.value.offsetTop
|
|
249
265
|
}
|
|
250
266
|
let formHeight = h1 - h2
|
|
251
|
-
if ((common.flagMicroMessenger()||common.flagHK())&&model.value.buttons.findIndex((v) => { return v.show }) > -1) {
|
|
267
|
+
if ((common.flagMicroMessenger() || common.flagHK()) && model.value.buttons.findIndex((v) => { return v.show }) > -1) {
|
|
252
268
|
formHeight = formHeight - 64
|
|
253
269
|
}
|
|
254
270
|
model.value.formHeight = formHeight
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<van-field clearable :type="model.inputType" :rows="model.rows" v-bind="model.attrs" v-model="model.code1"
|
|
12
12
|
:readonly="model.readonly" :disabled="model.locked" :maxlength="model.maxValue1"
|
|
13
13
|
:show-word-limit="model.showWordLimit" :label-align="model.inputType == 'textarea' ? 'top' : 'left'"
|
|
14
|
-
@input="
|
|
14
|
+
@input="input()" @blur="change()" class="ct-text" autocomplete="off">
|
|
15
15
|
<template #label v-if="model.showLabel && model.controlLabel">
|
|
16
16
|
<div :class="[model.required ? 'requiredLabel' : '']"
|
|
17
17
|
:style="model.isList ? 'white-space: nowrap' : ''">
|
|
@@ -49,7 +49,16 @@ function popupSearchListHandle() {
|
|
|
49
49
|
let isSingle = model.value.moreActionRouter.isSingle
|
|
50
50
|
emit('popupSearchList', isSingle, model, model.value.moreActionRouter);
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
function input() {
|
|
53
|
+
if(model.value.controlType===Enum.ControlType.MultiLineText || model.value.controlType===Enum.ControlType.TextBox){
|
|
54
|
+
}
|
|
55
|
+
else{
|
|
56
|
+
change();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function change() {
|
|
60
|
+
changeHandler(model.value, emit);
|
|
61
|
+
}
|
|
53
62
|
defineExpose({
|
|
54
63
|
model
|
|
55
64
|
})
|
|
@@ -163,6 +163,7 @@ function load(data) {
|
|
|
163
163
|
model.value.scripts.formData.form = model.value;
|
|
164
164
|
model.value.scripts.formData.excuteData = model.value.screen;
|
|
165
165
|
model.value.scripts.formData.fieldsDic = model.value.screenDic;
|
|
166
|
+
model.value.scripts.formData.source = SearchScreen;
|
|
166
167
|
}
|
|
167
168
|
if (model.value.onload) {
|
|
168
169
|
let onloads = model.value.onload.split(';');
|
|
@@ -204,7 +205,7 @@ function setscreendata() {
|
|
|
204
205
|
v.controlType !== Enum.ControlType.LineFeed
|
|
205
206
|
);
|
|
206
207
|
});
|
|
207
|
-
if (screens.length >
|
|
208
|
+
if (screens.length > 3) {
|
|
208
209
|
ismore.value = true;
|
|
209
210
|
screens = screens.splice(0, 3);
|
|
210
211
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
|
|
13
13
|
<div v-if="col.show !== false"
|
|
14
14
|
:class="index > 0 && (col.controlLabel == '' || col.is == 'ct-button') ? 'complex-left-10' : ''"
|
|
15
|
-
:style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : '
|
|
15
|
+
:style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : ''), 'flex': (col.width && col.width>0? '0 0 ' + col.width + 'px' : '') }">
|
|
16
16
|
<component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
|
|
17
17
|
v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
|
|
18
18
|
@popupSearchList="popupSearchListHandler"></component>
|
|
@@ -173,8 +173,8 @@
|
|
|
173
173
|
|
|
174
174
|
</div>
|
|
175
175
|
<template v-if="model?.aiAttr?.showAI && !showAI">
|
|
176
|
-
<div class="btn-avatar" @click="AIToggle">
|
|
177
|
-
<img class="avatar-img" :src="util.getAssetsImage('AIChat.png')" :alt="model?.aiRouter.controlLabel"
|
|
176
|
+
<div class="btn-avatar" @click.stop="AIToggle">
|
|
177
|
+
<img class="avatar-img" @click.stop="AIToggle" :src="util.getAssetsImage('AIChat.png')" :alt="model?.aiRouter.controlLabel"
|
|
178
178
|
:title="model?.aiRouter.controlLabel">
|
|
179
179
|
</div>
|
|
180
180
|
</template>
|
|
@@ -267,6 +267,7 @@ onBeforeUnmount(()=>{
|
|
|
267
267
|
model.value.scripts.formData.fieldsDic = null;
|
|
268
268
|
model.value.scripts.formData = null;
|
|
269
269
|
}
|
|
270
|
+
Fields.value = null;
|
|
270
271
|
refForm.value = null;
|
|
271
272
|
model.value = null;
|
|
272
273
|
if (qrtimer1.value) {
|
|
@@ -686,6 +687,7 @@ function buttonsWidth() {
|
|
|
686
687
|
.avatar-img {
|
|
687
688
|
height: 50px;
|
|
688
689
|
animation: bounce 0.5s infinite ease-in-out;
|
|
690
|
+
cursor: pointer;
|
|
689
691
|
/* 使用ease-in-out让动画更平滑 */
|
|
690
692
|
}
|
|
691
693
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<ct-field :vmodel="model">
|
|
3
3
|
<template #Control v-if="model.code1">
|
|
4
4
|
<template v-if="model.controlType==Enum.ControlType.HtmlLabel">
|
|
5
|
-
<span class="ct-html" @click="clickHandle" v-html="model.value"></span>
|
|
5
|
+
<span class="ct-html" :class="{ 'cursor-pointer': model.onChanged }" @click="clickHandle" v-html="model.value"></span>
|
|
6
6
|
</template>
|
|
7
7
|
<template v-else-if="model.flagJson">
|
|
8
8
|
<el-tag v-for="item in model.value" :key="item" type="info" :disable-transitions="true" style="margin: 2px 6px 2px 0px;">{{ item
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<div :style="{ 'width': (model.value.length > 66 ? '400px' : 'auto') }" v-html="model.value">
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
|
-
<span class="ct-lable" @mouseover="onMouseOver($event)" v-html="model.value" @click="clickHandle"></span>
|
|
19
|
+
<span class="ct-lable" :class="{ 'cursor-pointer': model.onChanged }" @mouseover="onMouseOver($event)" v-html="model.value" @click="clickHandle"></span>
|
|
20
20
|
</el-tooltip>
|
|
21
21
|
<span class="unitName">{{ model.unitName1 }}</span>
|
|
22
22
|
</template>
|
|
@@ -92,4 +92,8 @@ defineExpose({
|
|
|
92
92
|
--el-tag-text-color: var(--el-color-info);
|
|
93
93
|
color: var(--el-color-info);
|
|
94
94
|
}
|
|
95
|
+
|
|
96
|
+
.cursor-pointer {
|
|
97
|
+
cursor: pointer; /* 鼠标悬停时显示为“小手”形状 */
|
|
98
|
+
}
|
|
95
99
|
</style>
|
|
@@ -118,6 +118,7 @@ function load(data) {
|
|
|
118
118
|
model.value.scripts.formData.form = model.value;
|
|
119
119
|
model.value.scripts.formData.excuteData = model.value.screen;
|
|
120
120
|
model.value.scripts.formData.fieldsDic = model.value.screenDic;
|
|
121
|
+
model.value.scripts.formData.source = SearchScreen;
|
|
121
122
|
}
|
|
122
123
|
if (model.value.onload) {
|
|
123
124
|
let onloads = model.value.onload.split(';');
|
|
@@ -3,6 +3,7 @@ import LibFunction from './LibFunction';
|
|
|
3
3
|
import Enum from '../../utils/Enum';
|
|
4
4
|
import common from '../../utils/common';
|
|
5
5
|
import request from '../../utils/request';
|
|
6
|
+
import formData from '../../utils/formData';
|
|
6
7
|
|
|
7
8
|
function loadSearchScreenApi(action, callBack, screenPara, prevParam, failCallBack) {
|
|
8
9
|
if (action) {
|
|
@@ -27,395 +28,7 @@ function loadSearchScreenApi(action, callBack, screenPara, prevParam, failCallBa
|
|
|
27
28
|
}
|
|
28
29
|
function loadSearchScreenModel(source, prevParam) {
|
|
29
30
|
let rtn = {
|
|
30
|
-
formData:
|
|
31
|
-
form: null,
|
|
32
|
-
formTable: null,
|
|
33
|
-
excuteData: null,//fields
|
|
34
|
-
fieldsDic: null,//fieldsDic
|
|
35
|
-
_excuteListData: undefined,
|
|
36
|
-
enableRelationFields(FlagRelation) {
|
|
37
|
-
this.form.enableRelationFields = FlagRelation
|
|
38
|
-
},
|
|
39
|
-
//获取code1
|
|
40
|
-
getCode1ByField1(id) {
|
|
41
|
-
var rtn1 = this.fieldsDic[id];
|
|
42
|
-
if (rtn1) {
|
|
43
|
-
return rtn1.code1;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
//获取code2
|
|
48
|
-
getCode2ByField1(id) {
|
|
49
|
-
var rtn1 = this.fieldsDic[id];
|
|
50
|
-
if (rtn1) {
|
|
51
|
-
return rtn1.code2;
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
setActionRouter(id, attrKey, attrValue) {
|
|
55
|
-
var router = this.form.actionRouters.find((v1) => {
|
|
56
|
-
return v1.key === id;
|
|
57
|
-
});
|
|
58
|
-
if (router) {
|
|
59
|
-
router[attrKey] = attrValue;
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
//获取Field的属性attrKey的值
|
|
63
|
-
getValueByFieldName(id, attrKey) {
|
|
64
|
-
attrKey = common.initialsToLowerCase(attrKey);
|
|
65
|
-
var rtn1 = this.fieldsDic[id];
|
|
66
|
-
if (rtn1) {
|
|
67
|
-
return rtn1[attrKey];
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
getValueByFieldNameFromParent(id, attrKey) {
|
|
71
|
-
if (this.form && this.form.parentModelForm) {
|
|
72
|
-
return this.form.parentModelForm.getValueByFieldName(id, attrKey);
|
|
73
|
-
}
|
|
74
|
-
return null;
|
|
75
|
-
},
|
|
76
|
-
//设置Field的属性attrKey的值
|
|
77
|
-
setValueByFieldName(id, attrKey, attrValue) {
|
|
78
|
-
attrKey = common.initialsToLowerCase(attrKey);
|
|
79
|
-
var rtn1 = this.fieldsDic[id];
|
|
80
|
-
if (rtn1) {
|
|
81
|
-
if (attrKey == 'code1' && rtn1.controlType === Enum.ControlType.NumericTextBox
|
|
82
|
-
&& attrValue != undefined && attrValue != null && attrValue != '') {
|
|
83
|
-
if (rtn1.decimals1 != undefined && rtn1.decimals1 != null && rtn1.decimals1 > -1) {
|
|
84
|
-
attrValue = Number(attrValue).toFixed(rtn1.decimals1)
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else if (attrKey == 'code1' && (rtn1.controlType === Enum.ControlType.File
|
|
88
|
-
|| rtn1.controlType === Enum.ControlType.SliceUpload || rtn1.controlType === Enum.ControlType.PhotoSelect)
|
|
89
|
-
&& attrValue != undefined && attrValue != null && attrValue != '') {
|
|
90
|
-
rtn1.jsSetFile(attrValue, rtn1);
|
|
91
|
-
}
|
|
92
|
-
rtn1[attrKey] = attrValue;
|
|
93
|
-
if (rtn1.controlType === Enum.ControlType.Tags) {
|
|
94
|
-
rtn1["value"] = JSON.parse(attrValue);
|
|
95
|
-
}
|
|
96
|
-
if (rtn1.controlType === Enum.ControlType.SearchListBox
|
|
97
|
-
|| rtn1.controlType === Enum.ControlType.ComboBox
|
|
98
|
-
|| rtn1.controlType === Enum.ControlType.MultiSelectWithSearch
|
|
99
|
-
|| rtn1.controlType === Enum.ControlType.MultiSelectNoSearch
|
|
100
|
-
) {
|
|
101
|
-
if (rtn1["options"].length == 0) {
|
|
102
|
-
rtn1["options"] = [{ value: '', label: '' }];
|
|
103
|
-
}
|
|
104
|
-
if (attrKey == 'code1') {
|
|
105
|
-
rtn1["value"] = attrValue;
|
|
106
|
-
rtn1["options"][0]["value"] = attrValue
|
|
107
|
-
}
|
|
108
|
-
if (attrKey == 'name1') {
|
|
109
|
-
rtn1["options"][0]["label"] = attrValue
|
|
110
|
-
}
|
|
111
|
-
if (rtn1.itemKey) rtn1.itemKey = Math.random()
|
|
112
|
-
}
|
|
113
|
-
if (rtn1.is == 'ct-button') {
|
|
114
|
-
if (common.flagApp() && this.form.$vue.loaded) {
|
|
115
|
-
this.form.$vue.loaded(this.form)
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
hiddenHandle(rtn1, this.form);
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
setValueByFieldNameFromParent(id, attrKey, attrValue) {
|
|
122
|
-
if (this.form && this.form.parentModelForm) {
|
|
123
|
-
return this.form.parentModelForm.setValueByFieldName(id, attrKey, attrValue);
|
|
124
|
-
}
|
|
125
|
-
return null;
|
|
126
|
-
},
|
|
127
|
-
//设置Field的v1、v2的值
|
|
128
|
-
setV1AndV2ByField1(id, code1, code2) {
|
|
129
|
-
var rtn1 = this.fieldsDic[id];
|
|
130
|
-
if (rtn1) {
|
|
131
|
-
if (typeof rtn1.code1 !== 'undefined') {
|
|
132
|
-
rtn1.code1 = code1;
|
|
133
|
-
hiddenHandle(rtn1);//隐藏关联的
|
|
134
|
-
}
|
|
135
|
-
if (typeof rtn1.code2 !== 'undefined') {
|
|
136
|
-
rtn1.code2 = code2;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
clearMedia(id) {
|
|
141
|
-
var rtn1 = this.fieldsDic[id];
|
|
142
|
-
for (let i = 0; i < rtn1.fileSourceList.length; i++) {
|
|
143
|
-
rtn1.fileSourceList[i].flagDeleted = true;
|
|
144
|
-
}
|
|
145
|
-
rtn1.fileList = [];
|
|
146
|
-
},
|
|
147
|
-
setTabsSelect(id) {
|
|
148
|
-
if (this.form && this.form.$vue) {
|
|
149
|
-
var f = this.fieldsDic[id];
|
|
150
|
-
if (this.form.isHorizontalLayout) {
|
|
151
|
-
this.form.$vue.activeName = f.collapseName.toString() === '-1' ? this.form.$vue.activeName : f.collapseName.toString();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
//路由提交
|
|
156
|
-
submit(fieldName1) {
|
|
157
|
-
if (this.form && this.form.$vue) {
|
|
158
|
-
this.form.$vue.fieldClickHandler({ fieldName1: fieldName1 });
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
//获取列表数据
|
|
163
|
-
get excuteListData() {
|
|
164
|
-
if (this._excuteListData) {
|
|
165
|
-
return this._excuteListData;
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
if (this.excuteData !== null) {
|
|
169
|
-
this._excuteListData = this.excuteData.filter((v) => {
|
|
170
|
-
return typeof v.is !== undefined && (v.is === 'ct-formlist' || v.is === 'ct-repeat');
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return this._excuteListData;
|
|
175
|
-
},
|
|
176
|
-
setExcuteListData(fields) {
|
|
177
|
-
this._excuteListData = null;
|
|
178
|
-
if (fields !== null) {
|
|
179
|
-
this.excuteData = fields;
|
|
180
|
-
this._excuteListData = fields.filter((v) => {
|
|
181
|
-
return typeof v.is !== undefined && (v.is === 'ct-formlist' || v.is === 'ct-repeat');
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
//获取列表的Field
|
|
186
|
-
getListField(tableName, rowNum, fiedlId) {
|
|
187
|
-
let listData = this.excuteListData.find((v) => {
|
|
188
|
-
return v.name === tableName;
|
|
189
|
-
});
|
|
190
|
-
if (listData) {
|
|
191
|
-
let field = null;
|
|
192
|
-
//正在编辑的Field
|
|
193
|
-
if (rowNum === null && (fiedlId === null || listData.currentEventField.fieldName1 === fiedlId)) {
|
|
194
|
-
field = listData.currentEventField;
|
|
195
|
-
}
|
|
196
|
-
//正在编辑的行
|
|
197
|
-
else if (rowNum === null && listData.currentRowIndex === 0) {
|
|
198
|
-
let fields = listData.currentRow.data;
|
|
199
|
-
field = fields[fiedlId];
|
|
200
|
-
}
|
|
201
|
-
//源数据
|
|
202
|
-
else {
|
|
203
|
-
if (rowNum === null && listData.currentRowIndex) {
|
|
204
|
-
rowNum = listData.currentRowIndex;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (rowNum === 0 || (rowNum && fiedlId)) {
|
|
208
|
-
try {
|
|
209
|
-
let fields = listData.rows[rowNum].field;
|
|
210
|
-
field = fields.find((v) => {
|
|
211
|
-
return v.fieldName1 === fiedlId;
|
|
212
|
-
});
|
|
213
|
-
} catch (e) {
|
|
214
|
-
if (listData.rows.length <= rowNum) {
|
|
215
|
-
common.message('获取列表行索引超出界限', 'error')
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return { listData: listData, field: field };
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
//获取列表的行数(注意 这里包括列头)
|
|
225
|
-
getListCount(tableName) {
|
|
226
|
-
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
227
|
-
let data = this.getListField(tableName, null, null);
|
|
228
|
-
if (data) {
|
|
229
|
-
return data.listData.rows.length;
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
//获取表格某行某列的值
|
|
233
|
-
getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue) {
|
|
234
|
-
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
235
|
-
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
236
|
-
|
|
237
|
-
attrName = common.initialsToLowerCase(attrName);
|
|
238
|
-
attrName = attrName ? attrName : 'code1';
|
|
239
|
-
|
|
240
|
-
if (!fiedlId) {
|
|
241
|
-
fiedlId = data.listData.currentEventField.fieldName1;
|
|
242
|
-
}
|
|
243
|
-
if (fiedlId && rowNum === null && fiedlId === data.listData.currentEventField.fieldName1) {
|
|
244
|
-
data.field = data.listData.currentEventField;
|
|
245
|
-
}
|
|
246
|
-
rowNum = rowNum !== null ? rowNum : data.listData.currentRowIndex;
|
|
247
|
-
|
|
248
|
-
//若该行正在编辑,则取编辑状态的。
|
|
249
|
-
if (data && data.listData && data.listData.currentRow.data && data.listData.currentRow.data[fiedlId]
|
|
250
|
-
&& data.listData.currentRow.data.$sourceIndex === rowNum && data.listData.currentRow.isSet) {
|
|
251
|
-
return data.listData.currentRow.data[fiedlId][attrName];
|
|
252
|
-
}
|
|
253
|
-
else if (data && data.field) {
|
|
254
|
-
if (typeof defaultValue !== 'undefined' && data.listData.rows[rowNum].deleted) {//若该行被删除时,则直接返回默认值
|
|
255
|
-
return defaultValue;
|
|
256
|
-
}
|
|
257
|
-
return data.field[attrName];
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
//设置表格某行某列的值
|
|
261
|
-
setListFieldValue(value, tableName, rowNum, fiedlId, attrName, flagTemplate) {
|
|
262
|
-
value = value == undefined ? "" : value.toString();
|
|
263
|
-
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
264
|
-
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
265
|
-
|
|
266
|
-
attrName = common.initialsToLowerCase(attrName);
|
|
267
|
-
attrName = attrName ? attrName : 'code1';
|
|
268
|
-
|
|
269
|
-
if (!fiedlId) {
|
|
270
|
-
fiedlId = data.listData.currentEventField.id;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
rowNum = rowNum ? rowNum : data.listData.currentRowIndex;
|
|
274
|
-
|
|
275
|
-
if (data) {
|
|
276
|
-
//正在编辑的行
|
|
277
|
-
if (data.listData.currentRow.data && data.listData.currentRow.data[fiedlId] && rowNum > -1
|
|
278
|
-
&& data.listData.currentRow.data.$sourceIndex === data.listData.source.rows[rowNum].$sourceIndex) {
|
|
279
|
-
let currentField = data.listData.currentRow.data[fiedlId];
|
|
280
|
-
currentField[attrName] = value;
|
|
281
|
-
//校验自己
|
|
282
|
-
if (currentField.validExcute) {
|
|
283
|
-
currentField.validExcute();
|
|
284
|
-
}
|
|
285
|
-
if (data.field) {
|
|
286
|
-
data.field[attrName] = value;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
else if (data.field) {
|
|
290
|
-
if (data.field) {
|
|
291
|
-
data.field[attrName] = value;
|
|
292
|
-
}
|
|
293
|
-
if (data.field.source) {
|
|
294
|
-
data.field.source[attrName] = value;
|
|
295
|
-
}
|
|
296
|
-
if (flagTemplate) {
|
|
297
|
-
data.field[attrName] = value;
|
|
298
|
-
}
|
|
299
|
-
if (data.listData.flagTemplate && data.listData.$vue) {
|
|
300
|
-
data.listData.$vue.itemKey = Math.random()
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
//如果有汇总列,触发重新计算汇总
|
|
305
|
-
if (data.listData.showSummary) {
|
|
306
|
-
data.listData.tableData.push({});
|
|
307
|
-
data.listData.tableData.pop();
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
return true;
|
|
311
|
-
}
|
|
312
|
-
return false;
|
|
313
|
-
},
|
|
314
|
-
//设置表格选择路由
|
|
315
|
-
setListSelectRouter(tableId, attrKey, attrValue) {
|
|
316
|
-
let listData = this.excuteListData.find((v) => {
|
|
317
|
-
return v.fieldName1 === tableId;
|
|
318
|
-
});
|
|
319
|
-
if (listData) {
|
|
320
|
-
var router = listData.selectRouter;
|
|
321
|
-
if (router) {
|
|
322
|
-
router[attrKey] = attrValue;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
//设置表格属性值
|
|
327
|
-
setListAttr(tableId, attrName, attrValue) {
|
|
328
|
-
let listData = this.excuteListData.find((v) => {
|
|
329
|
-
return v.fieldName1 === tableId;
|
|
330
|
-
});
|
|
331
|
-
if (listData) {
|
|
332
|
-
listData[attrName] = attrValue
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
//新增表格数据
|
|
336
|
-
insertRow(tableId, rows) {
|
|
337
|
-
let listData = this.excuteListData.find((v) => {
|
|
338
|
-
return v.fieldName1 === tableId;
|
|
339
|
-
});
|
|
340
|
-
if (listData) {
|
|
341
|
-
listData.$vue.insertRow(rows);
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
//添加单选表格数据
|
|
345
|
-
insertSingleRow(tableId, row) {
|
|
346
|
-
let listData = this.excuteListData.find((v) => {
|
|
347
|
-
return v.fieldName1 === tableId;
|
|
348
|
-
});
|
|
349
|
-
if (listData) {
|
|
350
|
-
listData.$vue.insertSingleRow(row);
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
//新增或替换表格数据
|
|
354
|
-
insertOrUpdateRow(tableId, row) {
|
|
355
|
-
let listData = this.excuteListData.find((v) => {
|
|
356
|
-
return v.fieldName1 === tableId;
|
|
357
|
-
});
|
|
358
|
-
if (listData) {
|
|
359
|
-
listData.$vue.insertOrUpdateRow(row);
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
//删除表格数据
|
|
363
|
-
deleteRow(tableId, row) {
|
|
364
|
-
let listData = this.excuteListData.find((v) => {
|
|
365
|
-
return v.id === tableId;
|
|
366
|
-
});
|
|
367
|
-
if (listData) {
|
|
368
|
-
listData.$vue.delRow(row);
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
//清空表格数据
|
|
372
|
-
clear(tableId) {
|
|
373
|
-
let listData = this.excuteListData.find((v) => {
|
|
374
|
-
return v.fieldName1 === tableId;
|
|
375
|
-
});
|
|
376
|
-
if (listData) {
|
|
377
|
-
listData.$vue.deleteAll();
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
|
|
381
|
-
//获取后台数据,并返回脚本。
|
|
382
|
-
execServerScript(action, object, successCallback) {
|
|
383
|
-
let formData = this;//作用域保存
|
|
384
|
-
|
|
385
|
-
//是否是行内触发的
|
|
386
|
-
let data = this.getListField(this.form.scripts.$fd, null, null);
|
|
387
|
-
object.editMode = data ? 1 : 0;
|
|
388
|
-
|
|
389
|
-
request.postHandler(common.globalUri(), { action: action, para: object }).then(
|
|
390
|
-
function (response) {
|
|
391
|
-
if (response.rtnCode === Enum.ReturnCode.Successful) {
|
|
392
|
-
var data = response.content;
|
|
393
|
-
if (response.clientActionType === Enum.ClientActionType.ExcuteScript && data) {
|
|
394
|
-
common.excute.call(formData.form.scripts, data);
|
|
395
|
-
}
|
|
396
|
-
else
|
|
397
|
-
if (response.clientActionType === Enum.ClientActionType.None && data && successCallback) {
|
|
398
|
-
//因为要传参,并直接执行方法,故successCallback回调里要使用formData的话,要加this
|
|
399
|
-
//若不能接受this,也可修改common.excute方法
|
|
400
|
-
//successCallback.call(formData.form.scripts, data);
|
|
401
|
-
|
|
402
|
-
//优化,不需要加this
|
|
403
|
-
common.excuteFun.call(formData.form.scripts, successCallback, data);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
);
|
|
408
|
-
},
|
|
409
|
-
execRouter(routerKey) {
|
|
410
|
-
let field = { fieldName1: routerKey };
|
|
411
|
-
this.form.$vue.fieldClickHandler(field);
|
|
412
|
-
},
|
|
413
|
-
//消息提示 type主题:success/warning/info/error。 duration 显示时间, 毫秒。设为 0 则不会自动关闭。 showClose 是否显示关闭按钮。
|
|
414
|
-
message(message, type, center, duration, showClose, dangerouslyUseHTMLString) {
|
|
415
|
-
common.message(message, type, center, duration, showClose, dangerouslyUseHTMLString)
|
|
416
|
-
},
|
|
417
|
-
|
|
418
|
-
},
|
|
31
|
+
formData:formData,
|
|
419
32
|
get title() {
|
|
420
33
|
return source.title;
|
|
421
34
|
},
|
package/src/main.js
CHANGED
|
@@ -68,7 +68,7 @@ app.use(centaline, {
|
|
|
68
68
|
//authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
|
|
69
69
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
70
70
|
//authObject: '{token:"1-bce18a8d-21f0-4022-a6ca-450de105cafc"}',
|
|
71
|
-
authObject: '{EmpID:"
|
|
71
|
+
authObject: '{EmpID:"Token_35daf643-69e6-4da4-addf-c6c9ffdf59ff",MachineCode:"7c4b2ffd-920a-462c-a586-37bbfb45c4fe",SSO_Token:"SSOToken_35daf643-69e6-4da4-addf-c6c9ffdf59ff",Platform:"IOS"}',
|
|
72
72
|
};
|
|
73
73
|
},
|
|
74
74
|
getToken() {
|