|
|
<template>
|
|
|
<!-- 添加/编辑表单容器 -->
|
|
|
<div class="addEdit-block">
|
|
|
<!-- 表单组件 -->
|
|
|
<el-form
|
|
|
class="detail-form-content"
|
|
|
ref="ruleForm"
|
|
|
:model="ruleForm"
|
|
|
:rules="rules"
|
|
|
label-width="80px"
|
|
|
:style="{backgroundColor:addEditForm.addEditBoxColor}" <!-- 设置表单背景颜色 -->
|
|
|
>
|
|
|
<el-row> <!-- 表单布局行 -->
|
|
|
<el-col :span="12"> <!-- 左侧列,宽度为12 -->
|
|
|
<el-form-item class="input" v-if="type!='info'" label="合同编号" prop="hetongbianhao"> <!-- 合同编号输入框 -->
|
|
|
<el-input v-model="ruleForm.hetongbianhao"
|
|
|
placeholder="合同编号" clearable :readonly="ro.hetongbianhao"></el-input>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" label="合同编号" prop="hetongbianhao">
|
|
|
<el-input v-model="ruleForm.hetongbianhao"
|
|
|
placeholder="合同编号" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12"> <!-- 右侧列,宽度为12 -->
|
|
|
<el-form-item class="input" v-if="type!='info'" label="房屋名称" prop="fangwumingcheng"> <!-- 房屋名称输入框 -->
|
|
|
<el-input v-model="ruleForm.fangwumingcheng"
|
|
|
placeholder="房屋名称" clearable :readonly="ro.fangwumingcheng"></el-input>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" label="房屋名称" prop="fangwumingcheng">
|
|
|
<el-input v-model="ruleForm.fangwumingcheng"
|
|
|
placeholder="房屋名称" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12"> <!-- 左侧列,宽度为12 -->
|
|
|
<el-form-item class="input" v-if="type!='info'" label="房屋类型" prop="fangwuleixing"> <!-- 房屋类型输入框 -->
|
|
|
<el-input v-model="ruleForm.fangwuleixing"
|
|
|
placeholder="房屋类型" clearable :readonly="ro.fangwuleixing"></el-input>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" label="房屋类型" prop="fangwuleixing">
|
|
|
<el-input v-model="ruleForm.fangwuleixing"
|
|
|
placeholder="房屋类型" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12"> <!-- 右侧列,宽度为12 -->
|
|
|
<el-form-item class="input" v-if="type!='info'" label="小区" prop="xiaoqu"> <!-- 小区输入框 -->
|
|
|
<el-input v-model="ruleForm.xiaoqu"
|
|
|
placeholder="小区" clearable :readonly="ro.xiaoqu"></el-input>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" label="小区" prop="xiaoqu">
|
|
|
<el-input v-model="ruleForm.xiaoqu"
|
|
|
placeholder="小区" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12"> <!-- 左侧列,宽度为12 -->
|
|
|
<el-form-item class="select" v-if="type!='info'" label="评分" prop="pingfen"> <!-- 评分选择框 -->
|
|
|
<el-select v-model="ruleForm.pingfen" placeholder="请选择评分">
|
|
|
<el-option
|
|
|
v-for="(item,index) in pingfenOptions"
|
|
|
v-bind:key="index"
|
|
|
:label="item"
|
|
|
:value="item">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" label="评分" prop="pingfen">
|
|
|
<el-input v-model="ruleForm.pingfen"
|
|
|
placeholder="评分" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12"> <!-- 右侧列,宽度为12 -->
|
|
|
<el-form-item class="date" v-if="type!='info'" label="评价日期" prop="pingjiariqi"> <!-- 评价日期选择器 -->
|
|
|
<el-date-picker
|
|
|
format="yyyy 年 MM 月 dd 日"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
v-model="ruleForm.pingjiariqi"
|
|
|
type="date"
|
|
|
placeholder="评价日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" v-if="ruleForm.pingjiariqi" label="评价日期" prop="pingjiariqi">
|
|
|
<el-input v-model="ruleForm.pingjiariqi"
|
|
|
placeholder="评价日期" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12"> <!-- 左侧列,宽度为12 -->
|
|
|
<el-form-item class="input" v-if="type!='info'" label="房主账号" prop="fangzhuzhanghao"> <!-- 房主账号输入框 -->
|
|
|
<el-input v-model="ruleForm.fangzhuzhanghao"
|
|
|
placeholder="房主账号" clearable :readonly="ro.fangzhuzhanghao"></el-input>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" label="房主账号" prop="fangzhuzhanghao">
|
|
|
<el-input v-model="ruleForm.fangzhuzhanghao"
|
|
|
placeholder="房主账号" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12"> <!-- 右侧列,宽度为12 -->
|
|
|
<el-form-item class="input" v-if="type!='info'" label="用户名" prop="yonghuming"> <!-- 用户名输入框 -->
|
|
|
<el-input v-model="ruleForm.yonghuming"
|
|
|
placeholder="用户名" clearable :readonly="ro.yonghuming"></el-input>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" label="用户名" prop="yonghuming">
|
|
|
<el-input v-model="ruleForm.yonghuming"
|
|
|
placeholder="用户名" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12"> <!-- 左侧列,宽度为12 -->
|
|
|
<el-form-item class="input" v-if="type!='info'" label="联系电话" prop="lianxidianhua"> <!-- 联系电话输入框 -->
|
|
|
<el-input v-model="ruleForm.lianxidianhua"
|
|
|
placeholder="联系电话" clearable :readonly="ro.lianxidianhua"></el-input>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读输入框 -->
|
|
|
<el-form-item class="input" label="联系电话" prop="lianxidianhua">
|
|
|
<el-input v-model="ruleForm.lianxidianhua"
|
|
|
placeholder="联系电话" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row> <!-- 新的表单布局行 -->
|
|
|
<el-col :span="24"> <!-- 占满整行 -->
|
|
|
<el-form-item class="textarea" v-if="type!='info'" label="评价内容" prop="pingjianeirong"> <!-- 评价内容文本框 -->
|
|
|
<el-input
|
|
|
style="min-width: 200px; max-width: 600px;" <!-- 设置文本框宽度范围 -->
|
|
|
type="textarea"
|
|
|
:rows="8" <!-- 设置文本框行数 -->
|
|
|
placeholder="评价内容"
|
|
|
v-model="ruleForm.pingjianeirong" >
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<div v-else> <!-- 如果是查看模式,显示只读文本内容 -->
|
|
|
<el-form-item v-if="ruleForm.pingjianeirong" label="评价内容" prop="pingjianeirong">
|
|
|
<span>{{ruleForm.pingjianeirong}}</span>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-form-item class="btn"> <!-- 按钮容器 -->
|
|
|
<el-button v-if="type!='info'" type="primary" class="btn-success" @click="onSubmit">提交</el-button> <!-- 提交按钮 -->
|
|
|
<el-button v-if="type!='info'" class="btn-close" @click="back()">取消</el-button> <!-- 取消按钮 -->
|
|
|
<el-button v-if="type=='info'" class="btn-close" @click="back()">返回</el-button> <!-- 返回按钮 -->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
// 引入验证工具函数
|
|
|
import { isNumber,isIntNumer,isEmail,isPhone, isMobile,isURL,checkIdCard } from "@/utils/validate";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
let self = this
|
|
|
// 定义身份证验证规则
|
|
|
var validateIdCard = (rule, value, callback) => {
|
|
|
if(!value){
|
|
|
callback();
|
|
|
} else if (!checkIdCard(value)) {
|
|
|
callback(new Error("请输入正确的身份证号码"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
// 定义URL验证规则
|
|
|
var validateUrl = (rule, value, callback) => {
|
|
|
if(!value){
|
|
|
callback();
|
|
|
} else if (!isURL(value)) {
|
|
|
callback(new Error("请输入正确的URL地址"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
// 定义手机号验证规则
|
|
|
var validateMobile = (rule, value, callback) => {
|
|
|
if(!value){
|
|
|
callback();
|
|
|
} else if (!isMobile(value)) {
|
|
|
callback(new Error("请输入正确的手机号码"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
// 定义电话号验证规则
|
|
|
var validatePhone = (rule, value, callback) => {
|
|
|
if(!value){
|
|
|
callback();
|
|
|
} else if (!isPhone(value)) {
|
|
|
callback(new Error("请输入正确的电话号码"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
// 定义邮箱验证规则
|
|
|
var validateEmail = (rule, value, callback) => {
|
|
|
if(!value){
|
|
|
callback();
|
|
|
} else if (!isEmail(value)) {
|
|
|
callback(new Error("请输入正确的邮箱地址"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
// 定义数字验证规则
|
|
|
var validateNumber = (rule, value, callback) => {
|
|
|
if(!value){
|
|
|
callback();
|
|
|
} else if (!isNumber(value)) {
|
|
|
callback(new Error("请输入数字"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
// 定义整数验证规则
|
|
|
var validateIntNumber = (rule, value, callback) => {
|
|
|
if(!value){
|
|
|
callback();
|
|
|
} else if (!isIntNumer(value)) {
|
|
|
callback(new Error("请输入整数"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
// 表单样式配置
|
|
|
addEditForm: { /* 样式配置参数 */ },
|
|
|
id: '',
|
|
|
type: '',
|
|
|
ro:{
|
|
|
// 各字段只读状态配置
|
|
|
hetongbianhao : false,
|
|
|
fangwumingcheng : false,
|
|
|
fangwuleixing : false,
|
|
|
xiaoqu : false,
|
|
|
pingfen : false,
|
|
|
pingjianeirong : false,
|
|
|
pingjiariqi : false,
|
|
|
fangzhuzhanghao : false,
|
|
|
yonghuming : false,
|
|
|
.lianxidianhua : false,
|
|
|
sfsh : false,
|
|
|
shhf : false,
|
|
|
},
|
|
|
// 表单数据模型
|
|
|
ruleForm: {
|
|
|
hetongbianhao: '',
|
|
|
fangwumingcheng: '',
|
|
|
fangwuleixing: '',
|
|
|
xiaoqu: '',
|
|
|
pingfen: '',
|
|
|
pingjianeirong: '',
|
|
|
pingjiariqi: '',
|
|
|
fangzhuzhanghao: '',
|
|
|
yonghuming: '',
|
|
|
lianxidianhua: '',
|
|
|
shhf: '',
|
|
|
},
|
|
|
// 评分选项
|
|
|
pingfenOptions: [],
|
|
|
// 表单验证规则
|
|
|
rules: {
|
|
|
hetongbianhao: [
|
|
|
],
|
|
|
fangwumingcheng: [
|
|
|
],
|
|
|
fangwuleixing: [
|
|
|
],
|
|
|
xiaoqu: [
|
|
|
],
|
|
|
pingfen: [
|
|
|
],
|
|
|
pingjianeirong: [
|
|
|
],
|
|
|
pingjiariqi: [
|
|
|
],
|
|
|
fangzhuzhanghao: [
|
|
|
],
|
|
|
yonghuming: [
|
|
|
],
|
|
|
lianxidianhua: [
|
|
|
],
|
|
|
sfsh: [
|
|
|
],
|
|
|
shhf: [
|
|
|
],
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
props: ["parent"], // 定义父组件传入的属性
|
|
|
computed: {
|
|
|
},
|
|
|
created() {
|
|
|
this.addEditStyleChange() // 调用样式更新方法
|
|
|
this.addEditUploadStyleChange() // 调用上传组件样式更新方法
|
|
|
},
|
|
|
methods: {
|
|
|
// 下载文件方法
|
|
|
download(file){
|
|
|
window.open(`${file}`)
|
|
|
},
|
|
|
// 初始化方法
|
|
|
init(id,type) {
|
|
|
if (id) {
|
|
|
this.id = id; // 设置当前ID
|
|
|
this.type = type; // 设置当前类型
|
|
|
}
|
|
|
if(this.type=='info'||this.type=='else'){ // 如果是查看或编辑模式
|
|
|
this.info(id); // 获取详细信息
|
|
|
}else if(this.type=='cross'){ // 如果是关联模式
|
|
|
var obj = this.$storage.getObj('crossObj'); // 获取关联对象
|
|
|
for (var o in obj){ // 遍历关联对象属性
|
|
|
if(o=='hetongbianhao'){
|
|
|
this.ruleForm.hetongbianhao = obj[o]; // 设置合同编号
|
|
|
this.ro.hetongbianhao = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='fangwumingcheng'){
|
|
|
this.ruleForm.fangwumingcheng = obj[o]; // 设置房屋名称
|
|
|
this.ro.fangwumingcheng = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='fangwuleixing'){
|
|
|
this.ruleForm.fangwuleixing = obj[o]; // 设置房屋类型
|
|
|
this.ro.fangwuleixing = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='xiaoqu'){
|
|
|
this.ruleForm.xiaoqu = obj[o]; // 设置小区
|
|
|
this.ro.xiaoqu = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='pingfen'){
|
|
|
this.ruleForm.pingfen = obj[o]; // 设置评分
|
|
|
this.ro.pingfen = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='pingjianeirong'){
|
|
|
this.ruleForm.pingjianeirong = obj[o]; // 设置评价内容
|
|
|
this.ro.pingjianeirong = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='pingjiariqi'){
|
|
|
this.ruleForm.pingjiariqi = obj[o]; // 设置评价日期
|
|
|
this.ro.pingjiariqi = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='fangzhuzhanghao'){
|
|
|
this.ruleForm.fangzhuzhanghao = obj[o]; // 设置房主账号
|
|
|
this.ro.fangzhuzhanghao = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='yonghuming'){
|
|
|
this.ruleForm.yonghuming = obj[o]; // 设置用户名
|
|
|
this.ro.yonghuming = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
if(o=='lianxidianhua'){
|
|
|
this.ruleForm.lianxidianhua = obj[o]; // 设置联系电话
|
|
|
this.ro.lianxidianhua = true; // 设置为只读
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// 获取当前用户信息
|
|
|
this.$http({
|
|
|
url: `${this.$storage.get('sessionTable')}/session`,
|
|
|
method: "get"
|
|
|
}).then(({ data }) => {
|
|
|
if (data && data.code === 0) {
|
|
|
var json = data.data;
|
|
|
} else {
|
|
|
this.$message.error(data.msg); // 显示错误消息
|
|
|
}
|
|
|
});
|
|
|
this.pingfenOptions = "1,2,3,4,5".split(','); // 设置评分选项
|
|
|
},
|
|
|
// 获取详细信息方法
|
|
|
info(id) {
|
|
|
this.$http({
|
|
|
url: `fangwupingjia/info/${id}`, // 请求详细信息接口
|
|
|
method: "get"
|
|
|
}).then(({ data }) => {
|
|
|
if (data && data.code === 0) {
|
|
|
this.ruleForm = data.data; // 更新表单数据
|
|
|
} else {
|
|
|
this.$message.error(data.msg); // 显示错误消息
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 提交表单方法
|
|
|
onSubmit() {
|
|
|
// 表单验证并提交
|
|
|
this.$refs["ruleForm"].validate(valid => {
|
|
|
if (valid) {
|
|
|
this.$http({
|
|
|
url: `fangwupingjia/${!this.ruleForm.id ? "save" : "update"}`, // 请求保存或更新接口
|
|
|
method: "post",
|
|
|
data: this.ruleForm
|
|
|
}).then(({ data }) => {
|
|
|
if (data && data.code === 0) {
|
|
|
this.$message({
|
|
|
message: "操作成功", // 显示成功消息
|
|
|
type: "success",
|
|
|
duration: 1500,
|
|
|
onClose: () => {
|
|
|
this.parent.showFlag = true; // 显示列表页
|
|
|
this.parent.addOrUpdateFlag = false; // 隐藏表单页
|
|
|
this.parent.fangwupingjiaCrossAddOrUpdateFlag = false; // 隐藏关联表单页
|
|
|
this.parent.search(); // 刷新列表
|
|
|
this.parent.contentStyleChange(); // 更新列表样式
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
this.$message.error(data.msg); // 显示错误消息
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 获取唯一标识符方法
|
|
|
getUUID () {
|
|
|
return new Date().getTime();
|
|
|
},
|
|
|
// 返回方法
|
|
|
back() {
|
|
|
this.parent.showFlag = true; // 显示列表页
|
|
|
this.parent.addOrUpdateFlag = false; // 隐藏表单页
|
|
|
this.parent.fangwupingjiaCrossAddOrUpdateFlag = false; // 隐藏关联表单页
|
|
|
this.parent.contentStyleChange(); // 更新列表样式
|
|
|
},
|
|
|
addEditStyleChange() { // 更新表单样式方法
|
|
|
this.$nextTick(()=>{ // 在DOM更新后执行
|
|
|
// 更新input样式
|
|
|
document.querySelectorAll('.addEdit-block .input .el-input__inner').forEach(el=>{
|
|
|
el.style.height = this.addEditForm.inputHeight;
|
|
|
el.style.color = this.addEditForm.inputFontColor;
|
|
|
el.style.fontSize = this.addEditForm.inputFontSize;
|
|
|
el.style.borderWidth = this.addEditForm.inputBorderWidth;
|
|
|
el.style.borderStyle = this.addEditForm.inputBorderStyle;
|
|
|
el.style.borderColor = this.addEditForm.inputBorderColor;
|
|
|
el.style.borderRadius = this.addEditForm.inputBorderRadius;
|
|
|
el.style.backgroundColor = this.addEditForm.inputBgColor;
|
|
|
});
|
|
|
document.querySelectorAll('.addEdit-block .input .el-form-item__label').forEach(el=>{
|
|
|
el.style.lineHeight = this.addEditForm.inputHeight;
|
|
|
el.style.color = this.addEditForm.inputLableColor;
|
|
|
el.style.fontSize = this.addEditForm.inputLableFontSize;
|
|
|
});
|
|
|
// 更新select样式
|
|
|
document.querySelectorAll('.addEdit-block .select .el-input__inner').forEach(el=>{
|
|
|
el.style.height = this.addEditForm.selectHeight;
|
|
|
el.style.color = this.addEditForm.selectFontColor;
|
|
|
el.style.fontSize = this.addEditForm.selectFontSize;
|
|
|
el.style.borderWidth = this.addEditForm.selectBorderWidth;
|
|
|
el.style.borderStyle = this.addEditForm.selectBorderStyle;
|
|
|
el.style.borderColor = this.addEditForm.selectBorderColor;
|
|
|
el.style.borderRadius = this.addEditForm.selectBorderRadius;
|
|
|
el.style.backgroundColor = this.addEditForm.selectBgColor;
|
|
|
});
|
|
|
document.querySelectorAll('.addEdit-block .select .el-form-item__label').forEach(el=>{
|
|
|
el.style.lineHeight = this.addEditForm.selectHeight;
|
|
|
el.style.color = this.addEditForm.selectLableColor;
|
|
|
el.style.fontSize = this.addEditForm.selectLableFontSize;
|
|
|
});
|
|
|
document.querySelectorAll('.addEdit-block .select .el-select__caret').forEach(el=>{
|
|
|
el.style.color = this.addEditForm.selectIconFontColor;
|
|
|
el.style.fontSize = this.addEditForm.selectIconFontSize;
|
|
|
});
|
|
|
// 更新date样式
|
|
|
document.querySelectorAll('.addEdit-block .date .el-input__inner').forEach(el=>{
|
|
|
el.style.height = this.addEditForm.dateHeight;
|
|
|
el.style.color = this.addEditForm.dateFontColor;
|
|
|
el.style.fontSize = this.addEditForm.dateFontSize;
|
|
|
el.style.borderWidth = this.addEditForm.dateBorderWidth;
|
|
|
el.style.borderStyle = this.addEditForm.dateBorderStyle;
|
|
|
el.style.borderColor = this.addEditForm.dateBorderColor;
|
|
|
el.style.borderRadius = this.addEditForm.dateBorderRadius;
|
|
|
el.style.backgroundColor = this.addEditForm.dateBgColor;
|
|
|
});
|
|
|
document.querySelectorAll('.addEdit-block .date .el-form-item__label').forEach(el=>{
|
|
|
el.style.lineHeight = this.addEditForm.dateHeight;
|
|
|
el.style.color = this.addEditForm.dateLableColor;
|
|
|
el.style.fontSize = this.addEditForm.dateLableFontSize;
|
|
|
});
|
|
|
document.querySelectorAll('.addEdit-block .date .el-input__icon').forEach(el=>{
|
|
|
el.style.color = this.addEditForm.dateIconFontColor;
|
|
|
el.style.fontSize = this.addEditForm.dateIconFontSize;
|
|
|
el.style.lineHeight = this.addEditForm.dateHeight;
|
|
|
});
|
|
|
// 更新textarea样式
|
|
|
document.querySelectorAll('.addEdit-block .textarea .el-textarea__inner').forEach(el=>{
|
|
|
el.style.height = this.addEditForm.textareaHeight;
|
|
|
el.style.color = this.addEditForm.textareaFontColor;
|
|
|
el.style.fontSize = this.addEditForm.textareaFontSize;
|
|
|
el.style.borderWidth = this.addEditForm.textareaBorderWidth;
|
|
|
el.style.borderStyle = this.addEditForm.textareaBorderStyle;
|
|
|
el.style.borderColor = this.addEditForm.textareaBorderColor;
|
|
|
el.style.borderRadius = this.addEditForm.textareaBorderRadius;
|
|
|
el.style.backgroundColor = this.addEditForm.textareaBgColor;
|
|
|
});
|
|
|
document.querySelectorAll('.addEdit-block .textarea .el-form-item__label').forEach(el=>{
|
|
|
el.style.color = this.addEditForm.textareaLableColor;
|
|
|
el.style.fontSize = this.addEditForm.textareaLableFontSize;
|
|
|
});
|
|
|
// 更新按钮样式
|
|
|
document.querySelectorAll('.addEdit-block .btn .btn-success').forEach(el=>{
|
|
|
el.style.width = this.addEditForm.btnSaveWidth;
|
|
|
el.style.height = this.addEditForm.btnSaveHeight;
|
|
|
el.style.color = this.addEditForm.btnSaveFontColor;
|
|
|
el.style.fontSize = this.addEditForm.btnSaveFontSize;
|
|
|
el.style.borderWidth = this.addEditForm.btnSaveBorderWidth;
|
|
|
el.style.borderStyle = this.addEditForm.btnSaveBorderStyle;
|
|
|
el.style.borderColor = this.addEditForm.btnSaveBorderColor;
|
|
|
el.style.borderRadius = this.addEditForm.btnSaveBorderRadius;
|
|
|
el.style.backgroundColor = this.addEditForm.btnSaveBgColor;
|
|
|
});
|
|
|
document.querySelectorAll('.addEdit-block .btn .btn-close').forEach(el=>{
|
|
|
el.style.width = this.addEditForm.btnCancelWidth;
|
|
|
el.style.height = this.addEditForm.btnCancelHeight;
|
|
|
el.style.color = this.addEditForm.btnCancelFontColor;
|
|
|
el.style.fontSize = this.addEditForm.btnCancelFontSize;
|
|
|
el.style.borderWidth = this.addEditForm.btnCancelBorderWidth;
|
|
|
el.style.borderStyle = this.addEditForm.btnCancelBorderStyle;
|
|
|
el.style.borderColor = this.addEditForm.btnCancelBorderColor;
|
|
|
el.style.borderRadius = this.addEditForm.btnCancelBorderRadius;
|
|
|
el.style.backgroundColor = this.addEditForm.btnCancelBgColor;
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
addEditUploadStyleChange() { // 更新上传组件样式方法
|
|
|
this.$nextTick(()=>{ // 在DOM更新后执行
|
|
|
document.querySelectorAll('.addEdit-block .upload .el-upload-list--picture-card .el-upload-list__item').forEach(el=>{
|
|
|
el.style.width = this.addEditForm.uploadHeight;
|
|
|
el.style.height = this.addEditForm.uploadHeight;
|
|
|
el.style.borderWidth = this.addEditForm.uploadBorderWidth;
|
|
|
el.style.borderStyle = this.addEditForm.uploadBorderStyle;
|
|
|
el.style.borderColor = this.addEditForm.uploadBorderColor;
|
|
|
el.style.borderRadius = this.addEditForm.uploadBorderRadius;
|
|
|
el.style.backgroundColor = this.addEditForm.uploadBgColor;
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
.editor{
|
|
|
height: 500px; <!-- 编辑器高度 -->
|
|
|
|
|
|
& /deep/ .ql-container { <!-- 编辑器内容区域 -->
|
|
|
height: 310px; <!-- 设置内容区域高度 -->
|
|
|
}
|
|
|
}
|
|
|
.amap-wrapper { <!-- 地图容器 -->
|
|
|
width: 100%; <!-- 宽度为100% -->
|
|
|
height: 500px; <!-- 高度为500px -->
|
|
|
}
|
|
|
.search-box { <!-- 搜索按钮容器 -->
|
|
|
position: absolute; <!-- 绝对定位 -->
|
|
|
}
|
|
|
.addEdit-block { <!-- 表单容器 -->
|
|
|
margin: -10px; <!-- 外边距 -->
|
|
|
}
|
|
|
.detail-form-content { <!-- 表单内容 -->
|
|
|
padding: 12px; <!-- 内边距 -->
|
|
|
}
|
|
|
.btn .el-button { <!-- 按钮样式 -->
|
|
|
padding: 0; <!-- 无内边距 -->
|
|
|
}
|
|
|
</style>
|