feat: rename inspection point type to personnel type and update dev proxy
This commit is contained in:
@@ -1,19 +1,38 @@
|
||||
<template>
|
||||
<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-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>
|
||||
<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-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['inspection:manage:add']">新增</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['inspection:manage:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
@@ -36,7 +55,9 @@
|
||||
>删除</el-button>
|
||||
</el-col>-->
|
||||
<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 :span="1.5">
|
||||
<el-button
|
||||
@@ -47,41 +68,100 @@
|
||||
v-hasPermi="['inspection:manage:export']"
|
||||
>导出</el-button>
|
||||
</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-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 label="序号" align="center" prop="id" />
|
||||
<el-table-column label="巡检点" align="center" prop="inspectionPoint" />
|
||||
<el-table-column label="巡检要求" align="center" prop="inspectionRequirements" />
|
||||
<!-- 新增:巡检点类型展示 -->
|
||||
<el-table-column label="巡检点类型" align="center" prop="inspectionPointType">
|
||||
<el-table-column
|
||||
label="巡检要求"
|
||||
align="center"
|
||||
prop="inspectionRequirements"
|
||||
/>
|
||||
<!-- 新增:人员类型展示 -->
|
||||
<el-table-column
|
||||
label="人员类型"
|
||||
align="center"
|
||||
prop="inspectionPointType"
|
||||
>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="inspection_point_type" :value="scope.row.inspectionPointType" />
|
||||
<dict-tag
|
||||
:options="inspection_point_type"
|
||||
:value="scope.row.inspectionPointType"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="巡检点状态" align="center" prop="inspectionStatus">
|
||||
<el-table-column
|
||||
label="巡检点状态"
|
||||
align="center"
|
||||
prop="inspectionStatus"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.inspectionStatus" :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" />
|
||||
<el-switch
|
||||
v-model="scope.row.inspectionStatus"
|
||||
: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>
|
||||
</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">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
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>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<pagination
|
||||
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>
|
||||
@@ -90,18 +170,37 @@
|
||||
<el-input v-model="form.inspectionPoint" placeholder="请输入巡检点" />
|
||||
</el-form-item>
|
||||
<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 label="巡检点类型" prop="inspectionPointType">
|
||||
<el-select v-model="form.inspectionPointType" placeholder="请选择巡检点类型">
|
||||
<el-option v-for="dict in inspection_point_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<!-- 新增:人员类型选择 -->
|
||||
<el-form-item label="人员类型" prop="inspectionPointType">
|
||||
<el-select
|
||||
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-form-item>
|
||||
<el-form-item label="巡检点状态" prop="inspectionStatus">
|
||||
<el-select v-model="form.inspectionStatus" placeholder="请选择巡检点状态">
|
||||
<el-option v-for="dict in inspection_point_status" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
<el-select
|
||||
v-model="form.inspectionStatus"
|
||||
placeholder="请选择巡检点状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in inspection_point_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -112,7 +211,10 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<QRCodeDownloader ref="qrCodeDownloaderRef" @qrCodeGenerated="handleQRCodeGenerated"></QRCodeDownloader>
|
||||
<QRCodeDownloader
|
||||
ref="qrCodeDownloaderRef"
|
||||
@qrCodeGenerated="handleQRCodeGenerated"
|
||||
></QRCodeDownloader>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -122,7 +224,7 @@ import {
|
||||
getManage,
|
||||
delManage,
|
||||
addManage,
|
||||
updateManage
|
||||
updateManage,
|
||||
} from "@/api/inspection/manage";
|
||||
|
||||
import QRCodeDownloader from "@/components/QRCode/QRCodeDownloader.vue";
|
||||
@@ -130,7 +232,7 @@ import { ref, onMounted, onUnmounted, nextTick } from "vue";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { inspection_point_status } = proxy.useDict("inspection_point_status");
|
||||
// 新增:巡检点类型字典
|
||||
// 新增:人员类型字典
|
||||
const { inspection_point_type } = proxy.useDict("inspection_point_type");
|
||||
// 子组件
|
||||
const qrCodeDownloaderRef = ref(null);
|
||||
@@ -154,23 +256,23 @@ const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
inspectionPoint: null
|
||||
inspectionPoint: null,
|
||||
},
|
||||
rules: {
|
||||
inspectionPoint: [
|
||||
{ required: true, message: "巡检点不能为空", trigger: "blur" }
|
||||
{ required: true, message: "巡检点不能为空", trigger: "blur" },
|
||||
],
|
||||
inspectionRequirements: [
|
||||
{ required: true, message: "巡检要求不能为空", trigger: "blur" }
|
||||
{ required: true, message: "巡检要求不能为空", trigger: "blur" },
|
||||
],
|
||||
// 新增:类型为必填
|
||||
inspectionPointType: [
|
||||
{ required: true, message: "巡检点类型不能为空", trigger: "change" }
|
||||
{ required: true, message: "人员类型不能为空", trigger: "change" },
|
||||
],
|
||||
inspectionStatus: [
|
||||
{ required: true, message: "巡检点状态不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
{ required: true, message: "巡检点状态不能为空", trigger: "change" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
@@ -178,7 +280,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
// 开关
|
||||
function switchChange(data) {
|
||||
console.log(data);
|
||||
updateManage(data).then(response => {
|
||||
updateManage(data).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
getList();
|
||||
});
|
||||
@@ -187,7 +289,7 @@ function switchChange(data) {
|
||||
/** 查询巡检点管理列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listManage(queryParams.value).then(response => {
|
||||
listManage(queryParams.value).then((response) => {
|
||||
manageList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
@@ -209,7 +311,7 @@ function reset() {
|
||||
// 新增:重置类型字段
|
||||
inspectionPointType: null,
|
||||
inspectionStatus: null,
|
||||
inspectionQrCode: null
|
||||
inspectionQrCode: null,
|
||||
};
|
||||
proxy.resetForm("manageRef");
|
||||
}
|
||||
@@ -229,8 +331,8 @@ function resetQuery() {
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection);
|
||||
ids.value = selection.map(item => item.id);
|
||||
inspectionPoint.value = selection.map(item => item.inspectionPoint);
|
||||
ids.value = selection.map((item) => item.id);
|
||||
inspectionPoint.value = selection.map((item) => item.inspectionPoint);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
@@ -246,7 +348,7 @@ function handleAdd() {
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value;
|
||||
getManage(_id).then(response => {
|
||||
getManage(_id).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改巡检点管理";
|
||||
@@ -255,16 +357,16 @@ function handleUpdate(row) {
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["manageRef"].validate(valid => {
|
||||
proxy.$refs["manageRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateManage(form.value).then(response => {
|
||||
updateManage(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addManage(form.value).then(response => {
|
||||
addManage(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
@@ -286,7 +388,7 @@ function handleDelete(row) {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 生成二维码 */
|
||||
@@ -297,7 +399,7 @@ function getQRCode(row) {
|
||||
) {
|
||||
qrCodeDownloaderRef.value.generateQRCodeWithTextAndNotifyParent(
|
||||
row.id + "",
|
||||
row.inspectionPoint
|
||||
row.inspectionPoint,
|
||||
);
|
||||
//qrCodeDownloaderRef.value.Download(row.inspectionPoint);
|
||||
}
|
||||
@@ -329,7 +431,7 @@ function getQRCodes() {
|
||||
) {
|
||||
qrCodeDownloaderRef.value.generateQRCodeWithTextAndNotifyParent(
|
||||
String(id),
|
||||
inspectionPoint.value[index]
|
||||
inspectionPoint.value[index],
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -345,9 +447,9 @@ function handleExport() {
|
||||
proxy.download(
|
||||
"inspection/manage/export",
|
||||
{
|
||||
...queryParams.value
|
||||
...queryParams.value,
|
||||
},
|
||||
`manage_${new Date().getTime()}.xlsx`
|
||||
`manage_${new Date().getTime()}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,72 +1,78 @@
|
||||
import path from 'path'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import createVitePlugins from './vite/plugins'
|
||||
import path from "path";
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import createVitePlugins from "./vite/plugins";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode, command }) => {
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
const { VITE_APP_ENV, VITE_APP_CAS_ENABLE } = env
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
const { VITE_APP_ENV, VITE_APP_CAS_ENABLE } = env;
|
||||
|
||||
return {
|
||||
// 部署生产环境和开发环境下的URL.
|
||||
// 根据 .env 中的 CAS 开关动态设置 base 路径
|
||||
// 注意:不要从 src/settings 引入,因为 vite 配置运行在 Node 环境,无法使用 import.meta.env
|
||||
base: VITE_APP_ENV === 'production' ? ((VITE_APP_CAS_ENABLE === 'true') ? '/cas/' : '/srs/') : '/',
|
||||
plugins: createVitePlugins(env, command === 'build'),
|
||||
base:
|
||||
VITE_APP_ENV === "production"
|
||||
? VITE_APP_CAS_ENABLE === "true"
|
||||
? "/cas/"
|
||||
: "/srs/"
|
||||
: "/",
|
||||
plugins: createVitePlugins(env, command === "build"),
|
||||
resolve: {
|
||||
// https://cn.vitejs.dev/config/#resolve-alias
|
||||
alias: {
|
||||
'~': path.resolve(__dirname, './'),
|
||||
'@': path.resolve(__dirname, './src')
|
||||
"~": path.resolve(__dirname, "./"),
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
// https://cn.vitejs.dev/config/#resolve-extensions
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
||||
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
|
||||
},
|
||||
server: {
|
||||
host: true,
|
||||
open: true,
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
// target: 'http://localhost:8080', // 测试
|
||||
target: 'http://172.16.129.101:8080', // 正式环境
|
||||
"/dev-api": {
|
||||
target: "http://localhost:8080", // 测试
|
||||
// target: 'http://172.16.129.101:8080', // 正式环境
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||
},
|
||||
// 添加对第三方 API 的代理配置
|
||||
'/api/v1/jssdk/upload': {
|
||||
target: 'https://px.effirst.com',
|
||||
"/api/v1/jssdk/upload": {
|
||||
target: "https://px.effirst.com",
|
||||
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
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [
|
||||
{
|
||||
postcssPlugin: 'internal:charset-removal',
|
||||
postcssPlugin: "internal:charset-removal",
|
||||
AtRule: {
|
||||
charset: (atRule) => {
|
||||
if (atRule.name === 'charset') {
|
||||
if (atRule.name === "charset") {
|
||||
atRule.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
build: {
|
||||
target: 'es2015', // 指定编译目标
|
||||
minify: 'terser',
|
||||
target: "es2015", // 指定编译目标
|
||||
minify: "terser",
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user