askbot-dragon 0.7.95 → 0.7.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/package.json +1 -1
- package/src/components/formTemplate.vue +101 -13
- package/src/components/tree.vue +5 -1
package/package.json
CHANGED
|
@@ -22,6 +22,13 @@
|
|
|
22
22
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'"
|
|
23
23
|
:maxlength="item.formField.extInfo&&item.formField.extInfo.maxNum?item.formField.extInfo.maxNum*1:1000"
|
|
24
24
|
v-if="item.formField.type==='INPUT'&&item.fieldId!=='workorder_name'"
|
|
25
|
+
:type="item.formField.extInfo.inputType==='NUMBER'||
|
|
26
|
+
item.formField.extInfo.inputType==='RATE'? 'number':'text'"
|
|
27
|
+
@blur="typeCheck(item.formField,item)"
|
|
28
|
+
:min="item.formField.extInfo.inputType==='NUMBER'||
|
|
29
|
+
item.formField.extInfo.inputType==='RATE'?Number(item.formField.extInfo.range.start):''"
|
|
30
|
+
:max="item.formField.extInfo.inputType==='NUMBER'||
|
|
31
|
+
item.formField.extInfo.inputType==='RATE'?Number(item.formField.extInfo.range.end):''"
|
|
25
32
|
></el-input>
|
|
26
33
|
<template v-else-if="item.formField.type==='EXPLANATION'">
|
|
27
34
|
<div class="explanation">
|
|
@@ -214,7 +221,7 @@
|
|
|
214
221
|
</template>
|
|
215
222
|
<div
|
|
216
223
|
@click="lodeMore(item)"
|
|
217
|
-
v-if="
|
|
224
|
+
v-if="refNextPage[item.fieldId] && refNextPage[item.fieldId].hasNextPage"
|
|
218
225
|
style="width:100%;height:30px;display:flex;align-items: center;justify-content: center;color:#606266">
|
|
219
226
|
加载更多
|
|
220
227
|
</div>
|
|
@@ -235,6 +242,9 @@
|
|
|
235
242
|
:disabled="disableds"
|
|
236
243
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'"
|
|
237
244
|
:maxlength="item.formField.extInfo&&item.formField.extInfo.maxNum?item.formField.extInfo.maxNum*1:1000"
|
|
245
|
+
@blur="typeCheck(item.formField,item)"
|
|
246
|
+
:type="item.formField.extInfo.inputType==='NUMBER'||
|
|
247
|
+
item.formField.extInfo.inputType==='RATE'? 'number':'text'"
|
|
238
248
|
/>
|
|
239
249
|
</div>
|
|
240
250
|
<div v-else-if="item.formField.type==='EXPLANATION'||item.formField.type==='EXPLAIN'" class="explan-ation">
|
|
@@ -486,6 +496,9 @@
|
|
|
486
496
|
label:'name'
|
|
487
497
|
}"
|
|
488
498
|
>
|
|
499
|
+
<template slot="popup-footer" v-if="refNextPage[item.fieldId] && refNextPage[item.fieldId].hasNextPage">
|
|
500
|
+
<span @click="lodeMore(item)">加载更多</span>
|
|
501
|
+
</template>
|
|
489
502
|
</select-popup>
|
|
490
503
|
</van-popup>
|
|
491
504
|
</div>
|
|
@@ -494,7 +507,7 @@
|
|
|
494
507
|
readonly
|
|
495
508
|
clickable
|
|
496
509
|
name="area"
|
|
497
|
-
:value="extInfoFieldValue[item.fieldId] && Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].map(e=>e.label).join('
|
|
510
|
+
:value="extInfoFieldValue[item.fieldId] && Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].map(e=>e.label).join('/'):''"
|
|
498
511
|
:label=item.formField.name
|
|
499
512
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
500
513
|
@click="openDrawer(item,'cascader')"
|
|
@@ -697,11 +710,12 @@ export default {
|
|
|
697
710
|
refTemplateList:{},
|
|
698
711
|
refList:{},
|
|
699
712
|
dataQuery:{},
|
|
713
|
+
refNextPage:{},
|
|
700
714
|
drawer:false,
|
|
701
715
|
detailField:{
|
|
702
716
|
formField:{}
|
|
703
717
|
},
|
|
704
|
-
extInfoFieldValue:
|
|
718
|
+
extInfoFieldValue:{},
|
|
705
719
|
selectPopUp:false,
|
|
706
720
|
options:[],
|
|
707
721
|
defaultValue:[],
|
|
@@ -1177,10 +1191,8 @@ export default {
|
|
|
1177
1191
|
let type = this.formList.form.formFieldRelation[i].formField.type
|
|
1178
1192
|
let extInfo = this.formList.form.formFieldRelation[i].formField.extInfo
|
|
1179
1193
|
if (type === 'CASCADER') {
|
|
1180
|
-
let fieldValue = this.formList.form.formFieldRelation[i].formField.extInfo.
|
|
1181
|
-
this.formList.form.formFieldRelation[i].formField.extInfo.
|
|
1182
|
-
(this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue?
|
|
1183
|
-
this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue:[])
|
|
1194
|
+
let fieldValue = this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue ?
|
|
1195
|
+
this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue :[]
|
|
1184
1196
|
if (!this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]){
|
|
1185
1197
|
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = fieldValue
|
|
1186
1198
|
}
|
|
@@ -1461,9 +1473,11 @@ export default {
|
|
|
1461
1473
|
}
|
|
1462
1474
|
}
|
|
1463
1475
|
}
|
|
1464
|
-
|
|
1465
|
-
extInfoFieldValue
|
|
1476
|
+
let extInfo = {
|
|
1477
|
+
extInfoFieldValue:this.extInfoFieldValue
|
|
1466
1478
|
}
|
|
1479
|
+
this.$set(this.formShow,'extInfo',extInfo)
|
|
1480
|
+
console.debug('form',this.formShow)
|
|
1467
1481
|
this.$emit('submitClick',this.formShow)
|
|
1468
1482
|
this.disableds = true
|
|
1469
1483
|
this.submitValue = '已提交'
|
|
@@ -1505,7 +1519,7 @@ export default {
|
|
|
1505
1519
|
return
|
|
1506
1520
|
}
|
|
1507
1521
|
this.selectDetail = item;
|
|
1508
|
-
this.defaultValue =
|
|
1522
|
+
this.defaultValue = []
|
|
1509
1523
|
if(type == 'client') {
|
|
1510
1524
|
let selectOption
|
|
1511
1525
|
this.selectValue=[]
|
|
@@ -1537,7 +1551,10 @@ export default {
|
|
|
1537
1551
|
SelectClear(fieldId) {
|
|
1538
1552
|
if(this.disableds === false){
|
|
1539
1553
|
let i = this.formShow.form.formFieldRelation.findIndex(item => { console.log(item.fieldId); return item.fieldId == fieldId })
|
|
1540
|
-
this.selectValues[this.formShow.form.formFieldRelation[i].fieldId] = ''
|
|
1554
|
+
this.selectValues[this.formShow.form.formFieldRelation[i].fieldId] = '';
|
|
1555
|
+
this.formShow.form.formFieldRelation[i].value = "";
|
|
1556
|
+
this.extInfoFieldValue[this.formShow.form.formFieldRelation[i].fieldId] = ""
|
|
1557
|
+
this.defaultValue = []
|
|
1541
1558
|
this.$forceUpdate()
|
|
1542
1559
|
}
|
|
1543
1560
|
},
|
|
@@ -1886,7 +1903,7 @@ export default {
|
|
|
1886
1903
|
let fields = field.formField.type === 'REF' ? field.formField.extInfo.ref.field : field.formField.extInfo.ref.vars
|
|
1887
1904
|
if (visible) {
|
|
1888
1905
|
if (
|
|
1889
|
-
!this.refTemplateList[field.fieldId] || this.
|
|
1906
|
+
!this.refTemplateList[field.fieldId] || this.refNextPage[field.fieldId].hasNextPage
|
|
1890
1907
|
) {
|
|
1891
1908
|
this.$set(this.refTemplateList, field.fieldId, [])
|
|
1892
1909
|
!this.dataQuery[field.fieldId] && this.$set(this.dataQuery,field.fieldId, {
|
|
@@ -1903,7 +1920,8 @@ export default {
|
|
|
1903
1920
|
templateId:field.formField.extInfo.ref.source,
|
|
1904
1921
|
fieldId:fields,
|
|
1905
1922
|
field:field,
|
|
1906
|
-
dataQuery:this.dataQuery
|
|
1923
|
+
dataQuery:this.dataQuery,
|
|
1924
|
+
refNextPage:this.refNextPage
|
|
1907
1925
|
}
|
|
1908
1926
|
this.$emit('getTemplateList',param)
|
|
1909
1927
|
}
|
|
@@ -1940,6 +1958,71 @@ export default {
|
|
|
1940
1958
|
this.dataQuery[item.fieldId].pageInfo.pageNo += 1
|
|
1941
1959
|
this.refTemplateVisibleChange(true,item)
|
|
1942
1960
|
},
|
|
1961
|
+
//校验输入框
|
|
1962
|
+
typeCheck(field,item){
|
|
1963
|
+
if (!item.value){
|
|
1964
|
+
return
|
|
1965
|
+
}
|
|
1966
|
+
console.debug('typeCheck',field)
|
|
1967
|
+
if (field.extInfo.inputType==='MOBILE'){
|
|
1968
|
+
const phone = /^[1][3,4,5,7,8][0-9]{9}$/
|
|
1969
|
+
if (!phone.test(item.value)) {
|
|
1970
|
+
this.$message({
|
|
1971
|
+
message: "请输入有效的手机号",
|
|
1972
|
+
duration: 2000,
|
|
1973
|
+
type: "warning",
|
|
1974
|
+
});
|
|
1975
|
+
item.value = ''
|
|
1976
|
+
return
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
else if (field.extInfo.inputType ==='MAIL'){
|
|
1980
|
+
const reg =
|
|
1981
|
+
/^([a-z0-9A-Z]+[-|_|\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-zA-Z]{2,4}$/;
|
|
1982
|
+
if (!reg.test(item.value)) {
|
|
1983
|
+
this.$message({
|
|
1984
|
+
message: "请输入有效的邮箱",
|
|
1985
|
+
duration: 2000,
|
|
1986
|
+
type: "warning",
|
|
1987
|
+
});
|
|
1988
|
+
item.value = ''
|
|
1989
|
+
return
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
}
|
|
1993
|
+
else if (field.extInfo.inputType === 'ID_CARD'){
|
|
1994
|
+
const reg = /^(([1-9][0-9]{5}(19|20)[0-9]{2}((0[1-9])|(1[0-2]))([0-2][1-9]|10|20|30|31)[0-9]{3}([0-9]|X|x))|([1-9][0-9]{5}[0-9]{2}((0[1-9])|(1[0-2]))([0-2][1-9]|10|20|30|31)[0-9]{3}))$/
|
|
1995
|
+
if (!reg.test(item.value)) {
|
|
1996
|
+
this.$message({
|
|
1997
|
+
message: "请输入有效的身份证号",
|
|
1998
|
+
duration: 2000,
|
|
1999
|
+
type: "warning",
|
|
2000
|
+
});
|
|
2001
|
+
item.value = ''
|
|
2002
|
+
return
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
else if (field.extInfo.inputType ==='LINK'){
|
|
2006
|
+
const reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])/;
|
|
2007
|
+
if (!reg.test(item.value)) {
|
|
2008
|
+
this.$message({
|
|
2009
|
+
message: "请输入合法的链接地址",
|
|
2010
|
+
duration: 2000,
|
|
2011
|
+
type: "warning",
|
|
2012
|
+
});
|
|
2013
|
+
item.value = ''
|
|
2014
|
+
return
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
else if (field.extInfo.inputType ==='NUMBER'||field.extInfo.inputType ==='RATE'){
|
|
2018
|
+
if ( item.value < Number(field.extInfo.range.start)){
|
|
2019
|
+
item.value = Number(field.extInfo.range.start)
|
|
2020
|
+
}
|
|
2021
|
+
else if (item.value > Number(field.extInfo.range.end)){
|
|
2022
|
+
item.value = Number(field.extInfo.range.end)
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
},
|
|
1943
2026
|
//打开级联/下拉抽屉选择
|
|
1944
2027
|
openDrawer(field,type){
|
|
1945
2028
|
this.detailField = field;
|
|
@@ -1994,6 +2077,11 @@ export default {
|
|
|
1994
2077
|
//保存所选下拉值
|
|
1995
2078
|
confirmSelect(option, list){
|
|
1996
2079
|
console.debug('option',option,list)
|
|
2080
|
+
if (!option || !list){
|
|
2081
|
+
this.selectPopUp = false
|
|
2082
|
+
this.selectPicker = false
|
|
2083
|
+
return
|
|
2084
|
+
}
|
|
1997
2085
|
this.detailField.value = list;
|
|
1998
2086
|
this.selectPopUp = false
|
|
1999
2087
|
this.selectPicker = false
|
package/src/components/tree.vue
CHANGED
|
@@ -31,7 +31,10 @@ export default {
|
|
|
31
31
|
name: "tree",
|
|
32
32
|
data(){
|
|
33
33
|
return{
|
|
34
|
-
defaultProps:{
|
|
34
|
+
defaultProps:{
|
|
35
|
+
label:"label",
|
|
36
|
+
value:"value"
|
|
37
|
+
},
|
|
35
38
|
checked:'',
|
|
36
39
|
dataTree:[],
|
|
37
40
|
checkList:[],
|
|
@@ -96,6 +99,7 @@ export default {
|
|
|
96
99
|
else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]){
|
|
97
100
|
this.dataTree = this.dataOptions.extInfo.cascadeDown[0].options
|
|
98
101
|
}
|
|
102
|
+
console.debug('dataTree',this.dataOptions,this.dataTree)
|
|
99
103
|
}
|
|
100
104
|
};
|
|
101
105
|
</script>
|