Browse Source

切换选项卡,新增门类失败bug修改

master
z_yu 2 years ago
parent
commit
d86bac3a7e
  1. 36
      src/views/category/form.vue
  2. 1
      src/views/category/index.vue
  3. 4
      src/views/components/category/PreviewForm.vue

36
src/views/category/form.vue

@ -30,7 +30,7 @@
<script>
import { getCategoryTree, getCategoryType } from '@/api/category/category'
import CRUD, { form } from '@crud/crud'
import { form } from '@crud/crud'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -67,31 +67,35 @@ export default {
},
methods: {
// option
[CRUD.HOOK.beforeToAdd]() {
beforeToAdd() {
this.form.isType = null
this.selectOptions.forEach(item => {
if (this.selectedCategory.isType === 1) {
if (this.selectedCategory.isType === 1) {
this.selectOptions.forEach(item => {
if (item.value === 4) {
item.typeState = true
} else {
item.typeState = false
}
} else if (this.selectedCategory.isType === 2) {
})
} else if (this.selectedCategory.isType === 2) {
this.selectOptions.forEach(item => {
if (item.value !== 3) {
item.typeState = true
} else {
item.typeState = false
}
this.form.isType = 3
} else if (this.selectedCategory.isType === 3) {
})
this.form.isType = 3
} else if (this.selectedCategory.isType === 3) {
this.selectOptions.forEach(item => {
if (item.value !== 4) {
item.typeState = true
} else {
item.typeState = false
}
this.form.isType = 4
}
})
},
//
[CRUD.HOOK.beforeAddCancel]() {
this.selectOptions.forEach(item => {
item.typeState = false
})
})
this.form.isType = 4
}
},
changeType() {
if (this.form.isType === 6) {

1
src/views/category/index.vue

@ -215,6 +215,7 @@ export default {
})
return false
}
this.$refs.eform.beforeToAdd()
},
treeNodeSort(data) {
this.$refs.tree.updateKeyChildren(data[0].pid, JSON.parse(JSON.stringify(data)))

4
src/views/components/category/PreviewForm.vue

@ -71,7 +71,6 @@
</template>
<script>
import { form } from '@crud/crud'
import { edit, FetchDoeditIsRepeat } from '@/api/archivesManage/archivesList'
import { getNoFormatField } from '@/api/category/fileNoFormat'
import draggable from 'vuedraggable'
@ -83,9 +82,6 @@ import { parseTime } from '@/utils/index.js'
export default {
name: 'PreviewForm',
components: { draggable, Treeselect },
mixins: [
form({})
],
props: {
isDisabled: {
type: Boolean,

Loading…
Cancel
Save