centaline-data-driven-v3 0.0.96 → 0.0.98
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 +91 -91
- package/package.json +1 -1
- package/src/components/app/Progress.vue +1 -1
- package/src/components/app/SearchList/SearchStats.vue +3 -3
- package/src/components/app/SearchList/SearchTable.vue +1 -1
- package/src/components/web/Button.vue +84 -26
- package/src/components/web/Form.vue +35 -28
- package/src/components/web/FormList.vue +13 -2
- package/src/components/web/SearchList/SearchStats.vue +3 -3
- package/src/components/web/photo.vue +29 -17
- package/src/loader/src/Button.js +7 -0
- package/src/loader/src/Form.js +3 -2
- package/src/loader/src/Photo.js +23 -7
- package/src/loader/src/Router.js +12 -1
- package/src/loader/src/SearchStats.js +1 -1
- package/src/main.js +2 -2
- package/src/utils/Enum.js +5 -1
- package/src/utils/common.js +21 -2
- package/src/utils/formData.js +362 -358
- package/src/views/SearchList.vue +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="ct-progress">
|
|
3
3
|
<div style="padding: 5px;">
|
|
4
4
|
<div class="circleBox">
|
|
5
|
-
<van-circle v-if="progressFlag" v-model:current-rate="percentage" :rate="
|
|
5
|
+
<van-circle v-if="progressFlag" v-model:current-rate="percentage" :rate="percentage" :speed="100" />
|
|
6
6
|
<div class="circleCenter" v-if="progressFlag">
|
|
7
7
|
<div style="font-size: 16px;color: #666;"> {{ percentage.toFixed(2) }}%</div>
|
|
8
8
|
</div>
|
|
@@ -30,10 +30,10 @@ const model = ref(null)
|
|
|
30
30
|
const selectStats = ref("")
|
|
31
31
|
const fieldName1 = ref("")
|
|
32
32
|
const tableStatistics = ref()
|
|
33
|
-
function searchStatsComplate() {
|
|
33
|
+
function searchStatsComplate(defaultSearchData) {
|
|
34
34
|
nextTick(function () {
|
|
35
35
|
if (typeof props.api !== "undefined") {
|
|
36
|
-
SearchStats.loadSearchStatsApi(props.api, load, props.searchModel,
|
|
36
|
+
SearchStats.loadSearchStatsApi(props.api, load, props.searchModel, defaultSearchData);
|
|
37
37
|
}
|
|
38
38
|
if (typeof props.source !== "undefined") {
|
|
39
39
|
load(SearchStats.loadSearchStatsModel(props.source));
|
|
@@ -48,7 +48,7 @@ function load(data) {
|
|
|
48
48
|
data.source.content.forEach((item) => {
|
|
49
49
|
fieldName1.value = item.fieldName1;
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
if (selectStats.value == ''&&!(model.value.defaultSearchData&&model.value.defaultSearchData.searchData)) {
|
|
52
52
|
var i = data.source.content.findIndex((v) => {
|
|
53
53
|
return v.code1 == props.apiParam[fieldName1.value];
|
|
54
54
|
});
|
|
@@ -38,6 +38,21 @@
|
|
|
38
38
|
<div>{{ model.controlLabel }}</div>
|
|
39
39
|
<div class="subText">{{ model.subText }}</div>
|
|
40
40
|
</el-button>
|
|
41
|
+
<!-- <ct-selectfile v-else-if="model.isOpenFileDialog" :form="model" :vmodel="model"></ct-selectfile> -->
|
|
42
|
+
<template v-else-if="model.isOpenFileDialog" :form="model" :vmodel="model">
|
|
43
|
+
<input type="file" multiple ref="fileInput" @change="handleFileChange" style="display: none"
|
|
44
|
+
:accept="model.fileAccept" />
|
|
45
|
+
<el-button type="primary" @click="triggerUpload" v-bind="model.attrs"
|
|
46
|
+
:style="{ color: model.textColor, backgroundColor: model.imgUrl ? 'transparent' : model.bgColor, borderColor: model.imgUrl ? 'transparent' : model.borderColor, padding: model.imgUrl ? '0px' : null }"
|
|
47
|
+
:disabled="model.disabled || model.locked" class="btn-add">
|
|
48
|
+
<template #icon v-if="model.icon">
|
|
49
|
+
<el-icon>
|
|
50
|
+
<component :is="model.icon"></component>
|
|
51
|
+
</el-icon>
|
|
52
|
+
</template>
|
|
53
|
+
{{ model.controlLabel }}</el-button>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
41
56
|
<el-button v-else type="primary" :loading="model.loading" v-bind="model.attrs" @click="clickHandle"
|
|
42
57
|
:style="{ color: model.textColor, backgroundColor: model.imgUrl ? 'transparent' : model.bgColor, borderColor: model.imgUrl ? 'transparent' : model.borderColor, padding: model.imgUrl ? '0px' : null }"
|
|
43
58
|
:disabled="model.disabled || model.locked">
|
|
@@ -55,13 +70,13 @@
|
|
|
55
70
|
</el-button>
|
|
56
71
|
</template>
|
|
57
72
|
<script setup lang="ts">
|
|
58
|
-
import { computed } from 'vue'
|
|
73
|
+
import { computed, ref } from 'vue'
|
|
59
74
|
import { initData } from '../../utils/mixins';
|
|
60
75
|
import Button from '../../loader/src/Button';
|
|
61
76
|
import Enum from '../../utils/Enum'
|
|
62
77
|
import common from '../../utils/common'
|
|
63
78
|
import request from '../../utils/request'
|
|
64
|
-
import { ElMessage } from 'element-plus'
|
|
79
|
+
import { ElMessage, UploadFile } from 'element-plus'
|
|
65
80
|
const emit = defineEmits(['input', 'fieldClick', 'importComplete'])
|
|
66
81
|
const props = defineProps({
|
|
67
82
|
parameterAction: String,
|
|
@@ -71,6 +86,16 @@ const props = defineProps({
|
|
|
71
86
|
flagAppMode: Boolean,
|
|
72
87
|
parentModel: Object,
|
|
73
88
|
})
|
|
89
|
+
|
|
90
|
+
interface FileItem {
|
|
91
|
+
name: string;
|
|
92
|
+
raw: File;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const fileInput = ref(null); // 获取 input 元素的引用
|
|
96
|
+
const fileList = ref<FileItem[]>([]);
|
|
97
|
+
|
|
98
|
+
|
|
74
99
|
const model = initData(props, Button)
|
|
75
100
|
if (model.value.controlType == Enum.ControlType.ButtonAdvancedSearch) {
|
|
76
101
|
model.value.icon = 'ico-open';
|
|
@@ -96,35 +121,35 @@ const headers = computed(() => {
|
|
|
96
121
|
return common.getDataDrivenOpts().handler.getRequestHeaders();
|
|
97
122
|
})
|
|
98
123
|
function clickHandle() {
|
|
99
|
-
|
|
124
|
+
emit('fieldClick', model.value);
|
|
100
125
|
}
|
|
101
126
|
|
|
102
127
|
function handleAvatarBeforeUpload(file) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
128
|
+
if (model.value.form && model.value.form.$vue) {
|
|
129
|
+
let submitData = model.value.form.$vue.getFileData(model.value);
|
|
130
|
+
for (var key in submitData) {
|
|
131
|
+
if (typeof submitData[key] === "object") {
|
|
132
|
+
uploadData.value[key] = JSON.stringify(submitData[key]);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
uploadData.value[key] = submitData[key];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
112
138
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
139
|
+
if (props.parentModel && props.parentModel.is && props.parentModel.is == "ct-formlist" && props.parentModel.form && props.parentModel.form.$vue) {
|
|
140
|
+
let submitData = props.parentModel.form.$vue.getFileData(model.value);
|
|
141
|
+
for (var key in submitData) {
|
|
142
|
+
if (typeof submitData[key] === "object") {
|
|
143
|
+
uploadData.value[key] = JSON.stringify(submitData[key]);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
uploadData.value[key] = submitData[key];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
123
149
|
}
|
|
124
|
-
}
|
|
125
150
|
}
|
|
126
151
|
function handleAvatarSuccess(res) {
|
|
127
|
-
|
|
152
|
+
emit('importComplete', res, model.value);
|
|
128
153
|
}
|
|
129
154
|
function handleAvatarError(info) {
|
|
130
155
|
ElMessage({
|
|
@@ -141,8 +166,41 @@ function dropClick() {
|
|
|
141
166
|
}
|
|
142
167
|
}
|
|
143
168
|
function commandClick(code) {
|
|
144
|
-
|
|
145
|
-
|
|
169
|
+
model.value.selectOptionCode = code;
|
|
170
|
+
emit('fieldClick', model.value);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// 触发文件选择
|
|
174
|
+
const triggerUpload = () => {
|
|
175
|
+
fileInput.value.click();
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// 处理文件选择
|
|
179
|
+
const handleFileChange = (event) => {
|
|
180
|
+
const input = event.target as HTMLInputElement;
|
|
181
|
+
|
|
182
|
+
// 安全检查
|
|
183
|
+
if (!input?.files?.length) {
|
|
184
|
+
console.warn('未选择文件');
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// 更新文件列表
|
|
189
|
+
fileList.value = Array.from(input.files).map(file => ({
|
|
190
|
+
name: file.name,
|
|
191
|
+
raw: file
|
|
192
|
+
}));
|
|
193
|
+
|
|
194
|
+
model.value.fileList = fileList.value;
|
|
195
|
+
emit('fieldClick', model.value);
|
|
196
|
+
event.target.value = '';
|
|
197
|
+
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
function generateUUID() {
|
|
201
|
+
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
|
|
202
|
+
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
|
|
203
|
+
);
|
|
146
204
|
}
|
|
147
205
|
</script>
|
|
148
206
|
<style scoped>
|
|
@@ -157,13 +157,13 @@
|
|
|
157
157
|
|
|
158
158
|
</div>
|
|
159
159
|
<template v-if="model?.aiAttr?.showAI">
|
|
160
|
-
<div :style="{ flex: ' 0 0 ' + model.aiAttr.width + 'px',
|
|
160
|
+
<div :style="{ flex: ' 0 0 ' + model.aiAttr.width + 'px', position: 'sticky', top: '0', 'box-shadow': '-10px 0 5px -9px rgba(0, 0, 0, 0.3)' }"
|
|
161
161
|
v-show="showAI">
|
|
162
162
|
<div
|
|
163
163
|
:style="{ position: 'sticky', top: '0', height: dialogHeight + 'px', overflow: 'hidden', 'border-bottom-right-radius': '4px' }">
|
|
164
164
|
<AIChat :height="dialogHeight"
|
|
165
|
-
:style="{ position: 'sticky', top: '0', height: dialogHeight + 'px' }"
|
|
166
|
-
:
|
|
165
|
+
:style="{ position: 'sticky', top: '0', height: dialogHeight + 'px' }" :field="model.aiChat"
|
|
166
|
+
:router="model.aiRouter" :actionRouter="model.actionRouters" :form="model"
|
|
167
167
|
@hideAI="AIToggle" :isVisible="showAI" :tablewidth="model.aiAttr.width">
|
|
168
168
|
|
|
169
169
|
</AIChat>
|
|
@@ -174,8 +174,8 @@
|
|
|
174
174
|
</div>
|
|
175
175
|
<template v-if="model?.aiAttr?.showAI && !showAI">
|
|
176
176
|
<div class="btn-avatar" @click.stop="AIToggle">
|
|
177
|
-
<img class="avatar-img" @click.stop="AIToggle" :src="util.getAssetsImage('AIChat.png')"
|
|
178
|
-
:title="model?.aiRouter.controlLabel">
|
|
177
|
+
<img class="avatar-img" @click.stop="AIToggle" :src="util.getAssetsImage('AIChat.png')"
|
|
178
|
+
:alt="model?.aiRouter.controlLabel" :title="model?.aiRouter.controlLabel">
|
|
179
179
|
</div>
|
|
180
180
|
</template>
|
|
181
181
|
<div style="min-height:200px" v-if="loading"></div>
|
|
@@ -193,6 +193,7 @@ import { useRouter } from 'vue-router';
|
|
|
193
193
|
import util from '../../utils/pub-use'
|
|
194
194
|
import Enum from '../../utils/Enum';
|
|
195
195
|
import AIChat from '../web/AIChat.vue';
|
|
196
|
+
import { fi } from 'element-plus/es/locale';
|
|
196
197
|
const emit = defineEmits(['loaded', 'failLoad', 'submit', 'AIToggle'])
|
|
197
198
|
const props = defineProps({
|
|
198
199
|
api: String,
|
|
@@ -259,25 +260,25 @@ const showAI = ref(false);
|
|
|
259
260
|
const dialogHeight = ref(props.dialogHeight || (window.innerHeight - 60));
|
|
260
261
|
|
|
261
262
|
const qrtimer1 = ref(null)
|
|
262
|
-
const qrtimer2=ref(null)
|
|
263
|
-
onBeforeUnmount(()=>{
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
263
|
+
const qrtimer2 = ref(null)
|
|
264
|
+
onBeforeUnmount(() => {
|
|
265
|
+
if (model.value && typeof model.value.scripts !== 'undefined') {
|
|
266
|
+
model.value.scripts.formData.form = null;
|
|
267
|
+
model.value.scripts.formData.excuteData = null;
|
|
268
|
+
model.value.scripts.formData.fieldsDic = null;
|
|
269
|
+
model.value.scripts.formData = null;
|
|
270
|
+
}
|
|
271
|
+
Fields.value = null;
|
|
272
|
+
refForm.value = null;
|
|
273
|
+
model.value = null;
|
|
274
|
+
if (qrtimer1.value) {
|
|
275
|
+
clearTimeout(qrtimer1.value);
|
|
276
|
+
qrtimer1.value = null;
|
|
277
|
+
}
|
|
278
|
+
if (qrtimer2.value) {
|
|
279
|
+
clearTimeout(qrtimer2.value);
|
|
280
|
+
qrtimer2.value = null;
|
|
281
|
+
}
|
|
281
282
|
})
|
|
282
283
|
|
|
283
284
|
onUpdated(() => {
|
|
@@ -351,7 +352,7 @@ function doAction(data) {
|
|
|
351
352
|
//判断是否有滚动条
|
|
352
353
|
function getisScroll() {
|
|
353
354
|
if (Fields.value) {
|
|
354
|
-
if(qrtimer1.value)clearTimeout(qrtimer1.value);
|
|
355
|
+
if (qrtimer1.value) clearTimeout(qrtimer1.value);
|
|
355
356
|
if (refForm.value) {
|
|
356
357
|
let parentDom = refForm.value.parentElement;
|
|
357
358
|
if (parentDom.id == "app-form" && parentDom.scrollHeight > window.innerHeight) {
|
|
@@ -374,9 +375,15 @@ function fieldClickHandler(field) {
|
|
|
374
375
|
let data = Form.getRouterAndSubmitData(field, model.value);
|
|
375
376
|
clickHandler(data.router, data.submitData);
|
|
376
377
|
}
|
|
377
|
-
function clickHandler(field, submitData) {
|
|
378
|
-
|
|
378
|
+
function clickHandler(field, submitData,formList) {
|
|
379
|
+
if (field.isOpenFileDialog) {
|
|
380
|
+
common.excuteFunStr.call(model.value.scripts, field.onChanged, {files: field.fileList,columns: formList?.source?.rows[0].columns });
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
RouterClickHandler(field, submitData, null, model.value, 'form');
|
|
384
|
+
}
|
|
379
385
|
}
|
|
386
|
+
|
|
380
387
|
//组件数据验证
|
|
381
388
|
function validExcute() {
|
|
382
389
|
var rtnBool = true;
|
|
@@ -667,7 +674,7 @@ function buttonsWidth() {
|
|
|
667
674
|
}
|
|
668
675
|
return rtn;
|
|
669
676
|
}
|
|
670
|
-
|
|
677
|
+
|
|
671
678
|
</script>
|
|
672
679
|
|
|
673
680
|
<style scoped>
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
<div v-if="model">
|
|
3
3
|
<template v-if="model.flagTemplate">
|
|
4
4
|
<div class="list-button">
|
|
5
|
+
<template v-for="(v, i) in model.toolButtonsShow">
|
|
6
|
+
<component :is="v.is" :vmodel="v" :parentModel="model" @fieldClick="toolButtonsClick"
|
|
7
|
+
@importComplete="importComplete" @change="toolButtonsChangeHandler(v, $event)">
|
|
8
|
+
</component>
|
|
9
|
+
</template>
|
|
5
10
|
<component v-if="model.selectRouter !== null" :is="model.selectRouter.is" :vmodel="model.selectRouter"
|
|
6
11
|
@click="popupSearchListHandle(model.selectRouter)"></component>
|
|
7
12
|
<el-button v-if="model.create" :disabled="model.disabled" class="btn-add" type="success"
|
|
@@ -439,7 +444,7 @@ function fieldsValidExcute() {
|
|
|
439
444
|
if (model.value.form && model.value.form.fields) {
|
|
440
445
|
const currentIndex = model.value.form.fields.findIndex(v => v.fieldName1 === model.value.fieldName1);
|
|
441
446
|
if (currentIndex - 1 >= 0) {
|
|
442
|
-
if (model.value.form.fields[currentIndex - 1].controlType == Enum.ControlType.Group){
|
|
447
|
+
if (model.value.form.fields[currentIndex - 1].controlType == Enum.ControlType.Group) {
|
|
443
448
|
controlLabel = model.value.form.fields[currentIndex - 1].controlLabel;
|
|
444
449
|
}
|
|
445
450
|
}
|
|
@@ -531,7 +536,13 @@ function rolRouterClickHandler(field, rowData, rowindex) {
|
|
|
531
536
|
buttonClick(rowData, field);
|
|
532
537
|
}
|
|
533
538
|
function toolButtonsClick(field) {
|
|
534
|
-
|
|
539
|
+
if (field.isOpenFileDialog) {
|
|
540
|
+
emit('tableButtonClick', field, null,model.value);
|
|
541
|
+
} else {
|
|
542
|
+
emit('tableButtonClick', field, null);
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
}
|
|
535
546
|
}
|
|
536
547
|
function toolButtonsChangeHandler(field) {
|
|
537
548
|
emit('change', field);
|
|
@@ -113,10 +113,10 @@ const tableStatistics = ref()
|
|
|
113
113
|
onMounted(() => {
|
|
114
114
|
showWidth.value = tableStatistics.value && tableStatistics.value.offsetWidth || document.body.clientWidth;
|
|
115
115
|
})
|
|
116
|
-
function searchStatsComplate() {
|
|
116
|
+
function searchStatsComplate(defaultSearchData) {
|
|
117
117
|
nextTick(function () {
|
|
118
118
|
if (typeof props.api !== "undefined") {
|
|
119
|
-
SearchStats.loadSearchStatsApi(props.api, load, props.searchModel,
|
|
119
|
+
SearchStats.loadSearchStatsApi(props.api, load, props.searchModel, defaultSearchData);
|
|
120
120
|
}
|
|
121
121
|
if (typeof props.source !== "undefined") {
|
|
122
122
|
load(SearchStats.loadSearchStatsModel(props.source));
|
|
@@ -158,7 +158,7 @@ function load(data) {
|
|
|
158
158
|
return -1; // 顺序不变
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
|
-
if (selectStats.value == '') {
|
|
161
|
+
if (selectStats.value == ''&&!(model.value.defaultSearchData&&model.value.defaultSearchData.searchData)) {
|
|
162
162
|
var m = data.source.content.find((v) => {
|
|
163
163
|
return v.code1 == props.apiParam[fieldName1.value];
|
|
164
164
|
});
|
|
@@ -13,13 +13,12 @@
|
|
|
13
13
|
<div style="width: 100%;position: relative" ref="refct_Photo" class="block ct-file"
|
|
14
14
|
:style="{ 'width': (model.maxValue1 || 100) + 'px', 'height': (model.minValue1 || 100) + 'px' }"
|
|
15
15
|
:class="[model.attrs.size ? 'ct-checkbox-' + model.attrs.size : '']">
|
|
16
|
-
|
|
17
16
|
<el-upload :class="model.disableUpload ? 'ct-upload-display-none' : ''" v-bind="UploadhttpRequest"
|
|
18
|
-
:uploadStatus="!model.disableUpload && !model.locked ? 'upload' : 'lock'" ref="refupload"
|
|
19
|
-
:accept="model.fileAccept1" :on-change="handleChange" :multiple="false"
|
|
20
|
-
:action="action()" :headers="headers" :before-upload="beforeUploadProcess"
|
|
21
|
-
:on-
|
|
22
|
-
:show-file-list="false">
|
|
17
|
+
:uploadStatus="!model.disableUpload && !model.locked ? 'upload' : 'lock'" ref="refupload"
|
|
18
|
+
:disabled="model.locked" :accept="model.fileAccept1" :on-change="handleChange" :multiple="false"
|
|
19
|
+
:auto-upload="true" :action="action()" :headers="headers" :before-upload="beforeUploadProcess"
|
|
20
|
+
:on-success="handleAvatarSuccess" :on-error="handleAvatarError" :on-progress="uploadProcess"
|
|
21
|
+
:on-exceed="handleExceed" :show-file-list="false">
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
<el-icon class="avatar-uploader-icon"
|
|
@@ -126,7 +125,7 @@
|
|
|
126
125
|
</template>
|
|
127
126
|
</template>
|
|
128
127
|
<script setup lang="ts">
|
|
129
|
-
import { ref, nextTick, computed, onBeforeUnmount } from 'vue'
|
|
128
|
+
import { ref, nextTick, computed, onBeforeUnmount, watch } from 'vue'
|
|
130
129
|
import { ElMessage, UploadProps } from 'element-plus'
|
|
131
130
|
import common from '../../utils/common'
|
|
132
131
|
import { changeHandler } from '../../utils/mixins';
|
|
@@ -146,15 +145,12 @@ const refupload = ref()
|
|
|
146
145
|
const QRCodeRef = ref()
|
|
147
146
|
const UploadhttpRequest = ref({})
|
|
148
147
|
const model = ref(null)
|
|
149
|
-
const qrtimer1=ref(null)
|
|
150
|
-
const qrtimer2=ref(null)
|
|
148
|
+
const qrtimer1 = ref(null)
|
|
149
|
+
const qrtimer2 = ref(null)
|
|
151
150
|
|
|
152
151
|
const headers = computed(() => {
|
|
153
152
|
return common.getDataDrivenOpts().handler.getRequestHeaders();
|
|
154
153
|
})
|
|
155
|
-
const previewZIndex = computed(() => {
|
|
156
|
-
return common.getDataDrivenOpts().zindex + 100;
|
|
157
|
-
})
|
|
158
154
|
|
|
159
155
|
init()
|
|
160
156
|
//初始化数据
|
|
@@ -204,6 +200,23 @@ function load(data) {
|
|
|
204
200
|
});
|
|
205
201
|
}
|
|
206
202
|
}
|
|
203
|
+
|
|
204
|
+
// 深度监听 model
|
|
205
|
+
watch(
|
|
206
|
+
() => model.value, // 监听的源
|
|
207
|
+
(newValue, oldValue) => {
|
|
208
|
+
console.log('Model changed:', newValue);
|
|
209
|
+
console.log('Old value:', oldValue);
|
|
210
|
+
if (newValue?.file && newValue?.file != oldValue?.file) {
|
|
211
|
+
// 处理文件上传
|
|
212
|
+
var options = {
|
|
213
|
+
file: newValue.file.raw
|
|
214
|
+
}
|
|
215
|
+
SliceUpload(options);
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{ deep: true } // 启用深度监听
|
|
219
|
+
);
|
|
207
220
|
//校验上传数量
|
|
208
221
|
const handleExceed: UploadProps['onExceed'] = (files) => {
|
|
209
222
|
// model.value.validMessage = "附件数量最多" + model.value.maxValue1 + "张";
|
|
@@ -217,8 +230,8 @@ const handleExceed: UploadProps['onExceed'] = (files) => {
|
|
|
217
230
|
function handleRemove(file) {
|
|
218
231
|
|
|
219
232
|
|
|
220
|
-
common.confirm(common.LocalizedString("确定删除该附件?","確定刪除該附件?"), "提示", {
|
|
221
|
-
confirmButtonText: common.LocalizedString("确定","確認"),
|
|
233
|
+
common.confirm(common.LocalizedString("确定删除该附件?", "確定刪除該附件?"), "提示", {
|
|
234
|
+
confirmButtonText: common.LocalizedString("确定", "確認"),
|
|
222
235
|
cancelButtonText: "取消",
|
|
223
236
|
//type: 'warning'
|
|
224
237
|
}).then(() => {
|
|
@@ -321,7 +334,6 @@ async function SliceUpload(options) {
|
|
|
321
334
|
});
|
|
322
335
|
}
|
|
323
336
|
// data是上传时附带的额外参数,file是文件
|
|
324
|
-
|
|
325
337
|
let uid = Photo.uploadguid();
|
|
326
338
|
try {
|
|
327
339
|
file.uid = file.uid || uid;
|
|
@@ -492,7 +504,7 @@ function PasteUpload(event) {
|
|
|
492
504
|
++fileSum;
|
|
493
505
|
}
|
|
494
506
|
}
|
|
495
|
-
|
|
507
|
+
|
|
496
508
|
if (fileSum == items.length) {
|
|
497
509
|
for (let index in items) {
|
|
498
510
|
const item = items[index];
|
|
@@ -514,7 +526,7 @@ function PasteUpload(event) {
|
|
|
514
526
|
function ListenerPaste(event) {
|
|
515
527
|
|
|
516
528
|
const uploads = document.querySelectorAll('[uploadStatus="upload"]');
|
|
517
|
-
|
|
529
|
+
if (uploads.length == 1) {
|
|
518
530
|
PasteUpload(event);
|
|
519
531
|
}
|
|
520
532
|
|
package/src/loader/src/Button.js
CHANGED
|
@@ -17,6 +17,13 @@ const Button = function (source) {
|
|
|
17
17
|
// return '#519DA6'
|
|
18
18
|
// }
|
|
19
19
|
return source.borderColor
|
|
20
|
+
},
|
|
21
|
+
//允许的文件类型(针对上传控件)
|
|
22
|
+
get fileAccept1() {
|
|
23
|
+
return source.fileAccept1 || '';
|
|
24
|
+
},
|
|
25
|
+
set fileAccept1(v) {
|
|
26
|
+
source.fileAccept1 = v;
|
|
20
27
|
},
|
|
21
28
|
get action() {
|
|
22
29
|
if (source.controlType == Enum.ControlType.ButtonSearch) {
|
package/src/loader/src/Form.js
CHANGED
|
@@ -263,8 +263,9 @@ function loadFromModel(source, isFormList) {
|
|
|
263
263
|
}
|
|
264
264
|
},
|
|
265
265
|
//设置表格某行某列的值
|
|
266
|
-
setListFieldValue(value, tableName, rowNum, fiedlId, attrName, flagTemplate) {
|
|
267
|
-
value = value == undefined ? "" : value.toString();
|
|
266
|
+
setListFieldValue(value, tableName, rowNum, fiedlId, attrName, flagTemplate, flagTostring) {
|
|
267
|
+
value = value == undefined ? "" : flagTostring == false ? value : value.toString();
|
|
268
|
+
|
|
268
269
|
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
269
270
|
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
270
271
|
|
package/src/loader/src/Photo.js
CHANGED
|
@@ -23,16 +23,16 @@ function loadFromModel(source, SourceList, router, optionApi, videoPlayIconUrl)
|
|
|
23
23
|
QRCodeStatusAction: '',
|
|
24
24
|
fileSource: SourceList,//原始数据
|
|
25
25
|
valid: true,//验证是否通过
|
|
26
|
-
validMessage: '',//验证提示
|
|
27
|
-
|
|
28
|
-
get action() {
|
|
29
|
-
return router && router.action ? router.action : "";//上传完整地址
|
|
30
|
-
},
|
|
26
|
+
validMessage: '',//验证提示
|
|
27
|
+
uploadFiles:[],
|
|
31
28
|
get QRCodeAction() {
|
|
32
29
|
return router && router.actionForSearchRightPageKey ? router.actionForSearchRightPageKey : "";
|
|
33
30
|
},
|
|
34
31
|
get videoPlayIconUrl() {
|
|
35
32
|
return videoPlayIconUrl;
|
|
33
|
+
},
|
|
34
|
+
get action() {
|
|
35
|
+
return router && router.action ? router.action : "";//上传完整地址
|
|
36
36
|
},
|
|
37
37
|
set action(v) {
|
|
38
38
|
router.action = v;//上传完整地址
|
|
@@ -64,6 +64,18 @@ function loadFromModel(source, SourceList, router, optionApi, videoPlayIconUrl)
|
|
|
64
64
|
}
|
|
65
65
|
return rtn._fileList;
|
|
66
66
|
},
|
|
67
|
+
get file() {
|
|
68
|
+
return this.uploadFiles;//上传完整地址
|
|
69
|
+
},
|
|
70
|
+
set file(v) {
|
|
71
|
+
if (this.uploadFiles?.length > 0) {
|
|
72
|
+
this.uploadFiles[0] = v;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.uploadFiles = [];
|
|
76
|
+
this.uploadFiles.push(v);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
67
79
|
jsClearFile(model) {
|
|
68
80
|
model.fileList = [];
|
|
69
81
|
},
|
|
@@ -91,6 +103,10 @@ function loadFromModel(source, SourceList, router, optionApi, videoPlayIconUrl)
|
|
|
91
103
|
rtn.fileList[0] = FileData;
|
|
92
104
|
});
|
|
93
105
|
},
|
|
106
|
+
//外部增加上传文件
|
|
107
|
+
jsAddFile(data, model) {
|
|
108
|
+
model.file = data;
|
|
109
|
+
},
|
|
94
110
|
getFormObj() {
|
|
95
111
|
var rtnFormObj = {};
|
|
96
112
|
var that = this;
|
|
@@ -342,7 +358,7 @@ function updateFile(file, model) {
|
|
|
342
358
|
model.fileSource[0].mediaUrl = file.mediaUrl;
|
|
343
359
|
model.fileSource[0].savedFileName = file.savedFileName;
|
|
344
360
|
model.fileSource[0].mediaDate = file.mediaDate;
|
|
345
|
-
model.fileSource[0].mediaCode = file.mediaCode;
|
|
361
|
+
model.fileSource[0].mediaCode = file.mediaCode;
|
|
346
362
|
|
|
347
363
|
}
|
|
348
364
|
function uploadguid() {
|
|
@@ -380,7 +396,7 @@ function viewerfile(file, model) {
|
|
|
380
396
|
function selfValidExcute(eventName, model) {
|
|
381
397
|
if (model.required) {
|
|
382
398
|
if (Photo.getfileListLength(model) === 0) {
|
|
383
|
-
model.validMessage = common.LocalizedString("必须上传附件","必須上傳附件");
|
|
399
|
+
model.validMessage = common.LocalizedString("必须上传附件", "必須上傳附件");
|
|
384
400
|
model.valid = false;
|
|
385
401
|
model.displayValidMessage = model.validMessage;
|
|
386
402
|
return false;
|
package/src/loader/src/Router.js
CHANGED
|
@@ -14,7 +14,7 @@ const Router = function (source) {
|
|
|
14
14
|
return source.text;
|
|
15
15
|
},
|
|
16
16
|
set controlLabel(v) {
|
|
17
|
-
return source.text=v;
|
|
17
|
+
return source.text = v;
|
|
18
18
|
},
|
|
19
19
|
//动作对应的 控制器
|
|
20
20
|
get action() {
|
|
@@ -23,6 +23,13 @@ const Router = function (source) {
|
|
|
23
23
|
set action(v) {
|
|
24
24
|
return source.action = v;
|
|
25
25
|
},
|
|
26
|
+
//允许的文件类型(应用于 ButtonType 为 openFileDialog 的类型)
|
|
27
|
+
get fileAccept() {
|
|
28
|
+
return source.fileAccept || '';
|
|
29
|
+
},
|
|
30
|
+
set fileAccept(v) {
|
|
31
|
+
source.fileAccept = v;
|
|
32
|
+
},
|
|
26
33
|
// action的url对应的FieldName,如果此处有值,则忽略action
|
|
27
34
|
get actionField() {
|
|
28
35
|
return source.actionField;
|
|
@@ -63,6 +70,10 @@ const Router = function (source) {
|
|
|
63
70
|
get isCheckbox() {
|
|
64
71
|
return source.buttonType === Enum.ButtonType.Checkbox;
|
|
65
72
|
},
|
|
73
|
+
//按钮类型为openFileDialog
|
|
74
|
+
get isOpenFileDialog() {
|
|
75
|
+
return source.buttonType === Enum.ButtonType.openFileDialog;
|
|
76
|
+
},
|
|
66
77
|
|
|
67
78
|
//是否需要警示标志
|
|
68
79
|
get flagAlert() {
|
|
@@ -17,7 +17,7 @@ function loadSearchStatsApi(action, callBack, searchModel, defaultSearchData) {
|
|
|
17
17
|
}).then(
|
|
18
18
|
function (response) {
|
|
19
19
|
if (response.rtnCode === Enum.ReturnCode.Successful) {
|
|
20
|
-
var rtn = loadSearchStatsModel(response, defaultSearchData);
|
|
20
|
+
var rtn = loadSearchStatsModel(response,searchModel, defaultSearchData);
|
|
21
21
|
if (callBack) {
|
|
22
22
|
callBack(rtn);
|
|
23
23
|
}
|
package/src/main.js
CHANGED
|
@@ -30,7 +30,7 @@ app.use(centaline, {
|
|
|
30
30
|
//baseUrl: "http://10.1.245.111:38028/",
|
|
31
31
|
|
|
32
32
|
flagRouterSelf: true,
|
|
33
|
-
flagApp:
|
|
33
|
+
flagApp: true,//是否app端
|
|
34
34
|
zindex: 999,
|
|
35
35
|
showRequestSuccessMessage: true,
|
|
36
36
|
showRequestErrorMessage: false,
|
|
@@ -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_4abee9c9-2616-4cb5-beda-1f94dc7d8a96",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_4abee9c9-2616-4cb5-beda-1f94dc7d8a96",Platform:"IOS"}',
|
|
72
72
|
};
|
|
73
73
|
},
|
|
74
74
|
getToken() {
|