Commit eb855f20 by cwq0219

弹窗验证

1 parent 647dce37
......@@ -82,9 +82,6 @@
<gl-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
name="attachment"
v-validate="'required'"
data-vv-as="附件"
:limit="2"
:before-upload="beforeUpload"
:on-success="handleSuccess"
......@@ -101,25 +98,21 @@
class="el-upload__tip"
>请上传小于20MB的文件</div>
</gl-upload>
<span
v-show="errorBags.has('attachment')"
class="error"
>
{{ errorBags.first('attachment') }}
</span>
</gl-form-item>
<gl-form-item
label="展示方式:"
prop="showType"
>
<gl-radio-group v-model="noticeForm.showType">
<gl-radio-group
v-model="noticeForm.showType"
name="showType"
data-vv-as="展示方式"
v-validate="'required'">
<gl-radio
v-for="item in showTypeList"
:label="item.value"
:key="item.value"
name="showType"
data-vv-as="展示方式"
v-validate="'required'"
>{{item.label}}</gl-radio>
</gl-radio-group>
<!-- <p>说明:没有勾选则为默认形式,即在消息中心中展示</p> -->
......@@ -156,8 +149,7 @@ export default {
data() {
return {
isClear: false,
// 通过数据watch
title: '新增',
title: '创建通知',
fileList: [],
sendObjList: [
{
......@@ -208,6 +200,8 @@ export default {
},
isVisible(val) {
!val && (this.fileList = [])
console.log(this.noticeForm.recordId)
this.noticeForm.recordId && (this.title = '编辑通知')
this.$validator.errors.clear()
}
},
......@@ -237,21 +231,15 @@ export default {
this.$emit('hideDialog')
},
handleDraft() {
// this.$emit('handleAddComfirm')
// this.$validator.validateAll().then((result) => {
// if (result) {
// console.log(this.$validator)
// this.$emit('comfirmDialog', this.areaInfo)
// }
// })
this.$emit('handleAddComfirm')
},
handleComfrim() {
console.log(this.noticeForm)
this.$emit('handleAddComfirm')
// this.$emit('handleAddComfirm')
this.$validator.validateAll().then((result) => {
if (result) {
console.log(this.$validator)
this.$emit('comfirmDialog', this.areaInfo)
this.$emit('handleAddComfirm', this.areaInfo)
}
})
// Promise.all([
......
......@@ -83,12 +83,9 @@ export default {
},
data() {
return {
// isClear: false,
readonly: true,
isEditable: false,
// 通过数据watch
title: '通知详情',
// fileList: [],
sendObjList: [
{
label: '爱车保镖分组',
......@@ -141,26 +138,6 @@ export default {
}
},
methods: {
// 上传附件,限制用户上传的附件格式和大小
// beforeUpload(file) {
// const isLT20M = file.size / 1024 / 1024 < 20
// !isLT20M && this.$message.error('上传附件大小不能超过20M')
// return isLT20M
// },
// handleSuccess(file, fileList) {
// this.fileList = [{ name: fileList.name, url: fileList.url }]
// this.noticeForm.attachment = fileList.url
// // 移除验证
// // this.errorBags.remove('attachment')
// },
// handleError() {
// this.$message.error('上传失败,请重新上传!')
// },
// handleRemove(file, fileList) {
// this.noticeForm.attachment = ''
// // 添加验证
// // this.$validator.validate('attachment', this.noticeForm.attachment)
// },
handleClose() {
console.log(this.noticeForm)
this.$emit('hideDialog')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!