-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10f66a4
commit e4d9a49
Showing
8 changed files
with
326 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
ui/src/views/application-workflow/component/PublishHistory.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<template> | ||
<div class="workflow-publish-history"> | ||
<h4 class="border-b p-16-24">发布历史</h4> | ||
<div class="left-height pt-0"> | ||
<el-scrollbar> | ||
<div class="p-8 pt-0"> | ||
<common-list | ||
:data="LogData" | ||
class="mt-8" | ||
v-loading="loading" | ||
@click="clickListHandle" | ||
@mouseenter="mouseenter" | ||
@mouseleave="mouseId = ''" | ||
> | ||
<template #default="{ row, index }"> | ||
<div class="flex-between"> | ||
<div> | ||
<h5 :class="index === 0 ? 'primary' : ''" class="flex"> | ||
<ReadWrite | ||
@change="editName($event, row.id)" | ||
:data="row.name || datetimeFormat(row.create_time)" | ||
:showEditIcon="true" | ||
/> | ||
<el-tag v-if="index === 0" class="default-tag ml-4">最近发布</el-tag> | ||
</h5> | ||
<el-text type="info" class="color-secondary flex mt-8"> | ||
<AppAvatar :size="20" class="avatar-grey mr-4"> | ||
<el-icon><UserFilled /></el-icon> | ||
</AppAvatar> | ||
XXX | ||
</el-text> | ||
</div> | ||
|
||
<!-- <div @click.stop v-show="mouseId === row.id"> | ||
<el-dropdown trigger="click"> | ||
<el-button text> | ||
<el-icon><MoreFilled /></el-icon> | ||
</el-button> | ||
<template #dropdown> | ||
<el-dropdown-menu> | ||
<el-dropdown-item> | ||
<el-icon><EditPen /></el-icon> | ||
编辑 | ||
</el-dropdown-item> | ||
<el-dropdown-item @click="refreshVersion(row)"> | ||
<el-icon><RefreshLeft /></el-icon> | ||
恢复此版本 | ||
</el-dropdown-item> | ||
</el-dropdown-menu> | ||
</template> | ||
</el-dropdown> | ||
</div> --> | ||
</div> | ||
</template> | ||
|
||
<template #empty> | ||
<div class="text-center"> | ||
<el-text type="info">暂无历史记录</el-text> | ||
</div> | ||
</template> | ||
</common-list> | ||
</div> | ||
</el-scrollbar> | ||
</div> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref, onMounted, computed } from 'vue' | ||
import { useRoute } from 'vue-router' | ||
import applicationApi from '@/api/application' | ||
import { datetimeFormat } from '@/utils/time' | ||
import { MsgSuccess, MsgError } from '@/utils/message' | ||
const route = useRoute() | ||
const { | ||
params: { id } | ||
} = route as any | ||
const emit = defineEmits(['click', 'refreshVersion']) | ||
const loading = ref(false) | ||
const LogData = ref([]) | ||
const mouseId = ref('') | ||
function mouseenter(row: any) { | ||
mouseId.value = row.id | ||
} | ||
function clickListHandle(item: any) { | ||
emit('click', item) | ||
} | ||
function refreshVersion(item: any) { | ||
emit('refreshVersion', item) | ||
} | ||
function editName(val: string, currentId: string) { | ||
if (val) { | ||
const obj = { | ||
name: val | ||
} | ||
applicationApi.putWorkFlowVersion(id as string, currentId, obj, loading).then(() => { | ||
MsgSuccess('修改成功') | ||
getList() | ||
}) | ||
} else { | ||
MsgError('名字不能为空!') | ||
} | ||
} | ||
function getList() { | ||
applicationApi.getWorkFlowVersion(id, loading).then((res: any) => { | ||
LogData.value = res.data | ||
}) | ||
} | ||
onMounted(() => { | ||
getList() | ||
}) | ||
</script> | ||
<style lang="scss" scoped> | ||
.workflow-publish-history { | ||
width: 320px; | ||
position: absolute; | ||
right: 0; | ||
top: 57px; | ||
background: #ffffff; | ||
height: calc(100vh - 57px); | ||
z-index: 9; | ||
} | ||
</style> |
Oops, something went wrong.