Commit 0c343627 by 胡悦

Merge branch 'master' of 192.168.3.233:glsx-web/glsx-oss-account

2 parents 47a2a27b 9a22957b
...@@ -96,8 +96,8 @@ export default { ...@@ -96,8 +96,8 @@ export default {
mounted() { mounted() {
if (this.form[this.targetItem.name]) { if (this.form[this.targetItem.name]) {
console.log(this.treeData) // console.log(this.treeData)
console.log(this.form[this.targetItem.name]) // console.log(this.form)
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name]) this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => { this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]]) this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
...@@ -149,8 +149,8 @@ export default { ...@@ -149,8 +149,8 @@ export default {
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down { .el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg); transform: rotate(-180deg);
} }
/* .select-tree { .select-tree {
max-height: 350px; max-height: 400px;
overflow-y: scroll; overflow-y: scroll;
} */ }
</style> </style>
\ No newline at end of file \ No newline at end of file
import App from './index.vue' import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import notice from '@/common/notice'
base.getConfig().then(data => { base.getConfig().then(data => {
const { vue, config } = data const { vue, config } = data
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
vue.prototype.notice = notice
base.render(App) base.render(App)
}) })
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
slot-scope="scope" slot-scope="scope"
> >
<select-tree <select-tree
v-if="editVisible"
:form="editForm" :form="editForm"
:targetItem="scope.scope" :targetItem="scope.scope"
:treeData="baseData.menuTreeList" :treeData="baseData.menuTreeList"
...@@ -157,17 +158,7 @@ export default { ...@@ -157,17 +158,7 @@ export default {
nameLabel: 'parentName', nameLabel: 'parentName',
addHtml: 'menuTree', addHtml: 'menuTree',
formName: 'searchForm' formName: 'searchForm'
}, }, {
// {
// label: '商户账户类型',
// name: '',
// type: 'select',
// optionList: [],
// optionId: 'dictValue',
// optionLabel: 'dictLabel',
// optionsName: 'accounTypetList'
// },
{
label: '所属客户群体', label: '所属客户群体',
name: 'ownCus', name: 'ownCus',
firstVal: 'ownedCusgroupType', firstVal: 'ownedCusgroupType',
...@@ -264,11 +255,9 @@ export default { ...@@ -264,11 +255,9 @@ export default {
optionLabel: 'dictLabel', optionLabel: 'dictLabel',
optionsName: 'productList', optionsName: 'productList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
baseApi.getMenuTree({ productId: value }).then(res => { this.editForm.menuId = ''
this.baseData.menuTreeList = res.data this.editForm.menuName = ''
this.editForm.menuId = '' this.getMenuTree(value)
this.editForm.menuName = ''
})
} }
}, { }, {
label: '菜单', label: '菜单',
...@@ -311,7 +300,7 @@ export default { ...@@ -311,7 +300,7 @@ export default {
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (value === 3) this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (value === 3)
this.editRule.ownedCusgroupValue[0].required = (value !== 3) this.editRule.ownedCusgroupValue[0].required = (value !== 3)
// this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue') // this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue')
if (value !== 3) { if (value && (value !== 3)) {
this.baseData.cusGroupList = this.baseData[this.attrToList[value]] this.baseData.cusGroupList = this.baseData[this.attrToList[value]]
this.getOptionsList('editFormData', false) this.getOptionsList('editFormData', false)
} }
...@@ -474,10 +463,10 @@ export default { ...@@ -474,10 +463,10 @@ export default {
}, },
editDisable() { editDisable() {
this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.id this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.id
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (this.editForm.ownedCusgroupType === 3) this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = (!this.editForm.ownedCusgroupType || (this.editForm.ownedCusgroupType === 3))
this.editFormData[this.editFormData.findIndex(item => item.name === 'functionValue')].isDisabled = !!this.editForm.id this.editFormData[this.editFormData.findIndex(item => item.name === 'functionValue')].isDisabled = !!this.editForm.id
this.editFormData[this.editFormData.findIndex(item => item.name === 'newFunValue')].isHide = !this.editForm.id this.editFormData[this.editFormData.findIndex(item => item.name === 'newFunValue')].isHide = !this.editForm.id
this.editRule.ownedCusgroupValue[0].required = (this.editForm.ownedCusgroupType !== 3) this.editRule.ownedCusgroupValue[0].required = (!this.editForm.ownedCusgroupType || this.editForm.ownedCusgroupType !== 3)
// this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue') // this.$refs.editFormRef.$refs[this.editChildRef].validateField('ownedCusgroupValue')
}, },
handleAdd() { handleAdd() {
...@@ -485,23 +474,40 @@ export default { ...@@ -485,23 +474,40 @@ export default {
this.editDisable() this.editDisable()
this.$refs.editFormRef && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()) this.$refs.editFormRef && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate())
}, },
recoveryEdit(row) { getMenuTree(productId, fn) {
baseApi.getMenuTree({ productId: row.productId }).then(res => { baseApi.getMenuTree({ productId: productId }).then(res => {
this.baseData.menuTreeList = res.data this.baseData.menuTreeList = res.data
this.editForm.menuId = '' this.getOptionsList('editFormData', false)
this.editForm.menuName = '' fn && fn()
}) })
}, },
recoveryEdit(row) {
if (this.editForm.ownedCusgroupType && (this.editForm.ownedCusgroupType !== 3)) {
this.baseData.cusGroupList = this.baseData[this.attrToList[this.editForm.ownedCusgroupType]]
}
},
handleFunEdit(row) { handleFunEdit(row) {
this.editForm = _.cloneDeep(row) this.editForm = _.cloneDeep(row)
if (this.editForm.ownedCusgroupValue) { if (this.editForm.ownedCusgroupValue) {
this.editForm.ownedCusgroupValue = this.editForm.ownedCusgroupValue.split(',').map(item => +item) this.editForm.ownedCusgroupValue = this.editForm.ownedCusgroupValue.split(',').map(item => +item)
} }
recoveryEdit(row) this.recoveryEdit(row)
this.handleAdd() this.getMenuTree(row.productId, () => {
this.handleAdd()
})
}, },
handleClose() { handleClose() {
this.editForm = {} this.editForm = {
productId: '',
menuId: '',
menuName: '',
ownedCusgroupValue: ''
}
var resetBaseNameList = ['menuTreeList', 'cusGroupList']
resetBaseNameList.forEach(item => {
this.baseData[item] = []
})
this.getOptionsList('editFormData', false)
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate() this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()
this.handleAdd() this.handleAdd()
}, },
......
// import App from './index.vue' // import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import notice from '@/common/notice'
const Apps = require.context('./', false, /\.vue$/) const Apps = require.context('./', false, /\.vue$/)
Apps.keys().map(item => { Apps.keys().map(item => {
console.log(item)
base.getConfig().then(data => { base.getConfig().then(data => {
const { const {
vue, vue,
config config
} = data } = data
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
vue.prototype.notice = notice
base.render(Apps(item).default) base.render(Apps(item).default)
}) })
}) })
......
...@@ -109,7 +109,6 @@ ...@@ -109,7 +109,6 @@
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import { Util } from '@/common/util'
import SelectTree from '../components/SelectTree' import SelectTree from '../components/SelectTree'
import { menuApi, baseApi } from '@/api/productManage' import { menuApi, baseApi } from '@/api/productManage'
export default { export default {
...@@ -182,10 +181,7 @@ export default { ...@@ -182,10 +181,7 @@ export default {
prop: 'productName' prop: 'productName'
}, { }, {
label: '更新时间', label: '更新时间',
prop: 'updatedTime', prop: 'updatedTime'
formatter: cellValue => {
return cellValue.updatedTime ? Util.dateFormate(cellValue.updatedTime, 'YYYY-MM-DD HH:mm:ss') : ''
}
}] }]
}, },
// 弹窗 // 弹窗
...@@ -235,11 +231,9 @@ export default { ...@@ -235,11 +231,9 @@ export default {
optionLabel: 'dictLabel', optionLabel: 'dictLabel',
optionsName: 'productList', optionsName: 'productList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
baseApi.getMenuTree({ productId: value }).then(res => { this.editForm.parentId = ''
this.baseData.menuTreeList = res.data this.editForm.parentName = ''
this.editForm.parentId = '' this.getMenuTree(value)
this.editForm.parentName = ''
})
} }
}, { }, {
label: '菜单类型', label: '菜单类型',
...@@ -382,15 +376,6 @@ export default { ...@@ -382,15 +376,6 @@ export default {
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
this.getOptionsList('editFormData', false) this.getOptionsList('editFormData', false)
}) })
baseApi.getMenuTree().then(res => {
// console.log(res.data)
this.baseData.menuTreeList = res.data
this.baseData.menuTreeList.unshift({
id: ' ',
menuName: '无(表示顶级菜单)',
childlist: []
})
})
}, },
methods: { methods: {
...@@ -416,26 +401,42 @@ export default { ...@@ -416,26 +401,42 @@ export default {
resolve(this.tableSearchForm) resolve(this.tableSearchForm)
}) })
}, },
isMenuSpecial(flag = true) { getMenuTree(productId, fn) {
console.log(flag) baseApi.getMenuTree({ productId: productId }).then(res => {
this.editForm.ownedCusgroupType = '' this.baseData.menuTreeList = res.data
this.editForm.ownedCusgroupValue = [] this.baseData.menuTreeList.unshift({
this.editForm.ownedMerchant = '' id: ' ',
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupType')].isHide = !flag menuName: '无(表示顶级菜单)',
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = !flag childlist: []
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = !flag })
this.editRule.ownedCusgroupValue[0].required = flag this.getOptionsList('editFormData', false)
this.editRule.ownedCusgroupType[0].required = flag fn && fn()
})
},
isMenuSpecial(isSpecial = true) {
if (!isSpecial) {
this.editForm.ownedCusgroupType = ''
this.editForm.ownedCusgroupValue = []
this.editForm.ownedMerchant = ''
}
this.baseData.cusGroupList = isSpecial ? this.baseData[this.attrToList[this.editForm.ownedCusgroupType]] : []
this.getOptionsList('editFormData', false)
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupType')].isHide = !isSpecial
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isHide = !isSpecial
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedMerchant')].isHide = !isSpecial
this.editRule.ownedCusgroupValue[0].required = isSpecial && (this.editForm.ownedCusgroupType !== 3)
this.editRule.ownedCusgroupType[0].required = isSpecial
}, },
editDisable() { editDisable() {
this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.label === '产品')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.label === '父级菜单')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.label === '父级菜单')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.name === 'isSpecial')].isDisabled = !!this.editForm.menuCode this.editFormData[this.editFormData.findIndex(item => item.name === 'isSpecial')].isDisabled = !!this.editForm.menuCode
this.editFormData[this.editFormData.findIndex(item => item.name === 'ownedCusgroupValue')].isDisabled = !!this.editForm.menuCode && !(this.editForm.ownedCusgroupType !== 3)
}, },
handleAdd() { handleAdd(isEdit = false) {
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
this.editDisable() this.editDisable()
this.isMenuSpecial(false) !isEdit && this.isMenuSpecial(false)
this.$refs.editFormRef && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()) this.$refs.editFormRef && (this.$refs.editFormRef.$refs[this.editChildRef].clearValidate())
}, },
handleConfirm() { handleConfirm() {
...@@ -469,15 +470,27 @@ export default { ...@@ -469,15 +470,27 @@ export default {
ownedCusgroupValue: [], ownedCusgroupValue: [],
ownedMerchant: '' ownedMerchant: ''
} }
var resetBaseNameList = ['menuTreeList', 'cusGroupList']
resetBaseNameList.forEach(item => {
this.baseData[item] = []
})
this.getOptionsList('editFormData', false)
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate() this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()
this.handleAdd() this.handleAdd()
}, },
handleEdit(row) { handleEdit(row) {
// console.log(row)
this.editForm = _.cloneDeep(row) this.editForm = _.cloneDeep(row)
this.editForm.parentId = this.editForm.parentId || ' ' if (!this.editForm.parentId) {
this.handleAdd() this.editForm.parentId = ' '
this.editForm.isSpecial && this.isMenuSpecial(true) this.editForm.parentName = '无(表示顶级菜单)'
}
if (this.editForm.isSpecial) {
this.editForm.ownedCusgroupValue && (this.editForm.ownedCusgroupValue = this.editForm.ownedCusgroupValue.split(',').map(item => +item))
this.isMenuSpecial(true)
}
this.getMenuTree(this.editForm.productId, () => {
this.handleAdd(true)
})
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('是否删除菜单?', '提示', { this.$confirm('是否删除菜单?', '提示', {
......
// import App from './index.vue' // import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import notice from '@/common/notice'
const Apps = require.context('./', false, /\.vue$/) const Apps = require.context('./', false, /\.vue$/)
...@@ -12,7 +11,6 @@ Apps.keys().map(item => { ...@@ -12,7 +11,6 @@ Apps.keys().map(item => {
config config
} = data } = data
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
vue.prototype.notice = notice
base.render(Apps(item).default) base.render(Apps(item).default)
}) })
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!