Browse Source

档案管理 下拉列表框修改

master
z_yu 3 years ago
parent
commit
86060fc139
  1. 45
      src/views/components/category/PreviewForm.vue

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

@ -41,7 +41,6 @@
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import { FetchFindAllSubsetById } from '@/api/archivesConfig/dictDetail' import { FetchFindAllSubsetById } from '@/api/archivesConfig/dictDetail'
export default { export default {
name: 'PreviewForm', name: 'PreviewForm',
@ -94,12 +93,10 @@ export default {
getAllSubset() { getAllSubset() {
this.formPreviewData.map(item => { this.formPreviewData.map(item => {
if (item.dictionaryConfigId) { if (item.dictionaryConfigId) {
item.options = []
console.log(item.options)
this.$set(item, 'options', [])
FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => { FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => {
if (item.isInputClass === 'select') { if (item.isInputClass === 'select') {
// Vue.set(item, "options", res)
console.log(item.options)
this.$set(item, 'options', res)
} else if (item.isInputClass === 'popover') { } else if (item.isInputClass === 'popover') {
this.tableData = res this.tableData = res
} }
@ -108,25 +105,25 @@ export default {
}) })
}, },
// //
loadOptions({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
this.formPreviewData.map(item => {
if (item.dictionaryConfigId) {
FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => {
parentNode.children = res.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 100)
})
}
})
}
},
// loadOptions({ action, parentNode, callback }) {
// if (action === LOAD_CHILDREN_OPTIONS) {
// this.formPreviewData.map(item => {
// if (item.dictionaryConfigId) {
// FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => {
// parentNode.children = res.map(function(obj) {
// if (obj.hasChildren) {
// obj.children = null
// }
// return obj
// })
// setTimeout(() => {
// callback()
// }, 100)
// })
// }
// })
// }
// },
// popover - table // popover - table
clickRowHandler(row) { clickRowHandler(row) {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()

Loading…
Cancel
Save