ZaiZai 1 年之前
父节点
当前提交
d4fda99fc2

+ 2 - 1
src/store/modules/user.js

@@ -45,7 +45,8 @@ const getHomeRouter = async (arr) => {
     const menus = arr.filter((item) => {
         if (item?.children.length > 0) {
             const menua = item.children.filter((items) => {
-                return items?.children.length > 0
+                const children = getArrValue(items?.children)
+                return children.length > 0
             })
             return menua.length > 0
         } else {

+ 0 - 389
src/views/tasks/components/TableCard.vue

@@ -1,389 +0,0 @@
-<template>
-    <HcCard>
-        <template #header>
-            <div class="w-32">
-                <el-select v-model="searchForm.typeValue" block clearable placeholder="任务类型" size="large">
-                    <el-option v-for="item in tasksType" :label="item.dictValue" :value="item.dictKey" />
-                </el-select>
-            </div>
-            <div class="w-32 ml-3">
-                <el-select v-model="searchForm.statusValue" block clearable placeholder="任务状态" size="large">
-                    <el-option v-for="item in tasksStatus" :label="item.dictValue" :value="item.dictKey" />
-                </el-select>
-            </div>
-            <div class="w-32 ml-3">
-                <el-select
-                    v-model="searchForm.contractIdValue" block clearable placeholder="合同段" size="large"
-                    @change="ContractIdChange"
-                >
-                    <el-option v-for="item in contractList" :label="item.contractName" :value="item.id" />
-                </el-select>
-            </div>
-            <div class="w-32 ml-3">
-                <el-select v-model="searchForm.batch" block clearable placeholder="上报批次" size="large">
-                    <el-option v-for="item in reportBatch" :label="item.batch" :value="item.batch" />
-                </el-select>
-            </div>
-            <div class="w-64 ml-3">
-                <HcDatePicker :dates="betweenTime" clearable size="large" @change="betweenTimeUpdate" />
-            </div>
-            <div class="w-56 ml-3">
-                <el-input
-                    v-model="searchForm.queryValue" block clearable placeholder="请输入名称关键词检索"
-                    size="large" @keyup="keyUpEvent"
-                />
-            </div>
-            <div class="ml-2">
-                <el-button size="large" type="primary" @click="searchClick">
-                    <HcIcon name="search-2" />
-                    <span>搜索</span>
-                </el-button>
-            </div>
-        </template>
-        <template #extra>
-            <HcTooltip keys="tasks_data_set_sign_rules">
-                <el-button hc-btn @click="setSignRulesClick">
-                    <HcIcon name="settings" />
-                    <span>设置重签规则</span>
-                </el-button>
-            </HcTooltip>
-            <HcTooltip v-if="isTableKey === 'key1'" keys="tasks_data_batch_review">
-                <el-button
-                    :disabled="tableCheckedKeys.length <= 0" hc-btn type="primary"
-                    @click="batchApprovalTaskClick"
-                >
-                    <HcIcon name="check-double" />
-                    <span>批量审批</span>
-                </el-button>
-            </HcTooltip>
-        </template>
-        <HcTable
-            ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading" is-check
-            border @selection-change="tableSelectionChange"
-        >
-            <template #taskName="{ row }">
-                <span class="text-link" @click="rowTaskName(row)">{{ row?.taskName }}</span>
-            </template>
-            <template #taskStatusName="{ row }">
-                <el-tag
-                    v-if="row?.taskStatusName"
-                    :type="`${row.taskStatusName === '已审批' ? 'success' : row.taskStatusName === '已废除' ? 'warning' : 'info'}`" class="mx-1" effect="dark"
-                >
-                    {{ row.taskStatusName }}
-                </el-tag>
-            </template>
-            <template #taskApproveUserNamesList="{ row }">
-                <template v-for="item in row.taskApproveUserNamesList">
-                    <el-tag
-                        v-if="item.taskUserName"
-                        :type="`${item.evisaStatus === 2 ? 'success' : item.evisaStatus === 3 ? 'warning' : item.evisaStatus === 999 ? 'danger' : 'info'}`" class="mx-1" effect="dark"
-                    >
-                        {{ item.taskUserName }}
-                    </el-tag>
-                </template>
-            </template>
-        </HcTable>
-        <template #action>
-            <div class="lr-dialog-footer">
-                <div class="left">
-                    <span class="text-success">审批人员中:</span>
-                    <el-tag class="mx-1" effect="dark" type="info">未签字</el-tag>
-                    <el-tag class="mx-1" effect="dark" type="success">已签字</el-tag>
-                    <el-tag class="mx-1" effect="dark" type="warning">已废除</el-tag>
-                    <el-tag class="mx-1" effect="dark" type="danger">签字异常</el-tag>
-                </div>
-                <div class="right">
-                    <HcPages :pages="searchForm" :sizes="[10, 20, 30, 40, 50, 200]" @change="pageChange" />
-                </div>
-            </div>
-        </template>
-    </HcCard>
-</template>
-
-<script setup>
-import { nextTick, ref, watch } from 'vue'
-import { getArrValue } from 'js-fast-way'
-import tasksApi from '~api/tasks/data'
-import { useAppStore } from '~src/store'
-//参数
-const props = defineProps({
-    projectId: {
-        type: [String, Number],
-        default: '',
-    },
-    contractId: {
-        type: [String, Number],
-        default: '',
-    },
-    contractList: {
-        type: Array,
-        default: () => ([]),
-    },
-    tableKey: {
-        type: String,
-        default: '',
-    },
-})
-//事件
-const emit = defineEmits(['rowTaskName', 'signRules', 'batchApproval'])
-//初始变量
-const useAppState = useAppStore()
-//变量
-const projectId = ref(props.projectId)
-const contractId = ref(props.contractId)
-const isTableKey = ref(props.tableKey)
-const currentContractId = ref(useAppState.getContractId)
-
-//监听
-watch(() => [
-    props.tableKey,
-], ([Key]) => {
-    isTableKey.value = Key
-    setQueryData()
-})
-
-//渲染完成
-nextTick(() => {
-    setQueryData()
-})
-
-//获取相关数据
-const setQueryData = () => {
-    searchForm.value.contractIdValue = contractId.value
-    queryTaskType()
-    queryTaskStatus()
-    searchClick()
-    queryBatchList()
-}
-
-//获取任务类型
-const tasksType = ref([])
-const queryTaskType = async () => {
-    const { error, code, data } = await tasksApi.queryTaskTypeStatus({
-        typeOrStatus: 'task_type',
-    })
-    if (!error && code === 200) {
-        tasksType.value = getArrValue(data)
-    } else {
-        tasksType.value = []
-    }
-}
-
-//获取任务状态
-const tasksStatus = ref([])
-const queryTaskStatus = async () => {
-    const { error, code, data } = await tasksApi.queryTaskTypeStatus({
-        typeOrStatus: 'task_status',
-    })
-    if (!error && code === 200) {
-        tasksStatus.value = getArrValue(data)
-    } else {
-        tasksStatus.value = []
-    }
-}
-
-//合同段
-const ContractIdChange = () => {
-    searchForm.value.batch = null
-    queryBatchList()
-    // queryUserStartFlow()
-    getTableData()
-}
-
-//获取上报批次
-const reportBatch = ref([])
-const queryBatchList = async () => {
-    const { contractId } = searchForm.value
-    if (contractId) {
-        const { error, code, data } = await tasksApi.queryBatchList({
-            projectId: projectId.value,
-            contractId: contractId || '',
-        })
-        if (!error && code === 200) {
-            reportBatch.value = getArrValue(data)
-        } else {
-            reportBatch.value = []
-        }
-    } else {
-        reportBatch.value = []
-    }
-}
-
-//搜索表单
-const searchForm = ref({
-    queryValue: null, typeValue: null, statusValue: null, batch: null, startTimeValue: null, endTimeValue: null,
-    current: 1, size: 200, total: 0,
-})
-
-//日期时间被选择
-const betweenTime = ref(null)
-const betweenTimeUpdate = ({ val, arr }) => {
-    betweenTime.value = arr
-    searchForm.value.startTimeValue = val['start']
-    searchForm.value.endTimeValue = val['end']
-}
-
-//回车搜索
-const keyUpEvent = (e) => {
-    if (e.key === 'Enter') {
-        searchForm.value.current = 1
-        getTableData()
-    }
-}
-
-//搜索
-const searchClick = () => {
-    searchForm.value.current = 1
-    getTableData()
-}
-
-//分页被点击
-const pageChange = ({ current, size }) => {
-    searchForm.value.current = current
-    searchForm.value.size = size
-    getTableData()
-}
-
-//获取数据
-const tableLoading = ref(false)
-const tableListColumn = ref([
-    { key: 'taskName', name: '任务名称' },
-    { key: 'taskTypeName', name: '任务类型', width: '120' },
-    { key: 'taskStatusName', name: '任务状态', width: '160' },
-    { key: 'startTime', name: '开始时间', width: '180' },
-    { key: 'endTime', name: '限定时间', width: '180' },
-    { key: 'taskDesc', name: '任务描述' },
-    { key: 'taskReportUserName', name: '上报人', width: '120' },
-    { key: 'taskApproveUserNamesList', name: '签字人员' },
-    { key: 'evisaStatus', name: '电签状态' },
-])
-const tableListData = ref([])
-const getTableData = () => {
-    const key = isTableKey.value
-    tableListRef.value?.clearSelection()
-    tableCheckedKeys.value = []
-    // if (key === 'key1') {
-    //     queryUserToDoTaskList()
-    // } else if (key === 'key2') {
-    //     queryUserDoneTaskList()
-    // } else if (key === 'key3') {
-    //     queryUserStartFlow()
-    // }
-    if (key === 'key1') {
-        searchForm.value.selectedType = 1
-    } else if (key === 'key2') {
-        searchForm.value.selectedType = 2
-    } else if (key === 'key3') {
-        searchForm.value.selectedType = 3
-    }
-    queryPage()
-}
-
-//待办任务列表
-// const queryUserToDoTaskList = async () => {
-//     tableLoading.value = true
-//     const { error, code, data } = await tasksApi.queryUserToDoTaskList({
-//         ...searchForm.value,
-//         projectId: projectId.value,
-//         currentContractId:currentContractId.value,
-//     })
-//     //处理数据
-//     tableLoading.value = false
-//     if (!error && code === 200) {
-//         tableListData.value = getArrValue(data['records'])
-//         searchForm.value.total = data.total || 0
-//     } else {
-//         tableListData.value = []
-//         searchForm.value.total = 0
-//     }
-// }
-
-//任务列表
-const queryPage = async () => {
-    tableLoading.value = true
-    const { error, code, data } = await tasksApi.getTaskPage({
-        ...searchForm.value,
-
-        projectIdValue: projectId.value,
-
-        currentContractId:currentContractId.value,
-
-    })
-    //处理数据
-    tableLoading.value = false
-    if (!error && code === 200) {
-        tableListData.value = getArrValue(data['records'])
-        searchForm.value.total = data.total || 0
-    } else {
-        tableListData.value = []
-        searchForm.value.total = 0
-    }
-}
-//获取已办任务
-const queryUserDoneTaskList = async () => {
-    tableLoading.value = true
-    const { error, code, data } = await tasksApi.queryUserDoneTaskList({
-        ...searchForm.value,
-        projectId: projectId.value,
-    })
-    //处理数据
-    tableLoading.value = false
-    if (!error && code === 200) {
-        tableListData.value = getArrValue(data['records'])
-        searchForm.value.total = data.total || 0
-    } else {
-        tableListData.value = []
-        searchForm.value.total = 0
-    }
-}
-//获取我发起的
-const queryUserStartFlow = async () => {
-    tableLoading.value = true
-    const { error, code, data } = await tasksApi.queryUserStartFlow({
-        ...searchForm.value,
-        projectId: projectId.value,
-    })
-    //处理数据
-    tableLoading.value = false
-    if (!error && code === 200) {
-        tableListData.value = getArrValue(data?.records) || []
-        searchForm.value.total = data?.total || 0
-    } else {
-        tableListData.value = []
-        searchForm.value.total = 0
-    }
-}
-
-//多选
-const tableListRef = ref(null)
-const tableCheckedKeys = ref([])
-const tableSelectionChange = (rows) => {
-    tableCheckedKeys.value = rows.filter((item) => {
-        return (item ?? '') !== ''
-    })
-}
-
-//任务审核
-const rowTaskName = (row) => {
-    emit('rowTaskName', row)
-}
-
-//设置重签规则
-const setSignRulesClick = () => {
-    emit('signRules', {})
-}
-
-//批量审批
-const batchApprovalTaskClick = () => {
-    const rows = tableCheckedKeys.value
-    if (rows.length > 0) {
-        emit('batchApproval', rows)
-    } else {
-        window?.$message?.warning('请先勾选需要审批的数据')
-    }
-}
-</script>
-
-<style lang="scss" scoped>
-
-</style>

+ 185 - 0
src/views/tasks/components/hc-data/task-review.vue

@@ -0,0 +1,185 @@
+<template>
+    <hc-new-dialog v-model="isShow" :footer="false" is-table widths="95%" title="任务审核" @save="modalSave">
+        <template #header="{ titleId, titleClass }">
+            <div class="hc-card-header flex items-center">
+                <div :id="titleId" :class="titleClass">任务审核 【已开启电签】</div>
+                <!-- div v-if="taskReviewType === '1'" class="ml-6 font-bold text-main">
+                    任务名称:{{ taskReviewInfo.taskName }}
+                </div -->
+            </div>
+        </template>
+        <div class="relative h-full flex">
+            <div :id="`hc_pdf_card_${uuid}`">
+                <hc-new-card>
+                    <hc-pdf :src="batchPdfUrl" />
+                </hc-new-card>
+            </div>
+            <div :id="`hc_table_card_${uuid}`" class="flex-1">
+                <hc-new-card>
+                    <div class="content-box">
+                        <div class="table-box">
+                            <div class="table-view">
+                                <hc-table :column="tableColumn" :datas="tableData" is-new :index-style="{ width: 60 }" is-current-row @row-click="tableRowClick" />
+                            </div>
+                        </div>
+                        <div class="radio-box">
+                            <span class="label">审批操作:</span>
+                            <el-radio-group v-model="taskReviewForm.flag">
+                                <el-radio label="OK">同意</el-radio>
+                                <el-radio label="NO">废除任务</el-radio>
+                            </el-radio-group>
+                        </div>
+                        <div class="input-box">
+                            <el-input v-model="taskReviewForm.comment" :autosize="{ minRows: 3, maxRows: 5 }" placeholder="请输入审核意见" type="textarea" />
+                        </div>
+                        <div class="footer">
+                            <el-button type="info" hc-btn @click="cancelClick">取消</el-button>
+                            <el-button :loading="confirmLoading" hc-btn type="primary" @click="confirmClick">确认审批</el-button>
+                        </div>
+                    </div>
+                </hc-new-card>
+            </div>
+        </div>
+    </hc-new-dialog>
+</template>
+
+<script setup>
+import { nextTick, ref, watch } from 'vue'
+import { getRandom } from 'js-fast-way'
+
+const props = defineProps({
+    ids: {
+        type: [String, Number],
+        default: '',
+    },
+})
+
+//事件
+const emit = defineEmits(['finish', 'close'])
+
+const uuid = getRandom(4)
+
+//双向绑定
+// eslint-disable-next-line no-undef
+const isShow = defineModel('modelValue', {
+    default: false,
+})
+
+//监听
+watch(() => [
+    props.ids,
+], ([ids]) => {
+    console.log('ids', ids)
+}, { immediate: true })
+
+//监听
+watch(isShow, (val) => {
+    if (val) {
+        setSplitRef()
+    }
+})
+
+//初始化设置拖动分割线
+const setSplitRef = () => {
+    //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
+    nextTick(() => {
+        window.$split(['#hc_pdf_card_' + uuid, '#hc_table_card_' + uuid], {
+            sizes: [65, 35],
+            snapOffset: 0,
+            minSize: [50, 50],
+        })
+    })
+}
+
+const batchPdfUrl = ref('https://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20230920/0a4a7e36a1fcc05e9ff83f43fcfb12a9.pdf')
+
+//表格数据
+const tableColumn = ref([
+    { key: 'key1', name: '名称' },
+])
+const tableData = ref([
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+    { key1: 'xxxadasd' },
+])
+
+const tableRowClick = () => {
+
+}
+
+
+const taskReviewForm = ref({
+    flag: 'OK', comment: '',
+})
+
+//确认审批
+const confirmLoading = ref(false)
+const confirmClick = () => {
+
+}
+
+const cancelClick = () => {
+    isShow.value = false
+    emit('close')
+}
+
+
+const modalSave = () => {
+    emit('finish')
+}
+</script>
+
+<style lang="scss" scoped>
+.content-box {
+    position: relative;
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    .table-box {
+        position: relative;
+        flex: 1;
+        flex-basis: auto;
+        .table-view {
+            position: absolute;
+            inset: 0;
+        }
+    }
+    .radio-box {
+        position: relative;
+        flex-shrink: 0;
+        margin-top: 14px;
+    }
+    .input-box {
+        position: relative;
+        flex-shrink: 0;
+        margin-top: 10px;
+    }
+    .footer {
+        position: relative;
+        flex-shrink: 0;
+        text-align: center;
+        margin-top: 14px;
+        .el-button + .el-button {
+            margin-left: 40px;
+        }
+    }
+}
+</style>

+ 3 - 218
src/views/tasks/flow.vue

@@ -1,234 +1,19 @@
 <template>
     <div class="hc-layout-box">
-        <HcCard :scrollbar="false" action-size="lg">
-            <template #header>
-                <HcTooltip keys="tasks_flow_add">
-                    <el-button hc-btn type="primary" @click="addFlowData">
-                        <HcIcon name="add-circle" />
-                        <span>新建流程</span>
-                    </el-button>
-                </HcTooltip>
-            </template>
-            <template #extra>
-                <el-alert
-                    :closable="false"
-                    title="同一合同段内,只需要设置重复岗位的流程即可,其他任务岗位,系统将自动推送,无需创建更多任务流" type="error"
-                />
-            </template>
-            <HcTable :column="tableListColumn" :datas="tableListData" :loading="tableLoading" border>
-                <template #action="{ row }">
-                    <HcTooltip keys="tasks_flow_edit">
-                        <el-button plain size="small" type="primary" @click="handleTableEdit(row)">编辑</el-button>
-                    </HcTooltip>
-                    <HcTooltip keys="tasks_flow_del">
-                        <el-button plain size="small" type="danger" @click="handleTableDel(row)">删除</el-button>
-                    </HcTooltip>
-                </template>
-            </HcTable>
-            <template #action>
-                <HcPages :pages="searchForm" @change="pageChange" />
-            </template>
-        </HcCard>
-        <!-- 新增/编辑流程 弹框 -->
-        <el-dialog
-            v-model="showEditModal" :title="`${flowFormData.id ? '编辑' : '新增'}流程`" class="hc-modal-border"
-            width="47rem"
-        >
-            <el-form ref="formFlowRef" :model="flowFormData" :rules="formFlowRules" label-width="auto" size="large">
-                <el-form-item label="流程名称" prop="fixedFlowName">
-                    <el-input v-model="flowFormData.fixedFlowName" placeholder="请输入流程名称" />
-                </el-form-item>
-                <el-form-item label="任务人" prop="linkUserJoinString">
-                    <HcTasksUser
-                        :contract-id="contractId" :project-id="projectId" :users="flowFormData.linkUserJoinString"
-                        ui="w-full" @change="tasksUserChange"
-                    />
-                </el-form-item>
-            </el-form>
-            <template #footer>
-                <div class="dialog-footer">
-                    <el-button size="large" @click="showEditModal = false">取消</el-button>
-                    <el-button :loading="sevaLoading" hc-btn type="primary" @click="saveFormClick">保存</el-button>
-                </div>
-            </template>
-        </el-dialog>
+        1111
     </div>
 </template>
 
 <script setup>
 import { onMounted, ref } from 'vue'
-import { useAppStore } from '~src/store'
-import { getArrValue, getObjValue } from 'js-fast-way'
-import tasksFlowApi from '~api/tasks/flow'
-import { delMessageV2 } from '~com/message/index.js'
-//变量
-const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId)
-const contractId = ref(useAppState.getContractId)
 
 //渲染完成
 onMounted(() => {
-    getTableData()
-})
-
-//搜索表单
-const searchForm = ref({ current: 1, size: 20, total: 0 })
-
-//分页被点击
-const pageChange = ({ current, size }) => {
-    searchForm.value.current = current
-    searchForm.value.size = size
-    getTableData()
-}
-
-//获取数据
-const tableLoading = ref(false)
-const tableListData = ref([])
-
-const tableListColumn = ref([
-    { key: 'fixedFlowName', name: '流程名称' },
-    { key: 'linkUserJoinString', name: '流程详情' },
-    { key: 'action', name: '操作', width: '200', align: 'center' },
-])
-
-const getTableData = async () => {
-    tableLoading.value = true
-    const { error, code, data } = await tasksFlowApi.getPageData({
-        projectId: projectId.value,
-        contractId: contractId.value,
-        ...searchForm.value,
-    })
-    //处理数据
-    tableLoading.value = false
-    if (!error && code === 200) {
-        tableListData.value = getArrValue(data['records'])
-        searchForm.value.total = data.total || 0
-    } else {
-        tableListData.value = []
-        searchForm.value.total = 0
-    }
-}
-
-//新增编辑数据
-const showEditModal = ref(false)
-const formFlowRef = ref(null)
-const flowFormData = ref({ id: '', fixedFlowName: '', linkUserJoinString: '' })
-const formFlowRules = {
-    fixedFlowName: {
-        required: true,
-        trigger: 'blur',
-        message: '请输入流程名称',
-    },
-    linkUserJoinString: {
-        required: true,
-        trigger: 'blur',
-        message: '请选择任务人',
-    },
-}
 
-//任务人选择改变
-const tasksUserChange = (a, b, users) => {
-    flowFormData.value.linkUserJoinString = users
-}
-
-//新建流程
-const addFlowData = () => {
-    flowFormData.value = { id: '', fixedFlowName: '', linkUserJoinString: '' }
-    showEditModal.value = true
-}
-
-//编辑流程
-const handleTableEdit = async (row) => {
-    flowFormData.value = { id: '', fixedFlowName: '', linkUserJoinString: '' }
-    showEditModal.value = true
-    const { error, code, data } = await tasksFlowApi.queryFixedFlowDetail({
-        id: row?.id,
-    })
-    if (!error && code === 200) {
-        let users = '', res = getObjValue(data)
-        const list = getArrValue(res['fixedFlowLinkList'])
-        for (let i = 0; i < list.length; i++) {
-            const item = getObjValue(list[i])
-            if (users) {
-                users += `,${item['fixedFlowLinkUserName']}-${item['fixedFlowLinkUser']}`
-            } else {
-                users = `${item['fixedFlowLinkUserName']}-${item['fixedFlowLinkUser']}`
-            }
-        }
-        flowFormData.value = { id: res.id, fixedFlowName: res.fixedFlowName, linkUserJoinString: users }
-    } else {
-        flowFormData.value = { id: '', fixedFlowName: '', linkUserJoinString: '' }
-    }
-}
-
-//提交保存
-const sevaLoading = ref(false)
-const saveFormClick = async () => {
-    const form = flowFormData.value
-    if (!form.id) {
-        sevaLoading.value = true
-        const { error, code } = await tasksFlowApi.addFixedFlowData({
-            ...form,
-            projectId: projectId.value,
-            contractId: contractId.value,
-        })
-        //处理数据
-        sevaLoading.value = false
-        if (!error && code === 200) {
-            showEditModal.value = false
-            window?.$message?.success('保存成功')
-            getTableData()
-        }
-    } else {
-        sevaLoading.value = true
-        const { error, code } = await tasksFlowApi.updateFixedFlowData({
-            ...form,
-            projectId: projectId.value,
-            contractId: contractId.value,
-        })
-        //处理数据
-        sevaLoading.value = false
-        if (!error && code === 200) {
-            showEditModal.value = false
-            window?.$message?.success('保存成功')
-            getTableData()
-        }
-    }
-}
-
-//删除
-const handleTableDel = (row) => {
-    delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                removeFixedFlowData(row)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
-    })
-}
-
-//确认删除
-const removeFixedFlowData = async (row) => {
-    const { error, code } = await tasksFlowApi.removeFixedFlowData({
-        ids: row?.id || '',
-        projectId: projectId.value,
-        contractId: contractId.value,
-    })
-    //处理数据
-    if (!error && code === 200) {
-        window.$message?.success('删除成功')
-        getTableData()
-    }
-}
+})
 </script>
 
 <style lang="scss" scoped>
-.hc-layout-box {
-    position: relative;
-    height: 100%;
-}
+
 </style>
 

+ 119 - 391
src/views/tasks/hc-data.vue

@@ -1,427 +1,155 @@
 <template>
-    <div class="hc-layout-box">
-        <HcTabsSimple :no-drop-shadow="showTaskReviewModal" :cur="sbTableKey" :datas="sbTableData" @tabClick="sbTableClick">
-            <template #tab-key1>
-                <TableCard
-                    v-if="sbTableKey === 'key1'" :contract-id="contractId"
-                    :contract-list="contractList"
-                    :project-id="projectId" :table-key="sbTableKey"
-                    @batchApproval="batchApprovalTaskClick" @rowTaskName="rowTaskName"
-                    @signRules="setSignRulesClick"
-                />
-            </template>
-            <template #tab-key2>
-                <TableCard
-                    v-if="sbTableKey === 'key2'" :contract-id="contractId"
-                    :contract-list="contractList"
-                    :project-id="projectId" :table-key="sbTableKey"
-                    @batchApproval="batchApprovalTaskClick" @rowTaskName="rowTaskName"
-                    @signRules="setSignRulesClick"
-                />
+    <hc-tab-card :tabs="tabsData" :tab-key="tabsKey" @change="tabsClick">
+        <template v-if="tabsKey === '1'" #extra>
+            <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn type="primary" @click="batchApprovalTaskClick">批量审批</el-button>
+        </template>
+        <template #search>
+            <div class="w-32">
+                <el-select v-model="searchForm.typeValue" clearable block placeholder="任务类型">
+                    <!-- el-option v-for="item in tasksType" :label="item.dictValue" :value="item.dictKey" / -->
+                </el-select>
+            </div>
+            <div class="ml-2 w-32">
+                <el-select v-model="searchForm.statusValue" clearable block placeholder="任务状态">
+                    <!-- el-option v-for="item in tasksStatus" :label="item.dictValue" :value="item.dictKey" / -->
+                </el-select>
+            </div>
+            <div class="ml-2 w-32">
+                <el-select v-model="searchForm.batch" clearable block placeholder="上报批次">
+                    <!-- el-option v-for="item in reportBatch" :label="item.batch" :value="item.batch" / -->
+                </el-select>
+            </div>
+            <div class="ml-2 w-64">
+                <hc-date-picker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
+            </div>
+            <hc-search-input v-model="searchForm.queryValue" class="ml-2" placeholder="请输入名称关键词检索" @search="searchClick" />
+        </template>
+        <hc-table
+            ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
+            is-new is-check :check-style="{ width: 29 }" :index-style="{ width: 60 }"
+            @selection-change="tableSelectionChange"
+        >
+            <template #taskName="{ row }">
+                <span class="text-link" @click="rowTaskName(row)">{{ row?.taskName }}</span>
             </template>
-            <template #tab-key3>
-                <TableCard
-                    v-if="sbTableKey === 'key3'" :contract-id="contractId"
-                    :contract-list="contractList"
-                    :project-id="projectId" :table-key="sbTableKey"
-                    @batchApproval="batchApprovalTaskClick" @rowTaskName="rowTaskName"
-                    @signRules="setSignRulesClick"
-                />
+            <template #taskStatusName="{ row }">
+                <el-tag
+                    v-if="row?.taskStatusName"
+                    :type="`${row.taskStatusName === '已审批' ? 'success' : row.taskStatusName === '已废除' ? 'warning' : 'info'}`"
+                    class="mx-1" effect="dark"
+                >
+                    {{ row.taskStatusName }}
+                </el-tag>
             </template>
-        </HcTabsSimple>
-
-        <!-- 任务审核 -->
-        <el-dialog
-            v-model="showTaskReviewModal" class="hc-modal-border hc-modal-table" destroy-on-close draggable
-            width="80vw"
-        >
-            <template #header="{ titleId, titleClass }">
-                <div class="hc-card-header flex items-center">
-                    <div :id="titleId" :class="titleClass">任务审核 【已开启电签】</div>
-                    <div v-if="taskReviewType === '1'" class="ml-6 font-bold text-main">
-                        任务名称:{{ taskReviewInfo.taskName }}
-                    </div>
-                </div>
+            <template #taskApproveUserNamesList="{ row }">
+                <template v-for="(item, index) in row.taskApproveUserNamesList" :key="index">
+                    <el-tag
+                        v-if="item.taskUserName"
+                        :type="`${item.evisaStatus === 2 ? 'success' : item.evisaStatus === 3 ? 'warning' : item.evisaStatus === 999 ? 'danger' : 'info'}`"
+                        class="mx-1" effect="dark"
+                    >
+                        {{ item.taskUserName }}
+                    </el-tag>
+                </template>
             </template>
-            <div class="hc-card-body-flex">
-                <div v-if="batchPdfUrl" class="flex-iframe">
-                    <hc-pdf :src="batchPdfUrl" />
-                </div>
-                <div v-else class="flex-iframe hc-no-table-form">
-                    <div class="table-form-no">
-                        <img :src="notableform" alt="">
-                        <div class="desc">暂无 PDF 数据</div>
-                    </div>
+        </hc-table>
+        <template #action>
+            <div class="lr-dialog-footer">
+                <div class="left">
+                    <span class="text-success">审批人员中:</span>
+                    <el-tag class="mx-1" effect="dark" type="info">未签字</el-tag>
+                    <el-tag class="mx-1" effect="dark" type="success">已签字</el-tag>
+                    <el-tag class="mx-1" effect="dark" type="warning">已废除</el-tag>
+                    <el-tag class="mx-1" effect="dark" type="danger">签字异常</el-tag>
                 </div>
-                <div :class="sbTableKey === 'key1' ? '' : 'vh'" class="flex-table">
-                    <div v-if="taskReviewType === '1'" class="data-table taskReviewData">
-                        <HcTable :column="taskReviewColumns" :datas="taskReviewData" border @row-click="rowTaskReviewClick" />
-                    </div>
-                    <div v-if="taskReviewType === '2'" class="data-table checkedRowsRef">
-                        <HcTable :column="checkedRowsColumns" :datas="checkedRowsRef" border @row-click="rowTaskReviewClick" />
-                    </div>
-                    <div v-if="sbTableKey === 'key1'" class="radio-group-box">
-                        <span class="label">审批操作:</span>
-                        <el-radio-group v-model="taskReviewForm.flag">
-                            <el-radio label="OK">同意</el-radio>
-                            <el-radio label="NO">废除任务</el-radio>
-                        </el-radio-group>
-                    </div>
-                    <div v-if="sbTableKey === 'key1'" class="textarea-box">
-                        <el-input
-                            v-model="taskReviewForm.comment" :autosize="{ minRows: 3, maxRows: 5 }"
-                            placeholder="请输入审核意见"
-                            type="textarea"
-                        />
-                    </div>
+                <div class="right">
+                    <hc-pages :pages="searchForm" :sizes="[30, 40, 50, 200]" @change="pageChange" />
                 </div>
             </div>
-            <template v-if="sbTableKey === 'key1'" #footer>
-                <div class="dialog-footer">
-                    <el-button size="large" @click="showTaskReviewModal = false">取消</el-button>
-                    <el-button :loading="SMSAuthLoading" hc-btn type="primary" @click="ConfirmApprovalClick">
-                        确认审批
-                    </el-button>
-                </div>
-            </template>
-        </el-dialog>
-
-        <!-- 设置重签规则 -->
-        <el-dialog
-            v-model="showSetSignRulesModal" class="hc-modal-border" destroy-on-close draggable
-            title="设置重签规则"
-            width="38rem"
-        >
-            <div class="text-orange mb-10">
-                <span
-                    class="mr-4"
-                >提示:设置默认时长,在任务被废除需要重签的时候,规定的重签上报时间提示时间段内,系统提示用户重签信息,但是超过处理时间,系统可默认自动授权重签</span>
-                <el-checkbox v-model="setPactVal" label="Option 1" size="large">
-                    <span class="text-main">《授权系统自动电签协议》</span>
-                </el-checkbox>
-            </div>
-            <div class="obj-item-cell">
-                <div class="label">默认处理时间(时)</div>
-                <HcCounter v-model="formReport.date" @update:modelValue="dateUpdateValue" />
-            </div>
-            <div class="obj-item-cell">
-                <div class="label">开启系统自动电签</div>
-                <el-switch v-model="formReport.active" />
-            </div>
-            <template #footer>
-                <div class="dialog-footer">
-                    <el-button size="large" @click="showSetSignRulesModal = false">取消</el-button>
-                    <el-button hc-btn type="primary">保存</el-button>
-                </div>
-            </template>
-        </el-dialog>
-
-        <!-- 短信认证 -->
-        <HcSmsAuth :loading="SMSAuthLoading" :show="SMSAuthShow" @cancel="SMSAuthCancel" @confirm="SMSAuthConfirm" />
-    </div>
+        </template>
+        <!-- 任务审核 -->
+        <taskReview v-model="isTaskReviewModalshow" />
+    </hc-tab-card>
 </template>
 
 <script setup>
 import { onMounted, ref } from 'vue'
-import { useAppStore } from '~src/store'
-import { useRoute, useRouter } from 'vue-router'
-import TableCard from './components/TableCard.vue'
-import notableform from '~src/assets/view/notableform.svg'
-import { checkFlowUserIsExistPfxFile, getContractInfo } from '~api/other'
-import { arrToKey, getArrValue, isString } from 'js-fast-way'
-import tasksApi from '~api/tasks/data'
-import dayjs from 'dayjs'
-
-//初始变量
-const router = useRouter()
-const useRoutes = useRoute()
-const useAppState = useAppStore()
-
-//路由参数
-const routerQuery = useRoutes?.query
-const activeName = routerQuery?.active || 'key1'
-
-//全局变量
-const projectId = ref(useAppState.getProjectId)
-const contractId = ref(useAppState.getContractId)
-const projectInfo = ref(useAppState.getProjectInfo)
+import taskReview from './components/hc-data/task-review.vue'
 
 //渲染完成
 onMounted(() => {
-    checkSmsCode()
-    getContractInfoList()
+
 })
-//合同段信息
-const contractList = ref([])
 
-const getContractInfoList = async ()=>{
-    const { error, code, data } = await getContractInfo({
-            pid: projectId.value,
-     })
-     if (!error && code === 200) {
-        contractList.value = getArrValue(data)
-     } else {
-        contractList.value = []
-     }
-}
 //类型处理
-const sbTableKey = ref(activeName)
-const sbTableData = ref([
-    { icon: 'time', label: '待办任务', key: 'key1' },
-    { icon: 'calendar-check', label: '已办任务', key: 'key2' },
-    { icon: 'user-shared', label: '我发起的', key: 'key3' },
-])
-const sbTableClick = (key) => {
-    sbTableKey.value = key
-    router.push({
-        path: useRoutes.path,
-        query: { active: key },
-    })
-}
-
-//审批页详情
-const showTaskReviewModal = ref(false)
-const taskReviewType = ref('1')
-const taskReviewInfo = ref({})
-const taskReviewData = ref([])
-const batchPdfUrl = ref('')
-const taskReviewForm = ref({ flag: 'OK', comment: '' })
-const taskReviewColumns = ref([
-    { key: 'fileName', name: '文件名称' },
-])
-//任务审核
-const rowTaskName = async (row) => {
-    if (row.formDataId) {
-        taskReviewInfo.value = row
-        const { error, code, data } = await tasksApi.queryApprovalParameter({
-            parallelProcessInstanceId: row['parallelProcessInstanceId'] || '',
-            formDataId: row.formDataId,
-            approvalType: row.approvalType,
-        })
-        if (!error && code === 200) {
-            const approvalFileList = getArrValue(data['approvalFileList'])
-            if (approvalFileList.length > 0 && approvalFileList[approvalFileList.length - 1].fileName === '') {
-                approvalFileList.pop()
-            }
-            taskReviewData.value = approvalFileList
-            if (approvalFileList.length > 0) {
-                batchPdfUrl.value = approvalFileList[0].fileUrl
-            }
-            taskReviewType.value = '1'
-            showTaskReviewModal.value = true
-        } else {
-            taskReviewData.value = []
-            batchPdfUrl.value = ''
-        }
-    } else {
-        taskReviewInfo.value = {}
-        taskReviewData.value = []
-        batchPdfUrl.value = ''
-        window?.$message?.warning('此数据异常')
-    }
+const tabsKey = ref('1')
+const tabsData = [
+    { key: '1', name: '待办任务' },
+    { key: '2', name: '已办任务' },
+    { key: '3', name: '我发起的' },
+]
+const tabsClick = ({ key }) => {
+    tabsKey.value = key
 }
 
-//批量审批
-const checkedRowsColumns = ref([
-    { key: 'taskName', name: '任务名称' },
-])
-const checkedRowsRef = ref([])
-
-const batchApprovalTaskClick = (rows) => {
-    taskReviewType.value = '2'
-    showTaskReviewModal.value = true
-    checkedRowsRef.value = rows
-    let taskids = []
-    rows.forEach((item) => {
-        taskids.push(item.formDataId)
-    })
-    taskids = taskids.join()
-    queryTaskInfo(rows[0], taskids)
-}
+//搜索条件
+const searchForm = ref({
+    current: 1, size: 200, total: 0,
+})
 
-//行被点击
-const rowTaskReviewClick = async ({ row }) => {
-    const type = taskReviewType.value
-    if (type === '1') {
-        batchPdfUrl.value = row.fileUrl
-    } else if (row['hc_batchPdfUrl']) {
-        batchPdfUrl.value = row['hc_batchPdfUrl']
-    } else {
-        queryTaskInfo(row)
-    }
+//日期范围选择
+const betweenTime = ref(null)
+const betweenTimeUpdate = ({ val, arr }) => {
+    betweenTime.value = arr
+    searchForm.value.startTimeValue = val['start']
+    searchForm.value.endTimeValue = val['end']
 }
 
-//获取PDF数据
-const queryTaskInfo = async (row, taskids) => {
-    const { error, code, data } = await tasksApi.queryTaskInfo({
-        // formDataId: row['formDataId'] || '',
-        formDataId: taskids && taskids.length > 0 ? taskids : row['formDataId'],
-        approvalType: row['approvalType'],
-    })
-    //处理数据
-    if (!error && code === 200) {
-        // const approvalFileList = getArrValue(data['approvalFileList'])
-        // if (approvalFileList.length > 0) {
-        //     batchPdfUrl.value = approvalFileList[0].fileUrl
-        //     row['hc_batchPdfUrl'] = approvalFileList[0].fileUrl
-        // } else {
-        //     batchPdfUrl.value = ''
-        //     row['hc_batchPdfUrl'] = ''
-        //     window?.$message?.warning('PDF获取异常')
-        // }
-        const alldata = getArrValue(data)
-        let approvalFileList = []
-        alldata.forEach((item) => {
-            let innerfilist = item?.approvalFileList
-            innerfilist.forEach((item1) => {
-                approvalFileList.push(item1)
-            })
-        })
-        if (approvalFileList.length > 0) {
-            batchPdfUrl.value = approvalFileList[0].fileUrl
-            row['hc_batchPdfUrl'] = approvalFileList[0].fileUrl
-        } else {
-            batchPdfUrl.value = ''
-            row['hc_batchPdfUrl'] = ''
-            window?.$message?.warning('PDF获取异常')
-        }
-    } else {
-        batchPdfUrl.value = ''
-        row['hc_batchPdfUrl'] = ''
-        window?.$message?.warning(data.msg || 'PDF异常')
-    }
+//搜索
+const searchClick = () => {
+    searchForm.value.current = 1
 }
 
-//确认审批
-const ConfirmApprovalClick = async () => {
-    const formData = taskReviewForm.value
-    if (formData.flag === 'NO' && !formData.comment) {
-        window?.$message?.warning('请先输入审核意见')
-    } else {
-        SMSAuthLoading.value = true
-        const { error, code, msg, data } = await checkFlowUserIsExistPfxFile({
-            projectId:projectId.value,
-        }, false)
-        //判断数据
-        SMSAuthLoading.value = false
-        if (!error && code === 200 && data === true) {
-            const ShowAuth = isCheckSmsCodeTime()
-            SMSAuthShow.value = ShowAuth
-            //免短信验证
-            if (!ShowAuth) {
-                SMSAuthConfirm()
-            }
-        } else {
-            window.$message?.warning(msg)
-        }
-    }
+//分页被点击
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
 }
 
-//短信验证有效期
-const smsCodeTime = ref('')
-const checkSmsCode = async () => {
-    const { error, code, data } = await tasksApi.checkSmsCode()
-    //处理数据
-    if (!error && code === 200) {
-        smsCodeTime.value = isString(data) ? data : ''
-    } else {
-        smsCodeTime.value = ''
-    }
-}
+//获取数据
+const tableListRef = ref(null)
+const tableLoading = ref(false)
+const tableListColumn = ref([
+    { key: 'taskName', name: '任务名称' },
+    { key: 'taskTypeName', name: '任务类型', width: '120' },
+    { key: 'taskStatusName', name: '任务状态', width: '160' },
+    { key: 'startTime', name: '开始时间', width: '180' },
+    { key: 'endTime', name: '限定时间', width: '180' },
+    { key: 'taskDesc', name: '任务描述' },
+    { key: 'taskReportUserName', name: '上报人', width: '120' },
+    { key: 'taskApproveUserNamesList', name: '签字人员' },
+    { key: 'evisaStatus', name: '电签状态' },
+])
+const tableListData = ref([
+    { taskName: '测试的' },
+])
 
-//验证短信有效期
-const isCheckSmsCodeTime = () => {
-    const smsTime = smsCodeTime.value
-    if (!smsTime) {
-        return true
-    } else {
-        const toDayTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
-        return dayjs(smsTime).isBefore(toDayTime)
-    }
+//多选
+const tableCheckedKeys = ref([])
+const tableSelectionChange = (rows) => {
+    tableCheckedKeys.value = rows
 }
 
-//短信验证
-const SMSAuthLoading = ref(false)
-const SMSAuthShow = ref(false)
-const SMSAuthConfirm = () => {
-    const type = taskReviewType.value
-    if (type === '1') {
-        saveCompleteApprovalTask()
-    } else {
-        batchCompleteApprovalTask()
-    }
-    checkSmsCode()
-}
-const SMSAuthCancel = () => {
-    SMSAuthShow.value = false
-}
+//任务详情弹窗
+const isTaskReviewModalshow = ref(false)
 
-//单个审批
-const saveCompleteApprovalTask = async () => {
-    const DataInfo = taskReviewInfo.value
-    SMSAuthLoading.value = true
-    const { error, code } = await tasksApi.saveCompleteApprovalTask({
-        ...taskReviewForm.value,
-        taskId: DataInfo['id'] || '',
-        parallelProcessInstanceId: DataInfo['parallelProcessInstanceId'] || '',
-        formDataId: DataInfo['formDataId'] || '',
-        approvalType: DataInfo['approvalType'],
-    }, false)
-    //处理数据
-    SMSAuthLoading.value = false
-    if (!error && code === 200) {
-        SMSAuthShow.value = false
-        showTaskReviewModal.value = false
-        window?.$message?.success('审批成功')
-        setTimeout(() => {
-            window?.location?.reload() //刷新页面
-        }, 3000)
-    } else {
-        window?.$message?.warning('审批异常')
-    }
+//任务名称被点击
+const rowTaskName = () => {
+    isTaskReviewModalshow.value = true
 }
 
 //批量审批
-const batchCompleteApprovalTask = async () => {
-    const rows = checkedRowsRef.value
-    SMSAuthLoading.value = true
-    let taskIds = arrToKey(rows, 'id', ',')
-    let approvalType = arrToKey(rows, 'approvalType', ',')
-    let formDataId = arrToKey(rows, 'formDataId', ',')
-    let parallelProcessInstanceIds = arrToKey(rows, 'parallelProcessInstanceId', ',')
-    const { error, code, msg } = await tasksApi.batchCompleteApprovalTask({
-        ...taskReviewForm.value,
-        taskIds,
-        approvalType,
-        formDataId,
-        parallelProcessInstanceIds,
-    }, false)
-    //处理数据
-    SMSAuthLoading.value = false
-    if (!error && code === 200) {
-        SMSAuthShow.value = false
-        showTaskReviewModal.value = false
-        window?.$message?.success('审批成功')
-        setTimeout(() => {
-            window?.location?.reload() //刷新页面
-        }, 3000)
-    } else {
-        window?.$message?.warning(msg)
-    }
-}
+const batchApprovalTaskClick = () => {
 
-//设置重签规则
-const showSetSignRulesModal = ref(false)
-const setPactVal = ref(true)
-const formReport = ref({ date: 1, active: true })
-const setSignRulesClick = () => {
-    showSetSignRulesModal.value = true
-}
-const dateUpdateValue = (val) => {
-    formReport.value.date = val
 }
 </script>
-
-<style lang="scss" scoped>
-@import '../../styles/tasks/hc-data.scss';
-</style>

+ 2 - 302
src/views/tasks/message.vue

@@ -1,318 +1,18 @@
 <template>
     <div class="hc-layout-box">
-        <div class="hc-layout-left-box">
-            <el-scrollbar>
-                <HcMenuSimple :datas="menuOptions" :keys="menuKey" @change="handleMenuValue" />
-            </el-scrollbar>
-        </div>
-        <div class="hc-layout-content-box">
-            <HcCard action-size="lg">
-                <template #header>
-                    <div class="w-32 ml-2">
-                        <el-select v-model="searchForm.smsType" clearable placeholder="消息类型" size="large">
-                            <el-option v-for="item in smsTypeData" :label="item.label" :value="item.value" />
-                        </el-select>
-                    </div>
-                    <div class="w-64 ml-2">
-                        <HcDatePicker :dates="betweenTime" clearable size="large" @change="betweenTimeUpdate" />
-                    </div>
-                    <div class="ml-2">
-                        <el-button size="large" type="primary" @click="searchClick">
-                            <HcIcon name="search-2" />
-                            <span>搜索</span>
-                        </el-button>
-                    </div>
-                </template>
-                <template #extra>
-                    <el-button :disabled="tableCheckedKeys.length <= 0" :loading="delLoading" hc-btn @click="delClick">
-                        <HcIcon name="delete-bin-3" />
-                        <span>删除消息</span>
-                    </el-button>
-                    <el-button
-                        :disabled="tableCheckedKeys.length <= 0" :loading="markReadLoading" hc-btn
-                        @click="markReadClick"
-                    >
-                        <HcIcon name="bookmark" />
-                        <span>标记已读</span>
-                    </el-button>
-                </template>
-                <HcTable
-                    ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
-                    is-check border @selection-change="tableSelectionChange"
-                >
-                    <template #content="{ row }">
-                        <div class="text-link text-cut" @click="tableContent(row)">{{ row.content }}</div>
-                    </template>
-                </HcTable>
-                <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange" />
-                </template>
-            </HcCard>
-        </div>
-        <!-- 日志内容 -->
-        <el-dialog v-model="operationContentModal" class="hc-modal-border" title="消息内容" width="38rem">
-            {{ operationContent }}
-        </el-dialog>
+        222
     </div>
 </template>
 
 <script setup>
 import { onMounted, ref, watch } from 'vue'
-import { useAppStore } from '~src/store'
-import { useRoute, useRouter } from 'vue-router'
-import messageApi from '~api/tasks/message'
-import { arrToId, getArrValue } from 'js-fast-way'
-import website from '~src/config/index'
-import { delMessageV2 } from '~com/message/index.js'
 
-//消息数量
-const props = defineProps(
-    {
-        msgCount: {
-            type: Object,
-            default: () => ({
-                allCount: 0,
-                taskCount: 0,
-                messageCount: 0,
-                messageCount_1: 0,
-                messageCount_2: 0,
-                messageCount_3: 0,
-                messageCount_4: 0,
-                messageCount_5: 0,
-            }),
-        },
-    },
-)
-//变量
-const router = useRouter()
-const useRoutes = useRoute()
-const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId)
-const contractId = ref(useAppState.getContractId)
-const userInfo = ref(useAppState.getUserInfo)
-
-//路由参数数据
-const routerQuery = useRoutes?.query
-let MenuType = routerQuery?.MenuType || '1'
-const menumsgCount = ref(props.msgCount)
-//监听
-//监听
-watch(() => [
-        props.msgCount,
-    ], ([val]) => {
-        menumsgCount.value = val
-        if (val) {
-            queryCurrentUserMessageCount()
-        }
-
-    },
-)
 //渲染完成
 onMounted(() => {
-    searchForm.value.type = MenuType
-    searchForm.value.current = 1
-    searchClick()
-})
-
-//左侧菜单
-const menuKey = ref(MenuType)
-const menuOptions = ref([
-    { key: '1', label: '任务催办', icon: 'alarm-warning', badge: 0 },
-    { key: '2', label: '监测预警', icon: 'eye', badge: 0 },
-    { key: '3', label: '废除通知', icon: 'delete-bin-3', badge: 0 },
-    { key: '4', label: '工单反馈', icon: 'question-answer', badge: 0 },
-    { key: '5', label: '系统消息', icon: 'chat-settings', badge: 0 },
-])
-
-const handleMenuValue = (item) => {
-    searchForm.value.type = item.key
-    searchForm.value.current = 1
-    menuKey.value = item.key
-    searchClick()
-    router.push({
-        path: useRoutes.path,
-        query: { MenuType: item.key },
-    })
-}
 
-//获取消息数量
-const queryCurrentUserMessageCount = async () => {
-    const typeArr = ['messageCount_1', 'messageCount_2', 'messageCount_3', 'messageCount_4', 'messageCount_5']
-    for (let i = 0; i < typeArr.length; i++) {
-        menuOptions.value[i].badge = menumsgCount.value[typeArr[i]] ?? 0
-    }
-}
-//消息类型
-const smsTypeData = ref([{ label: '已读消息', value: '1' }, { label: '未读消息', value: '2' }])
-
-//搜索和分页数据
-const searchForm = ref({
-    isRead: null, startTime: null, endTime: null, type: 1,
-    current: 1, size: 20, total: 0,
 })
-
-//日期时间被选择
-const betweenTime = ref(null)
-const betweenTimeUpdate = ({ val, arr }) => {
-    betweenTime.value = arr
-    if (val && val.length > 0) {
-        searchForm.value.startTime = val['start']
-        searchForm.value.endTime = val['end']
-    } else {
-        searchForm.value.startTime = null
-        searchForm.value.endTime = null
-    }
-}
-
-//搜索
-const searchClick = () => {
-    searchForm.value.current = 1
-    getTableData()
-}
-
-//分页被点击
-const pageChange = ({ current, size }) => {
-    searchForm.value.current = current
-    searchForm.value.size = size
-    getTableData()
-}
-
-//设置表头数据
-const tableListRef = ref(null)
-const tableListColumn = ref([
-    { key: 'typeValue', name: '类型', width: '120' },
-    { key: 'time', name: '日期时间', width: '180' },
-    { key: 'content', name: '内容' },
-])
-const tableListData = ref([])
-
-//获取数据
-const tableLoading = ref(false)
-const getTableData = async () => {
-    //处理初始数据
-    tableLoading.value = true
-    tableListData.value = []
-    tableListRef.value?.clearSelection()
-    tableCheckedKeys.value = []
-    //获取数据
-    const { error, code, data } = await messageApi.getPageData({
-        ...searchForm.value,
-        projectId: projectId.value,
-        contractId: contractId.value,
-    })
-    //处理返回数据
-    tableLoading.value = false
-    if (!error && code === 200) {
-        tableListData.value = getArrValue(data['records'])
-        searchForm.value.total = data['total'] ?? 0
-    } else {
-        tableListData.value = []
-        searchForm.value.total = 0
-    }
-}
-
-//多选
-const tableCheckedKeys = ref([])
-const tableSelectionChange = (rows) => {
-    tableCheckedKeys.value = rows.filter((item) => {
-        return (item ?? '') !== ''
-    })
-}
-
-//查看内容
-const operationContentModal = ref(false)
-const operationContent = ref('')
-const tableContent = (row) => {
-    operationContent.value = row['content'] ?? ''
-    operationContentModal.value = true
-    setMessageWarningReadApi(row['id'], false)
-}
-
-//删除消息
-const delClick = () => {
-    const rows = tableCheckedKeys.value
-    if (rows.length > 0) {
-        delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                removeData(rows)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
-        })
-    } else {
-        window.$message?.warning('请先勾选要删除的消息')
-    }
-}
-
-//确认删除消息
-const delLoading = ref(false)
-const removeData = async (rows) => {
-    delLoading.value = true
-    const ids = arrToId(rows)
-    //请求数据
-    const { error, code } = await messageApi.removeData({
-        ids: ids,
-    }, false)
-    //处理返回数据
-    delLoading.value = false
-    if (!error && code === 200) {
-        tableCheckedKeys.value = []
-        window.$message?.success('消息删除成功')
-        queryCurrentUserMessageCount()
-        searchClick()
-    } else {
-        window.$message?.error('消息删除失败')
-    }
-}
-
-//标记已读
-const markReadClick = () => {
-    const rows = tableCheckedKeys.value
-    if (rows.length > 0) {
-        const ids = arrToId(rows)
-        window?.$messageBox?.alert('勾选的消息是否标记为已读?', '确认操作', {
-            showCancelButton: true,
-            confirmButtonText: '确定标记',
-            cancelButtonText: '取消',
-            callback: (action) => {
-                if (action === 'confirm') {
-                    setMessageWarningReadApi(ids)
-                }
-            },
-        })
-    } else {
-        window.$message?.warning('请先勾选要标记的消息')
-    }
-}
-
-//确认标记
-const markReadLoading = ref(false)
-const setMessageWarningReadApi = async (ids, getTable = true) => {
-    markReadLoading.value = true
-    //请求数据
-    const { error, code } = await messageApi.setMessageWarningRead({
-        ids: ids,
-    }, false)
-    //处理返回数据
-    markReadLoading.value = false
-    if (!error && code === 200) {
-        if (getTable) {
-            tableCheckedKeys.value = []
-            window.$message?.success('消息标记为已读成功')
-            queryCurrentUserMessageCount()
-            getTableData()
-        } else {
-            queryCurrentUserMessageCount()
-        }
-    } else {
-        window.$message?.error('消息标记为已读失败')
-    }
-}
 </script>
 
 <style lang="scss" scoped>
-@import "../../styles/tasks/message.scss";
+
 </style>