Compare commits
3 Commits
68b50e2577
...
895e7f7bc3
| Author | SHA1 | Date | |
|---|---|---|---|
| 895e7f7bc3 | |||
| 2eb27abfc3 | |||
| 4533aa2750 |
@@ -1,19 +1,62 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="巡检点" prop="inspectionPoint">
|
<el-form-item label="巡检点" prop="inspectionPoint">
|
||||||
<el-input v-model="queryParams.inspectionPoint" placeholder="请输入巡检点" clearable @keyup.enter="handleQuery" />
|
<el-input
|
||||||
|
v-model="queryParams.inspectionPoint"
|
||||||
|
placeholder="请输入巡检点"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="人员类型" prop="inspectionPointType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.inspectionPointType"
|
||||||
|
placeholder="请选择人员类型"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in inspection_point_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
<el-button
|
||||||
v-hasPermi="['inspection:manage:add']">新增</el-button>
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['inspection:manage:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -36,7 +79,9 @@
|
|||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>-->
|
</el-col>-->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain :disabled="multiple" @click="getQRCodes">批量生成二维码</el-button>
|
<el-button type="success" plain :disabled="multiple" @click="getQRCodes"
|
||||||
|
>批量生成二维码</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -47,41 +92,100 @@
|
|||||||
v-hasPermi="['inspection:manage:export']"
|
v-hasPermi="['inspection:manage:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>-->
|
</el-col>-->
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="manageList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="manageList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" align="center" prop="id" />
|
<el-table-column label="序号" align="center" prop="id" />
|
||||||
<el-table-column label="巡检点" align="center" prop="inspectionPoint" />
|
<el-table-column label="巡检点" align="center" prop="inspectionPoint" />
|
||||||
<el-table-column label="巡检要求" align="center" prop="inspectionRequirements" />
|
<el-table-column
|
||||||
<!-- 新增:巡检点类型展示 -->
|
label="巡检要求"
|
||||||
<el-table-column label="巡检点类型" align="center" prop="inspectionPointType">
|
align="center"
|
||||||
|
prop="inspectionRequirements"
|
||||||
|
/>
|
||||||
|
<!-- 新增:人员类型展示 -->
|
||||||
|
<el-table-column
|
||||||
|
label="人员类型"
|
||||||
|
align="center"
|
||||||
|
prop="inspectionPointType"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="inspection_point_type" :value="scope.row.inspectionPointType" />
|
<dict-tag
|
||||||
|
:options="inspection_point_type"
|
||||||
|
:value="scope.row.inspectionPointType"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="巡检点状态" align="center" prop="inspectionStatus">
|
<el-table-column
|
||||||
|
label="巡检点状态"
|
||||||
|
align="center"
|
||||||
|
prop="inspectionStatus"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-switch v-model="scope.row.inspectionStatus" :active-value="'1'" :inactive-value="'0'" active-text="开"
|
<el-switch
|
||||||
inactive-text="关" class="ml-2" @change="switchChange(scope.row)"
|
v-model="scope.row.inspectionStatus"
|
||||||
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" />
|
:active-value="'1'"
|
||||||
|
:inactive-value="'0'"
|
||||||
|
active-text="开"
|
||||||
|
inactive-text="关"
|
||||||
|
class="ml-2"
|
||||||
|
@change="switchChange(scope.row)"
|
||||||
|
style="
|
||||||
|
--el-switch-on-color: #13ce66;
|
||||||
|
--el-switch-off-color: #ff4949;
|
||||||
|
"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
<el-button
|
||||||
v-hasPermi="['inspection:manage:edit']">修改</el-button>
|
link
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
type="primary"
|
||||||
v-hasPermi="['inspection:manage:remove']">删除</el-button>
|
icon="Edit"
|
||||||
<el-button link type="primary" icon="FullScreen" @click="getQRCode(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['inspection:manage:code']">生成二维码</el-button>
|
v-hasPermi="['inspection:manage:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['inspection:manage:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="FullScreen"
|
||||||
|
@click="getQRCode(scope.row)"
|
||||||
|
v-hasPermi="['inspection:manage:code']"
|
||||||
|
>生成二维码</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
<pagination
|
||||||
@pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改巡检点管理对话框 -->
|
<!-- 添加或修改巡检点管理对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
@@ -90,18 +194,37 @@
|
|||||||
<el-input v-model="form.inspectionPoint" placeholder="请输入巡检点" />
|
<el-input v-model="form.inspectionPoint" placeholder="请输入巡检点" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="巡检要求" prop="inspectionRequirements">
|
<el-form-item label="巡检要求" prop="inspectionRequirements">
|
||||||
<el-input v-model="form.inspectionRequirements" placeholder="请输入巡检要求" type="textarea" />
|
<el-input
|
||||||
|
v-model="form.inspectionRequirements"
|
||||||
|
placeholder="请输入巡检要求"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 新增:巡检点类型选择 -->
|
<!-- 新增:人员类型选择 -->
|
||||||
<el-form-item label="巡检点类型" prop="inspectionPointType">
|
<el-form-item label="人员类型" prop="inspectionPointType">
|
||||||
<el-select v-model="form.inspectionPointType" placeholder="请选择巡检点类型">
|
<el-select
|
||||||
<el-option v-for="dict in inspection_point_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
v-model="form.inspectionPointType"
|
||||||
|
placeholder="请选择人员类型"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in inspection_point_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="巡检点状态" prop="inspectionStatus">
|
<el-form-item label="巡检点状态" prop="inspectionStatus">
|
||||||
<el-select v-model="form.inspectionStatus" placeholder="请选择巡检点状态">
|
<el-select
|
||||||
<el-option v-for="dict in inspection_point_status" :key="dict.value" :label="dict.label"
|
v-model="form.inspectionStatus"
|
||||||
:value="dict.value"></el-option>
|
placeholder="请选择巡检点状态"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in inspection_point_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -112,7 +235,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<QRCodeDownloader ref="qrCodeDownloaderRef" @qrCodeGenerated="handleQRCodeGenerated"></QRCodeDownloader>
|
<QRCodeDownloader
|
||||||
|
ref="qrCodeDownloaderRef"
|
||||||
|
@qrCodeGenerated="handleQRCodeGenerated"
|
||||||
|
></QRCodeDownloader>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -122,7 +248,7 @@ import {
|
|||||||
getManage,
|
getManage,
|
||||||
delManage,
|
delManage,
|
||||||
addManage,
|
addManage,
|
||||||
updateManage
|
updateManage,
|
||||||
} from "@/api/inspection/manage";
|
} from "@/api/inspection/manage";
|
||||||
|
|
||||||
import QRCodeDownloader from "@/components/QRCode/QRCodeDownloader.vue";
|
import QRCodeDownloader from "@/components/QRCode/QRCodeDownloader.vue";
|
||||||
@@ -130,7 +256,7 @@ import { ref, onMounted, onUnmounted, nextTick } from "vue";
|
|||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { inspection_point_status } = proxy.useDict("inspection_point_status");
|
const { inspection_point_status } = proxy.useDict("inspection_point_status");
|
||||||
// 新增:巡检点类型字典
|
// 新增:人员类型字典
|
||||||
const { inspection_point_type } = proxy.useDict("inspection_point_type");
|
const { inspection_point_type } = proxy.useDict("inspection_point_type");
|
||||||
// 子组件
|
// 子组件
|
||||||
const qrCodeDownloaderRef = ref(null);
|
const qrCodeDownloaderRef = ref(null);
|
||||||
@@ -144,6 +270,7 @@ const single = ref(true);
|
|||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
|
const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
|
||||||
|
|
||||||
// 多选导出的数组
|
// 多选导出的数组
|
||||||
@@ -154,23 +281,24 @@ const data = reactive({
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
inspectionPoint: null
|
inspectionPoint: null,
|
||||||
|
inspectionPointType: null,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
inspectionPoint: [
|
inspectionPoint: [
|
||||||
{ required: true, message: "巡检点不能为空", trigger: "blur" }
|
{ required: true, message: "巡检点不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
inspectionRequirements: [
|
inspectionRequirements: [
|
||||||
{ required: true, message: "巡检要求不能为空", trigger: "blur" }
|
{ required: true, message: "巡检要求不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
// 新增:类型为必填
|
// 新增:类型为必填
|
||||||
inspectionPointType: [
|
inspectionPointType: [
|
||||||
{ required: true, message: "巡检点类型不能为空", trigger: "change" }
|
{ required: true, message: "人员类型不能为空", trigger: "change" },
|
||||||
],
|
],
|
||||||
inspectionStatus: [
|
inspectionStatus: [
|
||||||
{ required: true, message: "巡检点状态不能为空", trigger: "change" }
|
{ required: true, message: "巡检点状态不能为空", trigger: "change" },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
@@ -178,7 +306,7 @@ const { queryParams, form, rules } = toRefs(data);
|
|||||||
// 开关
|
// 开关
|
||||||
function switchChange(data) {
|
function switchChange(data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
updateManage(data).then(response => {
|
updateManage(data).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
@@ -187,11 +315,13 @@ function switchChange(data) {
|
|||||||
/** 查询巡检点管理列表 */
|
/** 查询巡检点管理列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listManage(queryParams.value).then(response => {
|
listManage(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
manageList.value = response.rows;
|
manageList.value = response.rows;
|
||||||
total.value = response.total;
|
total.value = response.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
@@ -209,7 +339,7 @@ function reset() {
|
|||||||
// 新增:重置类型字段
|
// 新增:重置类型字段
|
||||||
inspectionPointType: null,
|
inspectionPointType: null,
|
||||||
inspectionStatus: null,
|
inspectionStatus: null,
|
||||||
inspectionQrCode: null
|
inspectionQrCode: null,
|
||||||
};
|
};
|
||||||
proxy.resetForm("manageRef");
|
proxy.resetForm("manageRef");
|
||||||
}
|
}
|
||||||
@@ -222,6 +352,7 @@ function handleQuery() {
|
|||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
@@ -229,8 +360,8 @@ function resetQuery() {
|
|||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
console.log(selection);
|
console.log(selection);
|
||||||
ids.value = selection.map(item => item.id);
|
ids.value = selection.map((item) => item.id);
|
||||||
inspectionPoint.value = selection.map(item => item.inspectionPoint);
|
inspectionPoint.value = selection.map((item) => item.inspectionPoint);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
@@ -246,7 +377,7 @@ function handleAdd() {
|
|||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
const _id = row.id || ids.value;
|
const _id = row.id || ids.value;
|
||||||
getManage(_id).then(response => {
|
getManage(_id).then((response) => {
|
||||||
form.value = response.data;
|
form.value = response.data;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "修改巡检点管理";
|
title.value = "修改巡检点管理";
|
||||||
@@ -255,16 +386,16 @@ function handleUpdate(row) {
|
|||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["manageRef"].validate(valid => {
|
proxy.$refs["manageRef"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
updateManage(form.value).then(response => {
|
updateManage(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addManage(form.value).then(response => {
|
addManage(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("新增成功");
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
getList();
|
getList();
|
||||||
@@ -286,7 +417,7 @@ function handleDelete(row) {
|
|||||||
getList();
|
getList();
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 生成二维码 */
|
/** 生成二维码 */
|
||||||
@@ -297,7 +428,7 @@ function getQRCode(row) {
|
|||||||
) {
|
) {
|
||||||
qrCodeDownloaderRef.value.generateQRCodeWithTextAndNotifyParent(
|
qrCodeDownloaderRef.value.generateQRCodeWithTextAndNotifyParent(
|
||||||
row.id + "",
|
row.id + "",
|
||||||
row.inspectionPoint
|
row.inspectionPoint,
|
||||||
);
|
);
|
||||||
//qrCodeDownloaderRef.value.Download(row.inspectionPoint);
|
//qrCodeDownloaderRef.value.Download(row.inspectionPoint);
|
||||||
}
|
}
|
||||||
@@ -329,7 +460,7 @@ function getQRCodes() {
|
|||||||
) {
|
) {
|
||||||
qrCodeDownloaderRef.value.generateQRCodeWithTextAndNotifyParent(
|
qrCodeDownloaderRef.value.generateQRCodeWithTextAndNotifyParent(
|
||||||
String(id),
|
String(id),
|
||||||
inspectionPoint.value[index]
|
inspectionPoint.value[index],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -345,9 +476,9 @@ function handleExport() {
|
|||||||
proxy.download(
|
proxy.download(
|
||||||
"inspection/manage/export",
|
"inspection/manage/export",
|
||||||
{
|
{
|
||||||
...queryParams.value
|
...proxy.addDateRange(queryParams.value, dateRange.value),
|
||||||
},
|
},
|
||||||
`manage_${new Date().getTime()}.xlsx`
|
`manage_${new Date().getTime()}.xlsx`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,30 @@
|
|||||||
<el-form-item label="巡检人" prop="inspectorId">
|
<el-form-item label="巡检人" prop="inspectorId">
|
||||||
<el-input v-model="queryParams.inspectorId" placeholder="输入巡检人姓名"></el-input>
|
<el-input v-model="queryParams.inspectorId" placeholder="输入巡检人姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="人员类型" prop="inspectionPointType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.inspectionPointType"
|
||||||
|
placeholder="请选择人员类型"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in inspection_point_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
@@ -77,6 +101,7 @@ import { ref, reactive, toRefs, getCurrentInstance } from "vue";
|
|||||||
|
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { inspection_point_type } = proxy.useDict("inspection_point_type");
|
||||||
|
|
||||||
// 三套柱状数据:总计 / 本月 / 本日(巡检点统计)
|
// 三套柱状数据:总计 / 本月 / 本日(巡检点统计)
|
||||||
const histogramTotalData = ref({ xAxis: [], seriesData: [] });
|
const histogramTotalData = ref({ xAxis: [], seriesData: [] });
|
||||||
@@ -93,26 +118,24 @@ const totalUser = ref(0);
|
|||||||
const monthPoint = ref(0);
|
const monthPoint = ref(0);
|
||||||
const monthUser = ref(0);
|
const monthUser = ref(0);
|
||||||
|
|
||||||
// const daterangeOccurTime = ref([]);
|
const dateRange = ref([]);
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startTime: null,
|
startTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
inspectionPoint: '',
|
inspectionPoint: '',
|
||||||
inspectorId: ''
|
inspectorId: '',
|
||||||
|
inspectionPointType: null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams } = toRefs(data);
|
const { queryParams } = toRefs(data);
|
||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
queryParams.value = {
|
const params = proxy.addDateRange(queryParams.value, dateRange.value);
|
||||||
inspectionPoint: data.queryParams.inspectionPoint,
|
|
||||||
inspectorId: data.queryParams.inspectorId
|
|
||||||
};
|
|
||||||
// 巡检点统计(三合一:总/月/日)
|
// 巡检点统计(三合一:总/月/日)
|
||||||
pointStats3(queryParams.value).then(res => {
|
pointStats3(params).then((res) => {
|
||||||
const d = res.data || {};
|
const d = res.data || {};
|
||||||
const total = d.total || { xAxis: [], seriesData: [] };
|
const total = d.total || { xAxis: [], seriesData: [] };
|
||||||
const month = d.month || { xAxis: [], seriesData: [] };
|
const month = d.month || { xAxis: [], seriesData: [] };
|
||||||
@@ -125,7 +148,7 @@ function getList() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 巡检人统计(三合一:总/月/日)
|
// 巡检人统计(三合一:总/月/日)
|
||||||
inspectorStats3(queryParams.value).then(res=>{
|
inspectorStats3(params).then((res) => {
|
||||||
const d = res.data || {};
|
const d = res.data || {};
|
||||||
inspectorTotalData.value = (d.total || []).map(i=>({ name:i.name, value:i.value }));
|
inspectorTotalData.value = (d.total || []).map(i=>({ name:i.name, value:i.value }));
|
||||||
inspectorMonthData.value = (d.month || []).map(i=>({ name:i.name, value:i.value }));
|
inspectorMonthData.value = (d.month || []).map(i=>({ name:i.name, value:i.value }));
|
||||||
@@ -143,6 +166,7 @@ function handleQuery() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,72 +1,78 @@
|
|||||||
import path from 'path'
|
import path from "path";
|
||||||
import { defineConfig, loadEnv } from 'vite'
|
import { defineConfig, loadEnv } from "vite";
|
||||||
import createVitePlugins from './vite/plugins'
|
import createVitePlugins from "./vite/plugins";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode, command }) => {
|
export default defineConfig(({ mode, command }) => {
|
||||||
const env = loadEnv(mode, process.cwd())
|
const env = loadEnv(mode, process.cwd());
|
||||||
const { VITE_APP_ENV, VITE_APP_CAS_ENABLE } = env
|
const { VITE_APP_ENV, VITE_APP_CAS_ENABLE } = env;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// 部署生产环境和开发环境下的URL.
|
// 部署生产环境和开发环境下的URL.
|
||||||
// 根据 .env 中的 CAS 开关动态设置 base 路径
|
// 根据 .env 中的 CAS 开关动态设置 base 路径
|
||||||
// 注意:不要从 src/settings 引入,因为 vite 配置运行在 Node 环境,无法使用 import.meta.env
|
// 注意:不要从 src/settings 引入,因为 vite 配置运行在 Node 环境,无法使用 import.meta.env
|
||||||
base: VITE_APP_ENV === 'production' ? ((VITE_APP_CAS_ENABLE === 'true') ? '/cas/' : '/srs/') : '/',
|
base:
|
||||||
plugins: createVitePlugins(env, command === 'build'),
|
VITE_APP_ENV === "production"
|
||||||
|
? VITE_APP_CAS_ENABLE === "true"
|
||||||
|
? "/cas/"
|
||||||
|
: "/srs/"
|
||||||
|
: "/",
|
||||||
|
plugins: createVitePlugins(env, command === "build"),
|
||||||
resolve: {
|
resolve: {
|
||||||
// https://cn.vitejs.dev/config/#resolve-alias
|
// https://cn.vitejs.dev/config/#resolve-alias
|
||||||
alias: {
|
alias: {
|
||||||
'~': path.resolve(__dirname, './'),
|
"~": path.resolve(__dirname, "./"),
|
||||||
'@': path.resolve(__dirname, './src')
|
"@": path.resolve(__dirname, "./src"),
|
||||||
},
|
},
|
||||||
// https://cn.vitejs.dev/config/#resolve-extensions
|
// https://cn.vitejs.dev/config/#resolve-extensions
|
||||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
open: true,
|
open: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
// https://cn.vitejs.dev/config/#server-proxy
|
// https://cn.vitejs.dev/config/#server-proxy
|
||||||
'/dev-api': {
|
"/dev-api": {
|
||||||
// target: 'http://localhost:8080', // 测试
|
target: "http://localhost:8080", // 测试
|
||||||
target: 'http://172.16.129.101:8080', // 正式环境
|
// target: 'http://172.16.129.101:8080', // 正式环境
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||||
},
|
},
|
||||||
// 添加对第三方 API 的代理配置
|
// 添加对第三方 API 的代理配置
|
||||||
'/api/v1/jssdk/upload': {
|
"/api/v1/jssdk/upload": {
|
||||||
target: 'https://px.effirst.com',
|
target: "https://px.effirst.com",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (p) => p.replace(/^\/api\/v1\/jssdk\/upload/, '/api/v1/jssdk/upload')
|
rewrite: (p) =>
|
||||||
}
|
p.replace(/^\/api\/v1\/jssdk\/upload/, "/api/v1/jssdk/upload"),
|
||||||
}
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
|
// fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
|
||||||
css: {
|
css: {
|
||||||
postcss: {
|
postcss: {
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
postcssPlugin: 'internal:charset-removal',
|
postcssPlugin: "internal:charset-removal",
|
||||||
AtRule: {
|
AtRule: {
|
||||||
charset: (atRule) => {
|
charset: (atRule) => {
|
||||||
if (atRule.name === 'charset') {
|
if (atRule.name === "charset") {
|
||||||
atRule.remove();
|
atRule.remove();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
target: 'es2015', // 指定编译目标
|
target: "es2015", // 指定编译目标
|
||||||
minify: 'terser',
|
minify: "terser",
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
compress: {
|
compress: {
|
||||||
drop_console: true,
|
drop_console: true,
|
||||||
drop_debugger: true,
|
drop_debugger: true,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user