Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
77596421
Commit
77596421
authored
Feb 15, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref:修改窗口关联业务
parent
a6cbcc4e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
20 deletions
+65
-20
base-manager-ui/admin/src/pages/basicset/dept/components/addWindowBusiness.vue
.../src/pages/basicset/dept/components/addWindowBusiness.vue
+20
-4
base-manager-ui/admin/src/utils/util.js
base-manager-ui/admin/src/utils/util.js
+45
-16
No files found.
base-manager-ui/admin/src/pages/basicset/dept/components/addWindowBusiness.vue
View file @
77596421
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
@
cancel=
"handleClose"
@
cancel=
"handleClose"
width=
"600px"
width=
"600px"
:maskClosable=
"false"
:maskClosable=
"false"
destroyOnClose
>
>
<template
slot=
"footer"
>
<template
slot=
"footer"
>
<a-button
@
click=
"handleReset"
>
重置
</a-button>
<a-button
@
click=
"handleReset"
>
重置
</a-button>
...
@@ -22,6 +23,11 @@
...
@@ -22,6 +23,11 @@
>
>
</div>
</div>
<div
class=
"business-search"
>
<div
class=
"business-search"
>
<div>
已关联
<span
style=
"color: #0595fd"
>
({{ rowKeys.length }})
</span>
条业务
</div>
<a-input-search
<a-input-search
style=
"width: 300px"
style=
"width: 300px"
placeholder=
"请输入业务名称搜索"
placeholder=
"请输入业务名称搜索"
...
@@ -73,6 +79,7 @@
...
@@ -73,6 +79,7 @@
<
script
>
<
script
>
import
{
getSiteBusinessList
}
from
"
@/services/business
"
;
import
{
getSiteBusinessList
}
from
"
@/services/business
"
;
import
{
addBusinessToWindow
}
from
"
@/services/dept
"
;
import
{
addBusinessToWindow
}
from
"
@/services/dept
"
;
import
{
extractTree
}
from
"
@/utils/util
"
;
import
local
from
"
@/utils/local
"
;
import
local
from
"
@/utils/local
"
;
const
columns
=
[
const
columns
=
[
{
{
...
@@ -123,17 +130,24 @@ export default {
...
@@ -123,17 +130,24 @@ export default {
},
},
},
},
},
},
created
()
{},
created
()
{
this
.
getSiteBusinessList
();
},
methods
:
{
methods
:
{
// 获取窗口信息
// 获取窗口信息
getWindowInfo
(
info
)
{
getWindowInfo
(
info
)
{
this
.
formData
=
info
;
this
.
formData
=
info
;
if
(
info
.
businessIds
.
length
)
{
if
(
info
.
businessIds
.
length
)
{
this
.
rowKeys
=
info
.
businessIds
;
let
arr
=
extractTree
(
this
.
siteBusinessList
,
"
children
"
).
map
((
v
)
=>
Number
(
v
.
id
)
);
console
.
log
(
arr
);
this
.
rowKeys
=
arr
.
filter
((
v
)
=>
{
return
info
.
businessIds
.
some
((
val
)
=>
v
==
val
);
});
}
else
{
}
else
{
this
.
rowKeys
=
[];
this
.
rowKeys
=
[];
}
}
this
.
getSiteBusinessList
();
},
},
// 去掉空children
// 去掉空children
delChildren
(
arr
)
{
delChildren
(
arr
)
{
...
@@ -211,6 +225,8 @@ export default {
...
@@ -211,6 +225,8 @@ export default {
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.business-search {
.business-search {
margin-bottom: 20px;
margin-bottom: 20px;
text-align: right;
display: flex;
align-items: center;
justify-content: space-between;
}
}
</
style
>
</
style
>
\ No newline at end of file
base-manager-ui/admin/src/utils/util.js
View file @
77596421
import
enquireJs
from
'
enquire.js
'
import
enquireJs
from
"
enquire.js
"
;
export
function
isDef
(
v
)
{
export
function
isDef
(
v
)
{
return
v
!==
undefined
&&
v
!==
null
return
v
!==
undefined
&&
v
!==
null
;
}
}
/**
/**
* Remove an item from an array.
* Remove an item from an array.
*/
*/
export
function
remove
(
arr
,
item
)
{
export
function
remove
(
arr
,
item
)
{
if
(
arr
.
length
)
{
if
(
arr
.
length
)
{
const
index
=
arr
.
indexOf
(
item
)
const
index
=
arr
.
indexOf
(
item
)
;
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
return
arr
.
splice
(
index
,
1
)
return
arr
.
splice
(
index
,
1
)
;
}
}
}
}
}
}
export
function
isRegExp
(
v
)
{
export
function
isRegExp
(
v
)
{
return
_toString
.
call
(
v
)
===
'
[object RegExp]
'
return
_toString
.
call
(
v
)
===
"
[object RegExp]
"
;
}
}
export
function
enquireScreen
(
call
)
{
export
function
enquireScreen
(
call
)
{
const
handler
=
{
const
handler
=
{
match
:
function
()
{
match
:
function
()
{
call
&&
call
(
true
)
call
&&
call
(
true
)
;
},
},
unmatch
:
function
()
{
unmatch
:
function
()
{
call
&&
call
(
false
)
call
&&
call
(
false
)
;
}
}
,
}
}
;
enquireJs
.
register
(
'
only screen and (max-width: 767.99px)
'
,
handler
)
enquireJs
.
register
(
"
only screen and (max-width: 767.99px)
"
,
handler
);
}
}
const
_toString
=
Object
.
prototype
.
toString
const
_toString
=
Object
.
prototype
.
toString
;
// 扁平化树形结构
export
const
extractTree
=
(
arrs
,
childs
,
attrArr
)
=>
{
let
attrList
=
[];
if
(
!
Array
.
isArray
(
arrs
)
&&
!
arrs
.
length
)
return
[];
if
(
typeof
childs
!==
"
string
"
)
return
[];
if
(
!
Array
.
isArray
(
attrArr
)
||
(
Array
.
isArray
(
attrArr
)
&&
!
attrArr
.
length
))
{
attrList
=
Object
.
keys
(
arrs
[
0
]);
attrList
.
splice
(
attrList
.
indexOf
(
childs
),
1
);
attrList
.
splice
(
attrList
.
indexOf
(
"
isLeaf
"
),
1
);
}
else
{
attrList
=
attrArr
;
}
let
list
=
[];
const
getObj
=
(
arr
)
=>
{
arr
.
forEach
(
function
(
row
)
{
let
obj
=
{};
attrList
.
forEach
((
item
)
=>
{
obj
[
item
]
=
row
[
item
];
});
list
.
push
(
obj
);
if
(
row
[
childs
])
{
getObj
(
row
[
childs
]);
}
});
return
list
;
};
return
getObj
(
arrs
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment