|
@@ -245,19 +245,12 @@ export default {
|
|
|
randomNum: [String, Number] // 时间戳,用于保证点击请求数据
|
|
randomNum: [String, Number] // 时间戳,用于保证点击请求数据
|
|
|
},
|
|
},
|
|
|
data () {
|
|
data () {
|
|
|
- const rules = {
|
|
|
|
|
- name: [{ required: true, message: this.$t('validate.required') }],
|
|
|
|
|
- typeKey: [{ required: true, validator: validateKey }]
|
|
|
|
|
- }
|
|
|
|
|
const level = this.firstDiDian || this.secondDiDian
|
|
const level = this.firstDiDian || this.secondDiDian
|
|
|
- if (this.categoryKey === 'FILE_TYPE') {
|
|
|
|
|
- rules.authorityObject = {
|
|
|
|
|
- chaYue: [{ required: true, message: this.$t('validate.required') }],
|
|
|
|
|
- shenCha: [{ required: true, message: this.$t('validate.required') }],
|
|
|
|
|
- shenHeZouXiang: [{ required: true, message: this.$t('validate.required') }]
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
return {
|
|
return {
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ name: [{ required: true, message: this.$t('validate.required') }],
|
|
|
|
|
+ typeKey: [{ required: true, validator: validateKey }]
|
|
|
|
|
+ },
|
|
|
formName: 'typeForm',
|
|
formName: 'typeForm',
|
|
|
formLabelWidth: '120px',
|
|
formLabelWidth: '120px',
|
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
@@ -279,7 +272,6 @@ export default {
|
|
|
shenHeZouXiang: ''
|
|
shenHeZouXiang: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- rules,
|
|
|
|
|
toolbars: [
|
|
toolbars: [
|
|
|
{ key: 'save', hidden: () => { return this.readonly } },
|
|
{ key: 'save', hidden: () => { return this.readonly } },
|
|
|
{ key: 'cancel' }
|
|
{ key: 'cancel' }
|
|
@@ -303,6 +295,19 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
|
|
+ categoryKey: {
|
|
|
|
|
+ handler (val) {
|
|
|
|
|
+ if (val === 'FILE_TYPE') {
|
|
|
|
|
+ this.rules.authorityObject = {
|
|
|
|
|
+ chaYue: [{ required: true, message: this.$t('validate.required') }],
|
|
|
|
|
+ shenCha: [{ required: true, message: this.$t('validate.required') }],
|
|
|
|
|
+ shenHeZouXiang: [{ required: true, message: this.$t('validate.required') }]
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ delete this.rules.authorityObject
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
random () {
|
|
random () {
|
|
|
if (this.displayType !== 'dialog') {
|
|
if (this.displayType !== 'dialog') {
|
|
|
this.getFormData()
|
|
this.getFormData()
|