|
@@ -21,17 +21,21 @@
|
|
|
|
|
|
</template>
|
|
</template>
|
|
<template v-if="table_head[index].field_type == '7'" >
|
|
<template v-if="table_head[index].field_type == '7'" >
|
|
- <button @click="file_fun(table_per_fun(table_head[index],Object.values(scope.row)[index]))">
|
|
|
|
- 预览
|
|
|
|
- </button>
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <div class="listLookBtn" @click="file_fun(table_per_fun(table_head[index],Object.values(scope.row)[index]))">
|
|
|
|
+ <i class="el-icon-view"></i>
|
|
|
|
+ 预览
|
|
|
|
+ </div>
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-if="table_head[index].field_type == '8'">
|
|
<template v-if="table_head[index].field_type == '8'">
|
|
|
|
+
|
|
<img class="img"
|
|
<img class="img"
|
|
style="width:55px;height:55px;"
|
|
style="width:55px;height:55px;"
|
|
- :src=" Object.values(scope.row).join(',').split(',')[index] "
|
|
|
|
|
|
+ v-if="Object.values(scope.row).join(',').split(',')[index].trim()"
|
|
|
|
+ :src="Object.values(scope.row).join(',').split(',')[index].trim() "
|
|
title="" alt=""
|
|
title="" alt=""
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
@@ -164,7 +168,12 @@
|
|
<!-- 上传单文件 7-->
|
|
<!-- 上传单文件 7-->
|
|
|
|
|
|
<template v-if="head.field_type==7">
|
|
<template v-if="head.field_type==7">
|
|
- {{ ruleForm[`field_${index}`] }}
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <button @click="file_fun(table_per_fun(head, ruleForm[`field_${index}`] ))">
|
|
|
|
+ 预览
|
|
|
|
+ </button>
|
|
|
|
+
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<!-- 上传img 8-->
|
|
<!-- 上传img 8-->
|
|
@@ -176,22 +185,23 @@
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:before-upload="(file) => beforeAvatarUpload(file, index)">
|
|
:before-upload="(file) => beforeAvatarUpload(file, index)">
|
|
|
|
|
|
- <img v-if="ruleForm[`field_${index}`]" :src="ruleForm[`field_${index}`]" class="avatar">
|
|
|
|
|
|
+ <img v-if="ruleForm[`field_${index}`]" :src="ruleForm[`field_${index}`]" class="avatar">
|
|
|
|
|
|
- <div v-else class="chooseImgDiv">
|
|
|
|
- <div>
|
|
|
|
- <img src="@/assets/public/upload/noImage.png">
|
|
|
|
|
|
+ <div v-else class="chooseImgDiv">
|
|
|
|
+ <div>
|
|
|
|
+ <img src="@/assets/public/upload/noImage.png">
|
|
|
|
|
|
- <div>选择图片</div>
|
|
|
|
|
|
+ <div>选择图片</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <input type="hidden" v-model="ruleForm[`field_${index}`]">
|
|
|
|
+ <span class="photo_tips">推荐图片长宽比例为 16:9,大小不能超过 500 K。</span>
|
|
|
|
+ <!-- <div v-if="true" -->
|
|
|
|
+ <div v-if="hovering && ruleForm[`field_${index}`]"
|
|
|
|
+ class="delete-button"
|
|
|
|
+ @click="handleDelete(index)">
|
|
|
|
+ <i class="el-icon-delete"></i>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <input type="hidden" v-model="ruleForm[`field_${index}`]">
|
|
|
|
- <span class="photo_tips">推荐图片长宽比例为 16:9,大小不能超过 500 K。</span>
|
|
|
|
- <div v-if="hovering && ruleForm[`field_${index}`]"
|
|
|
|
- class="delete-button"
|
|
|
|
- @click="handleDelete(index)">
|
|
|
|
- <i class="el-icon-delete"></i>
|
|
|
|
- </div>
|
|
|
|
</el-upload>
|
|
</el-upload>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -219,7 +229,7 @@ export default {
|
|
components: {
|
|
components: {
|
|
tableTitle,//表格标题
|
|
tableTitle,//表格标题
|
|
myEditor,
|
|
myEditor,
|
|
- },
|
|
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
const validateEmpty = (rule, value, callback) => {
|
|
const validateEmpty = (rule, value, callback) => {
|
|
if (value.length == 0) {
|
|
if (value.length == 0) {
|
|
@@ -265,10 +275,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
- fun_rg(){
|
|
|
|
- console.log("----------------")
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
|
|
|
|
convertStringArray(strArray) {
|
|
convertStringArray(strArray) {
|
|
try {
|
|
try {
|
|
@@ -573,21 +580,21 @@ export default {
|
|
const rules = [];
|
|
const rules = [];
|
|
|
|
|
|
// 调试信息
|
|
// 调试信息
|
|
- console.log(`字段 ${head.title}:`, {
|
|
|
|
- is_check: head.is_check,
|
|
|
|
- regular: head.regular,
|
|
|
|
- field_type: head.field_type
|
|
|
|
- });
|
|
|
|
|
|
+ // console.log(`字段 ${head.title}:`, {
|
|
|
|
+ // is_check: head.is_check,
|
|
|
|
+ // regular: head.regular,
|
|
|
|
+ // field_type: head.field_type
|
|
|
|
+ // });
|
|
|
|
|
|
// 检查是否需要验证:is_check 为 1 且有 regular 正则表达式
|
|
// 检查是否需要验证:is_check 为 1 且有 regular 正则表达式
|
|
if ((head.is_check === 1 || head.is_check === '1') && head.regular) {
|
|
if ((head.is_check === 1 || head.is_check === '1') && head.regular) {
|
|
- console.log(`为字段 ${head.title} 添加验证规则:`, head.regular);
|
|
|
|
|
|
+ // console.log(`为字段 ${head.title} 添加验证规则:`, head.regular);
|
|
rules.push({
|
|
rules.push({
|
|
required: true,
|
|
required: true,
|
|
message: head.regular_error || `${head.title}格式不正确`,
|
|
message: head.regular_error || `${head.title}格式不正确`,
|
|
trigger: 'blur',
|
|
trigger: 'blur',
|
|
validator: (rule, value, callback) => {
|
|
validator: (rule, value, callback) => {
|
|
- console.log(`验证字段 ${head.title}:`, value, '类型:', typeof value);
|
|
|
|
|
|
+ // console.log(`验证字段 ${head.title}:`, value, '类型:', typeof value);
|
|
// 空值检查
|
|
// 空值检查
|
|
if (!value || value.toString().trim() === '') {
|
|
if (!value || value.toString().trim() === '') {
|
|
callback(new Error(head.regular_error || `${head.title}不能为空`));
|
|
callback(new Error(head.regular_error || `${head.title}不能为空`));
|
|
@@ -605,10 +612,10 @@ export default {
|
|
regexPattern = regexPattern.substring(1, lastSlashIndex);
|
|
regexPattern = regexPattern.substring(1, lastSlashIndex);
|
|
}
|
|
}
|
|
|
|
|
|
- console.log(`处理后的正则表达式:`, regexPattern);
|
|
|
|
|
|
+ // console.log(`处理后的正则表达式:`, regexPattern);
|
|
const reg = new RegExp(regexPattern);
|
|
const reg = new RegExp(regexPattern);
|
|
const testResult = reg.test(value);
|
|
const testResult = reg.test(value);
|
|
- console.log(`正则测试结果:`, testResult, `值: "${value}"`, `正则: ${regexPattern}`);
|
|
|
|
|
|
+ // console.log(`正则测试结果:`, testResult, `值: "${value}"`, `正则: ${regexPattern}`);
|
|
|
|
|
|
if (!testResult) {
|
|
if (!testResult) {
|
|
callback(new Error(head.regular_error || `${head.title}格式不正确`));
|
|
callback(new Error(head.regular_error || `${head.title}格式不正确`));
|
|
@@ -875,7 +882,7 @@ input[aria-hidden=true] {
|
|
position: relative;
|
|
position: relative;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
width: 178px;
|
|
width: 178px;
|
|
- height: 178px;
|
|
|
|
|
|
+ height:auto;
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
border-color: #409EFF;
|
|
border-color: #409EFF;
|
|
@@ -883,41 +890,50 @@ input[aria-hidden=true] {
|
|
|
|
|
|
.avatar {
|
|
.avatar {
|
|
width: 100%;
|
|
width: 100%;
|
|
- height: 100%;
|
|
|
|
|
|
+ height: 177px;
|
|
display: block;
|
|
display: block;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
.chooseImgDiv {
|
|
.chooseImgDiv {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
align-items: center;
|
|
align-items: center;
|
|
height: 100%;
|
|
height: 100%;
|
|
color: #8c939d;
|
|
color: #8c939d;
|
|
-
|
|
|
|
|
|
+ width:100%;
|
|
img {
|
|
img {
|
|
width: 60px;
|
|
width: 60px;
|
|
height: 60px;
|
|
height: 60px;
|
|
- margin-bottom: 10px;
|
|
|
|
|
|
+ margin:10px auto 0;
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
.delete-button {
|
|
.delete-button {
|
|
position: absolute;
|
|
position: absolute;
|
|
- right: 10px;
|
|
|
|
- top: 10px;
|
|
|
|
|
|
+ right: 33%;
|
|
|
|
+ top: 33%;
|
|
color: #fff;
|
|
color: #fff;
|
|
background: rgba(0,0,0,0.5);
|
|
background: rgba(0,0,0,0.5);
|
|
padding: 5px;
|
|
padding: 5px;
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
|
+
|
|
|
|
+ width:33%;height: 60px;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ .delete-button .el-icon-delete{
|
|
|
|
+ font-size: 33px;
|
|
|
|
+ margin-top: 6px;
|
|
|
|
+ }
|
|
|
|
+
|
|
.photo_tips {
|
|
.photo_tips {
|
|
display: block;
|
|
display: block;
|
|
margin-top: 10px;
|
|
margin-top: 10px;
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
color: #999;
|
|
color: #999;
|
|
|
|
+ line-height:22px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|