|
@@ -1,14 +1,15 @@
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-import { ref, computed, onMounted, reactive, toRefs } from 'vue'
|
|
|
|
-import { staticFlowForm, listFlowForm } from '/@/api/flow/flowForm'
|
|
|
|
|
|
+import { ref, computed, onMounted, reactive, toRefs, getCurrentInstance } from 'vue'
|
|
|
|
+import { staticFlowForm, listFlowForm, listFlowFormTodo } from '/@/api/flow/flowForm'
|
|
import { useStore } from '/@/store'
|
|
import { useStore } from '/@/store'
|
|
import { useLoading } from '/@/utils/loading-util'
|
|
import { useLoading } from '/@/utils/loading-util'
|
|
import AddFormData from '/@/views/flow/flowForm/list/component/addFormData.vue'
|
|
import AddFormData from '/@/views/flow/flowForm/list/component/addFormData.vue'
|
|
-import { FlowFormTableColumns, FlowFormTableDataState } from '/@/views/flow/flowForm/list/component/model'
|
|
|
|
|
|
+import { FlowFormTableColumns, FlowFormTableDataState, FormFieldsData } from '/@/views/flow/flowForm/list/component/model'
|
|
import AddReportDialog from '/@/views/system/report/componments/add-report-dialog.vue'
|
|
import AddReportDialog from '/@/views/system/report/componments/add-report-dialog.vue'
|
|
import { CreateComplaintRequest } from '/@/api/system/report/type'
|
|
import { CreateComplaintRequest } from '/@/api/system/report/type'
|
|
|
|
|
|
const store = useStore()
|
|
const store = useStore()
|
|
|
|
+const { proxy } = <any>getCurrentInstance()
|
|
|
|
|
|
// 获取主题配置
|
|
// 获取主题配置
|
|
const getThemeConfig = computed(() => {
|
|
const getThemeConfig = computed(() => {
|
|
@@ -158,6 +159,62 @@ const handleComplaintSuccess = () => {
|
|
// 关闭对话框
|
|
// 关闭对话框
|
|
complaintDialogVisible.value = false
|
|
complaintDialogVisible.value = false
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 我的待办对话框
|
|
|
|
+const todoDialogVisible = ref(false)
|
|
|
|
+const todoTableLoading = ref(false)
|
|
|
|
+const todoFields = ref<FormFieldsData[]>([])
|
|
|
|
+const todoTableData = ref<any[]>([])
|
|
|
|
+const todoTableParam = ref({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ total: 0,
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+// 加载我的待办列表(与 ListFlowFormData 返回一致)
|
|
|
|
+const { loading: innerTodoLoading, doLoading: loadTodoList } = useLoading(async () => {
|
|
|
|
+ const res: any = await listFlowFormTodo({
|
|
|
|
+ pageNum: todoTableParam.value.pageNum,
|
|
|
|
+ pageSize: todoTableParam.value.pageSize,
|
|
|
|
+ })
|
|
|
|
+ todoTableData.value = res.list ?? []
|
|
|
|
+ todoTableParam.value.total = res.total ?? 0
|
|
|
|
+ todoFields.value = (res.fields ?? []).filter((item: FormFieldsData) => item.type === 'input' && item.display && !item.hidden).slice(0, 3)
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+// 打开我的待办对话框
|
|
|
|
+const openTodoDialog = () => {
|
|
|
|
+ todoDialogVisible.value = true
|
|
|
|
+ loadTodoList()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 待办分页
|
|
|
|
+const handleTodoPageSizeChange = (val: number) => {
|
|
|
|
+ todoTableParam.value.pageSize = val
|
|
|
|
+ loadTodoList()
|
|
|
|
+}
|
|
|
|
+const handleTodoCurrentChange = (val: number) => {
|
|
|
|
+ todoTableParam.value.pageNum = val
|
|
|
|
+ loadTodoList()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 字典选项与状态展示
|
|
|
|
+const { flow_status } = proxy.useDict('flow_status')
|
|
|
|
+const statusFormat = (row: any) => proxy.selectDictLabel(flow_status.value, row.status)
|
|
|
|
+const columnColor = (row: any) => {
|
|
|
|
+ switch (String(row.status)) {
|
|
|
|
+ case '-1':
|
|
|
|
+ return 'danger'
|
|
|
|
+ case '0':
|
|
|
|
+ return 'info'
|
|
|
|
+ case '1':
|
|
|
|
+ return 'warning'
|
|
|
|
+ case '2':
|
|
|
|
+ return 'success'
|
|
|
|
+ default:
|
|
|
|
+ return 'info'
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -166,7 +223,7 @@ const handleComplaintSuccess = () => {
|
|
<div class="summary-section">
|
|
<div class="summary-section">
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
- <el-card class="summary-card" shadow="hover" v-loading="summaryLoading">
|
|
|
|
|
|
+ <el-card class="summary-card" shadow="hover" v-loading="summaryLoading" @click="openTodoDialog">
|
|
<div class="summary-content">
|
|
<div class="summary-content">
|
|
<div class="summary-icon" :style="{ backgroundColor: getSummaryCardBgColor(0), color: '#f56c6c' }">
|
|
<div class="summary-icon" :style="{ backgroundColor: getSummaryCardBgColor(0), color: '#f56c6c' }">
|
|
<el-icon :size="24">
|
|
<el-icon :size="24">
|
|
@@ -311,6 +368,43 @@ const handleComplaintSuccess = () => {
|
|
mode="add"
|
|
mode="add"
|
|
@success="handleComplaintSuccess"
|
|
@success="handleComplaintSuccess"
|
|
/>
|
|
/>
|
|
|
|
+
|
|
|
|
+ <!-- 我的待办对话框 -->
|
|
|
|
+ <el-dialog v-model="todoDialogVisible" title="我的待办" width="80%">
|
|
|
|
+ <el-table :data="todoTableData" v-loading="innerTodoLoading">
|
|
|
|
+ <el-table-column type="index" width="60" label="#" align="center" />
|
|
|
|
+ <el-table-column label="主键" align="center" prop="id" min-width="120px" />
|
|
|
|
+ <el-table-column v-for="item in todoFields" :key="item.field" :label="item.title" align="center" :prop="item.field" min-width="150px" />
|
|
|
|
+ <el-table-column label="状态" align="center" prop="status" min-width="120px">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-tag :type="columnColor(scope.row)">{{ statusFormat(scope.row) }}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="创建时间" align="center" prop="created_at" min-width="160px">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <span>{{ proxy.parseTime(scope.row.created_at, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="创建人" align="center" prop="created_user.userNickname" min-width="140px" />
|
|
|
|
+ </el-table>
|
|
|
|
+ <div style="margin-top: 16px; text-align: right;">
|
|
|
|
+ <el-pagination
|
|
|
|
+ v-show="todoTableParam.total > 0"
|
|
|
|
+ v-model:current-page="todoTableParam.pageNum"
|
|
|
|
+ v-model:page-size="todoTableParam.pageSize"
|
|
|
|
+ :total="todoTableParam.total"
|
|
|
|
+ :page-sizes="[10, 20, 50]"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ @size-change="handleTodoPageSizeChange"
|
|
|
|
+ @current-change="handleTodoCurrentChange"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
+ <el-button @click="todoDialogVisible = false">关 闭</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|