Commit 5f4811ac authored by tianhongyang's avatar tianhongyang

新增邮箱联想组件

parent 0a35751c
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
"@form-create/element-ui": "^2.5.33", "@form-create/element-ui": "^2.5.33",
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"@vue/composition-api": "^1.7.2", "@vue/composition-api": "^1.7.2",
"async-validator": "^4.2.5",
"axios": "0.24.0", "axios": "0.24.0",
"clipboard": "2.0.8", "clipboard": "2.0.8",
"core-js": "^3.32.2", "core-js": "^3.32.2",
......
<template>
<div class="dsk-email-input-container">
</div>
</template>
<script>
export default {
name: "dskEmailInput",
props: {
emailValue: {
required: true,
type: String,
default: ""
}
},
model: {
prop: "emailValue",
event: "update:emailValue"
},
data() {
return {
};
},
//可访问data属性
created() {
},
//计算集
computed: {
},
//方法集
methods: {
},
}
</script>
<style lang="scss" scoped>
.dsk-email-input-container {
height: 32px;
width: 100%;
position: relative;
}
</style>
...@@ -8,7 +8,7 @@ export const subfieldModuleTemplate = { ...@@ -8,7 +8,7 @@ export const subfieldModuleTemplate = {
defaultSubfieldModuleName: "", defaultSubfieldModuleName: "",
subfieldModuleName: "", subfieldModuleName: "",
subfieldModuleNameRules: { subfieldModuleNameRules: {
trigger: ["blur", "change"], trigger: ["blur"],
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (!value && !value?.toString()?.trim()) { if (!value && !value?.toString()?.trim()) {
return callback(new Error("请输入分栏名称")); return callback(new Error("请输入分栏名称"));
...@@ -41,7 +41,8 @@ export const defaultComOptions = [ ...@@ -41,7 +41,8 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "单行文本", label: "单行文本",
// 组件宽度 // 组件宽度
width: 100 width: 100,
isError: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -70,7 +71,8 @@ export const defaultComOptions = [ ...@@ -70,7 +71,8 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "多行文本", label: "多行文本",
// 组件宽度 // 组件宽度
width: 100 width: 100,
isError: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -106,7 +108,8 @@ export const defaultComOptions = [ ...@@ -106,7 +108,8 @@ export const defaultComOptions = [
width: 100, width: 100,
selectOptions: [], selectOptions: [],
// 是否多选 // 是否多选
isMultiple: false isMultiple: false,
isError: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -135,7 +138,8 @@ export const defaultComOptions = [ ...@@ -135,7 +138,8 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "日期/时间", label: "日期/时间",
// 组件宽度 // 组件宽度
width: 100 width: 100,
isError: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -157,7 +161,7 @@ export const defaultComOptions = [ ...@@ -157,7 +161,7 @@ export const defaultComOptions = [
formAttribute: { formAttribute: {
// 验证规则 // 验证规则
rules: { rules: {
trigger: ["blur", "change"], trigger: ["blur"],
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
const phoneReg = /^1[3-9]\d{9}$/; const phoneReg = /^1[3-9]\d{9}$/;
if (value && !phoneReg.test(value)) { if (value && !phoneReg.test(value)) {
...@@ -167,7 +171,7 @@ export const defaultComOptions = [ ...@@ -167,7 +171,7 @@ export const defaultComOptions = [
} }
}, },
requiredRules: { requiredRules: {
trigger: ["blur", "change"], trigger: ["blur"],
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
const phoneReg = /^1[3-9]\d{9}$/; const phoneReg = /^1[3-9]\d{9}$/;
if (!value && !value?.toString()?.trim()) { if (!value && !value?.toString()?.trim()) {
...@@ -186,7 +190,8 @@ export const defaultComOptions = [ ...@@ -186,7 +190,8 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "电话", label: "电话",
// 组件宽度 // 组件宽度
width: 100 width: 100,
isError: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -208,8 +213,9 @@ export const defaultComOptions = [ ...@@ -208,8 +213,9 @@ export const defaultComOptions = [
formAttribute: { formAttribute: {
// 验证规则 // 验证规则
rules: { rules: {
trigger: ["blur", "change"], trigger: ["blur"],
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
console.log("value", value);
if (value && !validEmail(value)) { if (value && !validEmail(value)) {
return callback(new Error(`请输入正确的电子邮箱`)); return callback(new Error(`请输入正确的电子邮箱`));
} }
...@@ -217,7 +223,7 @@ export const defaultComOptions = [ ...@@ -217,7 +223,7 @@ export const defaultComOptions = [
} }
}, },
requiredRules: { requiredRules: {
trigger: ["blur", "change"], trigger: ["blur"],
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (!value && !value?.toString()?.trim()) { if (!value && !value?.toString()?.trim()) {
return callback(new Error(`请输入电子邮箱`)); return callback(new Error(`请输入电子邮箱`));
...@@ -235,7 +241,8 @@ export const defaultComOptions = [ ...@@ -235,7 +241,8 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "电子邮箱", label: "电子邮箱",
// 组件宽度 // 组件宽度
width: 100 width: 100,
isError: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -266,7 +273,8 @@ export const defaultComOptions = [ ...@@ -266,7 +273,8 @@ export const defaultComOptions = [
width: 100, width: 100,
limit: -1, limit: -1,
astrict: false, astrict: false,
fileList: [] fileList: [],
isError: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -297,7 +305,8 @@ export const defaultComOptions = [ ...@@ -297,7 +305,8 @@ export const defaultComOptions = [
width: 100, width: 100,
limit: -1, limit: -1,
astrict: false, astrict: false,
fileList: [] fileList: [],
isError: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
......
...@@ -132,6 +132,9 @@ export default { ...@@ -132,6 +132,9 @@ export default {
//可访问data属性 //可访问data属性
created() { created() {
this.initModule(); this.initModule();
},
beforeDestroy() {
}, },
//计算集 //计算集
computed: { computed: {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="subfield-item-container" :class="classCreate(comChildModuleInfo.comType)" :style="styles" @click="activeSubfieldItem"> <div class="subfield-item-container" :class="classCreate(comChildModuleInfo.comType)" :style="styles" @click="activeSubfieldItem">
<img src="@/assets/images/consultingAgencyManagement/customForm/icon_drag@2x.png" alt="" class="subfield-module-item-dragg-target-icon"> <img src="@/assets/images/consultingAgencyManagement/customForm/icon_drag@2x.png" alt="" class="subfield-module-item-dragg-target-icon">
<el-form-item class="subfield-module-form-item" :class="{'is-required': comChildModuleInfo.formAttribute.required}" <el-form-item class="subfield-module-form-item" :class="{'is-required': comChildModuleInfo.formAttribute.required}"
:label="comChildModuleInfo.formAttribute.label" :rules="comChildModuleInfo.formAttribute.rules" :prop="propValue"> :label="comChildModuleInfo.formAttribute.label" :prop="propValue">
<!-- 单行文本类型 --> <!-- 单行文本类型 -->
<el-input v-model="comChildModuleInfo.componentAttribute.value" :placeholder="comChildModuleInfo.componentAttribute.placeholder" clearable <el-input v-model="comChildModuleInfo.componentAttribute.value" :placeholder="comChildModuleInfo.componentAttribute.placeholder" clearable
v-if="comChildModuleInfo.comType == 'text'" :disabled="isDisabled"></el-input> v-if="comChildModuleInfo.comType == 'text'" :disabled="isDisabled"></el-input>
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
<el-input v-model="comChildModuleInfo.componentAttribute.value" :placeholder="comChildModuleInfo.componentAttribute.placeholder" clearable <el-input v-model="comChildModuleInfo.componentAttribute.value" :placeholder="comChildModuleInfo.componentAttribute.placeholder" clearable
v-if="comChildModuleInfo.comType == 'phone'" :disabled="isDisabled"></el-input> v-if="comChildModuleInfo.comType == 'phone'" :disabled="isDisabled"></el-input>
<!-- 电子邮箱类型 --> <!-- 电子邮箱类型 -->
<el-input v-model="comChildModuleInfo.componentAttribute.value" :placeholder="comChildModuleInfo.componentAttribute.placeholder" clearable <dsk-email-input v-model="comChildModuleInfo.componentAttribute.value" :placeholder="comChildModuleInfo.componentAttribute.placeholder"
v-if="comChildModuleInfo.comType == 'email'" :disabled="isDisabled"></el-input> clearable :disabled="isDisabled" v-if="comChildModuleInfo.comType == 'email'"></dsk-email-input>
<!-- 图片类型 --> <!-- 图片类型 -->
</el-form-item> </el-form-item>
...@@ -36,8 +36,13 @@ ...@@ -36,8 +36,13 @@
</template> </template>
<script> <script>
import { cloneDeep } from "lodash-es"; import { cloneDeep } from "lodash-es";
import Schema from "async-validator";
import DskEmailInput from "@/components/DskEmailInput";
export default { export default {
name: "subfieldItem", name: "subfieldItem",
components: {
DskEmailInput
},
props: { props: {
childModuleInfo: Object, childModuleInfo: Object,
parentUid: String, parentUid: String,
...@@ -205,6 +210,10 @@ export default { ...@@ -205,6 +210,10 @@ export default {
.el-form-item__label { .el-form-item__label {
line-height: 22px; line-height: 22px;
} }
.el-form-item__content {
line-height: 32px;
height: unset;
}
.el-textarea { .el-textarea {
.el-textarea__inner { .el-textarea__inner {
resize: unset; resize: unset;
......
...@@ -150,6 +150,15 @@ export default { ...@@ -150,6 +150,15 @@ export default {
flex: 1; flex: 1;
.el-form-item__content { .el-form-item__content {
line-height: 32px; line-height: 32px;
height: 32px;
.el-input {
line-height: 32px;
height: 32px;
.el-input__suffix {
display: flex;
align-items: center;
}
}
} }
.el-input { .el-input {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment