吉安感知网项目-前端
罗广辉
2026-01-17 da9ff2aff9efb4f91a0352539d7d5a1de698faa5
feat: 评价管理
5 files modified
2 files deleted
2 files added
861 ■■■■ changed files
applications/task-work-order/src/styles/common/cockpit.scss 63 ●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/basicManage/maintainRecord/FormDiaLog.vue 135 ●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/basicManage/maintainRecord/MaintenanceDiaLog.vue 177 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/basicManage/maintainRecord/fwDeviceMaintainRecord.js 19 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/basicManage/maintainRecord/index.vue 30 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/orderDataManage/evaluate/FormDiaLog.vue 220 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/orderDataManage/evaluate/evaluateApi.js 37 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/orderDataManage/evaluate/index.vue 178 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue 2 ●●● patch | view | raw | blame | history
applications/task-work-order/src/styles/common/cockpit.scss
@@ -1,3 +1,5 @@
//变量
$gd-placeholder: #86909C;
.gd-table {
  height: 0;
@@ -20,9 +22,7 @@
    border-bottom: 1px solid #DBDFF1 !important;
    .cell {
      padding: 0;
      padding-left: 16px;
      padding: 0 0 0 16px;
      font-family: Source Han Sans CN, Source Han Sans CN;
      font-weight: 400;
      font-size: 14px;
@@ -38,9 +38,7 @@
    height: 56px;
    .cell {
      padding: 0;
      padding-left: 16px;
      padding: 0 0 0 16px;
      font-family: Source Han Sans CN, Source Han Sans CN;
      font-weight: 400;
      font-size: 14px;
@@ -79,25 +77,25 @@
  }
}
.gd-input {
  .el-input__wrapper {
  .el-input__wrapper,.el-textarea__inner {
    padding: 0 8px !important;
    background: #DDE2ED;
    background: #F2F3F5;
    box-shadow: none !important;
    border: none;
  }
    .el-input__inner {
      color: #383874;
      &::placeholder {
        color: #A1A3D4;
      }
  .el-input__inner,.el-textarea__inner {
    &::placeholder {
      color: $gd-placeholder;
    }
  }
  &.is-disabled {
    .el-input__wrapper {
      background-color: #DDE2ED;
      background: #DDE2ED;
    }
  }
}
@@ -117,7 +115,7 @@
  .el-select__placeholder {
    &.is-transparent {
      color: #A1A3D4 !important;
      color: $gd-placeholder !important;
    }
    &.el-select__selected-item {
@@ -240,7 +238,7 @@
    color: #fff;
    &::placeholder {
      color: #A1A3D4;
      color: $gd-placeholder;
    }
  }
@@ -583,16 +581,6 @@
            }
          }
          .el-textarea {
            .el-textarea__inner {
              color: #fff;
              background: #DDE2ED !important;
              border: none;
              box-shadow: none;
            }
          }
          .el-button {
            color: #fff;
            background: #DDE2ED !important;
@@ -661,28 +649,7 @@
          }
        }
        .el-input {
          .el-input__wrapper {
            padding: 0 8px !important;
            background: #F2F3F5;
            box-shadow: none !important;
            border: none;
            .el-input__inner {
              color: #383874;
              &::placeholder {
                color: #86909C;
              }
            }
          }
          &.is-disabled {
            .el-input__wrapper {
              background-color: #F2F3F5;
            }
          }
        }
      }
    }
  }
applications/task-work-order/src/views/basicManage/maintainRecord/FormDiaLog.vue
@@ -1,7 +1,12 @@
<template>
    <el-dialog class="gd-dialog" v-model="visible" :title="titleEnum[dialogMode]" @closed="handleClosed" destroy-on-close>
    <el-dialog
        class="gd-dialog"
        v-model="visible"
        :title="titleEnum[dialogMode]"
        @closed="visible = false"
        destroy-on-close
    >
        <div class="detail-container" v-if="dialogReadonly">
            <div class="detail-title">设备详情</div>
            <el-row>
                <el-col :span="12">
                    <div class="label">设备名称</div>
@@ -44,29 +49,6 @@
                    <div class="val">{{ formData.manufacturer }}</div>
                </el-col>
            </el-row>
            <div class="detail-title">维护详情</div>
            <div class="gd-table-container" v-loading="loading">
                <div class="gd-table-content">
                    <el-table class="gd-table" :data="list">
                        <el-table-column type="index" width="60" label="序号" />
                        <el-table-column prop="maintainTime" label="维护时间" />
                        <el-table-column prop="maintainContent" label="维护内容" />
                        <el-table-column prop="replacePart" label="跟换部件" />
                    </el-table>
                </div>
                <div class="gd-pagination-parent">
                    <el-pagination
                        popper-class="gd-select-popper"
                        v-model:current-page="searchParams.current"
                        v-model:page-size="searchParams.size"
                        layout="total, prev, pager, next, sizes"
                        :total="total"
                        @change="getList"
                    />
                </div>
            </div>
        </div>
        <el-form
@@ -107,30 +89,10 @@
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="维护计划时间" prop="planCycleValue">
                        <el-select
                            class="gd-select"
                            popper-class="gd-select-popper"
                            v-model="formData.planCycleValue"
                            placeholder="请选择"
                            clearable
                            multiple
                            :disabled="!formData.planCycleType"
                        >
                            <el-option
                                v-for="item in planCycleValueOptions"
                                :key="item.value"
                                :label="item.value"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <template #footer>
            <el-button color="#F2F3F5" @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button>
            <el-button color="#F2F3F5" @click="visible = false">{{ dialogReadonly ? '关闭' : '取消' }}</el-button>
            <el-button
                class="save-btn"
                color="#4C34FF"
@@ -149,11 +111,9 @@
import { computed, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { fieldRules, getDictLabel } from '@ztzf/utils'
import { fwDeviceMaintainRecordPageApi } from '@/views/basicManage/maintainRecord/fwDeviceMaintainRecord'
import {
    fwDeviceMaintainPlanDetailApi,
    fwDeviceMaintainPlanSubmitApi,
    fwDevicePageApi,
} from '@/views/basicManage/maintainRecord/maintainRecordApi'
const initForm = () => ({
@@ -163,41 +123,23 @@
})
const planCycleOptions = inject('planCycleOptions')
const planCycleValueOptions = ref([])
const emit = defineEmits(['success'])
const formRef = ref(null) // 表单实例
const formData = ref(initForm()) // 表单数据
const visible = ref(false) // 弹框显隐
const visible = defineModel() // 弹框显隐
const dialogMode = ref('add') // 弹框模式
const submitting = ref(false) // 提交中
const deviceList = ref([]) // 设备列表
const getPlanCycleLabel = inject('getPlanCycleLabel')
const dictObj = inject('dictObj')
const dialogReadonly = computed(() => dialogMode.value === 'view')
const titleEnum = ref({ edit: '编辑', view: '查看', add: '维护计划' })
const planCycleLabel = computed(() => {
    const item = planCycleOptions.find(option => option.value === formData.value.planCycleType)
    return item?.label || formData.value.planCycleType || '-'
})
const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' })
const rules = {
    deviceId: fieldRules(true),
    planCycleType: fieldRules(true),
    planCycleValue: [{ required: true, message: '请选择', trigger: ['blur', 'change'] }],
}
// 获取设备列表
function getDeviceList() {
    return fwDevicePageApi({ current: 1, size: 999 }).then(res => {
        deviceList.value = res?.data?.data?.records ?? []
    })
}
// 关闭弹框
function handleCancel() {
    visible.value = false
}
// 提交新增/编辑
@@ -220,70 +162,21 @@
    if (!formData.value.id) return
    const res = await fwDeviceMaintainPlanDetailApi({ id: formData.value.id })
    formData.value = res?.data?.data ?? {}
    console.log(formData.value, 66)
}
// 关闭后重置
function handleClosed() {
    formData.value = initForm()
}
const initSearchParams = () => ({
    current: 1, // 当前页
    size: 10, // 每页大小
})
const searchParams = ref(initSearchParams())
const total = ref(0) // 总条数
const loading = ref(true) // 列表加载中
const list = ref([]) // 列表数据
async function getList() {
    loading.value = true
    try {
        const params = { ...searchParams.value, planId: formData.value.id }
        const res = await fwDeviceMaintainRecordPageApi(params)
        list.value = res?.data?.data?.records ?? []
        total.value = res?.data?.data?.total ?? 0
    } finally {
        loading.value = false
    }
}
// 打开弹框
async function open({ mode, row } = {}) {
    dialogMode.value = mode || 'add'
    visible.value = true
    await getDeviceList()
    if (dialogMode.value === 'add') {
        formData.value = initForm()
    } else {
        formData.value = row
async function open({ mode = 'add', row } = {}) {
    dialogMode.value = mode
    formData.value = dialogMode.value === 'add' ? initForm() : row
    if (dialogMode.value !== 'add') {
        await loadDetail()
        getList()
    }
}
defineExpose({ open })
watch(
    () => formData.value?.planCycleType,
    type => {
        planCycleValueOptions.value = []
        if (!type) return
        if (type === '1') {
            ;[...Array(12)].forEach((item, index) => {
                ;[...Array(31)].forEach((item1, index1) => {
                    planCycleValueOptions.value.push({ value: `${index + 1}月${index1 + 1}号` })
                })
            })
        } else if (type === '2') {
            ;[...Array(31)].forEach((item, index) => {
                planCycleValueOptions.value.push({ value: `${index + 1}号` })
            })
        } else if (type === '3') {
            ;[...Array(7)].forEach((item, index) => {
                planCycleValueOptions.value.push({ value: `星期${index + 1}` })
            })
        }
    }
)
</script>
applications/task-work-order/src/views/basicManage/maintainRecord/MaintenanceDiaLog.vue
File was deleted
applications/task-work-order/src/views/basicManage/maintainRecord/fwDeviceMaintainRecord.js
File was deleted
applications/task-work-order/src/views/basicManage/maintainRecord/index.vue
@@ -50,7 +50,7 @@
        </el-form>
        <div class="gd-table-toolbar">
            <el-button :icon="Plus" color="#4C34FF" type="primary" @click="handleAdd">维护计划</el-button>
            <el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增</el-button>
            <el-button :icon="Delete" color="#4C34FF" :disabled="!selectedIds.length" @click="handleDelete()">删除</el-button>
        </div>
@@ -76,8 +76,8 @@
                    </el-table-column>
                    <el-table-column label="操作" class-name="operation-btns">
                        <template v-slot="{ row }">
                            <el-link @click="handleView(row)">查看</el-link>
                            <el-link @click="maintenance(row)">维护</el-link>
                            <el-link @click="openForm('view', row)">查看</el-link>
                            <el-link @click="openForm('edit', row)">编辑</el-link>
                            <el-link @click="handleDelete(row)">删除</el-link>
                        </template>
                    </el-table-column>
@@ -96,8 +96,7 @@
            </div>
        </div>
        <FormDiaLog ref="dialogRef" @success="getList" />
        <MaintenanceDiaLog ref="maintenanceDialogRef" @success="getList" />
        <FormDiaLog ref="dialogRef" @success="getList" v-if="dialogVisible" v-model="dialogVisible" />
    </basic-container>
</template>
<script setup>
@@ -108,7 +107,6 @@
import { getDeptTree } from '@/api/system/dept'
import { getDictLabel } from '@ztzf/utils'
import FormDiaLog from './FormDiaLog.vue'
import MaintenanceDiaLog from '@/views/basicManage/maintainRecord/MaintenanceDiaLog.vue'
import {
    fwDeviceMaintainPlanPageApi,
    fwDeviceMaintainPlanRemoveApi,
@@ -128,7 +126,7 @@
const selectedIds = ref([]) // 勾选的ID列表
const queryParamsRef = ref(null) // 查询表单实例
const dialogRef = ref(null) // 弹框实例
const maintenanceDialogRef = ref(null) // 弹框实例
const dialogVisible = ref(false)
const dictObj = ref({
    deviceType: [], // 设备类型
    deviceAtt: [], // 设备属性
@@ -171,14 +169,13 @@
    getList()
}
// 查看
function handleView(row) {
    dialogRef.value?.open({ mode: 'view', row: { ...row } })
}
// 维护
function maintenance(row) {
    maintenanceDialogRef.value?.open({ mode: 'edit', row: { ...row } })
// 新增/编辑/查看 弹框
function openForm(mode, row) {
    dialogVisible.value = true
    nextTick(() => {
        dialogRef.value?.open({ mode, row })
    })
}
// 删除
@@ -214,11 +211,6 @@
    getDeptTree().then(res => {
        deptTree.value = res.data.data
    })
}
// 新增
function handleAdd() {
    dialogRef.value?.open({ mode: 'add' })
}
function getPlanCycleLabel(row) {
applications/task-work-order/src/views/orderView/orderDataManage/evaluate/FormDiaLog.vue
New file
@@ -0,0 +1,220 @@
<template>
    <el-dialog
        class="gd-dialog"
        v-model="visible"
        :title="titleEnum[dialogMode]"
        @closed="visible = false"
        destroy-on-close
    >
        <div class="detail-container" v-if="dialogReadonly">
            <el-row>
                <el-col :span="12">
                    <div class="label">标题</div>
                    <div class="val">{{ formData.title }}</div>
                </el-col>
                <el-col :span="12">
                    <div class="label">数据名称</div>
                    <div class="val">{{ formData.dataName }}</div>
                </el-col>
                <el-col :span="12">
                    <div class="label">提出部门</div>
                    <div class="val">{{ formData.proposeDeptName }}</div>
                </el-col>
                <el-col :span="12">
                    <div class="label">数据提供部门</div>
                    <div class="val">{{ formData.dataProvideDeptName }}</div>
                </el-col>
                <el-col :span="12">
                    <div class="label">评分</div>
                    <div class="val">{{ formData.score }}</div>
                </el-col>
                <el-col :span="12">
                    <div class="label">是否解决</div>
                    <div class="val">{{ formData.isResolved === '1' ? '是' : '否' }}</div>
                </el-col>
                <el-col :span="24">
                    <div class="label">评价内容</div>
                    <div class="val">{{ formData.evaluationContent }}</div>
                </el-col>
            </el-row>
        </div>
        <el-form
            class="dialog-form"
            v-else
            ref="formRef"
            :model="formData"
            :rules="rules"
            :disabled="dialogReadonly"
            label-width="80px"
        >
            <el-row>
                <el-col :span="12">
                    <el-form-item label="标题" prop="title">
                        <el-input class="gd-input" v-model="formData.title" placeholder="请输入" clearable />
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="数据名称" prop="dataName">
                        <el-input class="gd-input" v-model="formData.dataName" placeholder="请输入" clearable />
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="提出部门" prop="proposeDeptId">
                        <el-tree-select
                            class="gd-select"
                            popper-class="gd-tree-select-popper"
                            v-model="formData.proposeDeptId"
                            node-key="id"
                            :data="deptTree"
                            :props="treeProps"
                            check-strictly
                            clearable
                        />
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="数据提供部门" prop="dataProvideDeptId">
                        <el-tree-select
                            class="gd-select"
                            popper-class="gd-tree-select-popper"
                            v-model="formData.dataProvideDeptId"
                            node-key="id"
                            :data="deptTree"
                            :props="treeProps"
                            check-strictly
                            clearable
                        />
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="评分" prop="score">
                        <el-input-number
                            class="gd-input"
                            v-model="formData.score"
                            :min="1"
                            :max="10"
                            placeholder="请输入"
                            controls-position="right"
                        />
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="是否解决" prop="isResolved">
                        <el-select
                            class="gd-select"
                            popper-class="gd-select-popper"
                            v-model="formData.isResolved"
                            placeholder="请选择"
                            clearable
                        >
                            <el-option v-for="item in isResolvedOptions" :key="item.value" :label="item.label" :value="item.value" />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item label="评价内容" prop="evaluationContent">
                        <el-input
                            class="gd-input"
                            v-model="formData.evaluationContent"
                            type="textarea"
                            :rows="4"
                            placeholder="请输入"
                            clearable
                        />
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <template #footer>
            <el-button color="#F2F3F5" @click="visible = false">{{ dialogReadonly ? '关闭' : '取消' }}</el-button>
            <el-button
                class="save-btn"
                color="#4C34FF"
                v-if="!dialogReadonly"
                :loading="submitting"
                :disabled="submitting"
                @click="handleSubmit"
            >
                保存
            </el-button>
        </template>
    </el-dialog>
</template>
<script setup>
import { computed, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { fieldRules } from '@ztzf/utils'
import {
    gdDataEvaluationDetailApi,
    gdDataEvaluationSubmitApi,
} from '@/views/orderView/orderDataManage/evaluate/evaluateApi'
// 初始化表单数据
const initForm = () => ({
    title: '',
    dataName: '',
    proposeDeptId: '',
    dataProvideDeptId: '',
    score: null,
    isResolved: '',
    evaluationContent: '',
})
const deptTree = inject('deptTree')
const treeProps = inject('treeProps')
const isResolvedOptions = inject('isResolvedOptions')
const emit = defineEmits(['success'])
const formRef = ref(null) // 表单实例
const formData = ref(initForm()) // 表单数据
const visible = defineModel() // 弹框显隐
const dialogMode = ref('add') // 弹框模式
const submitting = ref(false) // 提交中
const dialogReadonly = computed(() => dialogMode.value === 'view')
const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' })
const rules = {
    title: fieldRules(true),
    dataName: fieldRules(true),
    proposeDeptId: fieldRules(true),
    dataProvideDeptId: fieldRules(true),
    score: fieldRules(true),
    isResolved: fieldRules(true),
    evaluationContent: fieldRules(true),
}
// 提交新增/编辑
async function handleSubmit() {
    const isValid = await formRef.value?.validate().catch(() => false)
    if (!isValid) return
    submitting.value = true
    try {
        await gdDataEvaluationSubmitApi(formData.value)
        ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功')
        visible.value = false
        emit('success')
    } finally {
        submitting.value = false
    }
}
// 加载详情
async function loadDetail() {
    if (!formData.value.id) return
    const res = await gdDataEvaluationDetailApi({ id: formData.value.id })
    formData.value = res?.data?.data ?? {}
}
// 打开弹框
async function open({ mode = 'add', row } = {}) {
    dialogMode.value = mode
    formData.value = dialogMode.value === 'add' ? initForm() : row
    if (dialogMode.value !== 'add') {
        await loadDetail()
    }
}
defineExpose({ open })
</script>
applications/task-work-order/src/views/orderView/orderDataManage/evaluate/evaluateApi.js
New file
@@ -0,0 +1,37 @@
import request from '@/axios'
// 列表
export const gdDataEvaluationPageApi = params => {
    return request({
        url: `/drone-gd/orderdata/gdDataEvaluation/page`,
        method: 'get',
        params: { descs: 'update_time', ...params },
    })
}
// 新增或编辑
export const gdDataEvaluationSubmitApi = data => {
    return request({
        url: `/drone-gd/orderdata/gdDataEvaluation/submit`,
        method: 'post',
        data,
    })
}
// 删除
export const gdDataEvaluationRemoveApi = params => {
    return request({
        url: `/drone-gd/orderdata/gdDataEvaluation/remove`,
        method: 'post',
        params,
    })
}
// 详情
export const gdDataEvaluationDetailApi = params => {
    return request({
        url: `/drone-gd/orderdata/gdDataEvaluation/detail`,
        method: 'get',
        params,
    })
}
applications/task-work-order/src/views/orderView/orderDataManage/evaluate/index.vue
@@ -1,9 +1,177 @@
<template>
  <basic-container>
    评价管理
  </basic-container>
    <basic-container>
        <el-form ref="queryParamsRef" :model="searchParams" class="gd-search-form">
            <el-form-item label="标题" prop="title">
                <el-input class="gd-input" v-model="searchParams.title" placeholder="请输入" clearable @clear="handleSearch" />
            </el-form-item>
            <el-form-item label="是否解决" prop="isResolved">
                <el-select
                    class="gd-select"
                    popper-class="gd-select-popper"
                    v-model="searchParams.isResolved"
                    placeholder="请选择"
                    clearable
                    @change="handleSearch"
                >
                    <el-option v-for="item in isResolvedOptions" :key="item.value" :label="item.label" :value="item.value" />
                </el-select>
            </el-form-item>
            <el-form-item class="gd-search-actions">
                <el-button :icon="RefreshRight" @click="resetForm"></el-button>
                <el-button class="search-btn" :icon="Search" @click="handleSearch"></el-button>
            </el-form-item>
        </el-form>
        <div class="gd-table-toolbar">
            <el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增</el-button>
            <el-button :icon="Delete" color="#4C34FF" :disabled="!selectedIds.length" @click="handleDelete()">删除</el-button>
        </div>
        <div class="gd-table-container" v-loading="loading">
            <div class="gd-table-content gd-table-content-bg">
                <el-table class="gd-table" :data="list" @selection-change="handleSelectionChange">
                    <el-table-column type="selection" width="46" />
                    <el-table-column prop="title" show-overflow-tooltip label="标题" />
                    <el-table-column prop="dataName" show-overflow-tooltip label="数据名称" />
                    <el-table-column prop="proposeDeptName" show-overflow-tooltip label="提出部门" />
                    <el-table-column prop="dataProvideDeptName" show-overflow-tooltip label="数据提供部门" />
                    <el-table-column prop="score" show-overflow-tooltip label="评分" />
                    <el-table-column prop="isResolved" show-overflow-tooltip label="是否解决">
                        <template v-slot="{ row }">
                            {{ row.isResolved === '1' ? '是' : '否' }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="evaluationContent" show-overflow-tooltip label="评价内容" />
                    <el-table-column label="操作" class-name="operation-btns">
                        <template v-slot="{ row }">
                            <el-link @click="openForm('view', row)">查看</el-link>
                            <el-link @click="openForm('edit', row)">编辑</el-link>
                            <el-link @click="handleDelete(row)">删除</el-link>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <div class="gd-pagination-parent">
                <el-pagination
                    popper-class="gd-select-popper"
                    v-model:current-page="searchParams.current"
                    v-model:page-size="searchParams.size"
                    layout="total, prev, pager, next, sizes"
                    :total="total"
                    @change="getList"
                />
            </div>
        </div>
        <FormDiaLog ref="dialogRef" @success="getList" v-if="dialogVisible" v-model="dialogVisible" />
    </basic-container>
</template>
<script setup>
import { Search, RefreshRight, Plus, Delete } from '@element-plus/icons-vue'
import { onMounted, ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getDeptTree } from '@/api/system/dept'
import FormDiaLog from './FormDiaLog.vue'
import {
    gdDataEvaluationPageApi,
    gdDataEvaluationRemoveApi,
} from '@/views/orderView/orderDataManage/evaluate/evaluateApi'
// 初始化查询参数
const initSearchParams = () => ({
    title: '', // 标题
    isResolved: '', // 是否解决
    current: 1, // 当前页
    size: 10, // 每页大小
})
const searchParams = ref(initSearchParams()) // 查询参数
const total = ref(0) // 总条数
const loading = ref(true) // 列表加载中
const list = ref([]) // 列表数据
const selectedIds = ref([]) // 勾选的ID列表
const queryParamsRef = ref(null) // 查询表单实例
const dialogRef = ref(null) // 弹框实例
const dialogVisible = ref(false)
const deptTree = ref([]) // 部门树
const treeProps = {
    label: 'name',
    children: 'children',
}
const isResolvedOptions = [
    { label: '否', value: '0' },
    { label: '是', value: '1' },
]
provide('deptTree', deptTree)
provide('treeProps', treeProps)
provide('isResolvedOptions', isResolvedOptions)
// 获取列表
async function getList() {
    loading.value = true
    try {
        const res = await gdDataEvaluationPageApi(searchParams.value)
        list.value = res?.data?.data?.records ?? []
        total.value = res?.data?.data?.total ?? 0
    } finally {
        loading.value = false
    }
}
// 查询
function handleSearch() {
    searchParams.value.current = 1
    getList()
}
// 重置查询
function resetForm() {
    queryParamsRef.value?.resetFields()
    searchParams.value.current = 1
    getList()
}
// 新增/编辑/查看 弹框
function openForm(mode, row) {
    dialogVisible.value = true
    nextTick(() => {
        dialogRef.value?.open({ mode, row })
    })
}
// 删除
async function handleDelete(row) {
    const tips = row ? '该条' : '选中的项'
    await ElMessageBox.confirm(`确认删除${tips}吗?`, '提示', {
        type: 'warning',
        customClass: 'gd-confirm-custom',
        confirmButtonClass: 'gd-confirm-button',
        cancelButtonClass: 'gd-confirm-cancel-button',
    })
    const ids = row ? row.id : selectedIds.value.join(',')
    await gdDataEvaluationRemoveApi({ ids })
    ElMessage.success('删除成功')
    selectedIds.value = []
    getList()
}
// 勾选值设置
function handleSelectionChange(rows) {
    selectedIds.value = rows.map(item => item.id)
}
// 获取部门树
function getDeptTreeFun() {
    getDeptTree().then(res => {
        deptTree.value = res.data.data
    })
}
onMounted(() => {
    getList()
    getDeptTreeFun()
})
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue
@@ -1,6 +1,6 @@
<template>
  <basic-container>
    基础管理
    基础3管理
  </basic-container>
</template>
<script setup>