diff --git a/src/views/inspection/manage/index.vue b/src/views/inspection/manage/index.vue index 211035d..2341d3f 100644 --- a/src/views/inspection/manage/index.vue +++ b/src/views/inspection/manage/index.vue @@ -1,19 +1,38 @@ - + @@ -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`, ); } diff --git a/vite.config.js b/vite.config.js index ec3666d..5e990a4 100644 --- a/vite.config.js +++ b/vite.config.js @@ -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, - } - } - } - } -}) \ No newline at end of file + }, + }, + }, + }; +}); diff --git a/测试.txt b/测试.txt deleted file mode 100644 index e69de29..0000000