Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
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
product
kim3-web-vue
Starter Web Vue
Commits
73a4d61b
Commit
73a4d61b
authored
Jun 30, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/shuiluo
parents
d8b5fd57
b49612b9
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
254 additions
and
13 deletions
+254
-13
src/api/organization.js
src/api/organization.js
+7
-2
src/components/table/index.vue
src/components/table/index.vue
+9
-5
src/components/table/my_item.vue
src/components/table/my_item.vue
+21
-0
src/pages/system/view/organization/components/OrganizationTree.vue
.../system/view/organization/components/OrganizationTree.vue
+52
-0
src/pages/system/view/organization/jobmanagement/index.js
src/pages/system/view/organization/jobmanagement/index.js
+0
-3
src/pages/system/view/organization/jobsmanagement/Jobs.vue
src/pages/system/view/organization/jobsmanagement/Jobs.vue
+0
-0
src/pages/system/view/organization/jobsmanagement/form.vue
src/pages/system/view/organization/jobsmanagement/form.vue
+2
-2
src/pages/system/view/organization/jobsmanagement/index.js
src/pages/system/view/organization/jobsmanagement/index.js
+3
-0
src/pages/system/view/organization/usermanagement/User.vue
src/pages/system/view/organization/usermanagement/User.vue
+56
-0
src/pages/system/view/organization/usermanagement/form.vue
src/pages/system/view/organization/usermanagement/form.vue
+36
-0
src/pages/system/view/organization/usermanagement/index.js
src/pages/system/view/organization/usermanagement/index.js
+3
-0
src/router/config.js
src/router/config.js
+8
-1
src/utils/index.js
src/utils/index.js
+57
-0
No files found.
src/api/organization.js
View file @
73a4d61b
...
...
@@ -8,7 +8,12 @@ function updateJobsApi(data) {
return
putReq
(
'
/api/v1/jobs
'
,
data
);
}
function
getOrganizationList
(
data
)
{
return
getReq
(
'
/api/v1/organizations
'
,
data
);
}
export
default
{
add
:
addJobsApi
,
update
:
updateJobsApi
,
addJobs
:
addJobsApi
,
updateJobs
:
updateJobsApi
,
getOrganizationList
:
getOrganizationList
,
};
src/components/table/index.vue
View file @
73a4d61b
<
template
>
<div>
<my-card
v-if=
"$scopedSlots.search"
>
<a-form-model
layout=
"inline"
:model=
"queryForm"
>
<slot
name=
"search"
:query=
"queryForm"
/>
<a-form-model
:model=
"queryForm"
layout=
"horizontal"
>
<a-row
:gutter=
"24"
>
<slot
name=
"search"
:query=
"queryForm"
/>
</a-row>
</a-form-model>
<div
class=
"tw-text-right tw-mt-2"
>
...
...
@@ -56,9 +58,7 @@
<a-divider
/>
<a-space>
<a-button
@
click=
"addVisible = false"
>
取消
</a-button>
<a-button
type=
"primary"
@
click=
"submit"
:loading=
"submitLoading"
>
确认
</a-button>
<a-button
type=
"primary"
@
click=
"submit"
:loading=
"submitLoading"
>
确认
</a-button>
</a-space>
</
template
>
</a-drawer>
...
...
@@ -104,6 +104,10 @@ export default {
flexDirection
:
'
column
'
,
},
noFooter
:
false
,
layout
:
{
labelCol
:
{
span
:
4
},
wrapperCol
:
{
span
:
20
},
},
total
:
0
,
};
},
...
...
src/components/table/my_item.vue
0 → 100644
View file @
73a4d61b
<
template
>
<a-col
v-bind=
"span"
>
<a-form-model-item
v-bind=
"layout"
>
<slot
/>
</a-form-model-item>
</a-col>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
span
:
{
xs
:
24
,
sm
:
24
,
lg
:
12
,
xl
:
6
},
layout
:
{
labelCol
:
{
span
:
5
},
wrapperCol
:
{
span
:
19
},
...
this
.
$attrs
},
};
},
};
</
script
>
<
style
>
</
style
>
\ No newline at end of file
src/pages/system/view/organization/components/OrganizationTree.vue
0 → 100644
View file @
73a4d61b
<
template
>
<div>
<a-tree-select
:value=
"value"
show-search
style=
"width: 100%"
:dropdown-style=
"
{ maxHeight: '400px', overflow: 'auto' }"
placeholder="Please select"
:tree-data="treeData"
allow-clear
tree-default-expand-all
:replaceFields="replaceFields"
v-on="$listeners"
>
</a-tree-select>
</div>
</
template
>
<
script
>
import
api
from
'
@/api/organization
'
;
import
{
arrayToTree
}
from
'
@/utils
'
;
export
default
{
model
:
{
prop
:
'
value
'
,
event
:
'
change
'
,
},
props
:
{
value
:
[
Object
,
Array
],
showMenu
:
Boolean
,
},
data
()
{
return
{
treeData
:
[],
replaceFields
:
{
title
:
'
orgName
'
,
key
:
'
orgId
'
,
value
:
'
orgId
'
,
},
};
},
async
mounted
()
{
this
.
rawData
=
await
api
.
getOrganizationList
();
const
newArr
=
new
arrayToTree
({
data
:
this
.
rawData
,
rootValue
:
0
,
parentKey
:
'
parentOrgId
'
,
key
:
'
orgId
'
,
}).
treeData
;
this
.
treeData
=
[...
newArr
];
},
};
</
script
>
src/pages/system/view/organization/jobmanagement/index.js
deleted
100644 → 0
View file @
d8b5fd57
import
JobManagement
from
'
./JobManagement
'
;
export
default
JobManagement
;
src/pages/system/view/organization/job
management/JobManagement
.vue
→
src/pages/system/view/organization/job
smanagement/Jobs
.vue
View file @
73a4d61b
File moved
src/pages/system/view/organization/jobmanagement/form.vue
→
src/pages/system/view/organization/job
s
management/form.vue
View file @
73a4d61b
...
...
@@ -26,10 +26,10 @@ export default {
},
methods
:
{
add
()
{
return
JobsApi
.
add
({
...
this
.
form
});
return
JobsApi
.
add
Jobs
({
...
this
.
form
});
},
edit
()
{
return
JobsApi
.
update
({
...
this
.
form
});
return
JobsApi
.
update
Jobs
({
...
this
.
form
});
},
},
};
...
...
src/pages/system/view/organization/jobsmanagement/index.js
0 → 100644
View file @
73a4d61b
import
Jobs
from
'
./Jobs
'
;
export
default
Jobs
;
src/pages/system/view/organization/usermanagement/User.vue
0 → 100644
View file @
73a4d61b
<
template
>
<my-table
url=
"/api/v1/users"
rowKey=
"userId"
:addBtn=
"addBtn"
ref=
"table"
>
<template
#drawer
>
<Form
ref=
"form"
/>
</
template
>
<
template
#search=
"{ query }"
>
<MyFormModelItem
label=
"归属部门"
>
<OrganizationTree
v-model=
"query.orgId"
/>
</MyFormModelItem>
<MyFormModelItem
label=
"账号"
>
<a-input
placeholder=
"Basic usage"
v-model=
"query.loginId"
/>
</MyFormModelItem>
</
template
>
<a-table-column
title=
"账号"
data-index=
"loginId"
/>
<a-table-column
title=
"姓名"
data-index=
"userName"
/>
<a-table-column
title=
"职称"
data-index=
"userTitleName"
/>
<a-table-column
title=
"移动电话"
data-index=
"mobilePhone"
/>
<a-table-column
title=
"固定电话"
data-index=
"fixedPhone"
/>
<a-table-column
title=
"电子邮箱"
data-index=
"userEmail"
/>
<a-table-column
title=
"是否锁定"
data-index=
"isLockedName"
/>
<a-table-column
title=
"操作"
>
<
template
#default=
"row"
>
<a
@
click=
"() => view(row, 1)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<PopconfirmDelete
:url=
"`/api/v1/jobs/$
{row.jobId}`" :cb="refreshTable" />
</
template
>
</a-table-column>
</my-table>
</template>
<
script
>
import
Form
from
'
./form.vue
'
;
import
PopconfirmDelete
from
'
@/components/popconfirm_delete/index.vue
'
;
import
MyFormModelItem
from
'
@/components/table/my_item.vue
'
;
import
OrganizationTree
from
'
../components/OrganizationTree.vue
'
;
export
default
{
components
:
{
Form
,
PopconfirmDelete
,
OrganizationTree
,
MyFormModelItem
},
data
()
{
return
{
addBtn
:
{
width
:
600
,
onOk
:
()
=>
this
.
$refs
[
'
form
'
]?.
submit
()
},
span
:
{
xs
:
12
,
md
:
8
,
lg
:
6
},
};
},
methods
:
{
refreshTable
()
{
this
.
$refs
[
'
table
'
]?.
getData
();
},
view
(
data
,
type
)
{
this
.
$refs
[
'
table
'
]?.
show
({
type
});
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
form
'
].
setData
({
...
data
},
type
);
});
},
},
};
</
script
>
\ No newline at end of file
src/pages/system/view/organization/usermanagement/form.vue
0 → 100644
View file @
73a4d61b
<
template
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"DrawerForm"
>
<a-form-model-item
label=
"名称"
prop=
"jobName"
>
<a-input
v-model=
"form.jobName"
:disabled=
"isView"
/>
</a-form-model-item>
<a-form-model-item
label=
"描述"
prop=
"jobDescription"
>
<a-textarea
v-model=
"form.jobDescription"
:disabled=
"isView"
:rows=
"4"
/>
</a-form-model-item>
</a-form-model>
</
template
>
<
script
>
import
JobsApi
from
'
@/api/organization
'
;
import
FormMixin
from
'
@/components/FormMixin
'
;
export
default
{
mixins
:
[
FormMixin
],
data
()
{
return
{
rules
:
{
jobName
:
[{
required
:
true
,
message
:
'
Please select Activity zone
'
,
trigger
:
'
change
'
}],
jobDescription
:
[
{
required
:
true
,
message
:
'
Please select Activity zone
'
,
trigger
:
'
change
'
},
],
},
};
},
methods
:
{
add
()
{
return
JobsApi
.
addJobs
({
...
this
.
form
});
},
edit
()
{
return
JobsApi
.
updateJobs
({
...
this
.
form
});
},
},
};
</
script
>
src/pages/system/view/organization/usermanagement/index.js
0 → 100644
View file @
73a4d61b
import
User
from
'
./User
'
;
export
default
User
;
src/router/config.js
View file @
73a4d61b
...
...
@@ -85,7 +85,14 @@ const options = {
{
path
:
'
job_management
'
,
name
:
'
岗位管理
'
,
component
:
()
=>
import
(
'
@/pages/system/view/organization/jobmanagement
'
),
component
:
()
=>
import
(
'
@/pages/system/view/organization/jobsmanagement
'
),
},
{
path
:
'
user_management
'
,
name
:
'
用户管理
'
,
component
:
()
=>
import
(
'
@/pages/system/view/organization/usermanagement
'
),
},
],
},
...
...
src/utils/index.js
View file @
73a4d61b
...
...
@@ -34,3 +34,60 @@ export function convertListToTree(menuList, filterMenu = false) {
export
function
EMPTY_FUN
()
{}
export
const
isFunction
=
val
=>
typeof
val
===
'
function
'
;
export
function
arrayToTree
(
options
)
{
options
=
JSON
.
parse
(
JSON
.
stringify
(
options
));
this
.
data
=
options
.
data
||
[];
this
.
parentKey
=
options
.
parentKey
||
'
parent_code
'
;
this
.
childrenKey
=
options
.
childrenKey
||
'
children
'
;
this
.
key
=
options
.
key
||
'
code
'
;
this
.
maping
=
options
.
maping
||
undefined
;
this
.
rootValue
=
options
.
rootValue
||
'
0
'
;
this
.
treeData
=
[];
this
.
indexStorage
=
{};
this
.
getDataBykey
=
function
(
key
)
{
return
this
.
indexStorage
[
key
];
};
this
.
setMapping
=
function
()
{
for
(
let
i
=
0
;
i
<
this
.
data
.
length
;
i
++
)
{
var
item
=
this
.
data
[
i
];
for
(
const
x
in
this
.
maping
)
{
item
[
this
.
maping
[
x
]]
=
item
[
x
];
}
}
};
if
(
this
.
maping
)
{
this
.
setMapping
();
}
this
.
setIndexStorage
=
function
()
{
for
(
let
i
=
0
;
i
<
this
.
data
.
length
;
i
++
)
{
this
.
indexStorage
[
this
.
data
[
i
][
this
.
key
]]
=
this
.
data
[
i
];
// 以id作为索引存储元素,可以无需遍历直接定位元素
}
};
this
.
setIndexStorage
();
// 利用数组浅拷贝
this
.
toTree
=
function
()
{
const
THISDATA
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
));
for
(
let
i
=
0
;
i
<
this
.
data
.
length
;
i
++
)
{
let
currentElement
=
this
.
data
[
i
];
let
tempCurrentElementParent
=
this
.
indexStorage
[
currentElement
[
this
.
parentKey
]];
// 临时变量里面的当前元素的父元素
if
(
tempCurrentElementParent
)
{
// 如果存在父元素
if
(
!
tempCurrentElementParent
[
this
.
childrenKey
])
{
// 如果父元素没有chindren键
tempCurrentElementParent
[
this
.
childrenKey
]
=
[];
// 设上父元素的children键
}
tempCurrentElementParent
[
this
.
childrenKey
].
push
(
currentElement
);
// 给父元素加上当前元素作为子元素
}
else
{
// 不存在父元素,意味着当前元素是一级元素
if
(
this
.
rootValue
!=
undefined
&&
currentElement
[
this
.
key
]
===
this
.
rootValue
)
{
this
.
treeData
.
push
(
currentElement
);
}
else
{
this
.
treeData
.
push
(
currentElement
);
}
}
}
return
this
.
treeData
;
};
this
.
toTree
();
return
this
;
}
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