commit
This commit is contained in:
@@ -16,7 +16,9 @@
|
|||||||
multiple
|
multiple
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
>
|
>
|
||||||
<!-- <el-option value="全选" label="全选" @click.native="clickOption"></el-option>-->
|
<el-option value="全选" @click.native="clickOption" v-if="options.length > 0">
|
||||||
|
{{ checkAll ? '取消全选' : '全选' }}
|
||||||
|
</el-option>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="opt in options"
|
v-for="opt in options"
|
||||||
:key="opt.value"
|
:key="opt.value"
|
||||||
@@ -53,7 +55,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
valueArr: []
|
valueArr: [],
|
||||||
|
checkAll: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -71,9 +74,32 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
clickOption () {
|
||||||
|
this.checkAll = !this.checkAll
|
||||||
|
if (this.checkAll) {
|
||||||
|
let list = []
|
||||||
|
this.config.options.map(item => {
|
||||||
|
this.valueArr.push(item.value)
|
||||||
|
list.push(item.value)
|
||||||
|
})
|
||||||
|
this.$emit('input', list)
|
||||||
|
} else {
|
||||||
|
this.valueArr = []
|
||||||
|
this.$emit('input', this.valueArr)
|
||||||
|
}
|
||||||
|
},
|
||||||
handleChange (event) {
|
handleChange (event) {
|
||||||
// const value = event.target.value
|
if (event.includes('全选')) {
|
||||||
this.$emit('input', event)
|
return
|
||||||
|
} else {
|
||||||
|
if (event.length === this.config.options.length) {
|
||||||
|
this.checkAll = true
|
||||||
|
} else {
|
||||||
|
this.checkAll = false
|
||||||
|
}
|
||||||
|
this.$emit('input', event)
|
||||||
|
}
|
||||||
|
// const value = event.target.value
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -91,7 +117,7 @@ export default {
|
|||||||
this.valueArr = []
|
this.valueArr = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
if (this.value !== '' && this.value !== null && typeof (this.value) !== 'undefined') {
|
if (this.value !== '' && this.value !== null && typeof (this.value) !== 'undefined') {
|
||||||
|
|||||||
@@ -4086,6 +4086,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 保存或修改标准
|
// 保存或修改标准
|
||||||
saveOrUpdateStands() {
|
saveOrUpdateStands() {
|
||||||
|
console.log(this.sarStandardsInfoEO);
|
||||||
|
return
|
||||||
this.isSubmit = true
|
this.isSubmit = true
|
||||||
this.$refs['sarStandardsInfoForm'].validate((valid) => {
|
this.$refs['sarStandardsInfoForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user