Browse Source

门类管理 Bug修正

master
z_yu 3 years ago
parent
commit
4ea640ad35
  1. 5
      src/api/category/fileNoFormat.js
  2. 34
      src/views/category/baseInfo/index.vue
  3. 2
      src/views/category/fileNoFormat/index.vue
  4. 14
      src/views/category/index.vue

5
src/api/category/fileNoFormat.js

@ -1,9 +1,10 @@
import request from '@/utils/request' import request from '@/utils/request'
export function getNoFormatField() {
export function getNoFormatField(params) {
return request({ return request({
url: 'api/dic-setting/list', url: 'api/dic-setting/list',
method: 'get'
method: 'get',
params
}) })
} }

34
src/views/category/baseInfo/index.vue

@ -13,13 +13,13 @@
<p v-else-if="selectedCategory.isType == 5">文件</p> <p v-else-if="selectedCategory.isType == 5">文件</p>
<p v-else /> <p v-else />
</div> </div>
<div v-if="selectedCategory.pid !== null" class="info-item">
<div v-if="selectedCategory.pid !== '0'" class="info-item">
<span>关联父级</span> <span>关联父级</span>
<p>{{ selectedCategory.parentName }}</p> <p>{{ selectedCategory.parentName }}</p>
</div> </div>
<div v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" class="info-item">
<div v-if="selectedCategory.isType !== 1" class="info-item">
<span>档号规则</span> <span>档号规则</span>
<p>{{ selectedCategory.isColumnLength }}</p>
<p>{{ fileNoFormatStr }}</p>
</div> </div>
<div class="info-item info-content"> <div class="info-item info-content">
<span>内容说明</span> <span>内容说明</span>
@ -29,6 +29,7 @@
</template> </template>
<script> <script>
import { getNoFormatField } from '@/api/category/fileNoFormat'
export default { export default {
name: 'BaseInfo', name: 'BaseInfo',
props: { props: {
@ -47,12 +48,35 @@ export default {
}, },
data() { data() {
return { return {
showFields: []
fileNoFormatStr: ''
} }
}, },
mounted() {
// computed: {
// fileNoFormatStr: function() {
// console.log(this.fileNoFormat)
// return this.fileNoFormat.reduce(
// (previousValue, currentValue) => {
// previousValue.fieldCnName + previousValue.connector + currentValue.fieldCnName + currentValue.connector}, { fieldCnName: '', connector: '' }
// )
// }
// },
watch: {
selectedCategory: function(newValue, oldValue) {
this.initData()
}
},
created() {
this.initData()
}, },
methods: { methods: {
initData() {
getNoFormatField({ categoryId: this.selectedCategory.id }).then((res) => {
this.fileNoFormatStr = ''
res.forEach((item) => {
this.fileNoFormatStr += item.fieldCnName + item.connector
})
})
}
} }
} }
</script> </script>

2
src/views/category/fileNoFormat/index.vue

@ -114,7 +114,7 @@ export default {
} }
}) })
}) })
getNoFormatField().then((res) => {
getNoFormatField({ categoryId: this.selectedCategory.id }).then((res) => {
this.table.right.data.splice(0, this.table.right.data.length) this.table.right.data.splice(0, this.table.right.data.length)
res.forEach((item) => { res.forEach((item) => {
this.table.right.data.push(item) this.table.right.data.push(item)

14
src/views/category/index.vue

@ -78,6 +78,7 @@ import listBrowsing from './listBrowsing/index'
import orderingRule from './orderingRule/index' import orderingRule from './orderingRule/index'
import fileNoFormat from './fileNoFormat/index' import fileNoFormat from './fileNoFormat/index'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import Vue from 'vue'
export default { export default {
name: 'Category', name: 'Category',
@ -137,15 +138,6 @@ export default {
} }
return 'baseInfo' return 'baseInfo'
} }
// ,
// brotherNodeNum: function() {
// const selectedNode = this.$refs.tree.getCurrentNode()
// if (selectedNode && selectedNode.pid && this.$refs.tree.getNode(selectedNode.pid)) {
// return this.$refs.tree.getNode(selectedNode.pid).childNodes.length
// } else {
// return 0
// }
// }
}, },
methods: { methods: {
// //
@ -197,12 +189,14 @@ export default {
this.crud.selectionChangeHandler([val]) this.crud.selectionChangeHandler([val])
this.$refs.eform.pid = val.id this.$refs.eform.pid = val.id
this.selectedCategory = val this.selectedCategory = val
if (val.pid !== '0') {
Vue.set(this.selectedCategory, 'parentName', this.$refs.tree.getNode(val.pid).data.cnName)
}
if (val.isType === 1) { if (val.isType === 1) {
this.changeActiveTab(0) this.changeActiveTab(0)
} }
// //
localStorage.setItem('currentCategoryKey', JSON.stringify(val)) localStorage.setItem('currentCategoryKey', JSON.stringify(val))
this.brotherNodeNum = val.pid
if (this.$refs.tree.getNode(val.pid) && this.$refs.tree.getNode(val.pid).childNodes) { if (this.$refs.tree.getNode(val.pid) && this.$refs.tree.getNode(val.pid).childNodes) {
this.brotherNodeNum = this.$refs.tree.getNode(val.pid).childNodes.length this.brotherNodeNum = this.$refs.tree.getNode(val.pid).childNodes.length
} }

Loading…
Cancel
Save