Commit e481b468 by 杨北旺

角色创建提醒更改

1 parent 7b1c06a8
......@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.2.7",
"glsx-components": "^1.3.1",
"lodash": "^4.17.21",
"vue": "^2.6.10",
"vue-amap": "^0.5.10",
......
......@@ -18,10 +18,10 @@
<el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input>
</el-form-item>
<el-form-item label="角色名称" prop="roleName">
<el-input size="small" maxlength="20" style="width: 40%; padding-right: 50px" v-model="ruleForm.roleName" placeholder="请输入角色名称"></el-input>
<el-input size="small" maxlength="20" style="width: 40%; padding-right: 50px" @input="changeInput" v-model="ruleForm.roleName" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色说明" prop="roleDesc">
<el-input size="small" maxlength="50" style="width: 40%; padding-right: 50px" v-model="ruleForm.roleDesc" placeholder="请输入角色说明"></el-input>
<el-input size="small" maxlength="50" style="width: 40%; padding-right: 50px" @input="changeInput" v-model="ruleForm.roleDesc" placeholder="请输入角色说明"></el-input>
</el-form-item>
<!-- <el-form-item label="角色权限" prop="roleRoot">
<div class="custom_element">
......@@ -107,7 +107,8 @@ export default {
// tree数据
treeDataList: [],
accountLevel: 1,
isHaveEdit: false
isHaveEdit: false,
isChangeEdit:false
}
},
watch: {
......@@ -119,6 +120,10 @@ export default {
}
},
methods: {
// 输入有变就触发提醒
changeInput(){
this.isChangeEdit = true
},
// 获取角色信息
getRoleData(id) {
this.$apis.role.roleInfoData({ id }).then(res => {
......@@ -195,6 +200,7 @@ export default {
},
// 选择商户权限
selectCurAccount(item, index) {
this.isChangeEdit = true
this.roleRootRules = false
this.accountListSelect[index].select = !item.select
this.curRootIndex = 0
......@@ -292,34 +298,22 @@ export default {
}
},
insertRole(para) {
this.$confirm('是否保存当前信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.role.createRole(para).then(res => {
this.$apis.role.createRole(para).then(res => {
if (res) {
this.$router.push('/role/index')
}
})
})
},
updateRole(para) {
this.$confirm('是否保存当前信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.role.updateRole(para).then(res => {
this.$apis.role.updateRole(para).then(res => {
if (res) {
this.$router.push('/role/index')
}
})
})
},
toBack() {
if (this.isHaveEdit&&this.pageType=='create') {
this.$confirm('离开当前页面内容将不会保存,是否继续?', '提示', {
if ((this.isHaveEdit&&this.pageType=='create') ||(this.isChangeEdit&&this.pageType=='edit')) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!