Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FE_COMMON_LIB
select-dpt-user-dialog-hy
Commits
21f65129
Commit
21f65129
authored
1 year ago
by
杜国峰
Browse files
Options
Download
Email Patches
Plain Diff
feat:域名替换
parent
5040f608
master
v0.1.0
v0.0.9
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+8
-7
README.md
package.json
+2
-2
package.json
src/selectDptUserDialogHy/SelectDptUserDialogHy.vue
+4
-2
src/selectDptUserDialogHy/SelectDptUserDialogHy.vue
src/utils/request.js
+12
-3
src/utils/request.js
with
26 additions
and
14 deletions
+26
-14
README.md
+
8
-
7
View file @
21f65129
...
...
@@ -39,13 +39,14 @@ const confirm = (data) => {
```
### prop
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------|
| visible | 显隐 | Boolean | false |
| defaults | 默认选中的成员的 user_uuid | Array | [] |
| disabledIds | 不可操作选中状态的成员 user_uuid | Array | [] |
| multiple | 多选 | Boolean | true |
| isRequired | 是否必选 | Boolean | false |
| 参数 | 说明 | 类型 | 默认值 |
|-------------|----------------------|---------|------|
| visible | 显隐 | Boolean | false |
| defaults | 默认选中的成员的 user_uuid | Array | [] |
| disabledIds | 不可操作选中状态的成员 user_uuid | Array | [] |
| multiple | 多选 | Boolean | true |
| isRequired | 是否必选 | Boolean | false |
| baseUrl | 接口baseUrl,不传会按照现有域名去取,如果后续域名变化,需要调用者自行传入接口地址 | String | |
### 事件
| 事件 | 说明 | 参数 |
...
...
This diff is collapsed.
Click to expand it.
package.json
+
2
-
2
View file @
21f65129
{
"name"
:
"select-dpt-user-dialog-hy"
,
"version"
:
"0.0.
8
"
,
"version"
:
"0.0.
9
"
,
"main"
:
"src/selectDptUserDialogHy/SelectDptUserDialogHy.vue"
,
"scripts"
:
{
"dev"
:
"vite"
,
"dev"
:
"vite
dev --host
"
,
"build"
:
"vite build"
,
"preview"
:
"vite preview"
},
...
...
This diff is collapsed.
Click to expand it.
src/selectDptUserDialogHy/SelectDptUserDialogHy.vue
+
4
-
2
View file @
21f65129
...
...
@@ -213,6 +213,7 @@ import {
api_personalDepList
}
from
'
../utils/api
'
import
{
debounce
,
findByKeyRecursively
,
mapObj
}
from
'
../utils/tools
'
import
{
setBaseUrl
}
from
'
../utils/request
'
// 所有部门id有两个,一个是 department_id, 一个是origin_department_id
// 分组和部门数据库中是两个不同的表,后端返的department_id可能会重复,拿到数据统一将department_id重写成 department_id + suffix形式作为部门key
...
...
@@ -247,10 +248,11 @@ const props = defineProps({
isRequired
:
{
type
:
Boolean
,
default
:
false
}
},
baseUrl
:
String
})
const
emit
=
defineEmits
([
'
update:visible
'
,
'
cancel
'
,
'
confirm
'
])
setBaseUrl
(
props
.
baseUrl
)
const
dptMembersMap
=
ref
({
[
TOP_DPT_ID
]:
[]
})
// 部门id为key, 该部门成员list为value
const
dptMembersCountMap
=
computed
(()
=>
{
return
mapObj
(
dptMembersMap
.
value
,
(
_
,
members
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/utils/request.js
+
12
-
3
View file @
21f65129
...
...
@@ -32,8 +32,14 @@ export function cancelRequest(cb) {
})
}
let
baseUrl
export
function
setBaseUrl
(
base_url
)
{
if
(
base_url
)
{
baseUrl
=
base_url
}
}
function
getBaseUrl
()
{
if
(
baseUrl
)
return
baseUrl
const
APP_BRANCH_NAME
=
getQueryObj
().
env
||
Cookies
.
get
(
'
APP_BRANCH_NAME
'
)
if
(
location
.
hostname
===
'
localhost
'
||
...
...
@@ -43,10 +49,10 @@ function getBaseUrl() {
)
{
// 本地开发或测试环境
return
`https://qtabletestapi.qimingpian.cn
${
location
.
pathname
.
match
(
/
(\/(
v
\d
+|hotfix
))?
/
)[
0
]
||
''
}
`
}
else
if
(
location
.
hostname
.
indexOf
(
'
qmp
work
'
)
!==
-
1
||
location
.
hostname
.
indexOf
(
'
qmp
one
'
)
!==
-
1
||
APP_BRANCH_NAME
===
'
public
'
)
{
// 公有云
return
'
https://api.qmp
work
.com
'
return
'
https://api.qmp
one
.com
'
}
else
if
(
location
.
hostname
.
indexOf
(
'
qmpoa
'
)
!==
-
1
||
APP_BRANCH_NAME
===
'
private
'
...
...
@@ -73,6 +79,9 @@ export function getWholeApiUrl(apiUrl) {
}
service
.
interceptors
.
request
.
use
(
config
=>
{
if
(
baseUrl
)
{
config
.
baseURL
=
baseUrl
}
config
.
url
=
getWholeApiUrl
(
config
.
url
)
config
.
data
=
config
.
data
||
{}
removePending
(
config
,
true
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help