修改赋能场景bug

This commit is contained in:
gongjiale 2023-01-06 10:54:09 +08:00
parent 0df1914eb3
commit f0b737396b
4 changed files with 52 additions and 58 deletions

View File

@ -41,7 +41,7 @@
<el-upload ref="editUpload" class="upload-demo" :action="fileUploadUrl" <el-upload ref="editUpload" class="upload-demo" :action="fileUploadUrl"
:on-success="eidtHandleAvatarSuccess" :before-upload="editBeforeAvatarUpload" :limit="1" :on-success="eidtHandleAvatarSuccess" :before-upload="editBeforeAvatarUpload" :limit="1"
:file-list="[]" :on-remove="editUploadRemoveFile" :on-exceed="handleExceed" list-type="picture"> :file-list="[]" :on-remove="editUploadRemoveFile" :on-exceed="handleExceed" list-type="picture">
<div slot="tip" class="el-upload__tip">只能上传图片文件</div> <div slot="tip" class="el-upload__tip">只能上传图片文件格式为jpg/png</div>
<div class="button-new"> <div class="button-new">
<div>点击上传</div> <div>点击上传</div>
</div> </div>
@ -299,7 +299,7 @@ export default {
file.type === 'image/jpg' || file.type === 'image/jpg' ||
file.type === 'image/png' file.type === 'image/png'
if (!isImage) { if (!isImage) {
this.$message.error('上传头像图片只能是 jpg/png 格式!') this.$message.error('上传图片只能是 jpg/png 格式!')
} }
return isImage return isImage
}, },
@ -314,7 +314,7 @@ export default {
file.type === 'image/png' file.type === 'image/png'
if (!isImage) { if (!isImage) {
this.$message.error('上传头像图片只能是 jpg/png 格式!') this.$message.error('上传图片只能是 jpg/png 格式!')
} }
return isImage return isImage
}, },

View File

@ -56,7 +56,7 @@
<el-upload ref="editUpload" class="upload-demo" :action="fileUploadUrl" <el-upload ref="editUpload" class="upload-demo" :action="fileUploadUrl"
:on-success="eidtHandleAvatarSuccess" :before-upload="editBeforeAvatarUpload" :limit="1" :on-success="eidtHandleAvatarSuccess" :before-upload="editBeforeAvatarUpload" :limit="1"
:file-list="[]" :on-remove="editUploadRemoveFile" :on-exceed="handleExceed" list-type="picture"> :file-list="[]" :on-remove="editUploadRemoveFile" :on-exceed="handleExceed" list-type="picture">
<div slot="tip" class="el-upload__tip">只能上传图片文件</div> <div slot="tip" class="el-upload__tip">只能上传图片文件格式为jpg/png</div>
<div class="button-new"> <div class="button-new">
<div>点击上传</div> <div>点击上传</div>
</div> </div>
@ -458,7 +458,7 @@ export default {
file.type === 'image/jpg' || file.type === 'image/jpg' ||
file.type === 'image/png' file.type === 'image/png'
if (!isImage) { if (!isImage) {
this.$message.error('上传头像图片只能是 jpg/png 格式!') this.$message.error('上传图片只能是 jpg/png 格式!')
} }
return isImage return isImage
}, },
@ -473,7 +473,7 @@ export default {
file.type === 'image/png' file.type === 'image/png'
if (!isImage) { if (!isImage) {
this.$message.error('上传头像图片只能是 jpg/png 格式!') this.$message.error('上传图片只能是 jpg/png 格式!')
} }
return isImage return isImage
}, },

View File

@ -61,11 +61,20 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<span <el-popconfirm
style="color: #0058e1" confirm-button-text="确认"
@click="handleDelete(scope.$index, scope.row)" cancel-button-text="不用了"
>删除</span icon="el-icon-info"
icon-color="red"
title="确定删除该实例数据吗?"
@confirm="handleDelete(scope.$index, scope.row)"
> >
<el-button
type="danger"
icon="el-icon-delete"
slot="reference"
></el-button>
</el-popconfirm>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -31,18 +31,28 @@
v-if="index != item.answer.length - 1" v-if="index != item.answer.length - 1"
v-model="itemson.answer" v-model="itemson.answer"
placeholder="请输入步骤小节" placeholder="请输入步骤小节"
style="width: 200px" style="width: 160px"
:disabled="disabledType" :disabled="disabledType"
> >
</el-input> </el-input>
<img
style="color: red; margin-left: 6px"
@click="deleteItem1(item.answer,index)"
type="danger"
size="small"
v-if="!disabledType && index != item.answer.length - 1"
src="~@/assets/img/deleteRed.png"
alt=""
/>
<div v-else style="display: inline"> <div v-else style="display: inline">
<el-input <el-input
v-model="itemson.answer" v-model="itemson.answer"
placeholder="请输入步骤小节" placeholder="请输入步骤小节"
style="width: 200px" style="width: 160px"
:disabled="disabledType" :disabled="disabledType"
> >
</el-input> </el-input>
<div class="submit1"> <div class="submit1">
<a-button type="primary" @click="addAnswerItem(item.answer)"> <a-button type="primary" @click="addAnswerItem(item.answer)">
<img <img
@ -55,22 +65,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <a-button type="primary" v-if="!disabledType && index == dataInfo.length - 1"
@click="addItem">
<img
style="height: 12px; width: 12px;margin-top: -2px;"
src="~@/assets/img/jiahao.png"
alt=""
/>
<span style="margin-left: 4px">添加小节</span>
</a-button> -->
<!-- <div class="question-box-right">
<span>步骤小节: </span>
<el-input v-model="itemson.answer" placeholder="请输入步骤小节" style="width:200px"
:disabled="disabledType">
</el-input>
</div> -->
</div> </div>
<div class="submit"> <div class="submit">
@ -89,33 +84,7 @@
</div> </div>
</div> </div>
<!-- <div class="question-box">
<div v-for="(item, index) in dataInfo" :key="index">
<el-form-item label="步骤标题" prop="question">
<el-input v-model="item.question" placeholder="请输入标题" style="width:90%" :disabled="disabledType">
</el-input>
</el-form-item>
<el-form-item label="步骤" prop="question">
<el-input type="textarea" :rows="3" v-model="item.answer" placeholder="请输入解释说明" style="width:90%"
:disabled="disabledType">
</el-input>
<el-button style="margin-left:10px" @click="deleteItem(index)" type="danger" size="small"
v-if="!disabledType && dataInfo.length > 1">删除
</el-button>
</el-form-item>
<el-button class="add-btn" size="small" v-if="!disabledType && index == dataInfo.length - 1"
@click="addItem" type="primary">添加
</el-button>
</div> -->
<!-- <div class="step-box">
<el-steps :active="2">
<el-step status="finish" :title="item.question || `标题${index + 1}`" v-for="(item, index) in dataInfo"
:key="index">
</el-step>
</el-steps>
</div> -->
</div> </div>
</template> </template>
<script> <script>
@ -207,6 +176,22 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
//
deleteItem1(item,index) {
this.$confirm("确认是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$message({
type: "success",
message: "删除成功!",
});
item.splice(index,1)
})
.catch(() => {});
},
}, },
}; };
</script> </script>
@ -262,7 +247,7 @@ export default {
} }
.question-box { .question-box {
float: left; float: left;
width: 42%; width: 295px;
} }
.question-box1 { .question-box1 {
float: left; float: left;