Kaynağa Gözat

feat: 调整流程组样式 100%

luoyali 1 yıl önce
ebeveyn
işleme
a6465446a7

+ 76 - 0
src/api/flow/definition.ts

@@ -0,0 +1,76 @@
+import request from '@/utils/request'
+import { AxiosPromise } from 'axios'
+
+// apiUrl 流程定义(实例)
+const api = {
+	listCategory: '/v1/process/list-category', // 获取所有分类流程定义列表
+	updateStateId: '/v1/process/update-state', // 根据流程定义ID更新流程状态
+	updateSortId: '/v1/process/update-sort', // 根据流程定义ID更新排序
+	delete: '/v1/process/delete', // 根据流程定义ID删除流程定义相关信息
+	create: '/v1/process/create', // 创建添加
+	get: '/v1/process/get', // 查询Id信息
+	clone: '/v1/process/clone' // 查询 id 克隆流程定义信息
+}
+
+function flowDefinitionListCategoryApi(data: any): AxiosPromise {
+	return request({
+		url: api.listCategory,
+		method: 'post',
+		data
+	})
+}
+
+function flowDefinitionUpdateStateIdApi(data: any): AxiosPromise {
+	return request({
+		url: `${api.updateStateId}-${data.id}`,
+		method: 'post'
+	})
+}
+
+function flowDefinitionUpdateSortIdApi(data: any): AxiosPromise {
+	return request({
+		url: `${api.updateStateId}-${data.id}`,
+		method: 'post'
+	})
+}
+function flowDefinitionDeleteApi(data: any): AxiosPromise {
+	return request({
+		url: api.delete,
+		method: 'post',
+		data
+	})
+}
+
+function flowDefinitionCreateApi(data: any): AxiosPromise {
+	return request({
+		url: api.create,
+		method: 'post',
+		data
+	})
+}
+
+function flowDefinitionGetApi(data: any): AxiosPromise {
+	return request({
+		url: api.get,
+		method: 'post',
+		data
+	})
+}
+
+function flowDefinitionCloneApi(data: any): AxiosPromise {
+	return request({
+		url: api.get,
+		method: 'post',
+		data
+	})
+}
+
+export default {
+	flowDefinitionListCategoryApi,
+	flowDefinitionUpdateStateIdApi,
+	flowDefinitionUpdateSortIdApi,
+	flowDefinitionDeleteApi,
+	flowDefinitionCreateApi,
+	flowDefinitionGetApi,
+	flowDefinitionCloneApi
+}

+ 4 - 4
src/api/system/flowGroup.ts → src/api/flow/group.ts

@@ -3,10 +3,10 @@ import { AxiosPromise } from 'axios'
 
 // apiUrl 流程分组
 const api = {
-	listAll: '/v1/flw/category/list-all',
-	create: '/v1/flw/category/create',
-	update: '/v1/flw/category/update',
-	delete: '/v1/flw/category/delete'
+	listAll: '/v1/process-category/list-all',
+	create: '/v1/process-category/create',
+	update: '/v1/process-category/update',
+	delete: '/v1/process-category/delete'
 }
 /**
  * 流程分组 - 列表

+ 7 - 28
src/views/flow/group/components/listGroup.vue

@@ -9,12 +9,12 @@
 				</div>
 			</div>
 		</div>
-		<div v-for="(item, idx) in myArray" :key="item" class="group_list">
+		<div v-for="(item, idx) in myArray" :key="item.categoryId" class="group_list">
 			<div class="group_header flex flex-pack-justify flex-align-center">
 				<div class="group_header_title">
 					<span>
 						<template v-if="!item.editor">
-							{{ item.name }}
+							{{ item.categoryName }}
 						</template>
 						<template v-else>
 							<el-input v-model="item.name" placeholder="请输入流程组名称" v-autoFocus @blur="editFlowGroup('save', item, idx)" />
@@ -86,31 +86,9 @@
 import Draggable from 'vuedraggable'
 import { Delete, CircleClose, EditPen, CopyDocument } from '@element-plus/icons-vue'
 import { nextTick, onMounted, ref } from 'vue'
-import flowGroup from '@/api/system/flowGroup'
-const myArray = ref([
-	{
-		name: '考勤',
-		id: 1,
-		children: [
-			{ name: '采购申请', title: '各类办公、活动用品采购', seeable: '全员可见', id: 123 },
-			{ name: '采购申请1', title: '各类办公、活动用品采购', seeable: '全员可见', id: 1232 }
-		],
-		editor: false,
-		sort: 0
-	},
-	{
-		name: '人事',
-		id: 2,
-		children: [
-			{ name: '采购申请', title: '各类办公、活动用品采购', seeable: '全员可见', id: 123 },
-			{ name: '采购申请1', title: '各类办公、活动用品采购', seeable: '全员可见', id: 1232 }
-		],
-		editor: false,
-		sort: 1
-	},
-	{ name: '财务', id: 3, editor: false, sort: 2 },
-	{ name: '行政', id: 4, editor: false, sort: 3 }
-])
+import flowGroup from '@/api/flow/group'
+import flowDefinition from '@/api/flow/definition'
+const myArray = ref([])
 const hideAddInput = ref(true)
 
 const listGroupName = ref('')
@@ -142,7 +120,8 @@ const addFlowGroup = async () => {
 // 流程组列表
 const flowGroupListAll = () => {
 	try {
-		const data = flowGroup.flowGroupListAllApi({})
+		const data = flowDefinition.flowDefinitionListCategoryApi({})
+		myArray.value = data || []
 		console.log(data)
 	} catch (e) {
 		console.log(e)

+ 1 - 1
src/views/flow/group/components/sortGroup.vue

@@ -22,7 +22,7 @@ import Draggable from 'vuedraggable'
 import { Delete } from '@element-plus/icons-vue'
 import { ref } from 'vue'
 import { ElMessageBox } from 'element-plus'
-import flowGroup from '@/api/system/flowGroup'
+import flowGroup from '@/api/flow/group'
 const dragging = ref(false)
 const myArray = ref([
 	{ name: '考勤', id: 1 },