From 64fb2899c9fef20568a1e634d534520a072de211 Mon Sep 17 00:00:00 2001
From: LiuHao <liuhaoai545@gmail.com>
Date: 星期一, 15 四月 2024 10:22:44 +0800
Subject: [PATCH] fix 修复代码缩进,类型名称错误
---
src/api/workflow/definitionConfig/types.ts | 8 --
src/views/workflow/processDefinition/index.vue | 131 ++++++++++++++++++++++---------------------
src/api/workflow/definitionConfig/index.ts | 7 +-
3 files changed, 70 insertions(+), 76 deletions(-)
diff --git a/src/api/workflow/definitionConfig/index.ts b/src/api/workflow/definitionConfig/index.ts
index 99e95d0..d34bf05 100644
--- a/src/api/workflow/definitionConfig/index.ts
+++ b/src/api/workflow/definitionConfig/index.ts
@@ -2,10 +2,9 @@
import { AxiosPromise } from 'axios';
import { DefinitionConfigVO, DefinitionConfigForm } from '@/api/workflow/definitionConfig/types';
-
/**
* 鏌ヨ琛ㄥ崟閰嶇疆璇︾粏
- * @param id
+ * @param definitionId
*/
export const getByDefId = (definitionId: string | number): AxiosPromise<DefinitionConfigVO> => {
return request({
@@ -40,9 +39,9 @@
/**
* 鏌ヨ娴佺▼瀹氫箟閰嶇疆鎺掗櫎褰撳墠鏌ヨ鐨勬祦绋嬪畾涔�
* @param tableName
- * @param tableName
+ * @param definitionId
*/
-export const getByTableNameNotDefId = (tableName: string,definitionId: string ) => {
+export const getByTableNameNotDefId = (tableName: string, definitionId: string | number) => {
return request({
url: `/workflow/definitionConfig/getByTableNameNotDefId/${tableName}/${definitionId}`,
method: 'get'
diff --git a/src/api/workflow/definitionConfig/types.ts b/src/api/workflow/definitionConfig/types.ts
index e3c93d3..0849fc2 100644
--- a/src/api/workflow/definitionConfig/types.ts
+++ b/src/api/workflow/definitionConfig/types.ts
@@ -35,7 +35,6 @@
* 琛ㄥ崟绠$悊
*/
wfFormManageVo: FormManageVO;
-
}
export interface DefinitionConfigForm extends BaseEntity {
@@ -73,12 +72,9 @@
* 琛ㄥ崟绠$悊
*/
wfFormManageVo: FormManageVO;
-
-
}
export interface DefinitionConfigQuery extends PageQuery {
-
/**
* 琛ㄥ悕
*/
@@ -103,8 +99,4 @@
* 琛ㄥ崟绠$悊
*/
wfFormManageVo: FormManageVO;
-
}
-
-
-
diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue
index 52e15a8..14de958 100644
--- a/src/views/workflow/processDefinition/index.vue
+++ b/src/views/workflow/processDefinition/index.vue
@@ -38,23 +38,20 @@
</el-card>
</div>
</transition>
- <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
- <div v-show="showSearch" class="mb-[10px]">
- <el-card shadow="hover">
- <el-button type="danger" icon="Delete" :disabled="multiple" @click="handleDelete">鍒犻櫎</el-button>
- <el-button type="primary" icon="UploadFilled" @click="uploadDialog.visible = true">閮ㄧ讲娴佺▼鏂囦欢</el-button>
- </el-card>
- </div>
- </transition>
<el-card shadow="hover">
<template #header>
<el-row :gutter="10" class="mb8">
- <el-col :span="1.5"> </el-col>
+ <el-col :span="1.5">
+ <el-button type="danger" icon="Delete" :disabled="multiple" @click="handleDelete()">鍒犻櫎</el-button>
+ </el-col>
+ <el-col :span="1.5">
+ <el-button type="primary" icon="UploadFilled" @click="uploadDialog.visible = true">閮ㄧ讲娴佺▼鏂囦欢</el-button>
+ </el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
- <el-table border v-loading="loading" :data="processDefinitionList" @selection-change="handleSelectionChange">
+ <el-table v-loading="loading" border :data="processDefinitionList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" type="index" label="搴忓彿" width="60"></el-table-column>
<el-table-column align="center" prop="name" label="娴佺▼瀹氫箟鍚嶇О" :show-overflow-tooltip="true"></el-table-column>
@@ -80,10 +77,10 @@
</el-table-column>
<el-table-column align="center" prop="deploymentTime" label="閮ㄧ讲鏃堕棿" width="120" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" label="琛ㄥ悕/琛ㄥ崟KEY" width="120" :show-overflow-tooltip="true">
- <template #default="scope">
- <span v-if="scope.row.wfDefinitionConfigVo">
+ <template #default="scope">
+ <span v-if="scope.row.wfDefinitionConfigVo">
{{ scope.row.wfDefinitionConfigVo.tableName }}
- </span>
+ </span>
</template>
</el-table-column>
<el-table-column fixed="right" label="鎿嶄綔" align="center" width="220" class-name="small-padding fixed-width">
@@ -101,7 +98,9 @@
</el-button>
</el-col>
<el-col :span="1.5">
- <el-button type="text" size="small" icon="Document" @click="getProcessDefinitionHitoryList(scope.row.id, scope.row.key)">鍘嗗彶鐗堟湰</el-button>
+ <el-button link type="primary" size="small" icon="Document" @click="getProcessDefinitionHitoryList(scope.row.id, scope.row.key)">
+ 鍘嗗彶鐗堟湰
+ </el-button>
</el-col>
<el-col :span="1.5">
<el-button link type="primary" size="small" icon="Delete" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
@@ -112,7 +111,7 @@
<el-button link type="primary" size="small" icon="Sort" @click="handleConvertToModel(scope.row)"> 杞崲妯″瀷 </el-button>
</el-col>
<el-col :span="1.5">
- <el-button type="text" size="small" icon="Tickets" @click="handleDefinitionConfigOpen(scope.row)">缁戝畾涓氬姟</el-button>
+ <el-button link type="primary" size="small" icon="Tickets" @click="handleDefinitionConfigOpen(scope.row)">缁戝畾涓氬姟</el-button>
</el-col>
</el-row>
</template>
@@ -222,19 +221,25 @@
</el-dialog>
<!-- 琛ㄥ崟閰嶇疆 -->
- <el-dialog v-model="definitionConfigDialog.visible" :title="definitionConfigDialog.title" width="650px" append-to-body :close-on-click-modal="false">
+ <el-dialog
+ v-model="definitionConfigDialog.visible"
+ :title="definitionConfigDialog.title"
+ width="650px"
+ append-to-body
+ :close-on-click-modal="false"
+ >
<el-form :model="definitionConfigForm" label-width="auto">
<el-form-item label="娴佺▼KEY">
- <el-input v-model="definitionConfigForm.processKey" disabled/>
+ <el-input v-model="definitionConfigForm.processKey" disabled />
</el-form-item>
<el-form-item label="琛ㄥ悕" prop="formId">
- <el-input v-model="definitionConfigForm.tableName" placeholder="绀轰緥:test_leave"/>
+ <el-input v-model="definitionConfigForm.tableName" placeholder="绀轰緥:test_leave" />
</el-form-item>
<el-form-item label="澶囨敞">
- <el-input v-model="definitionConfigForm.remark" type="textarea" resize="none"/>
+ <el-input v-model="definitionConfigForm.remark" type="textarea" resize="none" />
</el-form-item>
</el-form>
-
+
<template #footer>
<div class="dialog-footer">
<el-button @click="definitionConfigDialog.visible = false">鍙栨秷</el-button>
@@ -256,12 +261,12 @@
deployProcessFile,
getListByKey
} from '@/api/workflow/processDefinition';
-import { getByTableNameNotDefId,getByDefId,saveOrUpdate } from '@/api/workflow/definitionConfig';
+import { getByTableNameNotDefId, getByDefId, saveOrUpdate } from '@/api/workflow/definitionConfig';
import ProcessPreview from './components/processPreview.vue';
import { listCategory } from '@/api/workflow/category';
import { CategoryVO } from '@/api/workflow/category/types';
import { ProcessDefinitionQuery, ProcessDefinitionVO } from '@/api/workflow/processDefinition/types';
-import { definitionConfigForm } from '@/api/workflow/definitionConfig/types';
+import { DefinitionConfigForm } from '@/api/workflow/definitionConfig/types';
import { UploadRequestOptions, ElMessage, ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -269,7 +274,7 @@
const previewRef = ref<InstanceType<typeof ProcessPreview>>();
const queryFormRef = ref<ElFormInstance>();
const categoryTreeRef = ref<ElTreeInstance>();
-const definitionConfigForm = ref<definitionConfigForm>({});
+const definitionConfigForm = ref<DefinitionConfigForm>();
type CategoryOption = {
categoryCode: string;
@@ -418,11 +423,11 @@
}
};
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
-const handleDelete = async (row: ProcessDefinitionVO) => {
- const id = row.id || ids.value;
- const deployIds = row.deploymentId || deploymentIds.value;
- const defKeys = row.key || keys.value;
- await proxy?.$modal.confirm('鏄惁纭鍒犻櫎娴佺▼瀹氫箟KEY涓恒��' + keys.value + '銆戠殑鏁版嵁椤癸紵');
+const handleDelete = async (row?: ProcessDefinitionVO) => {
+ const id = row?.id || ids.value;
+ const deployIds = row?.deploymentId || deploymentIds.value;
+ const defKeys = row?.key || keys.value;
+ await proxy?.$modal.confirm('鏄惁纭鍒犻櫎娴佺▼瀹氫箟KEY涓恒��' + defKeys + '銆戠殑鏁版嵁椤癸紵');
loading.value = true;
await deleteProcessDefinition(deployIds, id).finally(() => (loading.value = false));
await getList();
@@ -480,46 +485,44 @@
};
//鎵撳紑娴佺▼瀹氫箟閰嶇疆
const handleDefinitionConfigOpen = async (row: ProcessDefinitionVO) => {
- definitionConfigDialog.visible = true
- definitionConfigForm.value.processKey = row.key
- definitionConfigForm.value.definitionId = row.id
- definitionConfigForm.value.version = row.version
- const resp = await getByDefId(row.id)
- if(resp.data){
- definitionConfigForm.value = resp.data
- }else{
- definitionConfigForm.value.tableName = undefined
- definitionConfigForm.value.remark = undefined
- }
-}
+ definitionConfigDialog.visible = true;
+ definitionConfigForm.value.processKey = row.key;
+ definitionConfigForm.value.definitionId = row.id;
+ definitionConfigForm.value.version = row.version;
+ const resp = await getByDefId(row.id);
+ if (resp.data) {
+ definitionConfigForm.value = resp.data;
+ } else {
+ definitionConfigForm.value.tableName = undefined;
+ definitionConfigForm.value.remark = undefined;
+ }
+};
//淇濆瓨琛ㄥ崟
const handlerSaveForm = async () => {
- getByTableNameNotDefId(definitionConfigForm.value.tableName,definitionConfigForm.value.definitionId).then(res => {
- if(res.data && res.data.length > 0){
- ElMessageBox.confirm('琛ㄥ悕宸茶銆�'+res.data[0].processKey+'銆戠増鏈瑅'+res.data[0].version+'.0缁戝畾纭鍚庡皢浼氬垹闄ょ粦瀹氱殑娴佺▼KEY!','鎻愮ず',{
- confirmButtonText: '纭',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- }
- ).then(() => {
- saveOrUpdate(definitionConfigForm.value).then(resp=>{
- if(resp.code === 200){
- proxy?.$modal.msgSuccess('鎿嶄綔鎴愬姛');
- definitionConfigDialog.visible = false
- getList();
- }
- })
- })
- }else{
- saveOrUpdate(definitionConfigForm.value).then(resp=>{
- if(resp.code === 200){
+ getByTableNameNotDefId(definitionConfigForm.value.tableName, definitionConfigForm.value.definitionId).then((res) => {
+ if (res.data && res.data.length > 0) {
+ ElMessageBox.confirm('琛ㄥ悕宸茶銆�' + res.data[0].processKey + '銆戠増鏈瑅' + res.data[0].version + '.0缁戝畾纭鍚庡皢浼氬垹闄ょ粦瀹氱殑娴佺▼KEY!', '鎻愮ず', {
+ confirmButtonText: '纭',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ saveOrUpdate(definitionConfigForm.value).then((resp) => {
+ if (resp.code === 200) {
+ proxy?.$modal.msgSuccess('鎿嶄綔鎴愬姛');
+ definitionConfigDialog.visible = false;
+ getList();
+ }
+ });
+ });
+ } else {
+ saveOrUpdate(definitionConfigForm.value).then((resp) => {
+ if (resp.code === 200) {
proxy?.$modal.msgSuccess('鎿嶄綔鎴愬姛');
- definitionConfigDialog.visible = false
+ definitionConfigDialog.visible = false;
getList();
}
- })
+ });
}
- })
-
-}
+ });
+};
</script>
--
Gitblit v1.9.3