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
35129d7a
Commit
35129d7a
authored
Jun 29, 2021
by
陈浩玮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组织管理
parent
f7f7fddb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
87 deletions
+72
-87
src/api/organization.js
src/api/organization.js
+7
-2
src/pages/system/view/organization/jobmanagement/JobManagement.vue
.../system/view/organization/jobmanagement/JobManagement.vue
+0
-45
src/pages/system/view/organization/jobmanagement/form.vue
src/pages/system/view/organization/jobmanagement/form.vue
+0
-36
src/pages/system/view/organization/jobmanagement/index.js
src/pages/system/view/organization/jobmanagement/index.js
+0
-3
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 @
35129d7a
...
@@ -8,7 +8,12 @@ function updateJobsApi(data) {
...
@@ -8,7 +8,12 @@ function updateJobsApi(data) {
return
putReq
(
'
/api/v1/jobs
'
,
data
);
return
putReq
(
'
/api/v1/jobs
'
,
data
);
}
}
function
getOrganizationList
(
data
)
{
return
getReq
(
'
/api/v1/organizations
'
,
data
);
}
export
default
{
export
default
{
add
:
addJobsApi
,
addJobs
:
addJobsApi
,
update
:
updateJobsApi
,
updateJobs
:
updateJobsApi
,
getOrganizationList
:
getOrganizationList
,
};
};
src/pages/system/view/organization/jobmanagement/JobManagement.vue
deleted
100644 → 0
View file @
f7f7fddb
<
template
>
<my-table
url=
"/api/v1/jobs"
rowKey=
"jobId"
:addBtn=
"addBtn"
ref=
"table"
noPage
>
<template
#drawer
>
<Form
ref=
"form"
/>
</
template
>
<!-- <template #search="{ query }">
<a-form-model-item label="名称">
<a-input v-model="query.jobName" />
</a-form-model-item>
</template> -->
<a-table-column
title=
"名称"
data-index=
"jobName"
/>
<a-table-column
title=
"描述"
data-index=
"jobDescription"
/>
<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
'
;
export
default
{
components
:
{
Form
,
PopconfirmDelete
},
data
()
{
return
{
addBtn
:
{
width
:
600
,
onOk
:
()
=>
this
.
$refs
[
'
form
'
]?.
submit
()
},
};
},
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/jobmanagement/form.vue
deleted
100644 → 0
View file @
f7f7fddb
<
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
.
add
({
...
this
.
form
});
},
edit
()
{
return
JobsApi
.
update
({
...
this
.
form
});
},
},
};
</
script
>
src/pages/system/view/organization/jobmanagement/index.js
deleted
100644 → 0
View file @
f7f7fddb
import
JobManagement
from
'
./JobManagement
'
;
export
default
JobManagement
;
src/router/config.js
View file @
35129d7a
...
@@ -78,7 +78,14 @@ const options = {
...
@@ -78,7 +78,14 @@ const options = {
{
{
path
:
'
job_management
'
,
path
:
'
job_management
'
,
name
:
'
岗位管理
'
,
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 @
35129d7a
...
@@ -31,3 +31,60 @@ export function convertListToTree(menuList, filterMenu = false) {
...
@@ -31,3 +31,60 @@ export function convertListToTree(menuList, filterMenu = false) {
export
function
EMPTY_FUN
()
{}
export
function
EMPTY_FUN
()
{}
export
const
isFunction
=
val
=>
typeof
val
===
'
function
'
;
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