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'
export function getNoFormatField() {
export function getNoFormatField(params) {
return request({
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 />
</div>
<div v-if="selectedCategory.pid !== null" class="info-item">
<div v-if="selectedCategory.pid !== '0'" class="info-item">
<span>关联父级</span>
<p>{{ selectedCategory.parentName }}</p>
</div>
<div v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" class="info-item">
<div v-if="selectedCategory.isType !== 1" class="info-item">
<span>档号规则</span>
<p>{{ selectedCategory.isColumnLength }}</p>
<p>{{ fileNoFormatStr }}</p>
</div>
<div class="info-item info-content">
<span>内容说明</span>
@ -29,6 +29,7 @@
</template>
<script>
import { getNoFormatField } from '@/api/category/fileNoFormat'
export default {
name: 'BaseInfo',
props: {
@ -47,12 +48,35 @@ export default {
},
data() {
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: {
initData() {
getNoFormatField({ categoryId: this.selectedCategory.id }).then((res) => {
this.fileNoFormatStr = ''
res.forEach((item) => {
this.fileNoFormatStr += item.fieldCnName + item.connector
})
})
}
}
}
</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)
res.forEach((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 fileNoFormat from './fileNoFormat/index'
import crudOperation from '@crud/CRUD.operation'
import Vue from 'vue'
export default {
name: 'Category',
@ -137,15 +138,6 @@ export default {
}
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: {
//
@ -197,12 +189,14 @@ export default {
this.crud.selectionChangeHandler([val])
this.$refs.eform.pid = val.id
this.selectedCategory = val
if (val.pid !== '0') {
Vue.set(this.selectedCategory, 'parentName', this.$refs.tree.getNode(val.pid).data.cnName)
}
if (val.isType === 1) {
this.changeActiveTab(0)
}
//
localStorage.setItem('currentCategoryKey', JSON.stringify(val))
this.brotherNodeNum = val.pid
if (this.$refs.tree.getNode(val.pid) && this.$refs.tree.getNode(val.pid).childNodes) {
this.brotherNodeNum = this.$refs.tree.getNode(val.pid).childNodes.length
}

Loading…
Cancel
Save