Commit 1f0a6e32 by 胡悦

修改账户类型

1 parent 8f43214e
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
>全部取消</el-button >全部取消</el-button
> >
<el-button <el-button
v-if="$Common.getParams().id"
:size="btn_size" :size="btn_size"
type="primary" type="primary"
@click="btnClick('resetTree', index)" @click="btnClick('resetTree', index)"
...@@ -136,7 +137,8 @@ export default { ...@@ -136,7 +137,8 @@ export default {
list: [], list: [],
accountParams: {}, accountParams: {},
defaultChecked: [], defaultChecked: [],
responseList: [] responseList: [],
checkStrictly: true
} }
}, },
mounted() { mounted() {
...@@ -154,10 +156,6 @@ export default { ...@@ -154,10 +156,6 @@ export default {
}, },
// 渲染树结构 // 渲染树结构
renderContent(h, v) { renderContent(h, v) {
console.log(v.node.checked)
// if (!this.$Common.getParams().id) {
// v.node.checked = true
// }
if (v.data.logo == 'function') { if (v.data.logo == 'function') {
return ( return (
<div class="custom-tree-node fun-tree-node"> <div class="custom-tree-node fun-tree-node">
...@@ -197,10 +195,7 @@ export default { ...@@ -197,10 +195,7 @@ export default {
} }
}, },
authVisibleChange(val) { authVisibleChange(val) {
console.log(11)
if (!val && this.accountRuleForm.requestList.length !== 0) { if (!val && this.accountRuleForm.requestList.length !== 0) {
console.log(this.accountRuleForm.requestList)
console.log(this.responseList)
this.activeName = this.accountRuleForm.requestList[0].dictLabel this.activeName = this.accountRuleForm.requestList[0].dictLabel
const arr = this.accountRuleForm.requestList const arr = this.accountRuleForm.requestList
const productId = arr.map(item => item.dictValue) const productId = arr.map(item => item.dictValue)
...@@ -236,7 +231,6 @@ export default { ...@@ -236,7 +231,6 @@ export default {
} }
}, },
authChange(val) { authChange(val) {
console.log(val, 'change')
if (val.length > 0 && this.treeData.length > 0) { if (val.length > 0 && this.treeData.length > 0) {
this.activeName = val[0].dictLabel this.activeName = val[0].dictLabel
const arr = this.accountRuleForm.requestList const arr = this.accountRuleForm.requestList
...@@ -266,17 +260,29 @@ export default { ...@@ -266,17 +260,29 @@ export default {
btnClick(type, index) { btnClick(type, index) {
switch (type) { switch (type) {
case 'allTree': case 'allTree':
console.log(this.$refs[`tree${index}`]) // this.checkStrictly = false
this.treeData.forEach((i, idx) => { // this.treeData.forEach((i, idx) => {
if (this.$refs[`tree${idx}`][0]) { // 可能被删除了 // if (this.$refs[`tree${index}`][0]) { // 可能被删除了
this.$refs[`tree${idx}`][0].setCheckedKeys(this.getAllId(i.children)) // console.log(this.getAllId(i.children), '====')
} // console.log(this.treeData[index].children)
}) this.$refs[`tree${index}`][0].setCheckedNodes(this.treeData[index].children)
// this.$refs[`tree${index}`][0].setCheckedKeys(this.getAllId(i.children))
// }
// })
// this.$nextTick(() => {
// this.checkStrictly = true
// })
break break
case 'cancelAllTree': case 'cancelAllTree':
this.$refs[`tree${index}`][0].setCheckedNodes([]) this.$refs[`tree${index}`][0].setCheckedNodes([])
break break
case 'resetTree': case 'resetTree':
this.responseList.forEach((item, index) => {
if (this.$refs[`tree${index}`][0]) {
this.$refs[`tree${index}`][0].setCheckedKeys(item.idList)
}
})
this.addStyle()
break break
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
case 'draft': case 'draft':
...@@ -386,6 +392,7 @@ export default { ...@@ -386,6 +392,7 @@ export default {
getById(id) { getById(id) {
accountApi.getById({ id }).then(res => { accountApi.getById({ id }).then(res => {
const { code, data } = res const { code, data } = res
console.log(data)
if (code == '0') { if (code == '0') {
const requestList = data.responseList.map(item => { const requestList = data.responseList.map(item => {
return { return {
......
<template> <template>
<div>
<div class="detail"> <div class="detail">
<el-form :model="detailForm" label-width="100px"> <el-form :model="detailForm" label-width="100px">
<h3 class="content-title">基本信息</h3> <h3 class="content-title">基本信息</h3>
...@@ -45,12 +44,11 @@ ...@@ -45,12 +44,11 @@
</el-tree> </el-tree>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- <div class="footer-btn"> <div class="footer-btn">
<el-button :size="btn_size" @click="cancel" type="primary" <el-button :size="btn_size" @click="cancel" type="primary"
>取消</el-button >关闭</el-button
> >
</div> --> </div>
</div>
</div> </div>
</template> </template>
...@@ -160,15 +158,32 @@ export default { ...@@ -160,15 +158,32 @@ export default {
} }
}, },
mounted() { mounted() {
// this.accountParams = this.$Common.getParams() this.accountParams = this.$Common.getParams()
// if (this.$Common.getParams()) this.getById(this.$Common.getParams().id) if (this.$Common.getParams()) {
this.$root.eventBus.$on('params', params => { this.detailId = this.$Common.getParams().id
console.log(params) this.getById(this.$Common.getParams().id)
this.detailId = params.id }
this.getById(params.id) // this.$root.eventBus.$on('params', params => {
}) // console.log(params)
// this.detailId = params.id
// this.getById(params.id)
// })
}, },
methods: { methods: {
setDisabled(data) {
if (data) {
data.forEach(item => {
if (item.children && item.children.length != 0) {
item.children.forEach(i => {
this.setDisabled(i.children)
i.disabled = true
})
}
item.disabled = true
})
}
return data
},
getById(id) { getById(id) {
accountApi.getById({ id }).then(res => { accountApi.getById({ id }).then(res => {
console.log(res) console.log(res)
...@@ -192,17 +207,16 @@ export default { ...@@ -192,17 +207,16 @@ export default {
accountApi.findProductById(params).then(res => { accountApi.findProductById(params).then(res => {
if (res.code == '0') { if (res.code == '0') {
const data = _.cloneDeep(res.data) const data = _.cloneDeep(res.data)
console.log(data, '=========')
// const data = _.cloneDeep(data) // const data = _.cloneDeep(data)
this.treeData = data console.log('disabled', this.setDisabled(data))
this.treeData = this.setDisabled(data)
// 编辑 // 编辑
if (this.detailForm.requestList.length != 0) { if (this.detailForm.requestList.length != 0) {
this.$nextTick(() => { this.$nextTick(() => {
this.activeName = this.detailForm.requestList[0].productName this.activeName = this.detailForm.requestList[0].productName
this.detailForm.requestList.forEach((item, index) => { this.detailForm.requestList.forEach((item, index) => {
this.$refs[`tree${index}`][0].setCheckedKeys(item.idList) this.$refs[`tree${index}`][0].setCheckedKeys(item.idList)
// this.$refs[`tree${index}`][0].setCheckedNodes(
// this.treeData[index]
// )
}) })
this.addStyle() this.addStyle()
}) })
...@@ -212,7 +226,6 @@ export default { ...@@ -212,7 +226,6 @@ export default {
}, },
// 渲染树结构 // 渲染树结构
renderContent(h, v) { renderContent(h, v) {
// v.node.disabled = true
if (v.data.logo == 'function') { if (v.data.logo == 'function') {
return ( return (
<div class="custom-tree-node fun-tree-node"> <div class="custom-tree-node fun-tree-node">
......
...@@ -153,17 +153,18 @@ export default { ...@@ -153,17 +153,18 @@ export default {
this.$Common.confirmDialog(tipData) this.$Common.confirmDialog(tipData)
break break
case 'detail': case 'detail':
// window.location.href = `./detail.html?id=${scope.id}` console.log(11)
this.$root.to( window.location.href = `./detail.html?id=${scope.id}`
[ // this.$root.to(
'商户账号系统', // [
'系统设置', // '商户账号系统(开发)',
'账户管理', // '商户账户管理',
'账户类型管理', // '账户管理',
'*账户详情' // '账户类型管理',
], // '*账户详情'
{ id: scope.id } // ],
) // { id: scope.id }
// )
break break
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!