centaline-data-driven-v3 0.0.68 → 0.0.69
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 +68 -68
- package/package.json +1 -1
- package/src/components/Layout/Layout.vue +7 -2
- package/src/components/app/ComboBox.vue +16 -7
- package/src/components/app/PhotoSelect.vue +16 -11
- package/src/components/app/SearchList/SearchTable.vue +3 -1
- package/src/components/app/searchScreen.vue +1 -1
- package/src/components/web/Form.vue +4 -2
- package/src/components/web/SearchList/SearchTable.vue +13 -9
- package/src/components/web/SearchList.vue +1 -0
- package/src/loader/src/ComboBox.js +18 -7
- package/src/loader/src/SearchScreen.js +0 -2
- package/src/main.js +2 -2
- package/src/utils/mixins.js +3 -0
- package/src/utils/request.js +4 -4
- package/src/views/Form.vue +2 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="ct-Layout" v-if="Layout !== null && !loading">
|
|
2
|
+
<div class="ct-Layout" v-if="Layout !== null && !loading" @click="rowClickHandle" :style="{ 'background-color': selectIndex === rowindex?selectedRowBackColor:'' }">
|
|
3
3
|
<ct-layoutchildren :rowindex="rowindex" :actionRouter="actionRouter" :rowdata="vmodel" :vmodel="LayoutList"
|
|
4
4
|
:flagflex="true" :fields="fields" :parameterAction="parameterAction"
|
|
5
5
|
:rowMenuDisplayCountForAPP="rowMenuDisplayCountForAPP" @click="clickHandler"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<script setup lang="ts">
|
|
10
10
|
import { ref, nextTick } from 'vue'
|
|
11
11
|
import common from '../../utils/common'
|
|
12
|
-
const emit = defineEmits(['rolRouterclick', 'changeHandler'])
|
|
12
|
+
const emit = defineEmits(['rolRouterclick', 'changeHandler','rowclick'])
|
|
13
13
|
const props = defineProps({
|
|
14
14
|
action: String,
|
|
15
15
|
cellLayout: String,
|
|
@@ -20,6 +20,8 @@ const props = defineProps({
|
|
|
20
20
|
apiParam: Object,
|
|
21
21
|
parameterAction: String,
|
|
22
22
|
fields: Array,
|
|
23
|
+
selectIndex:Number,
|
|
24
|
+
selectedRowBackColor:String,
|
|
23
25
|
formListactionRouter: {
|
|
24
26
|
type: Array,
|
|
25
27
|
default: [],
|
|
@@ -315,6 +317,9 @@ function changeHandler(field) {
|
|
|
315
317
|
emit("changeHandler", field, props.vmodel.$sourceIndex);
|
|
316
318
|
}
|
|
317
319
|
}
|
|
320
|
+
function rowClickHandle(){
|
|
321
|
+
emit("rowclick", props.rowindex);
|
|
322
|
+
}
|
|
318
323
|
</script>
|
|
319
324
|
<style scoped>
|
|
320
325
|
.ct-Layout {
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
</template>
|
|
99
99
|
<script lang="ts" setup>
|
|
100
100
|
import { ref } from 'vue'
|
|
101
|
+
import Axios from 'axios';
|
|
101
102
|
import { initData, changeHandler } from '../../utils/mixins';
|
|
102
103
|
import ComboBox from '../../loader/src/ComboBox';
|
|
103
104
|
const emit = defineEmits(['click', 'input', 'change', 'popupSearchList'])
|
|
@@ -110,19 +111,29 @@ const model = initData(props, ComboBox)
|
|
|
110
111
|
const showPicker = ref(false)
|
|
111
112
|
const searchText = ref('')
|
|
112
113
|
const checkboxRefs = ref([])
|
|
114
|
+
let cancelTokenSource = null; // 用于存储取消令牌
|
|
113
115
|
function visibleChange() {
|
|
114
|
-
if(model.value.locked){
|
|
116
|
+
if (model.value.locked) {
|
|
115
117
|
return;
|
|
116
118
|
}
|
|
117
|
-
|
|
119
|
+
getOptions();
|
|
120
|
+
}
|
|
121
|
+
function getOptions() {
|
|
122
|
+
if (cancelTokenSource) {
|
|
123
|
+
// 取消上一次未完成的请求
|
|
124
|
+
cancelTokenSource.cancel('取消上一次请求');
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 创建新的取消令牌
|
|
128
|
+
cancelTokenSource = Axios.CancelToken.source();
|
|
129
|
+
model.value.getOptions(props.parameterAction, searchText.value, cancelTokenSource, function (data) {
|
|
118
130
|
model.value.options = data
|
|
119
131
|
showPicker.value = true
|
|
120
132
|
})
|
|
121
133
|
}
|
|
122
|
-
|
|
123
134
|
function change(item) {
|
|
124
135
|
showPicker.value = false;
|
|
125
|
-
|
|
136
|
+
|
|
126
137
|
model.value.value = item.code;
|
|
127
138
|
model.value.setcode(item.code)
|
|
128
139
|
if (model.value.isList) {
|
|
@@ -145,9 +156,7 @@ function onConfirm() {
|
|
|
145
156
|
changeHandler(model.value, emit)
|
|
146
157
|
}
|
|
147
158
|
function searchInputHandle() {
|
|
148
|
-
|
|
149
|
-
model.value.options = data;
|
|
150
|
-
})
|
|
159
|
+
getOptions();
|
|
151
160
|
}
|
|
152
161
|
function itemOnClick(index, item) {
|
|
153
162
|
if (model.value.locked || item.locked) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="van-uploader" style="margin:10px 10px 0 10px; " v-if="model">
|
|
3
3
|
<div class="van-uploader__wrapper">
|
|
4
4
|
<div ref="uploadImgItem">
|
|
5
|
-
<template v-for="(element, index) in
|
|
5
|
+
<template v-for="(element, index) in model.fileList" :key="element.mediaCode">
|
|
6
6
|
<div class="van-uploader__preview" style="display:inline-block;"
|
|
7
7
|
@click="viewerfile(model.fileList, index)">
|
|
8
8
|
<div class="van-image van-uploader__preview-image">
|
|
@@ -117,7 +117,7 @@ function handleOpen() {
|
|
|
117
117
|
chooseList.push(n);
|
|
118
118
|
});
|
|
119
119
|
var dialogOption = {
|
|
120
|
-
title: common.LocalizedString('选择','選擇') + model.value.controlLabel || common.LocalizedString('选择图片','選擇圖片'),
|
|
120
|
+
title: common.LocalizedString('选择', '選擇') + model.value.controlLabel || common.LocalizedString('选择图片', '選擇圖片'),
|
|
121
121
|
pane: common.getParentPane(),
|
|
122
122
|
content: [{
|
|
123
123
|
component: "ct-photoselectlist",
|
|
@@ -166,16 +166,21 @@ function selfValidExcute(eventName) {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
function viewerfile(list, index) {
|
|
169
|
+
var file = list[index];
|
|
170
|
+
if (file && file.mediaTypeID == 4 && !common.isVideoFile(file.mediaUrl) && common.getDataDrivenOpts().handler.openUrlInBrowse) {
|
|
171
|
+
common.getDataDrivenOpts().handler.openUrlInBrowse(file.mediaUrl)
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
var MediaAlbum = [{ albumName: model.value.controlLabel || "媒体", medias: [] as any }];
|
|
169
175
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
MediaAlbum
|
|
177
|
-
}
|
|
178
|
-
common.viewerfile((model.value.controlLabel || "预览媒体"), MediaAlbum, 0, index, model.value.mediaViewPageType);
|
|
176
|
+
let fileList = list.filter((item) => {
|
|
177
|
+
return item.flagDeleted !== true;
|
|
178
|
+
});
|
|
179
|
+
fileList.forEach((v) => {
|
|
180
|
+
MediaAlbum[0].medias.push(v);
|
|
181
|
+
});
|
|
182
|
+
common.viewerfile((model.value.controlLabel || "预览媒体"), MediaAlbum, 0, index, model.value.mediaViewPageType);
|
|
183
|
+
}
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
|
|
@@ -181,7 +181,9 @@ function load(data) {
|
|
|
181
181
|
model.value.flagApp = true
|
|
182
182
|
tableError.value = false
|
|
183
183
|
tableLoading.value = false
|
|
184
|
-
model.value
|
|
184
|
+
model.value.scripts.formData = model.value.formData;
|
|
185
|
+
model.value.scripts.formData.formTable = model.value;
|
|
186
|
+
model.value.$vue = { loadStats, updateCurrentRow, doAction, itemKey,toolbarClickHandler, emit, tableError, refreshTableColumns, getPage, setTableHeight };
|
|
185
187
|
emit("loaded");
|
|
186
188
|
if (model.value.rowCount == model.value.$total) {
|
|
187
189
|
finished.value = true;
|
|
@@ -220,7 +220,7 @@ function open(field) {
|
|
|
220
220
|
field.showLabel = false;
|
|
221
221
|
field.isList = true;
|
|
222
222
|
if (field.is == 'ct-combobox') {
|
|
223
|
-
field.getOptions(model.value.parameterAction, '', function (data) {
|
|
223
|
+
field.getOptions(model.value.parameterAction, '',null, function (data) {
|
|
224
224
|
field.options = data
|
|
225
225
|
})
|
|
226
226
|
}
|
|
@@ -242,7 +242,7 @@ function init() {
|
|
|
242
242
|
function load(data) {
|
|
243
243
|
model.value = data
|
|
244
244
|
model.value.parentModelForm = props.parentModelForm
|
|
245
|
-
model.value.$vue = { fieldClickHandler, clickHandler, validExcute, emit, getFormObj, changeCallBackHandler, getFileData, Form, load, init, updateFields, itemKey,downloadUrl };
|
|
245
|
+
model.value.$vue = { fieldClickHandler, clickHandler, validExcute, emit, getFormObj, changeCallBackHandler, getFileData, Form, load, init, updateFields, itemKey,downloadUrl,doAction };
|
|
246
246
|
model.value.$vue.openType = props.openType
|
|
247
247
|
model.value.isIframe = props.isIframe
|
|
248
248
|
if (model.value.scripts) {
|
|
@@ -269,7 +269,9 @@ function failLoad() {
|
|
|
269
269
|
function getFileData(field) {
|
|
270
270
|
return Form.getFileData(field, model.value);
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
function doAction(data) {
|
|
273
|
+
Form.doAction(data)
|
|
274
|
+
}
|
|
273
275
|
//判断是否有滚动条
|
|
274
276
|
function getisScroll() {
|
|
275
277
|
if (Fields.value) {
|
|
@@ -206,7 +206,8 @@
|
|
|
206
206
|
<div v-else>
|
|
207
207
|
<div v-for="(row, rowindex) in model.listData" :key="rowindex">
|
|
208
208
|
<ct-layout :vmodel="row" :cellLayout="model.cellLayout" :rowindex="rowindex" :key="itemKey"
|
|
209
|
-
@rolRouterclick="rolRouterCellClickHandler" :actionRouter="model.actionRouter"
|
|
209
|
+
@rolRouterclick="rolRouterCellClickHandler" :actionRouter="model.actionRouter"
|
|
210
|
+
:selectIndex="model.selectIndex" :selectedRowBackColor="model.selectedRowBackColor" @rowclick="rowLayoutClickHandle">
|
|
210
211
|
</ct-layout>
|
|
211
212
|
</div>
|
|
212
213
|
</div>
|
|
@@ -350,7 +351,7 @@ onActivated(() => {
|
|
|
350
351
|
})
|
|
351
352
|
})
|
|
352
353
|
onDeactivated(() => {
|
|
353
|
-
|
|
354
|
+
downloadUrl.value = ''
|
|
354
355
|
})
|
|
355
356
|
|
|
356
357
|
//查询数据
|
|
@@ -376,7 +377,7 @@ function searchComplate(m, defaultSearch) {
|
|
|
376
377
|
//初始化数据
|
|
377
378
|
function load(data) {
|
|
378
379
|
model.value = data;
|
|
379
|
-
model.value.$vue = { searchStrat, searchEnd, downloadUrl, loadStats, setTableHeight, updateCurrentRow, doAction, itemKey, refreshTableColumns, calculatingRowHeight, emit, operationLoading, getPage,toolbarClickHandler };
|
|
380
|
+
model.value.$vue = { searchStrat, searchEnd, downloadUrl, loadStats, setTableHeight, updateCurrentRow, doAction, itemKey, refreshTableColumns, calculatingRowHeight, emit, operationLoading, getPage, toolbarClickHandler };
|
|
380
381
|
model.value.isIframe = props.isIframe
|
|
381
382
|
//自动查询 调用合并列
|
|
382
383
|
if (model.value.listData.length > 0) {
|
|
@@ -588,18 +589,18 @@ function importComplete(res, field) {
|
|
|
588
589
|
}
|
|
589
590
|
else {
|
|
590
591
|
if (field && field.callBackFunName) {
|
|
591
|
-
|
|
592
|
+
changeCallBackHandler(field, field.callBackFunName, res.content);
|
|
592
593
|
}
|
|
593
594
|
else {
|
|
594
|
-
|
|
595
|
+
doAction(res)
|
|
595
596
|
}
|
|
596
597
|
}
|
|
597
598
|
}
|
|
598
599
|
function changeCallBackHandler(field, callBackFunName, callBackPara) {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
if (callBackFunName) {
|
|
601
|
+
model.value.scripts.$fd = field.id;
|
|
602
|
+
common.excuteFunStr.call(model.value.scripts, callBackFunName, callBackPara);
|
|
603
|
+
}
|
|
603
604
|
}
|
|
604
605
|
//计算数据合并行
|
|
605
606
|
function tdRowspan(column, row) {
|
|
@@ -678,6 +679,9 @@ function rowClickHandle(ev, index) {
|
|
|
678
679
|
ev.cancelBubble = true;
|
|
679
680
|
ev.stopPropagation();
|
|
680
681
|
}
|
|
682
|
+
function rowLayoutClickHandle(index) {
|
|
683
|
+
model.value.selectIndex = index;
|
|
684
|
+
}
|
|
681
685
|
|
|
682
686
|
//表单列表操作
|
|
683
687
|
function rolRouterClickHandler(field, rowData, rowindex, visible, columnName) {
|
|
@@ -160,7 +160,7 @@ const ComboBox = function (source) {
|
|
|
160
160
|
}
|
|
161
161
|
return source.code1 === '' ? [] : [{ value: source.code1, label: source.name1 }]
|
|
162
162
|
},
|
|
163
|
-
getOptions(paramsAction, searchText, cancelTokenSource,CallBack) {
|
|
163
|
+
getOptions(paramsAction, searchText, cancelTokenSource, CallBack) {
|
|
164
164
|
var apiAddrs = paramsAction;
|
|
165
165
|
var params = {
|
|
166
166
|
action: apiAddrs,
|
|
@@ -171,13 +171,24 @@ const ComboBox = function (source) {
|
|
|
171
171
|
key: searchText
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if (
|
|
177
|
-
CallBack
|
|
174
|
+
if (cancelTokenSource) {
|
|
175
|
+
request.postTokenHandler(common.globalUri(), params, cancelTokenSource).then((response) => {
|
|
176
|
+
if (response.rtnCode === 200) {
|
|
177
|
+
if (CallBack) {
|
|
178
|
+
CallBack(response.content)
|
|
179
|
+
}
|
|
178
180
|
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
else{
|
|
184
|
+
request.postHandler(common.globalUri(), params).then((response) => {
|
|
185
|
+
if (response.rtnCode === 200) {
|
|
186
|
+
if (CallBack) {
|
|
187
|
+
CallBack(response.content)
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
181
192
|
},
|
|
182
193
|
};
|
|
183
194
|
rtn = base.copy(source, rtn);
|
|
@@ -320,8 +320,6 @@ function isHandle(type) {
|
|
|
320
320
|
let result = false;
|
|
321
321
|
switch (type) {
|
|
322
322
|
case Enum.ControlType.CheckBoxList://复选列表
|
|
323
|
-
case Enum.ControlType.MultiSelectNoSearch:
|
|
324
|
-
case Enum.ControlType.MultiSelectWithSearch:
|
|
325
323
|
result = true;
|
|
326
324
|
break;
|
|
327
325
|
default:
|
package/src/main.js
CHANGED
|
@@ -26,7 +26,7 @@ app.use(centaline, {
|
|
|
26
26
|
//baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
|
|
27
27
|
//baseUrl: "http://10.1.245.111:38028/",
|
|
28
28
|
flagRouterSelf: true,
|
|
29
|
-
flagApp:
|
|
29
|
+
flagApp: true,//是否app端
|
|
30
30
|
zindex: 999,
|
|
31
31
|
showRequestSuccessMessage: true,
|
|
32
32
|
showRequestErrorMessage: true,
|
|
@@ -64,7 +64,7 @@ app.use(centaline, {
|
|
|
64
64
|
//authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
|
|
65
65
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
66
66
|
//authObject: '{token:"1-a7289bb2-9f1e-4a04-9016-1e555bf39188"}',
|
|
67
|
-
authObject: '{EmpID:"
|
|
67
|
+
authObject: '{EmpID:"Token_15dc3fe3-b962-4bd2-85e2-2ce843676353",MachineCode:"e1f39b75-7069-4c4f-b5d5-c590da2d9aa2",SSO_Token:"SSOToken_15dc3fe3-b962-4bd2-85e2-2ce843676353",Platform:"IOS"}',
|
|
68
68
|
};
|
|
69
69
|
},
|
|
70
70
|
// 请求完成事件,可判断是否登录过期执行响应操作
|
package/src/utils/mixins.js
CHANGED
|
@@ -342,7 +342,9 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
342
342
|
cancelButtonText: '取消',
|
|
343
343
|
type: 'warning'
|
|
344
344
|
}).then(() => {
|
|
345
|
+
field.disabled = true;
|
|
345
346
|
field.doAction(model.$vue.getFormObj({ flagHaveAlert: '1' }), (res) => {
|
|
347
|
+
field.disabled = false;
|
|
346
348
|
if (res.rtnCode === Enum.ReturnCode.Successful) {
|
|
347
349
|
if (res.notification === Enum.ActionType.Router) {
|
|
348
350
|
if (common.dialogList && common.dialogList.List.value.length > 0
|
|
@@ -358,6 +360,7 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
358
360
|
}
|
|
359
361
|
});
|
|
360
362
|
}).catch(() => {
|
|
363
|
+
field.disabled = false;
|
|
361
364
|
});
|
|
362
365
|
}
|
|
363
366
|
}, model.scripts);
|
package/src/utils/request.js
CHANGED
|
@@ -15,7 +15,7 @@ const request = {
|
|
|
15
15
|
params = params.para;
|
|
16
16
|
}
|
|
17
17
|
else if (common.flagRouterSelf()) {
|
|
18
|
-
url = url + params.action;
|
|
18
|
+
url = url + (url=='' || url.substr(-1)=='/'?'':'/') + params.action;
|
|
19
19
|
params = params.para;
|
|
20
20
|
}
|
|
21
21
|
return Axios.get(url, params, {
|
|
@@ -34,7 +34,7 @@ const request = {
|
|
|
34
34
|
params = params.para;
|
|
35
35
|
}
|
|
36
36
|
else if (common.flagRouterSelf()) {
|
|
37
|
-
url = url + params.action;
|
|
37
|
+
url = url + (url=='' || url.substr(-1)=='/'?'':'/') + params.action;
|
|
38
38
|
params = params.para;
|
|
39
39
|
}
|
|
40
40
|
return Axios.post(url, params, {
|
|
@@ -127,7 +127,7 @@ const request = {
|
|
|
127
127
|
params = params.para;
|
|
128
128
|
}
|
|
129
129
|
else if (common.flagRouterSelf()) {
|
|
130
|
-
url = url + params.action;
|
|
130
|
+
url = url + (url=='' || url.substr(-1)=='/'?'':'/') + params.action;
|
|
131
131
|
params = params.para;
|
|
132
132
|
}
|
|
133
133
|
return Axios.post(url, params, {
|
|
@@ -175,7 +175,7 @@ const request = {
|
|
|
175
175
|
params = params.para;
|
|
176
176
|
}
|
|
177
177
|
else if (common.flagRouterSelf()) {
|
|
178
|
-
url = url + params.action;
|
|
178
|
+
url = url + (url=='' || url.substr(-1)=='/'?'':'/') + params.action;
|
|
179
179
|
params = params.para;
|
|
180
180
|
}
|
|
181
181
|
return Axios.post(url, params, {
|
package/src/views/Form.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="data-driven" id="app-form" >
|
|
3
3
|
|
|
4
|
-
<ct-form :api="'/
|
|
4
|
+
<ct-form :api="'/admin/SchoolTeachingPlanActivityExamAnswer/readDetail'" :apiParam="apiParam" :flagNavbar="true"></ct-form>
|
|
5
5
|
<!-- <ct-form :api="'/api/third-dept-tran/tran-comm-adjust/task'" :apiParam="apiParam"></ct-form> -->
|
|
6
6
|
<!-- <ct-form :api="'/PropertyTranToActive/getLayoutOfNew'" :apiParam="apiParam"></ct-form> -->
|
|
7
7
|
<!-- <ct-textbox :source="source"></ct-textbox> -->
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
<script lang="ts" setup>
|
|
12
12
|
//const apiParam={"originalTraId":"1739561435204980737","actionType":1,"pageStyle":2,"pageTitle":"成交报告","pageOnly":true}
|
|
13
|
-
const apiParam={"
|
|
13
|
+
const apiParam={"rowId":"1900912713408843776","actionType":3}
|
|
14
14
|
</script>
|