centaline-data-driven-v3 0.1.14 → 0.1.16
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 +132 -132
- package/package.json +1 -1
- package/src/assets/commonApp.css +6 -0
- package/src/assets/commonWeb.css +20 -11
- package/src/components/app/ComboBox.vue +2 -1
- package/src/components/app/DatePicker.vue +4 -2
- package/src/components/app/Field.vue +13 -9
- package/src/components/app/TextBox.vue +14 -11
- package/src/components/web/Button.vue +165 -6
- package/src/components/web/DatePicker.vue +25 -12
- package/src/components/web/DateTimePicker/DateTimePicker.vue +748 -0
- package/src/components/web/Field.vue +82 -35
- package/src/components/web/File.vue +4 -0
- package/src/components/web/Form.vue +7 -7
- package/src/components/web/SearchList/SearchTable.vue +5 -1
- package/src/components/web/SearchScreen.vue +26 -7
- package/src/loader/src/Button.js +5 -2
- package/src/loader/src/DatePicker.js +56 -22
- package/src/loader/src/Enum.ts +736 -727
- package/src/loader/src/Field.js +10 -1
- package/src/loader/src/LibFunction.js +1 -1
- package/src/loader/src/SearchScreen.js +26 -0
- package/src/main.js +4 -4
- package/src/views/Form.vue +8 -8
- package/src/views/SearchList.vue +5 -6
|
@@ -1,48 +1,95 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ct-field">
|
|
3
|
-
<div class="el-form-item el-form-item--small"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<div class="el-form-item el-form-item--small"
|
|
4
|
+
:class="[!model.valid ? 'is-error' : '', 'label-' + model.labelPlacement]">
|
|
5
|
+
|
|
6
|
+
<!-- 使用单一元素结构 -->
|
|
7
|
+
<template v-if="model.isList">
|
|
8
|
+
<div class="el-form-item__label" v-if="model.showLabel && model.controlLabel">
|
|
9
|
+
<slot name="ControlLabel">
|
|
10
|
+
<div :class="[model.required ? 'requiredLabel' : '']"
|
|
11
|
+
:style="model.isList ? 'white-space: nowrap' : ''">
|
|
12
|
+
<span>{{ model.controlLabel }}</span>
|
|
13
|
+
</div>
|
|
14
|
+
</slot>
|
|
15
|
+
</div>
|
|
16
|
+
<template v-else>
|
|
17
|
+
<div class="el-form-item__label" v-if="model.labelPlacement == '1'"></div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<slot name="PreLabel">
|
|
21
|
+
<div v-if="model.preLabel1" class="preLabel">
|
|
22
|
+
<span v-html="model.preLabel1"></span>
|
|
9
23
|
</div>
|
|
10
24
|
</slot>
|
|
11
|
-
</
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
</template>
|
|
26
|
+
<div class="label-wrapper" v-else>
|
|
27
|
+
<div class="el-form-item__label" v-if="model.showLabel && model.controlLabel">
|
|
28
|
+
<slot name="ControlLabel">
|
|
29
|
+
<div :class="[model.required ? 'requiredLabel' : '']"
|
|
30
|
+
:style="model.isList ? 'white-space: nowrap' : ''">
|
|
31
|
+
<span>{{ model.controlLabel }}</span>
|
|
32
|
+
</div>
|
|
33
|
+
</slot>
|
|
16
34
|
</div>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
<template v-else>
|
|
36
|
+
<div class="el-form-item__label" v-if="model.labelPlacement == '1'"></div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<slot name="PreLabel">
|
|
40
|
+
<div v-if="model.preLabel1" class="preLabel">
|
|
41
|
+
<span v-html="model.preLabel1"></span>
|
|
42
|
+
</div>
|
|
43
|
+
</slot>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="control-wrapper">
|
|
47
|
+
<!-- 插槽--控件的内容 -->
|
|
48
|
+
<slot name="Control">
|
|
49
|
+
</slot>
|
|
50
|
+
<!-- 插槽--控件后面的内容 -->
|
|
51
|
+
<slot name="SufLabel" v-if="model.controlType != Enum.ControlType.CheckBox
|
|
52
|
+
&& model.controlType != Enum.ControlType.MultiLineText
|
|
53
|
+
&& model.controlType != Enum.ControlType.Switch">
|
|
54
|
+
<span v-if="model.sufLabel1" class="sufLabel" v-html="model.sufLabel1"></span>
|
|
55
|
+
</slot>
|
|
56
|
+
<!-- 插槽--验证提示的内容 -->
|
|
57
|
+
<slot name="ValidMessage">
|
|
58
|
+
<span v-show="!model.valid" class="errorMessage">
|
|
59
|
+
{{ model.validMessage }}
|
|
60
|
+
</span>
|
|
61
|
+
</slot>
|
|
62
|
+
<!-- 插槽--控件后面的按钮 -->
|
|
63
|
+
<slot name="Sufbutton">
|
|
64
|
+
|
|
65
|
+
</slot>
|
|
66
|
+
</div>
|
|
39
67
|
</div>
|
|
40
68
|
</div>
|
|
41
69
|
</template>
|
|
42
|
-
<script lang="ts" setup>
|
|
70
|
+
<script lang="ts" setup>
|
|
43
71
|
import Enum from '../../utils/Enum'
|
|
44
72
|
const props = defineProps({
|
|
45
73
|
vmodel: Object,
|
|
46
74
|
})
|
|
47
75
|
const model = props.vmodel
|
|
48
|
-
</script>
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<style lang="scss" scoped>
|
|
79
|
+
.control-wrapper {
|
|
80
|
+
display: flex;
|
|
81
|
+
width: 100%;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.label-wrapper {
|
|
85
|
+
display: flex;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.el-form-item.label-1 {
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
|
|
91
|
+
.el-form-item__label {
|
|
92
|
+
justify-content: flex-start;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
</style>
|
|
@@ -318,6 +318,10 @@ function getSuffix(file) {
|
|
|
318
318
|
return "";
|
|
319
319
|
}
|
|
320
320
|
function handleChange(file, fileList) {
|
|
321
|
+
if (file && model.maxSize && file.size > model.maxSize) {
|
|
322
|
+
this.$message.error(`文件大小不能超过 ${model.maxSize / (1024 * 1024)}MB`);
|
|
323
|
+
fileList.pop(); // 移除不符合要求的文件
|
|
324
|
+
}
|
|
321
325
|
changeHandler(model.value, emit);
|
|
322
326
|
}
|
|
323
327
|
//上传之前的钩子
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<template v-for="(col, index) in relationParentFormFields" :key="index">
|
|
17
17
|
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
|
|
18
18
|
</div>
|
|
19
|
-
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
19
|
+
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
|
|
20
20
|
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
21
21
|
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
22
22
|
:fileData="getFileData(col)" @change="changeHandler"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<template v-for="(col, index) in model.collapseFields[0]" :key="index">
|
|
35
35
|
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
|
|
36
36
|
</div>
|
|
37
|
-
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
37
|
+
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
|
|
38
38
|
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
39
39
|
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
40
40
|
:fileData="getFileData(col)" @change="changeHandler"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
|
|
56
56
|
<div style="display: flex; flex: 0 0 100%;"
|
|
57
57
|
v-if="col.show !== false && col.lineFeed"></div>
|
|
58
|
-
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
58
|
+
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
|
|
59
59
|
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
60
60
|
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
61
61
|
:fileData="getFileData(col)" @change="changeHandler"
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
<template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
|
|
92
92
|
<div style="display: flex; flex: 0 0 100%;"
|
|
93
93
|
v-if="col.show !== false && col.lineFeed"></div>
|
|
94
|
-
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
94
|
+
<el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
|
|
95
95
|
<component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
|
|
96
96
|
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
97
97
|
:fileData="getFileData(col)" @change="changeHandler"
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
<template v-for="(col, index) in model.independentItem" :key="index">
|
|
115
115
|
<div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
|
|
116
116
|
</div>
|
|
117
|
-
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
117
|
+
<el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
|
|
118
118
|
<component ref="Fields" :is="col.is" :vmodel="col"
|
|
119
119
|
:parameterAction="model.parameterAction" v-bind="col.bindPara"
|
|
120
120
|
@change="changeHandler" :key="itemKey" :fileData="getFileData(col)"
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
</template>
|
|
128
128
|
</el-row>
|
|
129
129
|
<el-row v-if="model.links.findIndex((v) => { return v.show }) > -1" style="margin-top: 8px;">
|
|
130
|
-
<el-col :span="24" style="text-align:left">
|
|
130
|
+
<el-col :span="24" style="text-align:left" >
|
|
131
131
|
<template v-for="(btn, index) in model.links" :key="index">
|
|
132
132
|
<component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler">
|
|
133
133
|
</component>
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
:style="['max-width:' + buttonsWidth(), isWebScroll ? 'position: fixed;' : '']">
|
|
141
141
|
<el-col :span="24"
|
|
142
142
|
style="text-align:center;padding-bottom: 1px;padding-left: 5px;padding-right: 5px;"
|
|
143
|
-
class="btnPadBom">
|
|
143
|
+
class="btnPadBom" >
|
|
144
144
|
<template v-for="(btn, index) in model.buttons" :key="index">
|
|
145
145
|
<component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler"
|
|
146
146
|
:style="{ 'float': btn.isCheckbox ? btn.alignCss : '' }"></component>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]" @mousemove="thMouseMoveHandle($event)"
|
|
44
44
|
@mousedown="thMouseDownHandle($event, colIndex)" @mouseover="theadTitleHover"
|
|
45
45
|
@mouseout="theadTitleLeave" v-bind="column.attrs" id="thHeight">
|
|
46
|
-
<span
|
|
46
|
+
<span v-html="column.name"></span>
|
|
47
47
|
<span class="caret-wrapper" v-if="column.sort" @click="toSort($event, column)"
|
|
48
48
|
@contextmenu.prevent="clearSort($event, column)">
|
|
49
49
|
<i class="sort-caret ascending" @click.left="toSort($event, column, 'asc')"
|
|
@@ -555,6 +555,7 @@ function importComplete(res, field) {
|
|
|
555
555
|
message: data.rtnMsg,
|
|
556
556
|
type: 'success',
|
|
557
557
|
showClose: true,
|
|
558
|
+
dangerouslyUseHTMLString:true,
|
|
558
559
|
});
|
|
559
560
|
}
|
|
560
561
|
getPage(1, false);
|
|
@@ -565,6 +566,7 @@ function importComplete(res, field) {
|
|
|
565
566
|
message: data.rtnMsg,
|
|
566
567
|
type: 'warning',
|
|
567
568
|
showClose: true,
|
|
569
|
+
dangerouslyUseHTMLString:true,
|
|
568
570
|
});
|
|
569
571
|
}
|
|
570
572
|
},
|
|
@@ -607,6 +609,7 @@ function importComplete(res, field) {
|
|
|
607
609
|
message: data.rtnMsg,
|
|
608
610
|
type: 'success',
|
|
609
611
|
showClose: true,
|
|
612
|
+
dangerouslyUseHTMLString:true,
|
|
610
613
|
});
|
|
611
614
|
}
|
|
612
615
|
getPage(1, false);
|
|
@@ -617,6 +620,7 @@ function importComplete(res, field) {
|
|
|
617
620
|
message: data.rtnMsg,
|
|
618
621
|
type: 'warning',
|
|
619
622
|
showClose: true,
|
|
623
|
+
dangerouslyUseHTMLString:true,
|
|
620
624
|
});
|
|
621
625
|
}
|
|
622
626
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
:is="col.is" :vmodel="col" :parameterAction="model.parameterAction"
|
|
21
21
|
@fieldClick="searchHandler(col)" @change="changeHandler(col)"
|
|
22
22
|
@SaveSearchWhere="SaveSearchWhere" @SearchWhereManage="SearchWhereManage"
|
|
23
|
-
@clickSearchWhere="clickSearchWhere"></component>
|
|
23
|
+
:actionRouters="model.actionRouters" @clickSearchWhere="clickSearchWhere"></component>
|
|
24
24
|
<br v-else-if="col.controlType === Enum.ControlType.LineFeed" />
|
|
25
25
|
<component v-else :from="from" class="list-field" v-bind="col.listBind" :is="col.is"
|
|
26
26
|
:vmodel="col" :parameterAction="model.parameterAction" @search="searchHandler(col)"
|
|
@@ -54,9 +54,11 @@
|
|
|
54
54
|
</template>
|
|
55
55
|
<script setup lang="ts">
|
|
56
56
|
import { ref, nextTick, onDeactivated } from 'vue'
|
|
57
|
+
|
|
57
58
|
import SearchScreen from '../../loader/src/SearchScreen'
|
|
58
59
|
import Enum from '../../utils/Enum'
|
|
59
60
|
import common from '../../utils/common';
|
|
61
|
+
import { RouterClickHandler } from '../../utils/mixins';
|
|
60
62
|
const emit = defineEmits(['loaded', 'failLoad', 'showTitle', 'search', 'resetSearch', 'saveShortcut'])
|
|
61
63
|
const props = defineProps({
|
|
62
64
|
api: String,
|
|
@@ -206,14 +208,31 @@ function validExcute() {
|
|
|
206
208
|
}
|
|
207
209
|
return rtnBool;
|
|
208
210
|
}
|
|
209
|
-
function SaveSearchWhere() {
|
|
210
|
-
|
|
211
|
+
function SaveSearchWhere(field) {
|
|
212
|
+
if (model.value.searchData.fields.length == 0) {
|
|
213
|
+
common.message("没有选择任何搜索条件,无需保存!")
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
var submitData = {};
|
|
217
|
+
submitData["jsonData"] = JSON.stringify(model.value.searchData.fields);
|
|
218
|
+
RouterClickHandler(field, submitData, null, model.value, 'form');
|
|
211
219
|
}
|
|
212
|
-
function clickSearchWhere() {
|
|
213
|
-
|
|
220
|
+
function clickSearchWhere(col) {
|
|
221
|
+
if (typeof col.scripts !== 'undefined') {
|
|
222
|
+
model.value.reset();
|
|
223
|
+
model.value.scripts.formData = model.value.formData;
|
|
224
|
+
model.value.scripts.formData.form = model.value;
|
|
225
|
+
model.value.scripts.formData.excuteData = model.value.screen;
|
|
226
|
+
model.value.scripts.formData.fieldsDic = model.value.screenDic;
|
|
227
|
+
common.excute.call(model.value.scripts, col.scripts);
|
|
228
|
+
emit('search', model.value.scripts.formData.form);
|
|
229
|
+
}
|
|
214
230
|
}
|
|
215
|
-
function SearchWhereManage() {
|
|
216
|
-
|
|
231
|
+
function SearchWhereManage(v) {
|
|
232
|
+
let field = model.value.actionRouters.find((b) => {
|
|
233
|
+
return b.key === v.routerKey;
|
|
234
|
+
});
|
|
235
|
+
RouterClickHandler(field, {}, null, model.value, 'form');
|
|
217
236
|
}
|
|
218
237
|
function saveShortcut() {
|
|
219
238
|
emit('saveShortcut', model.value);
|
package/src/loader/src/Button.js
CHANGED
|
@@ -18,7 +18,7 @@ const Button = function (source) {
|
|
|
18
18
|
// }
|
|
19
19
|
return source.borderColor
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
//允许的文件类型(针对上传控件)
|
|
22
22
|
get fileAccept1() {
|
|
23
23
|
return source.fileAccept1 || '';
|
|
24
24
|
},
|
|
@@ -37,7 +37,10 @@ const Button = function (source) {
|
|
|
37
37
|
}
|
|
38
38
|
return source.action
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
get routerKey() {
|
|
41
|
+
return source.routerKey;
|
|
42
|
+
},
|
|
43
|
+
set action(v) {
|
|
41
44
|
source.action = v;
|
|
42
45
|
},
|
|
43
46
|
get isSearchRouterKey() {
|
|
@@ -9,19 +9,19 @@ const DatePicker = function (source) {
|
|
|
9
9
|
if (source.controlType == Enum.ControlType.DateTime || source.controlType == Enum.ControlType.DateTimeRange || this.flagtime) {
|
|
10
10
|
return 'yyyy-MM-dd HH:mm:ss'
|
|
11
11
|
}
|
|
12
|
-
else if(source.controlType == Enum.ControlType.DateYearMonth
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
else if (source.controlType == Enum.ControlType.DateYearMonth
|
|
13
|
+
|| source.controlType == Enum.ControlType.MonthRange) {
|
|
14
|
+
return 'yyyy-MM'
|
|
15
15
|
}
|
|
16
16
|
return 'yyyy-MM-dd'
|
|
17
17
|
},
|
|
18
18
|
//APP格式
|
|
19
19
|
get valueFormatAPP() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
if (source.controlType == Enum.ControlType.DateYearMonth
|
|
21
|
+
|| source.controlType == Enum.ControlType.MonthRange) {
|
|
22
|
+
return ['year', 'month']
|
|
23
|
+
}
|
|
24
|
+
return ['year', 'month', 'day']
|
|
25
25
|
},
|
|
26
26
|
//是否时间
|
|
27
27
|
get flagtime() {
|
|
@@ -30,33 +30,67 @@ const DatePicker = function (source) {
|
|
|
30
30
|
}
|
|
31
31
|
return false
|
|
32
32
|
},
|
|
33
|
+
get flagDateTime() {
|
|
34
|
+
if (source.controlType == Enum.ControlType.DateTime || source.controlType == Enum.ControlType.DateTimeRange) {
|
|
35
|
+
return true
|
|
36
|
+
}
|
|
37
|
+
return false
|
|
38
|
+
},
|
|
39
|
+
get format() {
|
|
40
|
+
let dateformat = 'YYYY-MM-DD';
|
|
41
|
+
|
|
42
|
+
if (this.flagtime) {
|
|
43
|
+
dateformat = 'HH:mm';
|
|
44
|
+
if (source.paramName1 && source.paramName1.length >= 2) {
|
|
45
|
+
dateformat = source.paramName1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
else if (source.paramName1 && source.paramName1.length >= 10) {
|
|
50
|
+
dateformat = source.paramName1;
|
|
51
|
+
}
|
|
52
|
+
else if (source.controlType == Enum.ControlType.DateTime || source.controlType == Enum.ControlType.DateTimeRange) {
|
|
53
|
+
dateformat = 'YYYY-MM-DD HH:mm';
|
|
54
|
+
}
|
|
55
|
+
else if (source.controlType == Enum.ControlType.DateYearMonth) {
|
|
56
|
+
dateformat = 'YYYY-MM';
|
|
57
|
+
}
|
|
58
|
+
return dateformat
|
|
59
|
+
},
|
|
60
|
+
get minuteStep() {
|
|
61
|
+
let step = 1
|
|
62
|
+
if (source.paramName2 && !isNaN(source.paramName2) && source.paramName2 > 0 && source.paramName2 < 60) {
|
|
63
|
+
step = parseInt(source.paramName2)
|
|
64
|
+
}
|
|
65
|
+
return step
|
|
66
|
+
},
|
|
33
67
|
//是否区间
|
|
34
68
|
get flagrange() {
|
|
35
|
-
if (source.controlType == Enum.ControlType.DateRange
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
69
|
+
if (source.controlType == Enum.ControlType.DateRange
|
|
70
|
+
|| source.controlType == Enum.ControlType.DateTimeRange
|
|
71
|
+
|| source.controlType == Enum.ControlType.MonthRange
|
|
72
|
+
|| source.controlType == Enum.ControlType.TimeRange) {
|
|
39
73
|
return true
|
|
40
74
|
}
|
|
41
75
|
return false
|
|
42
76
|
},
|
|
43
77
|
//控件类型
|
|
44
78
|
get dateType() {
|
|
45
|
-
if (source.controlType == Enum.ControlType.DateTime
|
|
46
|
-
|
|
79
|
+
if (source.controlType == Enum.ControlType.DateTime
|
|
80
|
+
|| source.controlType == Enum.ControlType.DateTimeRange) {
|
|
47
81
|
return 'datetime'
|
|
48
82
|
}
|
|
49
83
|
else if (this.flagtime) {
|
|
50
84
|
return 'time'
|
|
51
85
|
}
|
|
52
|
-
else if (source.controlType == Enum.ControlType.DateYearMonth
|
|
53
|
-
|
|
86
|
+
else if (source.controlType == Enum.ControlType.DateYearMonth
|
|
87
|
+
|| source.controlType == Enum.ControlType.MonthRange) {
|
|
54
88
|
return 'month'
|
|
55
89
|
}
|
|
56
90
|
return 'date'
|
|
57
91
|
},
|
|
58
92
|
get code1() {
|
|
59
|
-
if (this.flagtime
|
|
93
|
+
if (this.flagtime && !common.flagApp()) {
|
|
60
94
|
if (source.code1 && Object.prototype.toString.call(source.code1) === "[object String]") {
|
|
61
95
|
if (source.code1.length <= 8) {
|
|
62
96
|
return common.formatDate(new Date(), 'yyyy-MM-dd') + ' ' + source.code1;
|
|
@@ -66,15 +100,15 @@ const DatePicker = function (source) {
|
|
|
66
100
|
return source.code1
|
|
67
101
|
},
|
|
68
102
|
set code1(v) {
|
|
69
|
-
if(common.flagApp()||Object.prototype.toString.call(v) === "[object String]"){
|
|
103
|
+
if (common.flagApp() || Object.prototype.toString.call(v) === "[object String]") {
|
|
70
104
|
source.code1 = v
|
|
71
105
|
}
|
|
72
|
-
else{
|
|
106
|
+
else {
|
|
73
107
|
source.code1 = common.formatDate(v, rtn.valueFormat)
|
|
74
108
|
}
|
|
75
109
|
},
|
|
76
110
|
get code2() {
|
|
77
|
-
if (this.flagtime
|
|
111
|
+
if (this.flagtime && !common.flagApp()) {
|
|
78
112
|
if (source.code2 && Object.prototype.toString.call(source.code2) === "[object String]") {
|
|
79
113
|
if (source.code2.length <= 8) {
|
|
80
114
|
return common.formatDate(new Date(), 'yyyy-MM-dd') + ' ' + source.code2;
|
|
@@ -84,10 +118,10 @@ const DatePicker = function (source) {
|
|
|
84
118
|
return source.code2
|
|
85
119
|
},
|
|
86
120
|
set code2(v) {
|
|
87
|
-
if(common.flagApp()||Object.prototype.toString.call(v) === "[object String]"){
|
|
121
|
+
if (common.flagApp() || Object.prototype.toString.call(v) === "[object String]") {
|
|
88
122
|
source.code2 = v
|
|
89
123
|
}
|
|
90
|
-
else{
|
|
124
|
+
else {
|
|
91
125
|
source.code2 = common.formatDate(v, rtn.valueFormat)
|
|
92
126
|
}
|
|
93
127
|
},
|