feat: 前端对接工作流模块

This commit is contained in:
lbw 2023-03-03 00:43:16 +08:00 committed by 32189
parent 975adaf104
commit c011886140
25 changed files with 1384 additions and 3 deletions

46
src/api/oa/leave-bill.ts Normal file
View File

@ -0,0 +1,46 @@
import request from '/@/utils/request';
export function fetchList(query) {
return request({
url: '/admin/leave-bill/page',
method: 'get',
params: query
})
}
export function addObj(obj) {
return request({
url: '/admin/leave-bill',
method: 'post',
data: obj
})
}
export function getObj(id) {
return request({
url: '/admin/leave-bill/' + id,
method: 'get'
})
}
export function submit(id) {
return request({
url: '/admin/leave-bill/submit/' + id,
method: 'get'
})
}
export function delObj(id) {
return request({
url: '/admin/leave-bill/' + id,
method: 'delete'
})
}
export function putObj(obj) {
return request({
url: '/admin/leave-bill/',
method: 'put',
data: obj
})
}

46
src/api/oa/model.ts Normal file
View File

@ -0,0 +1,46 @@
import request from '/@/utils/request';
export function fetchList(query) {
return request({
url: '/admin/model',
method: 'get',
params: query
})
}
export function delObj(id) {
return request({
url: '/admin/model/' + id,
method: 'delete'
})
}
export function deploy(id) {
return request({
url: '/admin/model/deploy/' + id,
method: 'post'
})
}
export function addObj(obj) {
return request({
url: '/admin/model/insert',
method: 'post',
data: obj
})
}
export function getObj(id) {
return request({
url: '/admin/log/' + id,
method: 'get'
})
}
export function putObj(obj) {
return request({
url: '/admin/log/',
method: 'put',
data: obj
})
}

23
src/api/oa/process.ts Normal file
View File

@ -0,0 +1,23 @@
import request from '/@/utils/request';
export function fetchList(query) {
return request({
url: '/admin/process',
method: 'get',
params: query
})
}
export function delObj(id) {
return request({
url: '/admin/process/' + id,
method: 'delete'
})
}
export function status(id, type) {
return request({
url: '/admin/process/status/' + id + '/' + type,
method: 'put'
})
}

31
src/api/oa/task.ts Normal file
View File

@ -0,0 +1,31 @@
import request from '/@/utils/request';
export function fetchList(query) {
return request({
url: '/admin/task/todo',
method: 'get',
params: query
})
}
export function fetchDetail(id) {
return request({
url: '/admin/task/' + id,
method: 'get'
})
}
export function fetchComment(id) {
return request({
url: '/admin/task/comment/' + id,
method: 'get'
})
}
export function doTask(obj) {
return request({
url: '/admin/task',
method: 'post',
data: obj
})
}

View File

@ -13,6 +13,7 @@ export default {
resetBtn: 'reset',
action:'action',
optSuccessText: 'operation success',
optConfirmText: 'Confirm this operation ',
editSuccessText: 'edit success',
addSuccessText: 'add success',
delSuccessText: 'delete success',

View File

@ -16,6 +16,7 @@ export default {
addSuccessText: '添加成功',
delSuccessText: '删除成功',
delConfirmText: '此操作将永久删除',
optConfirmText: '是否确认本操作',
confirmButtonText: '确认',
cancelButtonText: '取消',
download: '下载'

View File

@ -37,7 +37,9 @@ export const Local = {
export const Session = {
// 设置临时缓存
set(key: string, val: any) {
if (key === 'token' || key === 'refresh_token') return Cookies.set(key, val);
if (key === 'token' || key === 'refresh_token') {
Cookies.set(key, val)
}
window.sessionStorage.setItem(key, JSON.stringify(val));
},
// 获取临时缓存

View File

@ -0,0 +1,144 @@
<template>
<el-dialog :title="form.leaveId ? $t('common.editBtn') : $t('common.addBtn')" v-model="visible"
:close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.username')" prop="username">
<el-input v-model="form.username" :placeholder="t('leave.inputUsernameTip')" disabled />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.days')" prop="days">
<el-input-number :min="1" :max="1000" v-model="form.days"
:placeholder="t('leave.inputDaysTip')"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.leaveTime')" prop="leaveTime">
<el-date-picker type="datetime" :placeholder="t('leave.inputLeaveTimeTip')" v-model="form.leaveTime"
:value-format="dateTimeStr"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.content')" prop="content">
<editor v-model:get-html="form.content" :placeholder="t('leave.inputContentTip')" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
<el-button type="primary" @click="onSubmit">{{ $t('common.confirmButtonText') }}</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="OaLeaveBillDialog">
import { useMessage } from "/@/hooks/message";
import { getObj, addObj, putObj } from '../../../api/oa/leave-bill'
import { useI18n } from "vue-i18n"
import { useUserInfo } from "/@/stores/userInfo";
const emit = defineEmits(['refresh']);
const { t } = useI18n();
//
const dataFormRef = ref();
const visible = ref(false)
const loading = ref(false)
//
const form = reactive({
leaveId: '',
username: '',
days: 0,
content: '',
leaveTime: '',
});
//
const dataRules = ref({
username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
days: [{ required: true, message: '请假天数不能为空', trigger: 'blur' }],
content: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
leaveTime: [{ required: true, message: '时间不能为空', trigger: 'blur' }],
})
//
const openDialog = (id: string) => {
visible.value = true
form.leaveId = ''
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
// oaLeaveBill
if (id) {
form.leaveId = id
getoaLeaveBillData(id)
} else {
form.username = useUserInfo().userInfos.user.username
}
};
//
const onSubmit = () => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false
}
//
if (form.leaveId) {
loading.value = true
putObj(form).then(() => {
useMessage().success(t('common.editSuccessText'))
visible.value = false //
emit('refresh')
}).catch((err: any) => {
useMessage().error(err.msg)
}).finally(() => {
loading.value = false
})
} else {
loading.value = true
addObj(form).then(() => {
useMessage().success(t('common.addSuccessText'))
visible.value = false //
emit('refresh')
}).catch((err: any) => {
useMessage().error(err.msg)
}).finally(() => {
loading.value = false
})
}
})
}
//
const getoaLeaveBillData = (id: string) => {
//
loading.value = true
getObj(id).then((res: any) => {
Object.assign(form, res.data)
}).finally(() => {
loading.value = false
})
};
//
defineExpose({
openDialog
});
</script>

View File

@ -0,0 +1,26 @@
export default {
leave: {
index: 'index',
importoaLeaveBillTip: 'import OaLeaveBill',
leaveId: 'leaveId',
username: 'username',
days: 'days',
content: 'content',
state: 'state',
leaveTime: 'leaveTime',
createTime: 'createTime',
updateTime: 'updateTime',
delFlag: 'delFlag',
tenantId: 'tenantId',
inputLeaveIdTip: 'input leaveId',
inputUsernameTip: 'input username',
inputDaysTip: 'input days',
inputContentTip: 'input content',
inputStateTip: 'input state',
inputLeaveTimeTip: 'input leaveTime',
inputCreateTimeTip: 'input createTime',
inputUpdateTimeTip: 'input updateTime',
inputDelFlagTip: 'input delFlag',
inputTenantIdTip: 'input tenantId',
}
}

View File

@ -0,0 +1,26 @@
export default {
leave: {
index: '序号',
importoaLeaveBillTip: '导入请假表',
leaveId: '主键',
username: '用户名',
days: '请假天数',
content: '备注',
state: '状态',
leaveTime: '请假时间',
createTime: '创建时间',
updateTime: '更新时间',
delFlag: '删除标识',
tenantId: '所属租户',
inputLeaveIdTip: '请输入主键',
inputUsernameTip: '请输入用户名',
inputDaysTip: '请输入请假天数',
inputContentTip: '请输入备注',
inputStateTip: '请输入状态',
inputLeaveTimeTip: '请输入请假时间',
inputCreateTimeTip: '请输入创建时间',
inputUpdateTimeTip: '请输入更新时间',
inputDelFlagTip: '请输入删除标识',
inputTenantIdTip: '请输入所属租户',
}
}

View File

@ -0,0 +1,154 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('leave.username')" prop="username">
<el-input :placeholder="t('leave.inputUsernameTip')" v-model="state.queryForm.username"
style="max-width: 180px" />
</el-form-item>
<el-form-item :label="t('leave.state')" prop="state" class="ml2">
<el-select v-model="state.queryForm.state" :placeholder="t('leave.inputStateTip')">
<el-option :label="item.label" :value="item.value" v-for="(item, index) in leave_status"
:key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
<el-button formDialogRef icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="Refresh" formDialogRef @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button formDialogRef icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()">
{{ $t('common.addBtn') }}
</el-button>
<el-button formDialogRef icon="Download" type="primary" class="ml10" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button formDialogRef :disabled="multiple" icon="Delete" type="primary" class="ml10"
@click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="60" align="center" />
<el-table-column type="index" :label="t('leave.index')" width="80" />
<el-table-column prop="leaveId" :label="t('leave.leaveId')" show-overflow-tooltip />
<el-table-column prop="username" :label="t('leave.username')" show-overflow-tooltip />
<el-table-column prop="days" :label="t('leave.days')" show-overflow-tooltip />
<el-table-column prop="state" :label="t('leave.state')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="leave_status" :value="scope.row.state"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="leaveTime" :label="t('leave.leaveTime')" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button text type="primary" @click="handleSubmit(scope.row)" v-if="scope.row.state === '0'">提交</el-button>
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row.leaveId)">{{ $t('common.editBtn')
}}</el-button>
<el-button text type="primary" @click="handleDelete([scope.row.leaveId])">{{
$t('common.delBtn')
}}</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
</div>
</template>
<script setup lang="ts" name="systemOaLeaveBill">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj, submit } from "/@/api/oa/leave-bill";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from '/@/hooks/dict';
import { useI18n } from "vue-i18n";
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n()
//
const { leave_status } = useDict('leave_status')
//
const formDialogRef = ref()
//
const queryRef = ref()
const showSearch = ref(true)
//
const selectObjs = ref([]) as any
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
})
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
//
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
// excel
const exportExcel = () => {
downBlobFile('/admin/leave/export', state.queryForm, 'leave.xlsx')
}
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.leaveId)
});
multiple.value = !objs.length
}
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
const handleSubmit = (row) => {
useMessageBox().confirm(t('common.optConfirmText'))
.then(() => {
submit(row.leaveId).then(() => {
getDataList(false);
useMessage().success(t('common.optSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
}
</script>

View File

@ -0,0 +1,37 @@
<template>
<div class="layout-padding">
<el-scrollbar class="main">
<iframe :src="src" class="iframe" />
</el-scrollbar>
</div>
</template>
<script lang="ts" name="modelView" setup>
const route = useRoute();
const src = ref('')
watch([route], () => {
init()
})
onMounted(() => {
init()
})
const init = () => {
src.value = "/admin/modeler.html?modelId=" + route.query.id
}
</script>
<style lang="scss" scoped>
.iframe {
width: 100%;
height: 80vh;
border: 0;
overflow: hidden;
box-sizing: border-box;
}
</style>

105
src/views/oa/model/form.vue Normal file
View File

@ -0,0 +1,105 @@
<template>
<el-dialog :title="form.id ? $t('common.editBtn') : $t('common.addBtn')" v-model="visible" :close-on-click-modal="false"
draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px">
<el-row :gutter="35">
<el-col :span="24" class="mb20">
<el-form-item :label="$t('model.name')" prop="name">
<el-input v-model="form.name" :placeholder="$t('model.inputNameTip')" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="$t('model.key')" prop="key">
<el-input v-model="form.key" :placeholder="$t('model.inputKeyTip')" clearable />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="$t('model.category')" prop="category">
<el-input v-model="form.category" :placeholder="$t('model.inputCategoryTip')" clearable />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
<el-button type="primary" @click="onSubmit">{{ $t('common.confirmButtonText') }}</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="systemRoleDialog">
import { useMessage } from "/@/hooks/message"
import { addObj } from "/@/api/oa/model";
import { useI18n } from "vue-i18n"
const emit = defineEmits(['refresh']);
const { t } = useI18n();
//
const dataFormRef = ref();
const visible = ref(false)
//
const form = reactive({
id: '',
key: '',
name: '',
category: ''
});
//
const dataRules = ref(
{
key: [
{ required: true, message: '模型表示不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '模型名称不能为空', trigger: 'blur' }
],
category: [
{ required: true, message: '模型分类不能为空', trigger: 'blur' }
]
}
)
//
const openDialog = (id: string) => {
visible.value = true
form.id = ''
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
if (id) {
form.id = id
}
};
//
const onSubmit = () => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false
}
addObj(form).then(() => {
useMessage().success(t('common.addSuccessText'))
visible.value = false //
emit('refresh')
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
//
defineExpose({
openDialog,
});
</script>

View File

@ -0,0 +1,16 @@
export default {
model: {
index: 'index',
id: 'id',
name: 'name',
key: 'key',
category: 'category',
version: 'version',
createTime: 'createTime',
lastUpdateTime: 'lastUpdateTime',
inputNameTip: 'input model name',
inputModelTip: 'input model name',
inputCategoryTip: 'input category tip',
inputKeyTip: 'input key',
}
}

View File

@ -0,0 +1,16 @@
export default {
model: {
index: '序号',
id: '模型ID',
name: '模型名称',
key: '模型标识',
category: '模型分类',
version: '版本',
createTime: '创建时间',
lastUpdateTime: '更新时间',
inputNameTip: '请输入模型名称',
inputModelTip: '请输入模型名称',
inputCategoryTip: '请输入模型分类',
inputKeyTip: '请输入模型标识',
}
}

View File

@ -0,0 +1,142 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<el-row class="mb8" shadow="hover" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('model.category')" prop="category">
<el-input :placeholder="$t('model.inputCategoryTip')" style="max-width: 180px"
v-model="state.queryForm.category" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'app_approle_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary" v-auth="'app_approle_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%"
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="$t('model.index')" type="index" width="80" />
<el-table-column :label="$t('model.name')" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.key')" prop="key" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.category')" prop="category" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.version')" prop="version" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.createTime')" prop="createTime" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.lastUpdateTime')" prop="lastUpdateTime"
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button @click="handleView(scope.row.id)" text type="primary" v-auth="'app_approle_edit'">模型图
</el-button>
<el-button @click="handleDeploy(scope.row.id)" text type="primary" v-auth="'app_approle_edit'">部署
</el-button>
<el-button @click="handleDelete([scope.row.roleId])" text type="primary"
v-auth="'app_approle_del'">{{
$t('common.delBtn')
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</el-card>
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="model" setup>
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, deploy, fetchList } from "/@/api/oa/model";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n()
const router = useRouter()
//
const formDialogRef = ref()
const queryRef = ref()
const showSearch = ref(true)
// rows
const selectObjs = ref([]) as any
//
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
category: ''
},
pageList: fetchList // H
});
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.roleId)
});
multiple.value = !objs.length
}
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids).then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
const handleDeploy = (id: string) => {
deploy(id).then(() => {
useMessage().success(t('common.optSuccessText'));
})
}
const handleView = (id: string) => {
router.push({
path: "/oa/model/detail",
query: { id: id },
});
}
</script>

View File

@ -0,0 +1,17 @@
export default {
process: {
index: 'index',
id: 'id',
name: 'name',
key: 'key',
category: 'category',
version: 'version',
status: 'status',
createTime: 'createTime',
lastUpdateTime: 'lastUpdateTime',
inputNameTip: 'input model name',
inputModelTip: 'input model name',
inputCategoryTip: 'input category tip',
inputKeyTip: 'input key',
}
}

View File

@ -0,0 +1,16 @@
export default {
process: {
index: '序号',
processonDefinitionId: '模型ID',
name: '模型名称',
key: '模型标识',
category: '模型分类',
revision: '版本',
status: '状态',
deploymentTime: '部署时间',
inputNameTip: '请输入模型名称',
inputModelTip: '请输入模型名称',
inputCategoryTip: '请输入模型分类',
inputKeyTip: '请输入模型标识',
}
}

View File

@ -0,0 +1,157 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<el-row class="mb8" shadow="hover" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('process.category')" prop="category">
<el-input :placeholder="$t('process.inputCategoryTip')" style="max-width: 180px"
v-model="state.queryForm.category" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary" v-auth="'app_approle_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%"
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="$t('process.index')" type="index" width="80" />
<el-table-column :label="$t('process.processonDefinitionId')" prop="processonDefinitionId"
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('process.name')" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('process.key')" prop="key" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('process.category')" prop="category" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('process.revision')" prop="revision" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('process.status')" prop="suspend" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.suspend"><el-tag type="danger">挂起</el-tag></span>
<span v-else><el-tag>有效</el-tag></span>
</template>
</el-table-column>
<el-table-column :label="$t('process.deploymentTime')" prop="deploymentTime" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseTime(scope.row.deploymentTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button @click="handleView(scope.row)" text type="primary">流程图
</el-button>
<el-button @click="handleStatus(scope.row, 'suspend')" text type="primary"
v-if="!scope.row.suspend">失效
</el-button>
<el-button @click="handleStatus(scope.row, 'active')" text type="primary"
v-if="scope.row.suspend">激活
</el-button>
<el-button @click="handleDelete([scope.row.roleId])" text type="primary">{{
$t('common.delBtn')
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</el-card>
<el-dialog v-model="showPicDialog" title="流程图">
<img :src="actPicUrl" style="width: 100%;">
</el-dialog>
</div>
</template>
<script lang="ts" name="model" setup>
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, fetchList, status } from "/@/api/oa/process";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
import { parseTime } from "/@/utils/formatTime";
//
const { t } = useI18n()
//
const showPicDialog = ref(false)
const queryRef = ref()
const showSearch = ref(true)
// rows
const selectObjs = ref([]) as any
//
const multiple = ref(true)
// URL
const actPicUrl = ref('')
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
category: ''
},
pageList: fetchList // H
});
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.roleId)
});
multiple.value = !objs.length
}
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids).then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
//
const handleView = (row: any) => {
actPicUrl.value = `/admin/process/resource/${row.deploymentId}/${row.processonDefinitionId}/image`
showPicDialog.value = true
}
//
const handleStatus = (row, type) => {
useMessageBox().confirm('是否将此流程设置为 ' + type)
.then(() => {
status(row.processonDefinitionId, type).then(() => {
getDataList();
useMessage().success(t('common.optSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
}
</script>

View File

@ -0,0 +1,74 @@
<template>
<div class="layout-padding">
<el-dialog title="批注列表" v-model="visible" :close-on-click-modal="false" draggable>
<el-card class="layout-padding-auto">
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="60" align="center" />
<el-table-column type="index" :label="t('comment.index')" width="80" />
<el-table-column prop="userId" :label="t('comment.userId')" show-overflow-tooltip />
<el-table-column prop="fullMessage" :label="t('comment.fullMessage')" show-overflow-tooltip>
<template #default="scope">
<span v-html="scope.row.fullMessage"></span>
</template>
</el-table-column>
<el-table-column prop="time" :label="t('comment.time')" show-overflow-tooltip />
</el-table>
</el-card>
</el-dialog>
</div>
</template>
<script setup lang="ts" name="systemTask">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchComment } from "/@/api/oa/task";
import { useI18n } from "vue-i18n";
//
const { t } = useI18n()
//
const visible = ref(false)
const taskId = ref('')
//
const selectObjs = ref([]) as any
const multiple = ref(true)
//
const pageList = () => {
return fetchComment(taskId.value)
}
const state: BasicTableProps = reactive<BasicTableProps>({
isPage: false,
queryForm: {},
pageList: pageList
})
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
} = useTable(state)
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.leaveId)
});
multiple.value = !objs.length
}
//
const openDialog = (id: string) => {
visible.value = true
taskId.value = id
getDataList()
};
//
defineExpose({
openDialog
});
</script>

136
src/views/oa/task/form.vue Normal file
View File

@ -0,0 +1,136 @@
<template>
<el-dialog :title="form.taskId ? $t('common.editBtn') : $t('common.addBtn')" v-model="visible"
:close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.username')" prop="username">
<el-input v-model="form.username" :placeholder="t('leave.inputUsernameTip')" disabled />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.days')" prop="days">
<el-input-number :min="1" :max="1000" v-model="form.days" :placeholder="t('leave.inputDaysTip')"
disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.leaveTime')" prop="leaveTime">
<el-date-picker type="datetime" :placeholder="t('leave.inputLeaveTimeTip')" v-model="form.leaveTime"
:value-format="dateTimeStr" disabled></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="t('task.content')" prop="content">
<div v-html="form.content"></div>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="t('task.comment')" prop="comment">
<editor v-model:get-html="form.comment" :placeholder="t('task.inputCommentTip')" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" v-for="flag in form.flagList" :key="flag"
@click="handleTask(flag)">{{ flag }}
</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="OaLeaveBillDialog">
import { useMessage } from "/@/hooks/message";
import { doTask, fetchDetail } from '/@/api/oa/task'
import { useI18n } from "vue-i18n"
import { useUserInfo } from "/@/stores/userInfo";
const emit = defineEmits(['refresh']);
const { t } = useI18n();
//
const dataFormRef = ref();
const visible = ref(false)
const loading = ref(false)
//
const form = reactive({
taskId: '',
taskName: '',
username: '',
comment: '',
days: 0,
content: '',
createTime: '',
time: '',
flagList: [],
taskFlag: '',
});
//
const dataRules = ref({
comment: [{ required: true, message: '批注不能为空', trigger: 'blur' }]
})
//
const openDialog = (id: string) => {
visible.value = true
form.taskId = ''
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
// oaLeaveBill
if (id) {
form.taskId = id
getTaskById(id)
} else {
form.username = useUserInfo().userInfos.user.username
}
};
//
const handleTask = (result) => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false
}
loading.value = true
form.taskFlag = result
doTask(form).then(() => {
useMessage().success(t('common.optSuccessText'))
visible.value = false
emit('refresh')
})
})
}
//
const getTaskById = (id: string) => {
//
loading.value = true
fetchDetail(id).then((res: any) => {
Object.assign(form, res.data)
form.comment = res.data.comment ? res.data.comment : ''
}).catch((err) => {
useMessage().error('操作失败')
}).finally(() => {
loading.value = false
})
};
//
defineExpose({
openDialog
});
</script>

View File

@ -0,0 +1,18 @@
export default {
task: {
index: 'index',
taskId: 'taskId',
taskName: 'taskName',
time: 'time',
comment: 'comment',
content: 'content',
inputTaskNameTip: 'input Task Name',
inputCommentTip: 'input comment'
},
comment: {
index: 'index',
userId: 'userId',
fullMessage: 'fullMessage',
time: 'time'
}
}

View File

@ -0,0 +1,18 @@
export default {
task: {
index: '序号',
taskId: 'ID',
taskName: '任务名称',
time: '提交时间',
comment: '批注',
content: '事由',
inputTaskNameTip: '请输入任务名称',
inputCommentTip: '请输入批注名称'
},
comment: {
index: '序号',
userId: '用户',
fullMessage: '批注',
time: '时间'
}
}

131
src/views/oa/task/index.vue Normal file
View File

@ -0,0 +1,131 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('task.taskName')" prop="taskName">
<el-input :placeholder="t('task.inputTaskNameTip')" v-model="state.queryForm.taskName"
style="max-width: 180px" />
</el-form-item>
<el-form-item class="ml2">
<el-button formDialogRef icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="Refresh" formDialogRef @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button formDialogRef icon="Download" type="primary" class="ml10" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button formDialogRef :disabled="multiple" icon="Delete" type="primary" class="ml10"
@click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="60" align="center" />
<el-table-column type="index" :label="t('task.index')" width="80" />
<el-table-column prop="taskId" :label="t('task.taskId')" show-overflow-tooltip />
<el-table-column prop="taskName" :label="t('task.taskName')" show-overflow-tooltip />
<el-table-column prop="time" :label="t('task.time')" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button text type="primary" @click="handleView(scope.row)">流程图
</el-button>
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row.taskId)">审批
</el-button>
<el-button text type="primary" @click="commentDialogRef.openDialog(scope.row.taskId)">批注
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<comment-dialog ref="commentDialogRef" @refresh="getDataList(false)" />
<el-dialog v-model="showPicDialog" title="流程图">
<img :src="actPicUrl" style="width: 100%;">
</el-dialog>
</div>
</template>
<script setup lang="ts" name="systemTask">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList } from "/@/api/oa/task";
import { useI18n } from "vue-i18n";
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const CommentDialog = defineAsyncComponent(() => import('./comment.vue'));
const { t } = useI18n()
//
const formDialogRef = ref()
const commentDialogRef = ref()
//
const queryRef = ref()
const showSearch = ref(true)
//
const selectObjs = ref([]) as any
const multiple = ref(true)
// URL
const actPicUrl = ref('')
//
const showPicDialog = ref(false)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
})
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
//
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
// excel
const exportExcel = () => {
downBlobFile('/admin/task/export', state.queryForm, 'task.xlsx')
}
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.leaveId)
});
multiple.value = !objs.length
}
//
const handleDelete = (ids: string[]) => {
};
//
const handleView = (row: any) => {
actPicUrl.value = `/admin/task/view/${row.taskId}`
showPicDialog.value = true
}
</script>

View File

@ -186,8 +186,6 @@ const passwordRuleForm = reactive({
})
//
const handleAvatarSuccess = (url: any) => {
formData.avatar = url;