|
@@ -6,7 +6,12 @@ import { ColumnConfigType } from '@/components/ATable/type'
|
|
|
import { StrAnyObj, StrAnyObjArr } from '@/typings'
|
|
|
import { useHandleData } from '@/utils/useHandleData'
|
|
|
import { getPageApi, getDetailApi, addApi, editApi, deleteApi } from '@/api/system/config'
|
|
|
-import { getToDoPageApi } from '@/api/flow/execute'
|
|
|
+import { getDoneListApi, getToDoPageApi } from '@/api/flow/execute'
|
|
|
+import { getChartApi } from '@/api/flow/definition'
|
|
|
+import { Comment } from '@element-plus/icons-vue'
|
|
|
+import { nextTick } from 'vue'
|
|
|
+
|
|
|
+const modules = import.meta.glob('@/views/**/*.vue')
|
|
|
|
|
|
const queryRef = ref<InstanceType<typeof AForm>>()
|
|
|
const formRef = ref<InstanceType<typeof AForm>>()
|
|
@@ -21,6 +26,17 @@ const formData = ref<StrAnyObj>({})
|
|
|
const dialogTitle = ref<string>('')
|
|
|
const dialogVisible = ref<boolean>(false)
|
|
|
|
|
|
+const chartVisible = ref(false)
|
|
|
+const imgUrl = ref('')
|
|
|
+
|
|
|
+const doneListVisible = ref(false)
|
|
|
+const doneList = ref([])
|
|
|
+
|
|
|
+const handleVisible = ref(false)
|
|
|
+const handleComponent = ref(null)
|
|
|
+const businessId = ref(null)
|
|
|
+const handleDisabled = ref(true)
|
|
|
+
|
|
|
const queryConfig: FormConfigType[] = [
|
|
|
{
|
|
|
type: 'input',
|
|
@@ -106,24 +122,38 @@ const columnConfig: ColumnConfigType[] = [
|
|
|
{
|
|
|
width: 200,
|
|
|
handleConfig: [
|
|
|
- // {
|
|
|
- // common: 'update',
|
|
|
- // permissions: 'sysConfig:edit',
|
|
|
- // click(row) {
|
|
|
- // dialogVisible.value = true
|
|
|
- // dialogTitle.value = '编辑'
|
|
|
- // getDetailApi({ id: row.id }).then((resp: StrAnyObj) => {
|
|
|
- // formData.value = resp
|
|
|
- // })
|
|
|
- // }
|
|
|
- // },
|
|
|
- // {
|
|
|
- // common: 'delete',
|
|
|
- // permissions: 'sysConfig:delete',
|
|
|
- // click(row) {
|
|
|
- // handleRemove([row.id])
|
|
|
- // }
|
|
|
- // }
|
|
|
+ {
|
|
|
+ text: '办理',
|
|
|
+ click(row) {
|
|
|
+ const path = `/src/views/${row.formPath}`
|
|
|
+ const module = modules[path]
|
|
|
+ if (!module) {
|
|
|
+ ElMessage.error(`未知流程表单路径:${path}`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ businessId.value = row.businessId
|
|
|
+ handleComponent.value = markRaw(defineAsyncComponent(module))
|
|
|
+ handleVisible.value = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '流程图',
|
|
|
+ click(row) {
|
|
|
+ getChartApi(row.instanceId).then((resp) => {
|
|
|
+ chartVisible.value = true
|
|
|
+ imgUrl.value = 'data:image/gif;base64,' + resp
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '审批记录',
|
|
|
+ click(row) {
|
|
|
+ getDoneListApi(row.instanceId).then((resp) => {
|
|
|
+ doneListVisible.value = true
|
|
|
+ doneList.value = resp
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
]
|
|
|
}
|
|
|
]
|
|
@@ -163,6 +193,30 @@ const formConfig: FormConfigType[] = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
+const doneListColumnConfig: ColumnConfigType[] = [
|
|
|
+ {
|
|
|
+ prop: 'nodeName',
|
|
|
+ label: '审批节点'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'targetNodeName',
|
|
|
+ label: '跳转节点'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'approver',
|
|
|
+ label: '审批人'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '审批时间'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'message',
|
|
|
+ label: '审批意见',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getPage()
|
|
|
})
|
|
@@ -224,5 +278,21 @@ function formClosed() {
|
|
|
>
|
|
|
<a-form ref="formRef" v-model="formData" :config="formConfig" :span="24"> </a-form>
|
|
|
</a-dialog>
|
|
|
+
|
|
|
+ <a-dialog title="办理" v-model="handleVisible" width="1200px" :footer="false">
|
|
|
+ <component :is="handleComponent" :businessId="businessId" />
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="handleVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submit">通 过</el-button>
|
|
|
+ </template>
|
|
|
+ </a-dialog>
|
|
|
+
|
|
|
+ <a-dialog title="流程图" v-model="chartVisible" width="1200px" :footer="false">
|
|
|
+ <img :src="imgUrl" width="100%" style="margin: 0 auto" alt="" />
|
|
|
+ </a-dialog>
|
|
|
+
|
|
|
+ <a-dialog title="审批记录" v-model="doneListVisible" width="1000px" :footer="false">
|
|
|
+ <a-table :data="doneList" :column-config="doneListColumnConfig" :card="false"> </a-table>
|
|
|
+ </a-dialog>
|
|
|
</div>
|
|
|
</template>
|