| | |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" label-width="130px" label-suffix=":" :rules="rules" inline> |
| | | <el-form :model="form" ref="form" label-width="130px" label-suffix=":" :rules="rules" > |
| | | <el-form-item label="标题" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请输入标题" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="资讯封面图" prop="imgurlfull"> |
| | | <el-form-item label="主图" prop="imgurl"> |
| | | <UploadAvatarImage |
| | | :file="{ 'imgurlfull': form.imgurlfull, 'imgurl': form.imgurl }" |
| | | @uploadSuccess="uploadAvatarSuccess" |
| | |
| | | ], |
| | | brandId: [ |
| | | { required: true, message: '请选择所属品牌' } |
| | | ], |
| | | imgurlfull: [ |
| | | { required: true, message: '请上传资讯主图' } |
| | | ], |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | getWangedditor(val){ |
| | | this.form.content =val |
| | | }, |
| | | open (title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.form.imgurlfull=null |
| | | this.form.imgurl=null |
| | | // 新建 |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | }) |
| | | return |
| | | } |
| | | // 编辑 |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/style/alertstyle.scss"; |
| | | ::v-deep .el-form-item__content { |
| | | flex: 0.6; |
| | | } |
| | | $image-width: 100px; |
| | | .avatar-uploader { |
| | | width: $image-width; |
| | | height: $image-width; |
| | | } |
| | | ::v-deep .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | width: $image-width; |
| | | height: $image-width; |
| | | overflow: hidden; |
| | | } |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409EFF; |
| | | } |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: $image-width; |
| | | height: $image-width; |
| | | line-height: $image-width; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: $image-width; |
| | | height: $image-width; |
| | | display: block; |
| | | ::v-deep .el-select { |
| | | width: 100%; |
| | | .el-input__inner { |
| | | width: 100%; |
| | | } |
| | | } |
| | | </style> |