【功能新增】工作流:流程模型增加批量修改 sort 交互

pull/582/head
YunaiV 2024-11-02 18:11:35 +08:00
parent 77062cb391
commit c3cf479f6f
3 changed files with 26 additions and 11 deletions

View File

@ -38,6 +38,16 @@ export const updateModel = async (data: ModelVO) => {
return await request.put({ url: '/bpm/model/update', data: data }) return await request.put({ url: '/bpm/model/update', data: data })
} }
// 批量修改流程分类的排序
export const updateModelSortBatch = async (ids: number[]) => {
return await request.put({
url: `/bpm/model/update-sort-batch`,
params: {
ids: ids.join(',')
}
})
}
export const updateModelBpmn = async (data: ModelVO) => { export const updateModelBpmn = async (data: ModelVO) => {
return await request.put({ url: '/bpm/model/update-bpmn', data: data }) return await request.put({ url: '/bpm/model/update-bpmn', data: data })
} }

View File

@ -30,7 +30,7 @@
link link
type="info" type="info"
class="mr-20px" class="mr-20px"
@click.stop="handleSort" @click.stop="handleModelSort"
> >
<Icon icon="fa:sort-amount-desc" class="mr-5px" /> <Icon icon="fa:sort-amount-desc" class="mr-5px" />
排序 排序
@ -56,8 +56,8 @@
</el-dropdown> </el-dropdown>
</template> </template>
<template v-else> <template v-else>
<el-button @click.stop="cancelSort"> </el-button> <el-button @click.stop="handleModelSortCancel"> </el-button>
<el-button type="primary" @click.stop="saveSort"> 保存排序 </el-button> <el-button type="primary" @click.stop="handleModelSortSubmit"> 保存排序 </el-button>
</template> </template>
</div> </div>
</div> </div>
@ -267,7 +267,7 @@ const { t } = useI18n() // 国际化
const { push } = useRouter() // const { push } = useRouter() //
const userStore = useUserStoreWithOut() // const userStore = useUserStoreWithOut() //
const isModelSorting = ref(false) // const isModelSorting = ref(false) //
const tableData: any = ref([]) const tableData: any = ref([]) //
const originalData: any = ref([]) // const originalData: any = ref([]) //
const isExpand = ref(false) // const isExpand = ref(false) //
@ -403,22 +403,27 @@ const isManagerUser = (row: any) => {
return row.managerUserIds && row.managerUserIds.includes(userId) return row.managerUserIds && row.managerUserIds.includes(userId)
} }
/* 排序 */ /** 处理模型的排序 **/
const handleSort = () => { const handleModelSort = () => {
// //
originalData.value = cloneDeep(props.categoryInfo.modelList) originalData.value = cloneDeep(props.categoryInfo.modelList)
isModelSorting.value = true isModelSorting.value = true
initSort() initSort()
} }
const saveSort = () => { /** 处理模型的排序提交 */
// TODO const handleModelSortSubmit = async () => {
//
const ids = tableData.value.map((item: any) => item.id)
await ModelApi.updateModelSortBatch(ids)
// //
emit('success')
isModelSorting.value = false isModelSorting.value = false
message.success('排序模型成功')
emit('success')
} }
const cancelSort = () => { /** 处理模型的排序取消 */
const handleModelSortCancel = () => {
// //
tableData.value = cloneDeep(originalData.value) tableData.value = cloneDeep(originalData.value)
isModelSorting.value = false isModelSorting.value = false

View File

@ -188,7 +188,7 @@ const handleCategorySortCancel = () => {
isCategorySorting.value = false isCategorySorting.value = false
} }
/** 保存排序 */ /** 分类排序的保存 */
const handleCategorySortSubmit = async () => { const handleCategorySortSubmit = async () => {
// //
const ids = categoryGroup.value.map((item: any) => item.id) const ids = categoryGroup.value.map((item: any) => item.id)