askbot-dragon 0.7.96 → 0.7.99
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
CHANGED
|
@@ -1633,6 +1633,7 @@ export default {
|
|
|
1633
1633
|
"cascadeDown":{
|
|
1634
1634
|
"options":[
|
|
1635
1635
|
{
|
|
1636
|
+
checked:true,
|
|
1636
1637
|
"_default":false,
|
|
1637
1638
|
"optionStruct":{
|
|
1638
1639
|
"d63aeeef437e4186af4a2efcd7a6a31b":[
|
|
@@ -1662,6 +1663,7 @@ export default {
|
|
|
1662
1663
|
},
|
|
1663
1664
|
"children":[
|
|
1664
1665
|
{
|
|
1666
|
+
checked:true,
|
|
1665
1667
|
"_default":false,
|
|
1666
1668
|
"optionStruct":{
|
|
1667
1669
|
"d63aeeef437e4186af4a2efcd7a6a31b":[
|
|
@@ -1691,6 +1693,7 @@ export default {
|
|
|
1691
1693
|
},
|
|
1692
1694
|
"children":[
|
|
1693
1695
|
{
|
|
1696
|
+
checked:true,
|
|
1694
1697
|
"_default":false,
|
|
1695
1698
|
"optionStruct":{
|
|
1696
1699
|
"d63aeeef437e4186af4a2efcd7a6a31b":[
|
|
@@ -1742,6 +1745,7 @@ export default {
|
|
|
1742
1745
|
]
|
|
1743
1746
|
},
|
|
1744
1747
|
{
|
|
1748
|
+
checked:true,
|
|
1745
1749
|
"_default":false,
|
|
1746
1750
|
"optionStruct":{
|
|
1747
1751
|
"d63aeeef437e4186af4a2efcd7a6a31b":[
|
|
@@ -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">
|
|
@@ -441,7 +451,7 @@
|
|
|
441
451
|
:required="item.required || isRequiredFn(item.formField)"
|
|
442
452
|
:disabled="disableds"
|
|
443
453
|
@click-right-icon.stop="SelectClear(item.fieldId)"
|
|
444
|
-
:right-icon="item.value
|
|
454
|
+
:right-icon="item.value && item.value.length? 'close' : 'van-icon van-icon-arrow van-cell__right-icon'"
|
|
445
455
|
/>
|
|
446
456
|
<van-popup v-model="selectPicker" position="bottom" :style="{ height: '300px' }">
|
|
447
457
|
<select-popup
|
|
@@ -463,7 +473,7 @@
|
|
|
463
473
|
<van-field
|
|
464
474
|
readonly
|
|
465
475
|
clickable
|
|
466
|
-
:value="Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].join(','):extInfoFieldValue[item.fieldId]"
|
|
476
|
+
:value="Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].map(v=>v.name).join(','):(extInfoFieldValue[item.fieldId] && extInfoFieldValue[item.fieldId].name?extInfoFieldValue[item.fieldId].name:'')"
|
|
467
477
|
:label="item.formField.name"
|
|
468
478
|
name="picker"
|
|
469
479
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
@@ -471,7 +481,7 @@
|
|
|
471
481
|
@click-right-icon.stop="SelectClear(item.fieldId)"
|
|
472
482
|
:required="item.required || isRequiredFn(item.formField)"
|
|
473
483
|
:disabled="disableds"
|
|
474
|
-
:right-icon="extInfoFieldValue[item.fieldId]? 'close' : 'van-icon van-icon-arrow van-cell__right-icon'"
|
|
484
|
+
:right-icon="extInfoFieldValue[item.fieldId] && extInfoFieldValue[item.fieldId].length? 'close' : 'van-icon van-icon-arrow van-cell__right-icon'"
|
|
475
485
|
/>
|
|
476
486
|
<van-popup v-model="refShowPicker" position="bottom" :style="{ height: '300px' }">
|
|
477
487
|
<select-popup
|
|
@@ -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>
|
|
@@ -697,6 +710,7 @@ export default {
|
|
|
697
710
|
refTemplateList:{},
|
|
698
711
|
refList:{},
|
|
699
712
|
dataQuery:{},
|
|
713
|
+
refNextPage:{},
|
|
700
714
|
drawer:false,
|
|
701
715
|
detailField:{
|
|
702
716
|
formField:{}
|
|
@@ -1200,7 +1214,7 @@ export default {
|
|
|
1200
1214
|
if (!this.formList.form.formFieldRelation[i].formField.extInfo.mold ||
|
|
1201
1215
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'TIME' ||
|
|
1202
1216
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'TIME'){
|
|
1203
|
-
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=dateTime
|
|
1217
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]= dateTime
|
|
1204
1218
|
}
|
|
1205
1219
|
else if (this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATA_TIME' ||
|
|
1206
1220
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATE_TIME' ||
|
|
@@ -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
|
@@ -99,7 +99,7 @@ export default {
|
|
|
99
99
|
else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]){
|
|
100
100
|
this.dataTree = this.dataOptions.extInfo.cascadeDown[0].options
|
|
101
101
|
}
|
|
102
|
-
console.debug('dataTree',this.dataTree)
|
|
102
|
+
console.debug('dataTree',this.dataOptions,this.dataTree)
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
</script>
|