centaline-data-driven-v3 0.0.55 → 0.0.57
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 +81 -81
- package/package.json +1 -1
- package/src/assets/commonWeb.css +1 -1
- package/src/components/Layout/Layout.vue +7 -2
- package/src/components/Layout/LayoutField.vue +1 -1
- package/src/components/app/ContainerControl.vue +4 -8
- package/src/components/app/SearchList/SearchTable.vue +18 -7
- package/src/components/app/TextBox.vue +3 -0
- package/src/components/web/Form.vue +40 -7
- package/src/components/web/FormList.vue +28 -8
- package/src/components/web/GroupList.vue +36 -0
- package/src/components/web/NumberWithPlusAndMinus.vue +110 -0
- package/src/components/web/PopupGroupList.vue +6 -0
- package/src/components/web/SearchList/SearchTable.vue +25 -15
- package/src/components/web/SearchList.vue +7 -2
- package/src/components/web/Steps.vue +3 -1
- package/src/loader/src/DatePicker.js +17 -4
- package/src/loader/src/Field.js +36 -17
- package/src/loader/src/Form.js +75 -0
- package/src/loader/src/FormList.js +30 -1
- package/src/loader/src/GroupList.js +14 -0
- package/src/loader/src/LibFunction.js +16 -6
- package/src/loader/src/NumberWithPlusAndMinus.js +35 -0
- package/src/loader/src/SearchScreen.js +1 -0
- package/src/loader/src/SearchTable.js +10 -4
- package/src/main.js +4 -4
- package/src/utils/Enum.js +14 -4
- package/src/utils/mixins.js +5 -3
- package/src/utils/validate.js +1 -0
- package/src/views/SearchList.vue +2 -2
package/package.json
CHANGED
package/src/assets/commonWeb.css
CHANGED
|
@@ -452,11 +452,11 @@ body {
|
|
|
452
452
|
.ct-searchtable .ct-tr {
|
|
453
453
|
background-color: #ffffff;
|
|
454
454
|
color: var(--centalineBlack);
|
|
455
|
+
cursor: default;
|
|
455
456
|
}
|
|
456
457
|
|
|
457
458
|
.ct-searchtable .ct-tr>.ct-td {
|
|
458
459
|
padding: 2px 20px;
|
|
459
|
-
cursor: default;
|
|
460
460
|
box-sizing: border-box;
|
|
461
461
|
}
|
|
462
462
|
|
|
@@ -18,7 +18,7 @@ const props = defineProps({
|
|
|
18
18
|
listData: Array,
|
|
19
19
|
apiParam: Object,
|
|
20
20
|
parameterAction: String,
|
|
21
|
-
formListactionRouter:{
|
|
21
|
+
formListactionRouter: {
|
|
22
22
|
type: Array,
|
|
23
23
|
default: [],
|
|
24
24
|
},
|
|
@@ -218,8 +218,13 @@ function xmlToJson(xml) {
|
|
|
218
218
|
}
|
|
219
219
|
else if (props.vmodel.delete && attribute.nodeValue == 'delete') {
|
|
220
220
|
obj["rightRouter"] = true
|
|
221
|
+
}
|
|
222
|
+
else if (props.vmodel.delete && attribute.nodeValue == 'moveup') {
|
|
223
|
+
obj["rightRouter"] = true
|
|
224
|
+
}
|
|
225
|
+
else if (props.vmodel.delete && attribute.nodeValue == 'movedown') {
|
|
226
|
+
obj["rightRouter"] = true
|
|
221
227
|
} else {
|
|
222
|
-
|
|
223
228
|
var actionRouter = props.formListactionRouter;
|
|
224
229
|
if (actionRouter) {
|
|
225
230
|
let field = actionRouter.find((b) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="model.className" :style="model.styleObject">
|
|
2
|
+
<div :class="model.className" :style="model.styleObject" v-if="field">
|
|
3
3
|
<component v-if="field.show !== false" ref="Fields" :is="field.is" :vmodel="field" :actionRouter="actionRouter"
|
|
4
4
|
:parameterAction="parameterAction" v-bind="field.bindPara" @change="changeHandler(field)" />
|
|
5
5
|
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
<script lang="ts" setup>
|
|
12
12
|
import { ref } from 'vue'
|
|
13
|
-
import common from '../../utils/common'
|
|
14
13
|
import { initData } from '../../utils/mixins';
|
|
15
14
|
import ContainerControl from '../../loader/src/ContainerControl';
|
|
16
15
|
const emit = defineEmits(['click', 'change', 'fieldClick', 'popupSearchList'])
|
|
@@ -24,15 +23,12 @@ const Fields = ref()
|
|
|
24
23
|
|
|
25
24
|
model.value.selfValidExcute = () => {
|
|
26
25
|
let rtnBool = true;
|
|
27
|
-
if (typeof Fields !== 'undefined') {
|
|
26
|
+
if (typeof Fields.value !== 'undefined') {
|
|
28
27
|
Fields.value.forEach((f) => {
|
|
29
|
-
if (typeof f.validExcute !== 'undefined') {
|
|
30
|
-
if (!f.validExcute(f.model)) {
|
|
28
|
+
if (f.model && typeof f.model.validExcute !== 'undefined') {
|
|
29
|
+
if (!f.model.validExcute(f.model)) {
|
|
30
|
+
model.value.displayValidMessage=f.model.displayValidMessage
|
|
31
31
|
rtnBool = false;
|
|
32
|
-
if (!model.controlLabel && f.model.controlLabel) {
|
|
33
|
-
common.message('【' + f.model.controlLabel + '】不能为空!')
|
|
34
|
-
}
|
|
35
|
-
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
34
|
});
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<div ref="refTableParent" class="ct-tableParentAPP" :style="'height:' + model.tableHeight + 'px'"
|
|
11
11
|
@scroll="scrollHandle($event)">
|
|
12
12
|
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
|
13
|
-
<van-list v-if="!tableError" v-model:loading="tableLoading"
|
|
14
|
-
:
|
|
15
|
-
:style="'min-height:' + model.tableHeight + 'px'">
|
|
13
|
+
<van-list v-if="!tableError" v-model:loading="tableLoading"
|
|
14
|
+
:error-text="common.LocalizedString('没有查到数据,点我刷新', '沒有查到數據,點我刷新')" :finished="finished"
|
|
15
|
+
@load="onLoad" :immediate-check="false" :style="'min-height:' + model.tableHeight + 'px'">
|
|
16
16
|
<template v-if="flagPopupSearchlist && singleSelectio">
|
|
17
17
|
<van-radio-group v-model="checkeds" ref="refCheckboxGroup">
|
|
18
18
|
<div class="ct-list" v-for="(row, rowindex) in model.listData" :key="rowindex">
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
</van-checkbox-group>
|
|
44
44
|
</template>
|
|
45
45
|
</van-list>
|
|
46
|
-
<van-empty v-else :description="common.LocalizedString('没有查到数据','沒有查到數據')" />
|
|
46
|
+
<van-empty v-else :description="common.LocalizedString('没有查到数据', '沒有查到數據')" />
|
|
47
47
|
</van-pull-refresh>
|
|
48
48
|
<div v-if="isoperate || flagPopupSearchlist" style="height: 50px;"></div>
|
|
49
49
|
<div class="safe-area-inset-bottom" style="background-color: #fafafa;"></div>
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
<div class="ct-checkboxtips" v-if="isoperate || flagPopupSearchlist">
|
|
61
61
|
<van-checkbox v-if="!singleSelectio" v-model="model.selectAll" shape="square" checked-color="#EE6B6B"
|
|
62
|
-
icon-size="14px" :indeterminate="model.isIndeterminate"
|
|
62
|
+
icon-size="14px" :indeterminate="model.isIndeterminate"
|
|
63
|
+
@click="selectAll()">{{ common.LocalizedString('本页全选(已选', '本頁全選(已選') }}{{ selectCount }})
|
|
63
64
|
</van-checkbox>
|
|
64
65
|
<div style="display: flex;flex: 1; justify-content: right;">
|
|
65
66
|
<template v-if="!flagPopupSearchlist">
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
</template>
|
|
72
73
|
<template v-else>
|
|
73
74
|
<van-button color="#EE6B6B" size="small" @click="confirmClickHandler()"
|
|
74
|
-
style=" width: 25%;margin-left: 10px;">{{common.LocalizedString('确认','確認')}}</van-button>
|
|
75
|
+
style=" width: 25%;margin-left: 10px;">{{ common.LocalizedString('确认', '確認') }}</van-button>
|
|
75
76
|
</template>
|
|
76
77
|
</div>
|
|
77
78
|
</div>
|
|
@@ -194,7 +195,7 @@ function load(data) {
|
|
|
194
195
|
return v.key && v.show && (v.key.indexOf('New') > -1 || v.key.indexOf('new') > -1 || v.key.indexOf('Apply') > -1);
|
|
195
196
|
})
|
|
196
197
|
modeButtons.value = model.value.buttons.filter((v) => {
|
|
197
|
-
return v.disabled
|
|
198
|
+
return v.disabled && v.show && v.isMulti && !(v.key.indexOf('New') > -1 || v.key.indexOf('new') > -1 || v.key.indexOf('Apply') > -1)
|
|
198
199
|
})
|
|
199
200
|
modeButtons.value.forEach((v) => {
|
|
200
201
|
v.name = v.controlLabel
|
|
@@ -386,6 +387,16 @@ function modeClickHandler() {
|
|
|
386
387
|
}
|
|
387
388
|
//选择行
|
|
388
389
|
function selectRow(row) {
|
|
390
|
+
if (props.singleSelectio) {
|
|
391
|
+
model.value.listData.forEach((ro) => {
|
|
392
|
+
if (
|
|
393
|
+
!model.value.rightCheckBoxColumn ||
|
|
394
|
+
common.getDataOfUpperLower(ro, model.value.rightCheckBoxColumn) == 1
|
|
395
|
+
) {
|
|
396
|
+
ro.$select = false
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
}
|
|
389
400
|
row.$select = !row.$select
|
|
390
401
|
SearchTable.setSelectAll(model.value);
|
|
391
402
|
SearchTable.getSelectAll(model.value);
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
<span>{{ model.controlLabel }}</span>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
|
+
<template #extra v-if="model.sufLabel1">
|
|
22
|
+
<span v-html="model.sufLabel1" style="margin-left: 5px;line-height: 32px;"></span>
|
|
23
|
+
</template>
|
|
21
24
|
<template v-if="model.unitName1" #button>
|
|
22
25
|
{{ model.unitName1 }}
|
|
23
26
|
</template>
|
|
@@ -9,6 +9,21 @@
|
|
|
9
9
|
|
|
10
10
|
<!--可根据场景判断显示el-card还是el-main-->
|
|
11
11
|
<component :is="model.showTitle ? 'el-main' : 'el-card'">
|
|
12
|
+
<!--relationParentFormFields-->
|
|
13
|
+
<el-row v-if="relationParentFormFields.length > 0">
|
|
14
|
+
<template v-for="(col, index) in relationParentFormFields" :key="index">
|
|
15
|
+
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
|
|
16
|
+
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
17
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
18
|
+
:parameterAction="model.parameterAction" v-bind="col.bindPara" @change="changeHandler"
|
|
19
|
+
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
20
|
+
@tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
|
|
21
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
22
|
+
</component>
|
|
23
|
+
</el-col>
|
|
24
|
+
</template>
|
|
25
|
+
</el-row>
|
|
26
|
+
|
|
12
27
|
<!--头部元素-->
|
|
13
28
|
<el-row v-if="model.collapseFields.length > 0">
|
|
14
29
|
<template v-for="(col, index) in model.collapseFields[0]" :key="index">
|
|
@@ -17,7 +32,7 @@
|
|
|
17
32
|
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
18
33
|
:parameterAction="model.parameterAction" v-bind="col.bindPara" @change="changeHandler"
|
|
19
34
|
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
20
|
-
@tableButtonClick="clickHandler"
|
|
35
|
+
@tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
|
|
21
36
|
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
22
37
|
</component>
|
|
23
38
|
</el-col>
|
|
@@ -26,7 +41,7 @@
|
|
|
26
41
|
<!--tabs-->
|
|
27
42
|
<el-tabs v-if="model.isHorizontalLayout" v-model="activeName">
|
|
28
43
|
<template v-for="(item, index) in model.collapse" :key="index">
|
|
29
|
-
<el-tab-pane :label="item.controlLabel" :name="index.toString()" v-if="item.show !== false"
|
|
44
|
+
<el-tab-pane :label="item.controlLabel" :name="index.toString()" :lazy="item.lazyLoad" v-if="item.show !== false"
|
|
30
45
|
:key="index">
|
|
31
46
|
<el-row>
|
|
32
47
|
<template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
|
|
@@ -36,7 +51,8 @@
|
|
|
36
51
|
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
37
52
|
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
38
53
|
@change="changeHandler" @fieldClick="fieldClickHandler"
|
|
39
|
-
@popupSearchList="popupSearchListHandler"
|
|
54
|
+
@popupSearchList="popupSearchListHandler"
|
|
55
|
+
@popupGroupList="popupGroupListHandler" @tableButtonClick="clickHandler"
|
|
40
56
|
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
41
57
|
</component>
|
|
42
58
|
</el-col>
|
|
@@ -66,7 +82,8 @@
|
|
|
66
82
|
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
67
83
|
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
68
84
|
@change="changeHandler" @fieldClick="fieldClickHandler"
|
|
69
|
-
@popupSearchList="popupSearchListHandler"
|
|
85
|
+
@popupSearchList="popupSearchListHandler"
|
|
86
|
+
@popupGroupList="popupGroupListHandler" @tableButtonClick="clickHandler"
|
|
70
87
|
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
71
88
|
</component>
|
|
72
89
|
</el-col>
|
|
@@ -83,7 +100,7 @@
|
|
|
83
100
|
<component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="model.parameterAction"
|
|
84
101
|
v-bind="col.bindPara" @change="changeHandler" :key="itemKey"
|
|
85
102
|
@fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
|
|
86
|
-
@tableButtonClick="clickHandler"
|
|
103
|
+
@tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
|
|
87
104
|
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
|
|
88
105
|
</component>
|
|
89
106
|
</el-col>
|
|
@@ -162,7 +179,18 @@ const props = defineProps({
|
|
|
162
179
|
String,
|
|
163
180
|
default: '',
|
|
164
181
|
},
|
|
182
|
+
isIframe: {
|
|
183
|
+
Boolean,
|
|
184
|
+
default: false,
|
|
185
|
+
},
|
|
186
|
+
relationParentFormFields: {
|
|
187
|
+
Array,
|
|
188
|
+
default: function () {
|
|
189
|
+
return [];
|
|
190
|
+
},
|
|
191
|
+
},
|
|
165
192
|
})
|
|
193
|
+
|
|
166
194
|
const itemKey = ref(1)
|
|
167
195
|
const router = useRouter()
|
|
168
196
|
const loading = ref(true)
|
|
@@ -205,6 +233,7 @@ function load(data) {
|
|
|
205
233
|
model.value.parentModelForm = props.parentModelForm
|
|
206
234
|
model.value.$vue = { fieldClickHandler, clickHandler, validExcute, emit, getFormObj, changeCallBackHandler, getFileData, Form, load, init, updateFields, itemKey };
|
|
207
235
|
model.value.$vue.openType = props.openType
|
|
236
|
+
model.value.isIframe = props.isIframe
|
|
208
237
|
if (model.value.scripts) {
|
|
209
238
|
model.value.scripts.formData = model.value.formData;
|
|
210
239
|
model.value.scripts.formData.form = model.value;
|
|
@@ -291,8 +320,8 @@ function validExcute() {
|
|
|
291
320
|
setTimeout(function () {
|
|
292
321
|
if (f.model.controlType == Enum.ControlType.List) {
|
|
293
322
|
if (f.$el.offsetParent) {
|
|
294
|
-
|
|
295
|
-
|
|
323
|
+
let total = f.$el.offsetParent.offsetTop;
|
|
324
|
+
document.querySelector(".ct-dialog_body").children[0].scrollTop = total - 50;
|
|
296
325
|
}
|
|
297
326
|
}
|
|
298
327
|
else {
|
|
@@ -357,6 +386,10 @@ function changeCallBackHandler(field, callBackFunName, callBackPara) {
|
|
|
357
386
|
function popupSearchListHandler(singleSelectio, field, router, callBack) {
|
|
358
387
|
Form.popupSearchListHandler(singleSelectio, field, router, model.value, Fields.value, props, callBack)
|
|
359
388
|
}
|
|
389
|
+
//弹出分组列表
|
|
390
|
+
function popupGroupListHandler(field, router, callBack) {
|
|
391
|
+
Form.popupGroupListHandler(field, router, model.value, Fields.value, props, callBack)
|
|
392
|
+
}
|
|
360
393
|
function flagNotificationParentAfterContentChanged() {
|
|
361
394
|
init();
|
|
362
395
|
}
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
</template>
|
|
136
136
|
</el-table-column>
|
|
137
137
|
<template #empty>
|
|
138
|
-
{{common.LocalizedString('暂无数据','暫無數據')}}
|
|
138
|
+
{{ common.LocalizedString('暂无数据', '暫無數據') }}
|
|
139
139
|
</template>
|
|
140
140
|
</el-table>
|
|
141
141
|
</template>
|
|
@@ -177,9 +177,9 @@ model.value.parentModel = props.parentModel;
|
|
|
177
177
|
model.value.parameterAction = props.parameterAction
|
|
178
178
|
model.value.$vue = { insertOrUpdateRow, insertRow, delRow, deleteAll, insertSingleRow, itemKey };
|
|
179
179
|
model.value.validExcute = () => {
|
|
180
|
-
var rtn=fieldsValidExcute();
|
|
181
|
-
if(!rtn){
|
|
182
|
-
model.value.displayValidMessage=common.LocalizedString('请填写','請填寫')+'['+model.value.controlLabel+']'
|
|
180
|
+
var rtn = fieldsValidExcute();
|
|
181
|
+
if (!rtn) {
|
|
182
|
+
model.value.displayValidMessage = common.LocalizedString('请填写', '請填寫') + '[' + model.value.controlLabel + ']'
|
|
183
183
|
}
|
|
184
184
|
return fieldsValidExcute();
|
|
185
185
|
}
|
|
@@ -379,8 +379,8 @@ function getSummaries(param) {
|
|
|
379
379
|
//验证
|
|
380
380
|
function fieldsValidExcute() {
|
|
381
381
|
var rtnBool = true;
|
|
382
|
-
if(model.value.required){
|
|
383
|
-
if(model.value.tableData.length==0){
|
|
382
|
+
if (model.value.required) {
|
|
383
|
+
if (model.value.tableData.length == 0) {
|
|
384
384
|
return false;
|
|
385
385
|
}
|
|
386
386
|
}
|
|
@@ -400,7 +400,7 @@ function fieldsValidExcute() {
|
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
}
|
|
403
|
-
else if(Fields.value) {
|
|
403
|
+
else if (Fields.value) {
|
|
404
404
|
Fields.value.forEach((f) => {
|
|
405
405
|
if (f.model.validExcute) {
|
|
406
406
|
if (!f.model.validExcute()) {
|
|
@@ -473,6 +473,26 @@ function rolRouterCellClickHandler(routerKey, rowindex, sourceIndex) {
|
|
|
473
473
|
emit('change', model.value);
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
|
+
else if (routerKey == 'moveup') {
|
|
477
|
+
if (rowindex === 0) {
|
|
478
|
+
model.value.tableData.push(model.value.tableData.shift());
|
|
479
|
+
} else {
|
|
480
|
+
const temp = model.value.tableData[rowindex - 1];
|
|
481
|
+
model.value.tableData[rowindex - 1] = model.value.tableData[rowindex];
|
|
482
|
+
model.value.tableData[rowindex] = temp;
|
|
483
|
+
}
|
|
484
|
+
onMoveEnd()
|
|
485
|
+
}
|
|
486
|
+
else if (routerKey == 'movedown') {
|
|
487
|
+
if (rowindex === model.value.tableData.length - 1) {
|
|
488
|
+
model.value.tableData.unshift(model.value.tableData.pop());
|
|
489
|
+
} else {
|
|
490
|
+
const temp = model.value.tableData[rowindex + 1];
|
|
491
|
+
model.value.tableData[rowindex + 1] = model.value.tableData[rowindex];
|
|
492
|
+
model.value.tableData[rowindex] = temp;
|
|
493
|
+
}
|
|
494
|
+
onMoveEnd()
|
|
495
|
+
}
|
|
476
496
|
else {
|
|
477
497
|
var router = model.value.buttons.find((v) => {
|
|
478
498
|
return v.key === routerKey;
|
|
@@ -512,7 +532,7 @@ function onMoveEnd(event) {
|
|
|
512
532
|
|
|
513
533
|
}
|
|
514
534
|
defineExpose({
|
|
515
|
-
|
|
535
|
+
model
|
|
516
536
|
})
|
|
517
537
|
</script>
|
|
518
538
|
<style scoped>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ct-field :vmodel="model">
|
|
3
|
+
<template #Control>
|
|
4
|
+
|
|
5
|
+
</template>
|
|
6
|
+
<template #Sufbutton v-if="model.moreActionRouter">
|
|
7
|
+
<div style="margin-left: 5px;">
|
|
8
|
+
<el-button size="small" type="primary" class="h26" @click="popupSearchListHandle">
|
|
9
|
+
{{ model.moreActionRouter.controlLabel }}</el-button>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
</ct-field>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { initData } from '../../utils/mixins';
|
|
16
|
+
import GroupList from '../../loader/src/GroupList';
|
|
17
|
+
const emit = defineEmits(['input', 'change', 'click','search','popupGroupList'])
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
parameterAction: String,
|
|
20
|
+
vmodel: Object,
|
|
21
|
+
source: Object,
|
|
22
|
+
from: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
const model = initData(props, GroupList)
|
|
28
|
+
|
|
29
|
+
//弹出选择列表
|
|
30
|
+
function popupSearchListHandle() {
|
|
31
|
+
emit('popupGroupList',model, model.value.moreActionRouter);
|
|
32
|
+
}
|
|
33
|
+
defineExpose({
|
|
34
|
+
model
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ct-field">
|
|
3
|
+
<div class="el-form-item el-form-item--small">
|
|
4
|
+
<div class="el-form-item__label" v-if="model.showLabel && model.controlLabel">
|
|
5
|
+
<div class="requiredLabel">
|
|
6
|
+
<span>{{ model.controlLabel }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="fieldControl">
|
|
10
|
+
<el-input-number v-model="model.maxValue1" :min="1" :max="26" @change="handleChange" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<template v-for="(item, index) in model.value" :key="index">
|
|
15
|
+
<div class="ct-field" style="margin-top: 10px;" v-if="!item.flagDeleted">
|
|
16
|
+
<div class="el-form-item el-form-item--small">
|
|
17
|
+
<div class="el-form-item__label">
|
|
18
|
+
<div class="requiredLabel">
|
|
19
|
+
<span
|
|
20
|
+
style="background-color: #EE6B6B;width: 20px; height: 24px;display: block;line-height: 24px; text-align: center; border-radius: 5px;color: #ffffff;">{{
|
|
21
|
+
item.code }}</span>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="fieldControl">
|
|
25
|
+
<el-input v-model="item.name" placeholder="" @input="changeOption()" />
|
|
26
|
+
</div>
|
|
27
|
+
<span class="sufLabel" style="background-color: #EE6B6B;border-radius: 50px;width: 20px;height: 20PX;text-align: center;color: #ffffff;cursor: pointer;" @click="handleDelete(item)"><el-icon><Minus /></el-icon></span>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
</template>
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import { initData } from '../../utils/mixins';
|
|
34
|
+
import NumberWithPlusAndMinus from '../../loader/src/NumberWithPlusAndMinus';
|
|
35
|
+
const emit = defineEmits(['click', 'change', 'search'])
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
parameterAction: String,
|
|
38
|
+
vmodel: Object,
|
|
39
|
+
source: Object,
|
|
40
|
+
})
|
|
41
|
+
const model = initData(props, NumberWithPlusAndMinus)
|
|
42
|
+
function handleChange() {
|
|
43
|
+
var count = model.value.maxValue1;
|
|
44
|
+
var rows = model.value.value;
|
|
45
|
+
const str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
46
|
+
var newRows = [];
|
|
47
|
+
for (let i = 0; i < count; i++) {
|
|
48
|
+
var item = {};
|
|
49
|
+
item['code'] = str[i];
|
|
50
|
+
|
|
51
|
+
var name = '';
|
|
52
|
+
var rowID = '';
|
|
53
|
+
if (i < rows.length) {
|
|
54
|
+
rowID = rows[i]['rowID'];
|
|
55
|
+
name = rows[i]['name'];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
item['rowID'] = rowID;
|
|
59
|
+
item['name'] = name;
|
|
60
|
+
item['flagDeleted'] = false
|
|
61
|
+
newRows.push(item)
|
|
62
|
+
}
|
|
63
|
+
if(rows.length>count){
|
|
64
|
+
for (let i = rows.length; i > count; i--){
|
|
65
|
+
rows[i-1]['flagDeleted']=true
|
|
66
|
+
newRows.push(rows[i-1])
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
model.value.value = newRows;
|
|
70
|
+
model.value.code1 = newRows;
|
|
71
|
+
}
|
|
72
|
+
function changeOption() {
|
|
73
|
+
var data = model.value.value.filter((v) => {
|
|
74
|
+
return v.name != '';
|
|
75
|
+
});
|
|
76
|
+
model.value.code1 = data;
|
|
77
|
+
}
|
|
78
|
+
function handleDelete(ev){
|
|
79
|
+
ev['flagDeleted']=true
|
|
80
|
+
model.value.maxValue1--;
|
|
81
|
+
var count = model.value.maxValue1;
|
|
82
|
+
var rows = model.value.value.filter((v) => {
|
|
83
|
+
return !v.flagDeleted;
|
|
84
|
+
});
|
|
85
|
+
const str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
86
|
+
var newRows = [];
|
|
87
|
+
for (let i = 0; i < count; i++) {
|
|
88
|
+
var item = {};
|
|
89
|
+
item['code'] = str[i];
|
|
90
|
+
|
|
91
|
+
var name = '';
|
|
92
|
+
var rowID = '';
|
|
93
|
+
if (i < rows.length) {
|
|
94
|
+
rowID = rows[i]['rowID'];
|
|
95
|
+
name = rows[i]['name'];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
item['rowID'] = rowID;
|
|
99
|
+
item['name'] = name;
|
|
100
|
+
item['flagDeleted'] = false
|
|
101
|
+
newRows.push(item)
|
|
102
|
+
}
|
|
103
|
+
newRows.push(ev)
|
|
104
|
+
model.value.value = newRows;
|
|
105
|
+
model.value.code1 = newRows;
|
|
106
|
+
}
|
|
107
|
+
defineExpose({
|
|
108
|
+
model
|
|
109
|
+
})
|
|
110
|
+
</script>
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
<template v-for="(row, rowindex) in model.listData" :key="rowindex">
|
|
62
62
|
<tr v-if="from == 'form' || pageRowMin <= rowindex && rowindex <= pageRowMax"
|
|
63
63
|
:ref="el => getRowsRef(el, rowindex)" @click="rowClickHandle($event, rowindex)"
|
|
64
|
-
class="ct-tr" :style="row.rowStyle"
|
|
64
|
+
class="ct-tr" :style="row.rowStyle" :draggable="row.flagDrag == '1' ? true : false"
|
|
65
|
+
@dragstart="onDragStart($event, row, null, 'table')">
|
|
65
66
|
|
|
66
67
|
<td v-if="model.isMulti" class="ct-td tdFiexd left-fixation checkbox-td"
|
|
67
68
|
:class="[model.tdClass, rowindex === model.selectIndex ? 'select' : null,]"
|
|
@@ -85,9 +86,10 @@
|
|
|
85
86
|
column.fixed === 'left' ? 'left-fixation' : null,
|
|
86
87
|
column.width === undefined ? 'ct-table-auto' : null,
|
|
87
88
|
column.fixed === 'right' ? 'right-fixation' : null,
|
|
88
|
-
]" v-bind="column.attrs"
|
|
89
|
-
@
|
|
90
|
-
@
|
|
89
|
+
]" v-bind="column.attrs" :draggable="column.paramName == 'drop' ? true : false"
|
|
90
|
+
@drop="drop($event, row, column, 'table')" @dragover.prevent
|
|
91
|
+
@dragenter="dragenter($event, column, 'table')"
|
|
92
|
+
@dragleave="dragleave($event, column, 'table')">
|
|
91
93
|
<!--操作列-->
|
|
92
94
|
<div v-if="column.id === 'operation'" class="div_allinline"
|
|
93
95
|
:class="column.autoRowHeight ? 'lineFeedCell' : 'cell'"
|
|
@@ -217,7 +219,7 @@
|
|
|
217
219
|
style="margin-top: 10px;width: 100%;display: inline-block;height: 30px;margin-bottom: 10px;">
|
|
218
220
|
<el-button size="mini" @click="popupClickHandler()" class="max-search-btn" style="float:right;"
|
|
219
221
|
type="primary">
|
|
220
|
-
|
|
222
|
+
{{ common.LocalizedString('确认', '確認') }}
|
|
221
223
|
</el-button>
|
|
222
224
|
</div>
|
|
223
225
|
<div v-if="isLoading" v-loading="isLoading" style="top: 30px"></div>
|
|
@@ -237,7 +239,7 @@ import Tablecurrency from './Tablecurrency.vue';
|
|
|
237
239
|
import SearchTable from '../../../loader/src/SearchTable'
|
|
238
240
|
import { RouterClickHandler, RouterMouseenterHandler } from '../../../utils/mixins';
|
|
239
241
|
import { ElMessage } from 'element-plus'
|
|
240
|
-
const emit = defineEmits(['rowClickHandle', 'searchComplate', 'refreshRowHandle', 'simpleRouterRefreshHandler', 'loaded', 'scrollHandle', 'closeSideBar', 'refreshParent', 'popupClickHandler', '
|
|
242
|
+
const emit = defineEmits(['rowClickHandle', 'searchComplate', 'refreshRowHandle', 'simpleRouterRefreshHandler', 'loaded', 'scrollHandle', 'closeSideBar', 'refreshParent', 'popupClickHandler', 'drag'])
|
|
241
243
|
const props = defineProps({
|
|
242
244
|
vmodel: Object,
|
|
243
245
|
api: String,
|
|
@@ -372,6 +374,7 @@ function searchComplate(m, defaultSearch) {
|
|
|
372
374
|
function load(data) {
|
|
373
375
|
model.value = data;
|
|
374
376
|
model.value.$vue = { searchStrat, searchEnd, downloadUrl, loadStats, setTableHeight, updateCurrentRow, doAction, itemKey, refreshTableColumns, calculatingRowHeight, emit, operationLoading, getPage };
|
|
377
|
+
model.value.isIframe = props.isIframe
|
|
375
378
|
//自动查询 调用合并列
|
|
376
379
|
if (model.value.listData.length > 0) {
|
|
377
380
|
if (model.value.rowMergedColumns.length > 0) {
|
|
@@ -1048,6 +1051,7 @@ function updateCurrentRow(router, data, flagSimple) {
|
|
|
1048
1051
|
SearchTable.getCurrentRowApiData(model.value,
|
|
1049
1052
|
function () {
|
|
1050
1053
|
itemKey.value = Math.random()
|
|
1054
|
+
model.value.selectAll=false
|
|
1051
1055
|
emit("searchComplate");
|
|
1052
1056
|
if (data && !flagSimple) {
|
|
1053
1057
|
emit("simpleRouterRefreshHandler");
|
|
@@ -1145,11 +1149,11 @@ function refreshTableColumns(data) {
|
|
|
1145
1149
|
load(SearchTable.loadSearchTableModel(data, model.value.searchModel, false, props.api));
|
|
1146
1150
|
}
|
|
1147
1151
|
else {
|
|
1148
|
-
if (refTableStats.value){
|
|
1152
|
+
if (refTableStats.value) {
|
|
1149
1153
|
disabledStats.value = true;
|
|
1150
1154
|
getPage(1, true);
|
|
1151
1155
|
}
|
|
1152
|
-
else{
|
|
1156
|
+
else {
|
|
1153
1157
|
SearchTable.loadSearchTableApi(props.api, load, searchModel, true);
|
|
1154
1158
|
}
|
|
1155
1159
|
}
|
|
@@ -1238,10 +1242,17 @@ function fiexdHead() {
|
|
|
1238
1242
|
}
|
|
1239
1243
|
});
|
|
1240
1244
|
}
|
|
1245
|
+
// 拖拽开始事件
|
|
1246
|
+
function onDragStart(event, row, column, name) {
|
|
1247
|
+
if (name == "table" && row.flagDrag == "1") {
|
|
1248
|
+
emit("drag", row, column, 'drag');
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1241
1252
|
function drop(e, row, column, name) {
|
|
1242
1253
|
let routerKey = "edit";
|
|
1243
1254
|
let submitData = {};
|
|
1244
|
-
if (props.dragStartName == "top" && name == "
|
|
1255
|
+
if (props.dragStartName == "top" && name == "table" && column.paramName == "drop") {
|
|
1245
1256
|
var actionRouter = model.value.actionRouter;
|
|
1246
1257
|
let field = actionRouter.find((b) => {
|
|
1247
1258
|
return b.key === routerKey;
|
|
@@ -1276,18 +1287,17 @@ function drop(e, row, column, name) {
|
|
|
1276
1287
|
}
|
|
1277
1288
|
});
|
|
1278
1289
|
|
|
1279
|
-
if (name === "
|
|
1290
|
+
if (name === "table") {
|
|
1280
1291
|
let el = e.target.nodeName.toLowerCase() == "td" ? e.target : getTDOfParents(e.target);
|
|
1281
1292
|
removeClass(el, "dragEnterHover");
|
|
1282
1293
|
}
|
|
1283
1294
|
}
|
|
1284
|
-
|
|
1285
|
-
emit("drop", row, column);
|
|
1286
|
-
|
|
1295
|
+
emit("drag", row, column, 'drop');
|
|
1287
1296
|
}
|
|
1297
|
+
|
|
1288
1298
|
function dragenter(e, column, name) {
|
|
1289
1299
|
let el = e.target.nodeName.toLowerCase() == "td" ? e.target : getTDOfParents(e.target);
|
|
1290
|
-
if (name === "
|
|
1300
|
+
if (name === "table" && column.paramName == "drop") {
|
|
1291
1301
|
addClass(el, "dragEnterHover");
|
|
1292
1302
|
}
|
|
1293
1303
|
dragenterEl.value = el;
|
|
@@ -1296,7 +1306,7 @@ function dragenter(e, column, name) {
|
|
|
1296
1306
|
function dragleave(e, column, name) {
|
|
1297
1307
|
let el = e.target.nodeName.toLowerCase() == "td" ? e.target : getTDOfParents(e.target);
|
|
1298
1308
|
// 目标节点的背景色恢复原样
|
|
1299
|
-
if (name === "
|
|
1309
|
+
if (name === "table" && dragenterEl.value != el) {
|
|
1300
1310
|
removeClass(el, "dragEnterHover");
|
|
1301
1311
|
}
|
|
1302
1312
|
|