Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
vhwweng committed Dec 5, 2024
1 parent 6e8bead commit 380e5c9
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 35 deletions.
1 change: 1 addition & 0 deletions src/frontend/devops-permission/src/css/svg/abnormal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/frontend/devops-permission/src/css/svg/unknown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/frontend/devops-permission/src/css/svg/warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion src/frontend/devops-permission/src/http/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default {
const query = new URLSearchParams({
...params,
}).toString();
return fetch.get(`${apiPerfix}/auth/resource/member/${projectId}/etMemberGroupCount?${query}g`);
return fetch.get(`${apiPerfix}/auth/resource/member/${projectId}/getMemberGroupCount?${query}`);
},
/**
* 获取项目成员有权限的用户组
Expand Down Expand Up @@ -191,4 +191,10 @@ export default {
getMemberGroupDetails(projectId: string, resourceType: string, groupId: number) {
return fetch.get(`${apiPerfix}/auth/resource/group/${projectId}/${resourceType}/${groupId}/getMemberGroupDetails`);
},
/**
* 获取交接单列表
*/
fetchHandoverOverviewList(params: any) {
return fetch.post(`${apiPerfix}/auth/handover/listHandoverOverviews`, params);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
<bk-loading class="handover-table" :loading="isLoading">
<bk-table
ref="refTable"
:data="tableData"
:data="handoverList"
:columns="columns"
height="100%"
max-height="100%"
border="outer"
show-overflow-tooltip
:pagination="pagination"
remote-pagination
Expand Down Expand Up @@ -78,13 +79,17 @@
</template>


<script lang="ts" setup>
import { ref, computed, h } from 'vue';
<script setup>
import http from '@/http/api';
import { ref, computed, h, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { Spinner } from 'bkui-vue/lib/icon';
import abnormalIcon from '@/css/svg/abnormal.svg'
import unknownIcon from '@/css/svg/unknown.svg'
const { t } = useI18n();
const isLoading = ref(false);
const tableData = ref([]);
const handoverList = ref([]);
const pagination = ref({
count: 0,
limit: 20,
Expand All @@ -94,8 +99,19 @@
const searchValue = ref([]);
const selectList = ref([]);
const isSelectAll = ref(false); // 选择全量数据
const userId = computed(() => window.top.userInfo.username);
const columns = computed(() => {
const list = [
return [
...(
!isGiven.value ? [
{
type: "selection",
maxWidth: 60,
minWidth: 60,
align: 'center'
}
] : []
),
{
label: t('单号'),
field: "flowNo",
Expand All @@ -119,43 +135,48 @@
},
{
label: t('移交详情'),
field: "handoverFrom",
},
{
label: t('提单人'),
field: "handoverTime",
render ({ cell, row }) {
return h(
'span',
[
cell
]
);
},
field: 'title',
},
...(
!isGiven.value ? [
{
label: t('提单人'),
field: 'applicant',
},
] : []
),
{
label: t('提单时间'),
field: "handoverFrom",
field: 'handoverFrom',
},
...(
isGiven.value ? [
{
label: t('当前处理人'),
field: 'approver',
},
] : []
),
{
label: t('状态'),
field: "handoverFrom",
},
{
label: t('操作'),
field: "handoverFrom",
field: 'handoverStatus',
render ({ cell, row}) {
return h('div', { style: { 'display': 'flex' } },
cell === 'pending'
? []
: []
)
}
},
...(
!isGiven.value ? [
{
label: t('操作'),
field: 'operation',
},
] : []
)
]
if (!isGiven.value) {
list.unshift({
type: "selection",
maxWidth: 60,
minWidth: 60,
align: 'center'
})
}
return list
})
const isEmpty = computed(() => !searchValue.value.length);
const handoverTypeMap = computed(() => {
Expand Down Expand Up @@ -193,6 +214,29 @@
const filterTips = computed(() => {
return searchData.value.map(item => item.name).join(' / ');
})
const fetchHandoverList = async () => {
try {
isLoading.value = true
const param = {
memberId: userId.value,
page: pagination.value.current,
pageSize: pagination.value.limit,
}
if (isGiven.value) {
param['applicant'] = userId.value
} else {
param['approver'] = userId.value
}
const res = await http.fetchHandoverOverviewList(param)
handoverList.value = res.records
pagination.value.current += 1
pagination.value.count = res.count
} catch (e) {
console.error(e)
} finally {
isLoading.value = false
}
}
const handleChangeHandoverType = (value) => {
isGiven.value = value;
}
Expand All @@ -214,6 +258,10 @@
const clearSearchValue = () => {
}
onMounted(() => {
fetchHandoverList()
})
</script>

<style lang="scss">
Expand Down

0 comments on commit 380e5c9

Please sign in to comment.