|
@@ -309,8 +309,18 @@ export default {
|
|
|
ListToTree(){
|
|
|
var a =[]
|
|
|
if(this.list.length==1){
|
|
|
- a = this.list[0]
|
|
|
- a.nodeType='logic'
|
|
|
+ // a[0]={}
|
|
|
+ // a[0].nodeType='logic'
|
|
|
+ // a[0].logicOpr = 'and'
|
|
|
+ // a[0].left=this.list[0]
|
|
|
+ // a[0].right = {
|
|
|
+ // field: "1",
|
|
|
+ // nodeType: "exp",
|
|
|
+ // opr: "=",
|
|
|
+ // value: "1"
|
|
|
+ // }
|
|
|
+ a[0]=this.list[0]
|
|
|
+ // a.nodeType='logic'
|
|
|
}else{
|
|
|
a[0]=this.list[0]
|
|
|
a[0].nodeType='exp'
|
|
@@ -392,11 +402,18 @@ export default {
|
|
|
this.title = '新增数据权限'
|
|
|
this.visible = true
|
|
|
this.ruleForm={}
|
|
|
+ this.list=[]
|
|
|
},
|
|
|
handleEdit(row) {
|
|
|
this.title = '编辑数据权限'
|
|
|
this.visible = true
|
|
|
- this.TreeToList(JSON.parse(row.rule))
|
|
|
+ console.log(JSON.parse(row.rule))
|
|
|
+ if(JSON.parse(row.rule).hasOwnProperty('left')){
|
|
|
+ this.TreeToList(JSON.parse(row.rule))
|
|
|
+ }else{
|
|
|
+ this.list[0]=JSON.parse(row.rule)
|
|
|
+ }
|
|
|
+
|
|
|
this.ruleForm = { ...row }
|
|
|
},
|
|
|
close() {
|
|
@@ -437,8 +454,10 @@ export default {
|
|
|
submit() {
|
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ this.ruleForm.functionId=this.fun.fun.id
|
|
|
this.btnLoading = true
|
|
|
this.ListToTree()
|
|
|
+ console.log(this.ruleForm)
|
|
|
if (this.ruleForm.id) {
|
|
|
this.$api.editData(this.ruleForm).then(response => {
|
|
|
this.$message.success('编辑成功')
|
|
@@ -450,7 +469,8 @@ export default {
|
|
|
})
|
|
|
} else {
|
|
|
this.ruleForm.tenant=this.userinfo.tenantId
|
|
|
- console.log(this.ruleForm)
|
|
|
+
|
|
|
+
|
|
|
this.$api.addData(this.ruleForm).then(response => {
|
|
|
this.$message.success('新增成功')
|
|
|
this.btnLoading = false
|