fhrons-mobile-next 2.0.0 → 2.0.2
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/.env.poc +8 -0
- package/assets/css/colors.js +6 -0
- package/assets/css/customVant.less +60 -0
- package/assets/css/extra.css +32 -0
- package/assets/css/global.css +1 -0
- package/assets/css/global.less +1637 -0
- package/assets/css/index.js +63 -0
- package/assets/css/static.less +607 -0
- package/assets/js/func.js +361 -0
- package/assets/js/globalData.js +18 -0
- package/assets/js/qywxapi.js +484 -0
- package/{packages → assets/js}/storage.js +1 -20
- package/assets/js/upload.js +269 -0
- package/assets/js/validate.js +48 -0
- package/assets/js/vant.js +39 -0
- package/assets/js/wxapi.js +297 -0
- package/assets/vantLang/index.js +172 -0
- package/assets/vantLang/lib/en-US.js +95 -0
- package/assets/vantLang/lib/es-ES.js +95 -0
- package/assets/vantLang/lib/pt-PT.js +96 -0
- package/assets/vantLang/lib/zh-CN.js +96 -0
- package/assets/vantLang/lib/zh-HK.js +96 -0
- package/assets/vantLang/locales/en_US.js +102 -0
- package/assets/vantLang/locales/es_ES.js +102 -0
- package/assets/vantLang/locales/index.js +12 -0
- package/assets/vantLang/locales/pt_PT.js +102 -0
- package/assets/vantLang/locales/zh_CN.js +102 -0
- package/assets/vantLang/locales/zh_T.js +102 -0
- package/babel.config.js +15 -0
- package/index.js +68 -33
- package/inject-env-plugin.js +29 -0
- package/package.json +46 -32
- package/packages/areaMobile/index.js +5 -0
- package/packages/areaMobile/index.vue +260 -0
- package/packages/autoGraph/VueEsign.vue +309 -0
- package/packages/autoGraph/index.js +5 -0
- package/packages/autoGraph/index.vue +472 -0
- package/packages/commonForm/CommonAsyncAreaPicker.vue +223 -0
- package/packages/commonForm/CommonDatePicker.vue +152 -0
- package/packages/commonForm/CommonForm.vue +786 -0
- package/packages/commonForm/CommonFullTimePicker.vue +137 -0
- package/packages/commonForm/CommonSinglePicker.vue +121 -0
- package/packages/commonForm/CommonYearMonthPicker.vue +127 -0
- package/packages/commonForm/index.js +33 -0
- package/packages/dialog/index.js +32 -0
- package/packages/dialog/index.vue +379 -0
- package/packages/index.js +7 -3
- package/packages/introduce/index.js +5 -0
- package/packages/introduce/index.vue +31 -0
- package/packages/loading/Loading.vue +70 -0
- package/packages/loading/index.js +43 -0
- package/packages/mindMap/index.js +5 -0
- package/packages/mindMap/index.vue +437 -0
- package/packages/pdfViewer/index.js +12 -0
- package/packages/pdfViewer/index.vue +131 -0
- package/packages/sharePanel/SheetPanel.vue +316 -0
- package/packages/sharePanel/index.js +5 -0
- package/packages/sharePanel/index.vue +476 -0
- package/packages/sharePanel/props.js +58 -0
- package/packages/sharePanel/utils/QyWxShareMixin.js +93 -0
- package/packages/sharePanel/utils/shareWay.js +81 -0
- package/packages/theme/index copy.js +89 -0
- package/packages/theme/index.js +38 -0
- package/packages/theme/theme.css +910 -0
- package/packages/theme/theme.less +26 -0
- package/packages/uploadFile/VanUploadFile.vue +80 -0
- package/packages/uploadFile/index.js +5 -0
- package/packages/uploadFile/index.vue +725 -0
- package/packages/uploadFile/vanUpload.js +5 -0
- package/packages/verify/Verify/VerifyPoints.vue +247 -0
- package/packages/verify/Verify/VerifySlide.vue +364 -0
- package/packages/verify/index.js +5 -0
- package/packages/verify/index.vue +416 -0
- package/packages/verify/utils/verify.js +53 -0
- package/packages/videoPage/index.js +5 -0
- package/packages/videoPage/index.vue +440 -0
- package/plugins/sensors/fhsensors.js +84 -0
- package/plugins/sensors/sensors.js +175 -0
- package/plugins/sensors/sensorsFun.js +1387 -0
- package/fhrons-mobile-next-2.0.0.tgz +0 -0
- package/packages/fhImage/index.js +0 -5
- package/packages/fhImage/index.vue +0 -57
- package/packages/fhPresetImage/index.js +0 -5
- package/packages/fhPresetImage/index.vue +0 -39
- package/packages/html2canvas/index.js +0 -29
- package/upload copy.js +0 -468
- package/utils/tools.js +0 -22
- /package/{dist → fhcommon/dist}/fhcommon.min.js +0 -0
- /package/{dist → fhcommon/dist}/fhcommon.min.js.LICENSE.txt +0 -0
- /package/{upload.js → fhcommon/upload.js} +0 -0
|
@@ -0,0 +1,786 @@
|
|
|
1
|
+
<!-- 功能:公共表单; 作者:LZJ; 时间:2021年08月10日 09:35:21-->
|
|
2
|
+
<template>
|
|
3
|
+
<div id="CommonForm" class="common-form">
|
|
4
|
+
<van-form :ref="`form${formIndex}`" :show-error-message="formData.showErrorMessage !== false" :show-error="formData.showErrorMessage !== false" :scroll-to-error="scrollToError">
|
|
5
|
+
<div v-for="(item, index) in cellData" :key="`cell${index}${item.prop}${item.required || ''}`" class="data-cell">
|
|
6
|
+
<!-- 输入框(包含右边有验证码等按钮类型) -->
|
|
7
|
+
<div v-if="item.type === 'text' || item.type === 'tel' || item.type === 'digit' || item.type === 'fuzzyMatching'" :class="item.subLabel ? ' cell-sub-label' : ''">
|
|
8
|
+
<van-field :ref="item['prop']" v-model="model[item['prop']]" :class="[item.class, underLine ? 'underLine' : '']" class="field-text" :readonly="item.readOnly" :label-class="item.labelClass" :label-width="item.labelWidth" :input-align="item.inputAlign || 'right'" :required="item.required" :type="item.type" :rules="fetchRules(item)" :label="item.title" :name="item.prop" :maxlength="item.maxlength" :placeholder="item.placeholder || $t('customerdetail.customeranalysis.xd8243')" :clearable="true" @input="fieldChange($event, item, model)" @blur="inputBlur(item, model, index)" @focus="fieldFocus($event, item, model)" @click="fieldClick($event, item)" @clear="handleClear">
|
|
9
|
+
<template #label>
|
|
10
|
+
<div class="flex-column-start">
|
|
11
|
+
<p class="flex-start mtb0">
|
|
12
|
+
<span v-if="(item.rule && item.rule[0].required) || item.required" class="c-ff5c5c ft14 line-height21">*</span>
|
|
13
|
+
<span @click="leftBtnClick(model, item, index)">
|
|
14
|
+
<i v-if="item.leftStartIcon" class="iconfont" :class="[item.leftStartIcon]" />
|
|
15
|
+
{{ item.title }}
|
|
16
|
+
<i v-if="item.leftEndIcon" class="iconfont" :class="[item.leftEndIcon]" />
|
|
17
|
+
</span>
|
|
18
|
+
</p>
|
|
19
|
+
<p v-if="item.subLabel" :class="item.subLabelClass" class="c-c8c9cc nowrap mt8 mb0">{{ item.subLabel }}</p>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
<template v-if="item.rightBtnName || item.rightStartIcon || item.rightEndIcon" #button>
|
|
23
|
+
<UploadFile v-if="item.rightUpload" :upload-file-id="`bankCard${index}`" class="file-btn" :upload-obj="item.uploadObj" :delete-flag="false" @photoChanged="fileChanged(arguments, item, model)">
|
|
24
|
+
<span v-if="item.needBar" class="right-parting-line ml4 mr12" />
|
|
25
|
+
<div @click="rightBtnClick(model, item, index)" class="flex-start-center">
|
|
26
|
+
<i v-if="item.rightStartIcon" :class="['iconfont', item.rightStartIcon]"></i>
|
|
27
|
+
<span v-if="item.rightBtnName" :class="item.rightBtnClass || 'theme-color'">{{ item.rightBtnName }}</span>
|
|
28
|
+
<i v-if="item.rightEndIcon" :class="['iconfont', item.rightEndIcon ]"></i>
|
|
29
|
+
</div>
|
|
30
|
+
</UploadFile>
|
|
31
|
+
<div v-else class="flex-start-center">
|
|
32
|
+
<span v-if="item.needBar" class="right-parting-line ml4 mr12" />
|
|
33
|
+
<div @click="rightBtnClick(model, item, index)" class="flex-start-center">
|
|
34
|
+
<i v-if="item.rightStartIcon" :class="['iconfont', item.rightStartIcon]"></i>
|
|
35
|
+
<span v-if="item.rightBtnName" :class="item.rightBtnClass || 'theme-color'">{{ item.rightBtnName }}</span>
|
|
36
|
+
<i v-if="item.rightEndIcon" :class="['iconfont', item.rightEndIcon ]"></i>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
<template v-else-if="item.showRecommend" #extra>
|
|
41
|
+
<div class="fuzzy-wrapper ps-a bgc-ffffff br8 pl12 over-hidden">
|
|
42
|
+
<p v-for="(fuzzyTwig, fuzzyIndex) in item.fuzzyMatchingContent" :key="fuzzyIndex" class="ptb12 single-fuzzy ft14 fw-400 c-23242e line-height21 text-ellipsis" @click.stop.prevent="handleClickFuzzyTwig(fuzzyTwig, fuzzyIndex)">{{ fuzzyTwig }}</p>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
</van-field>
|
|
46
|
+
</div>
|
|
47
|
+
<div v-else-if="item.type === 'phoneNum'" class="flex-start" :class="[item.rightBtnName?'phone-num-btn':'phone-num']">
|
|
48
|
+
<AreaMobile style="padding: 0" :class="[item.readOnly ? 'no-click ' : '','area-mobile']" showLabel :ref="`phoneNum${item.prop}`" :dialling-code="model['diallingCode']" @getArea="(area) => fieldChange(area, Object.assign(item, { area }), model, index)">
|
|
49
|
+
<template slot="widget">
|
|
50
|
+
<van-field :ref="item['prop']" :maxlength="areaMaxLength" v-model="model[item['prop']]" :class="[item.class, underLine ? 'underLine' : '']" class="field-text" :readonly="item.readOnly" :label-class="item.labelClass" :label-width="item.labelWidth" :input-align="item.inputAlign || 'right'" :required="item.required" type="digit" :rules="fetchRules(item)" :name="item.prop" :placeholder="item.placeholder || $t('customerdetail.customeranalysis.xd8243')" :clearable="true" @input="fieldChange($event, item, model,index);adjustWidth(item,'input')" @clear="adjustWidth(item,'clear')" @blur="inputBlur(item, model,index);adjustWidth(item,'blur')" @focus="fieldFocus($event, item, model);adjustWidth(item,'focus')" @click="fieldClick($event, item)">
|
|
51
|
+
<template #label>
|
|
52
|
+
<p class="flex-start mtb0">
|
|
53
|
+
<span v-if="(item.rule && item.rule[0].required) || item.required" class="c-ff5c5c ft14 line-height21">*</span>
|
|
54
|
+
<span>{{ item.title }}</span>
|
|
55
|
+
<span ref="nosee" class="nosee ps-a">{{ model[item['prop']] || item.placeholder || $t('customerdetail.customeranalysis.xd8243') }}</span>
|
|
56
|
+
</p>
|
|
57
|
+
</template>
|
|
58
|
+
<template v-if="item.rightBtnName" #button>
|
|
59
|
+
<div class="flex-start-center">
|
|
60
|
+
<span v-if="item.needBar" class="right-parting-line ml4 mr12" />
|
|
61
|
+
<div @click="rightBtnClick(model, item, index)" class="flex-start-center">
|
|
62
|
+
<i v-if="item.rightStartIcon" :class="['iconfont', item.rightStartIcon]"></i>
|
|
63
|
+
<span v-if="item.rightBtnName" :class="item.rightBtnClass || 'theme-color'">{{ item.rightBtnName }}</span>
|
|
64
|
+
<i v-if="item.rightEndIcon" :class="['iconfont', item.rightEndIcon ]"></i>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
</van-field>
|
|
69
|
+
</template>
|
|
70
|
+
</AreaMobile>
|
|
71
|
+
</div>
|
|
72
|
+
<!-- 带百分比完善度的跳转 应用场景 入司第二步-->
|
|
73
|
+
<van-field v-else-if="item.type === 'link'" :ref="item['prop']" v-model="model[item['prop']]" :class="[item.class, underLine ? 'underLine' : '']" class="field-text link-text theme-input-placeholder" :readonly="item.readOnly" :label-class="item.labelClass" :label-width="item.labelWidth" :input-align="item.inputAlign || 'right'" :required="item.required" :type="item.popType" :rules="fetchRules(item)" :label="item.title" :name="item.prop" :maxlength="item.maxlength" :disabled="item.disabled" :rows="item.rows" autosize :placeholder="item.placeholder || $t('customerdetail.customeranalysis.xd8243')" :clearable="true" @input="fieldChange($event, item, model, index)" @blur="inputBlur(item, model, index)" @focus="fieldFocus($event, item)" @click="fieldClick($event, item)">
|
|
74
|
+
<template #label>
|
|
75
|
+
<span v-if="(item.rule && item.rule[0].required) || item.required" class="c-ff5c5c ft14 line-height21">*</span>
|
|
76
|
+
<span>{{ item.title }}</span>
|
|
77
|
+
<!-- subtitle -->
|
|
78
|
+
<span v-if="item.subLabel" class="theme-color ml10">{{ item.subLabel }}{{ model[item.prop] || 0 }}%</span>
|
|
79
|
+
</template>
|
|
80
|
+
<template v-if="item.rightEndIcon" #button>
|
|
81
|
+
<span>
|
|
82
|
+
<span :class="[model[item.prop] >= 100 ? 'c-7f808a' : 'theme-color', 'ft14 line-height21']">{{ item.rightBtnName }}</span>
|
|
83
|
+
<i class="iconfont fw-500 ft14 ps-r" :class="[item.rightEndIcon]" />
|
|
84
|
+
</span>
|
|
85
|
+
</template>
|
|
86
|
+
<template #input>
|
|
87
|
+
<span class="ft14 line-height21" :class="[!item.subLabel && !model[item.prop] ? 'theme-color' : '']">{{ item.subLabel ? "" : model[item.prop] ? model[item.prop] : item.placeholder }}</span>
|
|
88
|
+
</template>
|
|
89
|
+
</van-field>
|
|
90
|
+
<!-- 数字键盘输入框 -->
|
|
91
|
+
<!-- 多行输入 -->
|
|
92
|
+
<van-field
|
|
93
|
+
v-else-if="item.type === 'textarea'"
|
|
94
|
+
:ref="item['prop']"
|
|
95
|
+
v-model="model[item['prop']]"
|
|
96
|
+
:class="[item.class, item.nowrap ? 'pd0' : '', item.nowrap ? '' : 'flex-column', item.underLine ? 'underLine' : '', model[item['prop']] && model[item['prop']].length >= item.maxlength ? 'van-field__word-num-red' : '']"
|
|
97
|
+
class="field-textarea"
|
|
98
|
+
:name="item.prop"
|
|
99
|
+
:label="item.title"
|
|
100
|
+
:label-class="item.labelClass"
|
|
101
|
+
:label-width="item.nowrap ? '' : '80vw'"
|
|
102
|
+
:required="item.required"
|
|
103
|
+
:clearable="item.clearable"
|
|
104
|
+
type="textarea"
|
|
105
|
+
autosize
|
|
106
|
+
:rules="item.rule"
|
|
107
|
+
:rows="item.rows || 2"
|
|
108
|
+
:input-align="item.inputAlign || 'right'"
|
|
109
|
+
:maxlength="item.maxlength"
|
|
110
|
+
:placeholder="item.placeholder || $t('customerdetail.customeranalysis.xd8243')"
|
|
111
|
+
:readonly="item.readOnly"
|
|
112
|
+
:show-word-limit="item.wordLimit"
|
|
113
|
+
@input="fieldChange($event, item, model, index)"
|
|
114
|
+
@focus="fieldFocus($event, item)"
|
|
115
|
+
@click="fieldClick($event, item, index)"
|
|
116
|
+
>
|
|
117
|
+
<template #label>
|
|
118
|
+
<span v-if="(item.rule && item.rule[0].required) || item.required" class="c-ff5c5c ft14 line-height21">*</span>
|
|
119
|
+
<span>{{ item.title }}</span>
|
|
120
|
+
</template>
|
|
121
|
+
</van-field>
|
|
122
|
+
<!-- 上传 -->
|
|
123
|
+
<van-field v-else-if="item.type === 'uploader'" :rules="item.rule" :required="item.required" :name="item.prop" :class="[item.class ? item.class:'flex-column', underLine ? 'underLine' : '', item.required ? 'required' : '']" class="uploader" :label-width="item.labelWidth">
|
|
124
|
+
<template v-if="item.title" #label>
|
|
125
|
+
<p class="c-555661 ft14 upload-title line-height14"><span v-if="(item.rule && item.rule[0].required) || item.required" class="c-ff5c5c ft14 line-height21">*</span>{{ item.title }}</p>
|
|
126
|
+
<p v-if="item.type === 'uploader'" class="c-c8c9cc ft12 mb15 line-height12">{{ item.subLabel }}</p>
|
|
127
|
+
</template>
|
|
128
|
+
<template #input>
|
|
129
|
+
<!-- 上传图片 -->
|
|
130
|
+
<van-uploader :ref="`uploaderDom${index}`" v-model="model[item['prop']]" :multiple="item.multiple" :max-count="item.maxCount" :rules="item.rule" :upload-icon="item.uploadIcon || ' iconfont icon-tianjia ft24 c-7f808a'" :after-read="(file) => afterRead(file, item, model, index)" :max-size="item.maxSize * 1000 * 1024" @click-preview="(file, name) => handlePreview(item, file, name, model, index)" @delete="(file, name) => deleteFile(item, file, name, model, index)" @oversize="$toast($t('commonform.commonform.lldfqi', [item.maxSize]))" />
|
|
131
|
+
<!-- deleteFile($event, item, model, index) -->
|
|
132
|
+
</template>
|
|
133
|
+
</van-field>
|
|
134
|
+
<div v-else-if="item.type === 'selectDate'">
|
|
135
|
+
<CommonYearMonthPicker v-if="item.popType === 'year-month'" :class="[item.class, underLine ? 'underLine' : '']" :under-line="underLine" :item="item" :model="model" :index="index" :cell-data="cellData" @onConfirmPicker="onConfirmPicker" @pickerFieldChange="pickerFieldChange" />
|
|
136
|
+
<CommonDatePicker v-else-if="item.popType === 'date'" :class="[item.class, underLine ? 'underLine' : '']" :under-line="underLine" :item="item" :model="model" :index="index" :cell-data="cellData" @onConfirmPicker="onConfirmPicker" @pickerFieldChange="pickerFieldChange" />
|
|
137
|
+
<CommonFullTimePicker v-else-if="item.popType === 'fulldate'" :class="[item.class, underLine ? 'underLine' : '']" :under-line="underLine" :item="item" :model="model" :index="index" :cell-data="cellData" @onConfirmPicker="onConfirmPicker" @pickerFieldChange="pickerFieldChange" />
|
|
138
|
+
</div>
|
|
139
|
+
<CommonAsyncAreaPicker v-else-if="item.type === 'asyncSelectArea'" :class="[item.class, underLine ? 'underLine' : '']" :under-line="underLine" :item="item" :model="model" :index="index" :cell-data="cellData" @onConfirmPicker="onConfirmPicker" @pickerFieldChange="pickerFieldChange" @areaHandleAddressData="areaHandleAddressData" />
|
|
140
|
+
<CommonSinglePicker v-else-if="item.type === 'selectSinglePicker'" :class="[item.class, underLine ? 'underLine' : '']" :under-line="underLine" :item="item" :model="model" :index="index" :cell-data="cellData" @onConfirmPicker="onConfirmPicker" @pickerFieldChange="pickerFieldChange" />
|
|
141
|
+
<van-field v-else-if="item.type === 'singleTag' || item.type === 'multiTag' || item.type === 'singleTagAndNum' || item.type === 'singleMutexTag'" v-model="model[item.prop]" :required="item.required" :name="item.prop" :label="item.title" :label-class="item.labelClass" :label-width="item.labelWidth" :class="[item.class, underLine ? 'underLine' : '', item.subLabelClass ? item.subLabelClass : '', 'pd12']" :input-align="item.inputAlign || 'right'" :rules="item.rule">
|
|
142
|
+
<template #label>
|
|
143
|
+
<div class="flex-start">
|
|
144
|
+
<p class="mtb0 c-555661 ft14"><span v-if="(item.rule && item.rule[0].required) || item.required" class="c-ff5c5c ft14 line-height21">*</span>{{ item.title }}</p>
|
|
145
|
+
<p v-if="item.subLabel" class="c-c8c9cc ft12 mt12 mb10">{{ item.subLabel }}</p>
|
|
146
|
+
</div>
|
|
147
|
+
</template>
|
|
148
|
+
<template #input>
|
|
149
|
+
<!-- 单选标签 -->
|
|
150
|
+
<div v-if="item.type === 'singleTag' || item.type === 'singleMutexTag'" direction="horizontal" class="line-feed" :class="item.singleTagClass">
|
|
151
|
+
<span v-for="(singleTag, singleTagIdx) in item.options" :key="`singleTag${singleTagIdx}`" class="br12" :class="[item.singleTagClass === 'cientsex' ? 'cient-btn' : 'radio-btn', singleTag.isChecked ? 'checked-btn theme-color' : singleTag.disabled ? 'border-line c-c8c9cc' : 'normal-btn', singleTagIdx === item.options.length - 1 ? '' : 'mr12', item.options.length > 3 ? '' : '']" :disabled="singleTag.disabled" @click.stop.prevent="singleTagClick(index, singleTagIdx, model, item.prop, item)">
|
|
152
|
+
<span class="nowrap">{{ singleTag.name }}</span>
|
|
153
|
+
</span>
|
|
154
|
+
</div>
|
|
155
|
+
<!-- 多选标签 -->
|
|
156
|
+
<div v-else-if="item.type === 'multiTag'" direction="horizontal" class="line-feed" :class="item.multiTagClass">
|
|
157
|
+
<span v-for="(multiTag, multiTagIdx) in item.options" :key="`multiTag${multiTagIdx}`" class="br12 radio-btn mr10" :class="multiTag.isChecked ? 'checked-btn theme-color' : 'normal-btn'" @click.stop.prevent="multiTagClick(index, multiTagIdx, model, item.prop, item)">{{ multiTag.name }}</span>
|
|
158
|
+
</div>
|
|
159
|
+
<!-- 单选标签加数字 -->
|
|
160
|
+
<div v-else-if="item.type === 'singleTagAndNum'" direction="horizontal" class="line-feed" :class="item.singleTagClass">
|
|
161
|
+
<div v-for="(singleTag, singleTagIdx) in item.options" :key="`singleTag${singleTagIdx}`" class="flex-column-center-center" @click.stop.prevent="singleTagClick(index, singleTagIdx, model, item.prop, item)">
|
|
162
|
+
<span class="br12 radio-btn mr10" :class="singleTag.isChecked ? 'checked-btn theme-color' : 'normal-btn'" :disabled="item.disabled">
|
|
163
|
+
<span>{{ singleTag.name }}</span>
|
|
164
|
+
</span>
|
|
165
|
+
<span class="bgc-5f9 br8 ft10 c-c8c9cc line-height16 mt6 ta-c width-24 inline-block">{{ `0${singleTagIdx + 1}` }}</span>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</template>
|
|
169
|
+
</van-field>
|
|
170
|
+
<van-field v-else :name="item.prop" :label="item.title" :label-class="item.labelClass" :label-width="item.labelWidth" :class="[item.class, underLine ? 'underLine' : '', item.subLabelClass ? item.subLabelClass : '']" :input-align="item.inputAlign || 'right'" :required="item.required" :rules="item.rule">
|
|
171
|
+
<template #label>
|
|
172
|
+
<div class="flex-column-start">
|
|
173
|
+
<p class="mtb0 c-555661 ft14"><span v-if="(item.rule && item.rule[0].required) || item.required" class="c-ff5c5c ft14 line-height21">*</span>{{ item.title }}</p>
|
|
174
|
+
<p v-if="item.subLabel" class="c-c8c9cc ft12 mt12 mb10">{{ item.subLabel }}</p>
|
|
175
|
+
</div>
|
|
176
|
+
</template>
|
|
177
|
+
<template #input>
|
|
178
|
+
<!-- 多选 -->
|
|
179
|
+
<van-checkbox-group v-if="item.type === 'checkbox'" :ref="item['prop']" v-model="model[item['prop']]" direction="horizontal" icon-size="16px" :disabled="item.disabled" @input="fieldChange($event, item, model, index)">
|
|
180
|
+
<van-checkbox v-for="(check, checkIdx) in item.options" :key="`checkbox${checkIdx}`" :name="check.value"
|
|
181
|
+
>{{ check.name }}
|
|
182
|
+
<template #icon="props">
|
|
183
|
+
<i class="iconfont ft16 c-c8c9cc" :class="props.checked ? 'icon-dianxuangouxuan theme-color' : 'icon-dianxuan'" />
|
|
184
|
+
</template>
|
|
185
|
+
</van-checkbox>
|
|
186
|
+
</van-checkbox-group>
|
|
187
|
+
<!-- 单选项 -->
|
|
188
|
+
<van-radio-group v-else-if="item.type === 'radio'" :ref="item['prop']" v-model="model[item['prop']]" direction="horizontal" @input.stop.prevent="fieldChange($event, item, model, index)">
|
|
189
|
+
<van-radio v-for="(radio, radioIdx) in item.options" :key="`radio${radioIdx}`" :name="radio.name"
|
|
190
|
+
>{{ radio.name }} <template #icon="props"> <i class="iconfont ft16 c-c8c9cc" :class="props.checked ? 'icon-dianxuangouxuan theme-color' : 'icon-dianxuan'" /> </template
|
|
191
|
+
></van-radio>
|
|
192
|
+
</van-radio-group>
|
|
193
|
+
<!-- 步进器 -->
|
|
194
|
+
<div v-else-if="item.type === 'stepper'" class="flex-end" :class="item.onlyClass">
|
|
195
|
+
<van-stepper :ref="item['prop']" v-model="model[item['prop']]" :button-size="item.buttonZize" :decimal-length="item.decimalLength || '0'" :max="item.max || '9999'" :input-width="item.width || '100px'" /><span v-if="item.unit" class="pl8">{{ item.unit }}</span>
|
|
196
|
+
</div>
|
|
197
|
+
<!-- 评分 -->
|
|
198
|
+
<van-rate v-else-if="item.type === 'rate'" :ref="item['prop']" v-model="model[item['prop']]" />
|
|
199
|
+
<!-- 滑块 -->
|
|
200
|
+
<van-slider v-else-if="item.type === 'slider'" :ref="item['prop']" v-model="model[item['prop']]" @change="fieldChange($event, item, model, index)" />
|
|
201
|
+
<!-- 开关 -->
|
|
202
|
+
<van-switch v-else-if="item.type === 'switch'" :ref="item['prop']" v-model="model[item['prop']]" size="20" @change="fieldChange($event, item, model, index)" />
|
|
203
|
+
</template>
|
|
204
|
+
</van-field>
|
|
205
|
+
<van-calendar v-if="item.type === 'select' && item.popType === 'calendar'" v-model="item['showPop']" :min-date="new Date(2010, 0, 1)" :max-date="new Date()" :type="item['popItemType']" @confirm="(value, pIdx) => onConfirm(value, pIdx, index, item, model)" @cancel="showPopView(index, false)" />
|
|
206
|
+
<slot v-else-if="item.type === 'customWidget'" :name="item.prop"></slot>
|
|
207
|
+
</div>
|
|
208
|
+
<div v-if="hasSubmit" style="margin: 16px">
|
|
209
|
+
<van-button round block type="info" native-type="submit">{{ $t("applyprocess.examine.j16189") }}</van-button>
|
|
210
|
+
</div>
|
|
211
|
+
</van-form>
|
|
212
|
+
</div>
|
|
213
|
+
</template>
|
|
214
|
+
|
|
215
|
+
<script>
|
|
216
|
+
import { isEmpty, verifyRule } from "../../assets/js/func";
|
|
217
|
+
import { getStorage } from "../../assets/js/storage";
|
|
218
|
+
import AreaMobile from "../areaMobile/index.vue";
|
|
219
|
+
import UploadFile from "../uploadFile/index.vue";
|
|
220
|
+
import CommonAsyncAreaPicker from "./CommonAsyncAreaPicker.vue";
|
|
221
|
+
import CommonDatePicker from "./CommonDatePicker.vue";
|
|
222
|
+
import CommonFullTimePicker from "./CommonFullTimePicker.vue";
|
|
223
|
+
import CommonSinglePicker from "./CommonSinglePicker.vue";
|
|
224
|
+
import CommonYearMonthPicker from "./CommonYearMonthPicker.vue";
|
|
225
|
+
export default {
|
|
226
|
+
// 组件名称
|
|
227
|
+
name: "CommonForm",
|
|
228
|
+
// 局部注册的组件
|
|
229
|
+
components: {
|
|
230
|
+
CommonYearMonthPicker,
|
|
231
|
+
CommonAsyncAreaPicker,
|
|
232
|
+
CommonDatePicker,
|
|
233
|
+
CommonFullTimePicker,
|
|
234
|
+
CommonSinglePicker,
|
|
235
|
+
UploadFile,
|
|
236
|
+
AreaMobile,
|
|
237
|
+
},
|
|
238
|
+
// 组件参数 接收来自父组件的数据
|
|
239
|
+
props: {
|
|
240
|
+
dataArr: {
|
|
241
|
+
type: Array,
|
|
242
|
+
default: () => [],
|
|
243
|
+
required: true,
|
|
244
|
+
},
|
|
245
|
+
form: {
|
|
246
|
+
type: Object,
|
|
247
|
+
default: () => {},
|
|
248
|
+
required: true,
|
|
249
|
+
},
|
|
250
|
+
hasSubmit: {
|
|
251
|
+
type: Boolean,
|
|
252
|
+
default: true,
|
|
253
|
+
},
|
|
254
|
+
underLine: {
|
|
255
|
+
type: Boolean,
|
|
256
|
+
default: false,
|
|
257
|
+
},
|
|
258
|
+
formIndex: {
|
|
259
|
+
type: Number,
|
|
260
|
+
default: () => null,
|
|
261
|
+
},
|
|
262
|
+
formData: {
|
|
263
|
+
type: Object,
|
|
264
|
+
default: () => {
|
|
265
|
+
return {};
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
scrollToError: {
|
|
269
|
+
type: Boolean,
|
|
270
|
+
default: false,
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
// 组件状态值
|
|
274
|
+
data() {
|
|
275
|
+
return {
|
|
276
|
+
cellData: this.dataArr,
|
|
277
|
+
showPop: false,
|
|
278
|
+
model: this.form,
|
|
279
|
+
areaMaxLength: 11,
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
computed: {
|
|
283
|
+
phoneNumList () {
|
|
284
|
+
return this.dataArr.filter(item=>item.type === 'phoneNum')
|
|
285
|
+
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
// 侦听器
|
|
289
|
+
watch: {
|
|
290
|
+
dataArr: {
|
|
291
|
+
immediate: true,
|
|
292
|
+
deep: true,
|
|
293
|
+
handler(newVal) {
|
|
294
|
+
const temp = newVal.filter((item) => item.show !== false);
|
|
295
|
+
this.$set(this,'cellData',temp)
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
form: {
|
|
299
|
+
immediate: true,
|
|
300
|
+
deep: true,
|
|
301
|
+
handler(newVal) {
|
|
302
|
+
this.model = newVal;
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
phoneNumList: {
|
|
306
|
+
deep:true,
|
|
307
|
+
handler (newVal, oldVal) {
|
|
308
|
+
console.log(newVal,oldVal,this.$refs)
|
|
309
|
+
// debugger
|
|
310
|
+
this.$nextTick(_=> {
|
|
311
|
+
this.initPhoneNum()
|
|
312
|
+
})
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
mounted () {
|
|
318
|
+
this.initPhoneNum()
|
|
319
|
+
},
|
|
320
|
+
methods: {
|
|
321
|
+
initPhoneNum () {
|
|
322
|
+
this.phoneNumList.forEach(item => {
|
|
323
|
+
this.adjustWidth(item);
|
|
324
|
+
})
|
|
325
|
+
},
|
|
326
|
+
// 调整输入框宽度
|
|
327
|
+
adjustWidth(item = {}, method) {
|
|
328
|
+
const inputer = this.$refs[`phoneNum${item.prop}`][0].$el.querySelector('input');
|
|
329
|
+
const span = this.$refs.nosee[0];
|
|
330
|
+
span.textContent = this.model[item['prop']] || item.placeholder || this.$t('customerdetail.customeranalysis.xd8243');
|
|
331
|
+
|
|
332
|
+
let width = span.offsetWidth;
|
|
333
|
+
|
|
334
|
+
inputer.style.width = width + 'px';
|
|
335
|
+
const { inputAlign } = item
|
|
336
|
+
// const align = inputAlign === 'left'?'start':inputAlign==='right'?'end':inputAlign
|
|
337
|
+
this.setPhoneNumPosition(item,inputAlign);
|
|
338
|
+
},
|
|
339
|
+
// 重新调整区号控件的定位位置
|
|
340
|
+
setPhoneNumPosition (item, align) {
|
|
341
|
+
const areaCom = this.$refs[`phoneNum${item.prop}`][0];
|
|
342
|
+
if (!areaCom) return;
|
|
343
|
+
this.areaMaxLength = areaCom.areaItem.maxlength;
|
|
344
|
+
const areaDom = areaCom.$el.querySelector('.phone-num-widget');
|
|
345
|
+
if (isEmpty(areaDom)) return;
|
|
346
|
+
const inputer = areaCom.$el.querySelector('input');
|
|
347
|
+
const container = areaCom.$el.querySelector('.van-field__body');
|
|
348
|
+
if (align === 'left') {
|
|
349
|
+
inputer.style.marginRight = 'auto'
|
|
350
|
+
} else if (align === 'center') {
|
|
351
|
+
areaDom.style.marginLeft = 'auto'
|
|
352
|
+
inputer.style.marginRight = 'auto'
|
|
353
|
+
} else if (align === 'right') {
|
|
354
|
+
areaDom.style.marginLeft = 'auto'
|
|
355
|
+
inputer.style.marginRight = 'unset'
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// container.style.justifyContent = align
|
|
359
|
+
if (container.contains(areaDom))return
|
|
360
|
+
areaDom.style.color = '#323233';
|
|
361
|
+
areaDom.style.marginRight = '4px';
|
|
362
|
+
container.insertBefore(areaDom, inputer);
|
|
363
|
+
areaDom.style.visibility = 'visible'
|
|
364
|
+
areaDom.style.position = 'unset'
|
|
365
|
+
},
|
|
366
|
+
|
|
367
|
+
handleClear() {
|
|
368
|
+
console.log(arguments);
|
|
369
|
+
},
|
|
370
|
+
judgeEmpty() {
|
|
371
|
+
return !isEmpty();
|
|
372
|
+
},
|
|
373
|
+
fetchRules(item) {
|
|
374
|
+
if (item.ruleType) {
|
|
375
|
+
const valid = [
|
|
376
|
+
{
|
|
377
|
+
required: item.required,
|
|
378
|
+
validator: (value) => {
|
|
379
|
+
return verifyRule(item.ruleType).test(value) || (!item.required && value === "");
|
|
380
|
+
},
|
|
381
|
+
message: item.message || this.$t("utils.mockdata.6tme0h"),
|
|
382
|
+
trigger: item.trigger || "onBlur",
|
|
383
|
+
},
|
|
384
|
+
];
|
|
385
|
+
if (item.rule) {
|
|
386
|
+
return [...valid, ...item.rule];
|
|
387
|
+
}
|
|
388
|
+
return valid;
|
|
389
|
+
}
|
|
390
|
+
return item.rule || null;
|
|
391
|
+
},
|
|
392
|
+
areaHandleAddressData(obj) {
|
|
393
|
+
const { value, prop, model } = obj;
|
|
394
|
+
this.handleAddressData(value, prop, model);
|
|
395
|
+
},
|
|
396
|
+
handleAddressData(value, prop, model) {
|
|
397
|
+
if (!value[0] || !value[0].areaCode) {
|
|
398
|
+
model[prop] = "";
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
// 这里value的长度必定是2
|
|
402
|
+
const provinceName = value[0].areaName;
|
|
403
|
+
const provinceCode = value[0].areaCode;
|
|
404
|
+
const cityName = value[1].areaName;
|
|
405
|
+
const cityCode = value[1].areaCode;
|
|
406
|
+
const districtName = value[2]?.areaName;
|
|
407
|
+
const districtCode = value[2]?.areaCode;
|
|
408
|
+
const arr = ["province", "provinceName", "city", "cityName", "homeProvince", "homeProvinceName", "homeCity", "homeCityName"];
|
|
409
|
+
arr.forEach((item) => {
|
|
410
|
+
if (Object.keys(model).findIndex((key) => key === item) !== -1) {
|
|
411
|
+
if (item === "province" || item === "homeProvince") {
|
|
412
|
+
model[item] = provinceCode;
|
|
413
|
+
} else if (item === "provinceName" || item === "homeProvinceName") {
|
|
414
|
+
model[item] = provinceName;
|
|
415
|
+
} else if (item === "city" || item === "homeCity") {
|
|
416
|
+
model[item] = cityCode;
|
|
417
|
+
} else if (item === "cityName" || item === "homeCityName") {
|
|
418
|
+
model[item] = cityName;
|
|
419
|
+
}
|
|
420
|
+
model[prop] = `${provinceName}-${cityName}`;
|
|
421
|
+
} else {
|
|
422
|
+
if (value.length > 2) {
|
|
423
|
+
model[prop] = `${provinceName}-${cityName}-${districtName}`;
|
|
424
|
+
model["district"] = districtCode;
|
|
425
|
+
} else {
|
|
426
|
+
model[prop] = `${provinceName}-${cityName}`;
|
|
427
|
+
}
|
|
428
|
+
model["province"] = provinceCode;
|
|
429
|
+
model["city"] = cityCode;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
},
|
|
433
|
+
onConfirmPicker(obj) {
|
|
434
|
+
const { value, pIdx, index, item, model } = obj;
|
|
435
|
+
this.onConfirm(value, pIdx, index, item, model);
|
|
436
|
+
},
|
|
437
|
+
onConfirm(value, pIdx, index, item, model) {
|
|
438
|
+
const prop = this.cellData[index].prop;
|
|
439
|
+
if (item.popType === "area") {
|
|
440
|
+
this.handleAddressData(value, prop, model);
|
|
441
|
+
} else if (item.popType === "picker") {
|
|
442
|
+
model[prop] = value[item.valueKey || "text"] === this.$t("financialinfo.carinfo.42bfwl") ? null : value[item.valueKey || "text"];
|
|
443
|
+
// debugger
|
|
444
|
+
if (item.popTypeOther === "cient") {
|
|
445
|
+
model["identityType"] = value.value;
|
|
446
|
+
} else {
|
|
447
|
+
model[item["prop"] + "Value"] = value.value;
|
|
448
|
+
}
|
|
449
|
+
} else if (item.popType === "calendar") {
|
|
450
|
+
if (item["popItemType"] === "range") {
|
|
451
|
+
const [start, end] = value;
|
|
452
|
+
model[prop] = `${this.$dayjs(start).format("YYYY-MM")} - ${this.$dayjs(end).format("YYYY-MM")}`;
|
|
453
|
+
} else if (isEmpty(item["popItemType"])) {
|
|
454
|
+
model[prop] = this.$dayjs(value).format("YYYY/MM/DD");
|
|
455
|
+
}
|
|
456
|
+
} else if (item.popType === "year-month") {
|
|
457
|
+
model[prop] = `${this.$dayjs(value).format("YYYY-MM")}`;
|
|
458
|
+
} else {
|
|
459
|
+
if (item["popItemType"] === "datetime") {
|
|
460
|
+
this.model[prop] = this.$dayjs(value).format("YYYY-MM-DD HH:mm");
|
|
461
|
+
} else {
|
|
462
|
+
this.model[prop] = this.$dayjs(value).format("YYYY-MM-DD");
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
this.cellData[index]["showPop"] = false;
|
|
466
|
+
this.fieldChange(value, item, model, index, this.cellData);
|
|
467
|
+
// this.$emit('fieldChange', formObj);
|
|
468
|
+
},
|
|
469
|
+
showPopView(index, isShow) {
|
|
470
|
+
this.cellData[index]["showPop"] = false;
|
|
471
|
+
this.$forceUpdate();
|
|
472
|
+
},
|
|
473
|
+
rightBtnClick (model, item, index) {
|
|
474
|
+
const obj = {
|
|
475
|
+
model: model,
|
|
476
|
+
item: item,
|
|
477
|
+
inD: index
|
|
478
|
+
};
|
|
479
|
+
this.$emit("rightBtnClick", obj);
|
|
480
|
+
},
|
|
481
|
+
singleTagClick(index, singleTagIdx, model, prop, item) {
|
|
482
|
+
if (item.readOnly) {
|
|
483
|
+
if (item.message) {
|
|
484
|
+
this.$toast(item.message);
|
|
485
|
+
}
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
const options = item.options || [];
|
|
489
|
+
if (item.type === "singleMutexTag") {
|
|
490
|
+
const checkIndex = options.findIndex((single) => single.isChecked);
|
|
491
|
+
if (singleTagIdx === checkIndex) return;
|
|
492
|
+
}
|
|
493
|
+
options.forEach((singleTag, sIndex) => {
|
|
494
|
+
this.$set(singleTag, "isChecked", sIndex === singleTagIdx ? !singleTag["isChecked"] : false);
|
|
495
|
+
});
|
|
496
|
+
const val = options[singleTagIdx]["isChecked"] ? options[singleTagIdx].value : "";
|
|
497
|
+
model[prop] = val;
|
|
498
|
+
this.fieldChange(val, item, model, this.cellData, index);
|
|
499
|
+
},
|
|
500
|
+
multiTagClick(index, multiTagIdx, model, prop, item) {
|
|
501
|
+
const options = item.options || [];
|
|
502
|
+
const checkedArr = options.filter((item) => item.isChecked);
|
|
503
|
+
if (checkedArr.length >= item.maxCheckedLen && !options[multiTagIdx]["isChecked"]) return;
|
|
504
|
+
this.$set(options[multiTagIdx], "isChecked", !options[multiTagIdx]["isChecked"]);
|
|
505
|
+
this.$set(item, "options", options);
|
|
506
|
+
this.$set(this.cellData, index, item);
|
|
507
|
+
const val = options[multiTagIdx].value || "";
|
|
508
|
+
const arr = [];
|
|
509
|
+
options.map((item) => {
|
|
510
|
+
if (item.isChecked) {
|
|
511
|
+
arr.push(item.value);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
this.model[prop] = arr.join();
|
|
515
|
+
this.fieldChange(val, item, model);
|
|
516
|
+
},
|
|
517
|
+
pickerFieldChange(obj) {
|
|
518
|
+
const { val, item, model, allDataArr } = obj;
|
|
519
|
+
this.fieldChange(val, item, model, allDataArr);
|
|
520
|
+
},
|
|
521
|
+
// filed内容发生改变
|
|
522
|
+
fieldChange (val, item, model, index) {
|
|
523
|
+
// 点击相对应的选项的时候,需要更改数据源
|
|
524
|
+
const formObj = {
|
|
525
|
+
item,
|
|
526
|
+
prop: item.prop,
|
|
527
|
+
val,
|
|
528
|
+
model,
|
|
529
|
+
allDataArr: this.cellData,
|
|
530
|
+
formIdx: this.formIndex,
|
|
531
|
+
index,
|
|
532
|
+
};
|
|
533
|
+
this.$emit("fieldChange", formObj);
|
|
534
|
+
},
|
|
535
|
+
afterRead(file, item, model, index) {
|
|
536
|
+
// 区分单张和多张
|
|
537
|
+
let uploadList = [];
|
|
538
|
+
file = Array.isArray(file) ? file : [file];
|
|
539
|
+
uploadList = file.map((i) => {
|
|
540
|
+
i.status = "uploading";
|
|
541
|
+
i.message = this.$t("workorder.uploadfile.224534");
|
|
542
|
+
console.log(i);
|
|
543
|
+
return FHCommon.upload({ file: i });
|
|
544
|
+
});
|
|
545
|
+
Promise.allSettled(uploadList)
|
|
546
|
+
.then((res) => {
|
|
547
|
+
console.log(res);
|
|
548
|
+
// 回显上传状态
|
|
549
|
+
file.forEach((i, index) => {
|
|
550
|
+
i.status = res[index].status === "rejected" ? "failed" : "done";
|
|
551
|
+
i.message = res[index].status === "rejected" ? this.$t("aqcomponents.offline.u15l63") : this.$t("componentsfile.uploadfile.7b44sh");
|
|
552
|
+
});
|
|
553
|
+
const formObj = {
|
|
554
|
+
item: item,
|
|
555
|
+
prop: item.prop,
|
|
556
|
+
val: res.map((item) => item.value),
|
|
557
|
+
model,
|
|
558
|
+
index,
|
|
559
|
+
file
|
|
560
|
+
};
|
|
561
|
+
this.$emit("fieldChange", formObj);
|
|
562
|
+
})
|
|
563
|
+
.catch((err) => {
|
|
564
|
+
console.log(err);
|
|
565
|
+
});
|
|
566
|
+
},
|
|
567
|
+
handlePreview(item, file, name, model, index) {
|
|
568
|
+
const obj = {
|
|
569
|
+
item,
|
|
570
|
+
val: file,
|
|
571
|
+
name,
|
|
572
|
+
model,
|
|
573
|
+
domIndex: index,
|
|
574
|
+
formIdx: this.formIndex,
|
|
575
|
+
};
|
|
576
|
+
this.$emit("handlePreview", obj);
|
|
577
|
+
},
|
|
578
|
+
// 删除上传的图片
|
|
579
|
+
deleteFile(item, file, name, model, index) {
|
|
580
|
+
val.status = "delete";
|
|
581
|
+
const formObj = {
|
|
582
|
+
prop: item.prop,
|
|
583
|
+
val: val,
|
|
584
|
+
model,
|
|
585
|
+
index,
|
|
586
|
+
item,
|
|
587
|
+
};
|
|
588
|
+
this.$emit("fieldChange", formObj);
|
|
589
|
+
},
|
|
590
|
+
// 选择完银行卡图片
|
|
591
|
+
fileChanged(result, item, model) {
|
|
592
|
+
this.$emit("fileChanged", { result: result[0], item, model });
|
|
593
|
+
},
|
|
594
|
+
// 输入框失焦事件
|
|
595
|
+
inputBlur(item, model, index) {
|
|
596
|
+
if (!item.canBlur) return;
|
|
597
|
+
this.$emit("inputBlur", { item, model, index });
|
|
598
|
+
},
|
|
599
|
+
// 获取焦点
|
|
600
|
+
fieldFocus(event, item, model) {
|
|
601
|
+
this.$emit("fieldFocus", { event, item, model });
|
|
602
|
+
},
|
|
603
|
+
// 输入框点击事件
|
|
604
|
+
fieldClick(event, item, index, isShow) {
|
|
605
|
+
if (item.type === "text" || item.type === "fuzzyMatching") {
|
|
606
|
+
if (item.readOnly && item.message) {
|
|
607
|
+
this.$toast(item.message);
|
|
608
|
+
}
|
|
609
|
+
this.$emit("fieldClick", { item, index });
|
|
610
|
+
} else if (item.type === "select" || item.type === "selectDate") {
|
|
611
|
+
this.cellData[index]["showPop"] = isShow;
|
|
612
|
+
this.$forceUpdate();
|
|
613
|
+
} else if (item.type === "link") {
|
|
614
|
+
if (item.readOnly) {
|
|
615
|
+
event.preventDefault();
|
|
616
|
+
event.stopPropagation();
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
this.$emit("fieldClick", { event, item, index, isShow });
|
|
620
|
+
return;
|
|
621
|
+
} else if (item.type === "textarea") {
|
|
622
|
+
if (item.readOnly) {
|
|
623
|
+
this.$emit("fieldClick", { item, index });
|
|
624
|
+
}
|
|
625
|
+
} else {
|
|
626
|
+
this.$emit("fieldClick", { event, item });
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
handleClickFuzzyTwig(twig, index) {
|
|
630
|
+
const obj = {
|
|
631
|
+
twig: twig,
|
|
632
|
+
index: index,
|
|
633
|
+
};
|
|
634
|
+
this.$emit("handleClickFuzzyTwig", obj);
|
|
635
|
+
},
|
|
636
|
+
leftBtnClick(model, item, index) {
|
|
637
|
+
const obj = {
|
|
638
|
+
model: model,
|
|
639
|
+
item: item,
|
|
640
|
+
inD: index,
|
|
641
|
+
};
|
|
642
|
+
this.$emit("leftBtnClick", obj);
|
|
643
|
+
},
|
|
644
|
+
},
|
|
645
|
+
};
|
|
646
|
+
</script>
|
|
647
|
+
|
|
648
|
+
<!--使用了scoped属性之后,父组件的style样式将不会渗透到子组件中,-->
|
|
649
|
+
<style scoped lang="less">
|
|
650
|
+
#CommonForm {
|
|
651
|
+
.only_class {
|
|
652
|
+
.van-stepper {
|
|
653
|
+
border-radius: 14px;
|
|
654
|
+
border: 0.5px solid #c8c9cc;
|
|
655
|
+
overflow: hidden;
|
|
656
|
+
|
|
657
|
+
.van-stepper__minus {
|
|
658
|
+
border-radius: 14px 0px 0px 14px;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.van-stepper__plus {
|
|
662
|
+
border-radius: 0px 14px 14px 0px;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/deep/ .van-stepper__input {
|
|
666
|
+
margin: 0px !important;
|
|
667
|
+
border-left: 0.5px solid #c8c9cc;
|
|
668
|
+
border-right: 0.5px solid #c8c9cc;
|
|
669
|
+
font-weight: 500;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.van-stepper__minus::after,
|
|
673
|
+
.van-stepper__minus::before,
|
|
674
|
+
.van-stepper__plus::after,
|
|
675
|
+
.van-stepper__plus::before {
|
|
676
|
+
transform: translate(-50%, -50%) scale(0.8);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
.line-feed {
|
|
681
|
+
display: flex;
|
|
682
|
+
white-space: normal;
|
|
683
|
+
.radio-btn,
|
|
684
|
+
.cient-btn {
|
|
685
|
+
display: flex;
|
|
686
|
+
justify-content: center;
|
|
687
|
+
align-items: center;
|
|
688
|
+
min-width: 60px;
|
|
689
|
+
border-radius: 14px;
|
|
690
|
+
line-height: 28px;
|
|
691
|
+
height: 28px;
|
|
692
|
+
font-size: 12px;
|
|
693
|
+
box-sizing: border-box;
|
|
694
|
+
position: relative;
|
|
695
|
+
width: max-content;
|
|
696
|
+
padding: 0 12px;
|
|
697
|
+
}
|
|
698
|
+
.radio-btn[disabled] {
|
|
699
|
+
color: #c8c9cc;
|
|
700
|
+
pointer-events: none;
|
|
701
|
+
}
|
|
702
|
+
.cient-btn[disabled] {
|
|
703
|
+
pointer-events: none;
|
|
704
|
+
}
|
|
705
|
+
.checked-btn {
|
|
706
|
+
font-weight: 500;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.upload-title {
|
|
711
|
+
margin-bottom: 14.5px;
|
|
712
|
+
}
|
|
713
|
+
.flex-column {
|
|
714
|
+
.line-feed {
|
|
715
|
+
width: 100%;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
.checked-btn {
|
|
719
|
+
border: 0.5px solid;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.normal-btn {
|
|
723
|
+
border: 0.5px solid #c9c9cc;
|
|
724
|
+
color: #555661;
|
|
725
|
+
}
|
|
726
|
+
.right-parting-line {
|
|
727
|
+
display: block;
|
|
728
|
+
top: 3px;
|
|
729
|
+
left: 50%;
|
|
730
|
+
content: "";
|
|
731
|
+
width: 1px;
|
|
732
|
+
height: 16px;
|
|
733
|
+
background-color: #c8c9cc;
|
|
734
|
+
}
|
|
735
|
+
.fuzzy-wrapper {
|
|
736
|
+
width: 251px;
|
|
737
|
+
height: 225px;
|
|
738
|
+
z-index: 9;
|
|
739
|
+
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08);
|
|
740
|
+
top: 52.5px;
|
|
741
|
+
right: 0;
|
|
742
|
+
.single-fuzzy {
|
|
743
|
+
&:not(:last-of-type) {
|
|
744
|
+
position: relative;
|
|
745
|
+
&::after {
|
|
746
|
+
position: absolute;
|
|
747
|
+
left: 0;
|
|
748
|
+
bottom: 0;
|
|
749
|
+
display: block;
|
|
750
|
+
content: "";
|
|
751
|
+
width: calc(100% - 12px);
|
|
752
|
+
height: 0.5px;
|
|
753
|
+
background-color: #e8e8e8;
|
|
754
|
+
border-bottom: 0.5px solid #e8e8e8;
|
|
755
|
+
pointer-events: none;
|
|
756
|
+
transform: scaleY(0.5);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
.lineHeight-initial {
|
|
762
|
+
line-height: initial;
|
|
763
|
+
}
|
|
764
|
+
.nosee{
|
|
765
|
+
visibility: hidden;
|
|
766
|
+
}
|
|
767
|
+
.phone-num-btn{
|
|
768
|
+
/deep/ .van-icon-clear{
|
|
769
|
+
margin-right: 0;
|
|
770
|
+
padding-right: 0;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
.phone-num{
|
|
774
|
+
/deep/ .van-icon-clear{
|
|
775
|
+
position: absolute;
|
|
776
|
+
right: 12px;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
.area-mobile{
|
|
780
|
+
/deep/ .phone-num-widget{
|
|
781
|
+
visibility: hidden;
|
|
782
|
+
position: absolute;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
</style>
|