| | |
| | | <template> |
| | | <el-dialog |
| | | title="新增表头" |
| | | :visible.sync="dialogVisible" |
| | | width="30%" |
| | | :close-on-click-modal="false" |
| | | @close="handleClose" |
| | | > |
| | | <el-dialog title="新增表头" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false" @close="handleClose"> |
| | | <div class="sample-dialog"> |
| | | <div class="sample-content"> |
| | | <div class="form-content"> |
| | |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="表头名称" prop="name"> |
| | | <el-input |
| | | v-model="form.name" |
| | | style="width: 100%" |
| | | placeholder="请输入表头名称" |
| | | /> |
| | | <el-input v-model="form.name" style="width: 100%" placeholder="请输入表头名称" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="表头类型" prop="type"> |
| | | <el-radio-group v-model="form.type" style="width: 100%"> |
| | | <el-radio-button label="text">文本框</el-radio-button> |
| | | <el-radio-button label="text">文本框</el-radio-button> |
| | | <el-radio-button label="image">图片上传</el-radio-button> |
| | | <el-radio-button label="date">日期选择</el-radio-button> |
| | | <el-radio-button label="user">人员选择</el-radio-button> |
| | | <el-radio-button label="date">日期选择</el-radio-button> |
| | | <el-radio-button label="user">人员选择</el-radio-button> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="操作权限" prop="role"> |
| | | <el-select v-model="form.role" placeholder="请选择" style="width: 100%" multiple> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-if="['text', 'date', 'user'].includes(form.type)"> |
| | | <el-form-item label="提示文案" prop="message"> |
| | | <el-input |
| | | v-model="form.message" |
| | | style="width: 100%" |
| | | placeholder="请输入提示文案" |
| | | /> |
| | | <el-input v-model="form.message" style="width: 100%" placeholder="请输入提示文案" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | export default { |
| | | name: "AddDialog", |
| | |
| | | }, |
| | | options() { |
| | | // 将participants转换为select组件需要的格式 |
| | | return this.participants.map(participant => ({ |
| | | value: participant.userId , |
| | | let userId = JSON.parse(sessionStorage.getItem('userInfo'))?.userId |
| | | let nickName = JSON.parse(sessionStorage.getItem('userInfo'))?.nickName |
| | | let newList = JSON.parse(JSON.stringify(this.participants)) |
| | | newList.push({ userId, nickName }) |
| | | return newList.map(participant => ({ |
| | | value: participant.userId, |
| | | label: participant.nickName |
| | | })); |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 组件挂载时的初始化逻辑 |
| | | console.log('组件已挂载'); |
| | | }, |
| | | methods: { |
| | | setFormData(data) { |
| | |
| | | this.$message.error('请输入提示文案'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | const submitData = { |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | <style scoped lang="less"> |
| | | ::v-deep .el-dialog__body { |
| | | padding: 0; |
| | |
| | | .el-upload-list { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .el-upload-list__item { |
| | | transition: all 0.3s; |
| | | |
| | | &:hover { |
| | | background-color: #f5f7fa; |
| | | } |
| | | } |
| | | |
| | | .el-upload__tip { |
| | | color: #909399; |
| | | font-size: 12px; |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |