Commit 601c9192 authored by 姬鋆屾's avatar 姬鋆屾

feated:添加图片管理模块,做名片背景相关功能

parent 40aca4d2
...@@ -5,49 +5,148 @@ ...@@ -5,49 +5,148 @@
:visible.sync="open" :visible.sync="open"
:direction="direction" :direction="direction"
:destroy-on-close="true" :destroy-on-close="true"
size="50%"> size="50%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<Field :span="20" label="所属关联员工" prop="staffId" v-model="form.staffId" type="select" :enumData="dict.staffId" placeholder="请输入名片所属关联员工ID"/> <Field
:span="20"
<Field :span="20" label="名片姓名" prop="name" v-model="form.name" placeholder="请输入名片姓名"/> label="所属关联员工"
<Field :span="20" label="性别" prop="gender" v-model="form.gender" type="select" :enumData="dict.gender" placeholder="请选择性别"/> prop="staffId"
<Field :span="20" label="出生日期" prop="birthday" v-model="form.birthday" type="date" /> v-model="form.staffId"
<Field :span="20" label="照片" prop="photoPath" placeholder="请输入照片"><imageUpload v-model="form.photoPath" prePath="/file/preview"/> </Field> type="select"
:enumData="dict.staffId"
placeholder="请输入名片所属关联员工ID"
<Field :span="20" label="邮件地址" prop="email" v-model="form.email" placeholder="请输入邮件地址"/> />
<Field :span="20" label="联系电话" prop="phoneNumber" v-model="form.phoneNumber" placeholder="请输入联系电话"/>
<Field :span="20" label="身份证号码" prop="idCard" v-model="form.idCard" placeholder="请输入身份证号码"/> <Field
<Field :span="20" label="所在公司" prop="companyId" v-model="form.companyId" type="select" :enumData="dict.companyId" placeholder="请输入记录名片持有者所在公司或组织的名称ID"/> :span="20"
<Field :span="20" label="职位" prop="positionId" v-model="form.positionId" type="select" :enumData="dict.positionId" placeholder="请输入职位ID"/> label="名片姓名"
prop="name"
<Field :span="20" label="简介" prop="bio" v-model="form.bio" type="textarea" placeholder="请输入简介"/> v-model="form.name"
<Field :span="20" label="社交媒体链接" prop="socialMedia" v-model="form.socialMedia" type="textarea" placeholder="请输入社交媒体链接, 可以是一个包含社交媒体账号的JSON对象或单独的字段"/> placeholder="请输入名片姓名"
/>
<Field :span="20" label="二维码图片" prop="qRCode" placeholder="请输入二维码图片"><imageUpload v-model="form.qRCode" prePath="/file/preview"/> </Field> <Field
:span="20"
label="性别"
<Field :span="20" label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/> prop="gender"
v-model="form.gender"
type="select"
:enumData="dict.gender"
placeholder="请选择性别"
/>
<Field
:span="20"
label="出生日期"
prop="birthday"
v-model="form.birthday"
type="date"
/>
<Field
:span="20"
label="照片"
prop="photoPath"
placeholder="请输入照片"
>
<imageUpload
v-model="form.photoPath"
prePath="/file/preview"
:slotP="'请上传 62*62px 的2MB以内的图片'"
/>
</Field>
<Field
:span="20"
label="邮件地址"
prop="email"
v-model="form.email"
placeholder="请输入邮件地址"
/>
<Field
:span="20"
label="联系电话"
prop="phoneNumber"
v-model="form.phoneNumber"
placeholder="请输入联系电话"
/>
<Field
:span="20"
label="身份证号码"
prop="idCard"
v-model="form.idCard"
placeholder="请输入身份证号码"
/>
<Field
:span="20"
label="所在公司"
prop="companyId"
v-model="form.companyId"
type="select"
:enumData="dict.companyId"
placeholder="请输入记录名片持有者所在公司或组织的名称ID"
/>
<Field
:span="20"
label="职位"
prop="positionId"
v-model="form.positionId"
type="select"
:enumData="dict.positionId"
placeholder="请输入职位ID"
/>
<Field
:span="20"
label="简介"
prop="bio"
v-model="form.bio"
type="textarea"
placeholder="请输入简介"
/>
<Field
:span="20"
label="社交媒体链接"
prop="socialMedia"
v-model="form.socialMedia"
type="textarea"
placeholder="请输入社交媒体链接, 可以是一个包含社交媒体账号的JSON对象或单独的字段"
/>
<Field
:span="20"
label="二维码图片"
prop="qRCode"
placeholder="请输入二维码图片"
><imageUpload v-model="form.qRCode" prePath="/file/preview" />
</Field>
<Field
:span="20"
label="备注"
prop="remark"
v-model="form.remark"
type="textarea"
placeholder="请输入备注"
/>
</el-row> </el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn /> <form-buttons
@submit="submitForm"
v-if="pageInfo.type != 'view'"
noCancelBtn
/>
</el-form> </el-form>
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import form from "@/assets/mixins/formdialog"; import form from "@/assets/mixins/formdialog";
export default { export default {
name: "BussinesscardDetail", name: "BussinesscardDetail",
mixins: [form], mixins: [form],
components: { components: {},
},
created() { created() {
this.changePath("bussinesscard") this.changePath("bussinesscard");
}, },
data() { data() {
return { return {
...@@ -57,61 +156,52 @@ ...@@ -57,61 +156,52 @@
title: "名片基本信息", title: "名片基本信息",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
direction:"rtl", direction: "rtl",
toString:[ toString: ["gender", "staffId", "companyId", "positionId"],
"gender", toDate: ["birthday"],
"staffId",
"companyId",
"positionId",
],
toDate:[
"birthday",
],
// 表单校验 // 表单校验
rules: { rules: {
staffId: [ staffId: [{ required: true, message: "请选择员工", trigger: "blur" }],
{required: true,message: "请选择员工", trigger: "blur" },
],
name: [ name: [
{required: true,message: "请输入名片姓名", trigger: "blur" }, { required: true, message: "请输入名片姓名", trigger: "blur" },
{max: 64,message: "最多只能录入64个字符",trigger: "blur",}, { max: 64, message: "最多只能录入64个字符", trigger: "blur" },
], ],
companyId: [ companyId: [
{required: true,message: "请选择所在公司", trigger: "blur" }, { required: true, message: "请选择所在公司", trigger: "blur" },
], ],
positionId: [ positionId: [
{required: true,message: "请选择职位", trigger: "blur" }, { required: true, message: "请选择职位", trigger: "blur" },
], ],
} },
}; };
}, },
methods: { methods: {
/** 编辑 */ /** 编辑 */
edit(row) { edit(row) {
this.reset() this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="bussinesscard/edit"; this.urls.currUrl = "bussinesscard/edit";
this.getData(); this.getData();
this.pageInfo.type="edit" this.pageInfo.type = "edit";
this.title = "修改名片基本信息"; this.title = "修改名片基本信息";
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.reset() this.reset();
this.urls.currUrl = "bussinesscard/add"; this.urls.currUrl = "bussinesscard/add";
this.getData(); this.getData();
this.pageInfo.type="add" this.pageInfo.type = "add";
this.title = "新增名片基本信息"; this.title = "新增名片基本信息";
}, },
/** 查看*/ /** 查看*/
view(row) { view(row) {
this.reset() this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="bussinesscard/view"; this.urls.currUrl = "bussinesscard/view";
this.getData(); this.getData();
this.pageInfo.type="view" this.pageInfo.type = "view";
this.title = "名片基本信息详细"; this.title = "名片基本信息详细";
}, },
/**取消按钮 */ /**取消按钮 */
...@@ -131,25 +221,25 @@ ...@@ -131,25 +221,25 @@
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
staffId : null, staffId: null,
staffName : "", staffName: "",
name : "", name: "",
gender : 1, gender: 1,
birthday : null, birthday: null,
photoPath : "", photoPath: "",
email : "", email: "",
phoneNumber : "", phoneNumber: "",
idCard : "", idCard: "",
companyId : "", companyId: "",
companyName : "", companyName: "",
positionId : null, positionId: null,
positionName : "", positionName: "",
bio : "", bio: "",
socialMedia : "", socialMedia: "",
qRCode : "", qRCode: "",
remark : "", remark: "",
sumViews : 0, sumViews: 0,
viewsByDay : 0, viewsByDay: 0,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -159,5 +249,5 @@ ...@@ -159,5 +249,5 @@
} }
}, },
}, },
}; };
</script> </script>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
><imageUpload ><imageUpload
v-model="form.url" v-model="form.url"
prePath="/file/preview" prePath="/file/preview"
:slotP="'请上传 62*62px 的2MB以内的图片'" :slotP="'请上传2MB以内的图片'"
/> />
</Field> </Field>
</el-row> </el-row>
...@@ -85,8 +85,8 @@ export default { ...@@ -85,8 +85,8 @@ export default {
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.reset(); this.reset();
this.getData();
this.urls.currUrl = "resourceImage/add"; this.urls.currUrl = "resourceImage/add";
this.getData();
this.pageInfo.type = "add"; this.pageInfo.type = "add";
this.title = "新增名片背景"; this.title = "新增名片背景";
}, },
...@@ -94,8 +94,8 @@ export default { ...@@ -94,8 +94,8 @@ export default {
view(row) { view(row) {
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.getData();
this.urls.currUrl = "resourceImage/view"; this.urls.currUrl = "resourceImage/view";
this.getData();
this.pageInfo.type = "view"; this.pageInfo.type = "view";
this.title = "名片背景详细"; this.title = "名片背景详细";
}, },
......
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