1、设置打包环境公共文件夹路径;2、修复bug

master
chris 1 month ago
parent 4aa1d5604b
commit 4bfedb525d

@ -5,7 +5,7 @@ VITE_APP_TITLE = AEO系统
VITE_APP_ENV = 'production'
# 若依管理系统/生产环境
VITE_APP_BASE_API = '/prod-api'
VITE_APP_BASE_API = 'http://aeo.gdguanhui.com/aeo'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip

@ -151,7 +151,7 @@ function handleExceed() {
//
function handleUploadSuccess(res, file) {
if (res.code === 200) {
uploadList.value.push({ name: res.fileName, url: res.fileName });
uploadList.value.push({ name: res.fileName, url: import.meta.env.VITE_APP_BASE_API + res.fileName });
uploadedSuccessfully();
} else {
number.value--;

@ -88,7 +88,7 @@ function logout() {
type: 'warning'
}).then(() => {
userStore.logOut().then(() => {
location.href = '/index';
location.href = '/';
})
}).catch(() => { });
}

@ -1,6 +1,6 @@
import { createWebHistory, createRouter } from 'vue-router'
import { createWebHistory, createRouter } from "vue-router";
/* Layout */
import Layout from '@/layout'
import Layout from "@/layout";
/**
* Note: 路由配置项
@ -27,147 +27,147 @@ import Layout from '@/layout'
// 公共路由
export const constantRoutes = [
{
path: '/redirect',
path: "/redirect",
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index.vue')
}
]
path: "/redirect/:path(.*)",
component: () => import("@/views/redirect/index.vue"),
},
],
},
{
path: '/login',
component: () => import('@/views/login'),
hidden: true
path: "/login",
component: () => import("@/views/login"),
hidden: true,
},
{
path: '/register',
component: () => import('@/views/register'),
hidden: true
path: "/register",
component: () => import("@/views/register"),
hidden: true,
},
{
path: "/:pathMatch(.*)*",
component: () => import('@/views/error/404'),
hidden: true
component: () => import("@/views/error/404"),
hidden: true,
},
{
path: '/401',
component: () => import('@/views/error/401'),
hidden: true
path: "/401",
component: () => import("@/views/error/401"),
hidden: true,
},
{
path: '',
path: "",
component: Layout,
redirect: '/index',
redirect: "/index",
children: [
{
path: '/index',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
path: "/index",
component: () => import("@/views/index"),
name: "Index",
meta: { title: "首页", icon: "dashboard", affix: true },
},
],
},
{
path: '/user',
path: "/user",
component: Layout,
hidden: true,
redirect: 'noredirect',
redirect: "noredirect",
children: [
{
path: 'profile',
component: () => import('@/views/system/user/profile/index'),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
}
]
}
]
path: "profile",
component: () => import("@/views/system/user/profile/index"),
name: "Profile",
meta: { title: "个人中心", icon: "user" },
},
],
},
];
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [
{
path: '/system/user-auth',
path: "/system/user-auth",
component: Layout,
hidden: true,
permissions: ['system:user:edit'],
permissions: ["system:user:edit"],
children: [
{
path: 'role/:userId(\\d+)',
component: () => import('@/views/system/user/authRole'),
name: 'AuthRole',
meta: { title: '分配角色', activeMenu: '/system/user' }
}
]
path: "role/:userId(\\d+)",
component: () => import("@/views/system/user/authRole"),
name: "AuthRole",
meta: { title: "分配角色", activeMenu: "/system/user" },
},
],
},
{
path: '/system/role-auth',
path: "/system/role-auth",
component: Layout,
hidden: true,
permissions: ['system:role:edit'],
permissions: ["system:role:edit"],
children: [
{
path: 'user/:roleId(\\d+)',
component: () => import('@/views/system/role/authUser'),
name: 'AuthUser',
meta: { title: '分配用户', activeMenu: '/system/role' }
}
]
path: "user/:roleId(\\d+)",
component: () => import("@/views/system/role/authUser"),
name: "AuthUser",
meta: { title: "分配用户", activeMenu: "/system/role" },
},
],
},
{
path: '/system/dict-data',
path: "/system/dict-data",
component: Layout,
hidden: true,
permissions: ['system:dict:list'],
permissions: ["system:dict:list"],
children: [
{
path: 'index/:dictId(\\d+)',
component: () => import('@/views/system/dict/data'),
name: 'Data',
meta: { title: '字典数据', activeMenu: '/system/dict' }
}
]
path: "index/:dictId(\\d+)",
component: () => import("@/views/system/dict/data"),
name: "Data",
meta: { title: "字典数据", activeMenu: "/system/dict" },
},
],
},
{
path: '/monitor/job-log',
path: "/monitor/job-log",
component: Layout,
hidden: true,
permissions: ['monitor:job:list'],
permissions: ["monitor:job:list"],
children: [
{
path: 'index/:jobId(\\d+)',
component: () => import('@/views/monitor/job/log'),
name: 'JobLog',
meta: { title: '调度日志', activeMenu: '/monitor/job' }
}
]
path: "index/:jobId(\\d+)",
component: () => import("@/views/monitor/job/log"),
name: "JobLog",
meta: { title: "调度日志", activeMenu: "/monitor/job" },
},
],
},
{
path: '/tool/gen-edit',
path: "/tool/gen-edit",
component: Layout,
hidden: true,
permissions: ['tool:gen:edit'],
permissions: ["tool:gen:edit"],
children: [
{
path: 'index/:tableId(\\d+)',
component: () => import('@/views/tool/gen/editTable'),
name: 'GenEdit',
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
}
]
}
]
path: "index/:tableId(\\d+)",
component: () => import("@/views/tool/gen/editTable"),
name: "GenEdit",
meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
},
],
},
];
const router = createRouter({
history: createWebHistory(),
routes: constantRoutes,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
return savedPosition;
}
return { top: 0 }
return { top: 0 };
},
});

@ -71,15 +71,22 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="客户编码" align="center" prop="code" />
<el-table-column label="客户名称" align="center" prop="name" />
<el-table-column label="所属类别" align="center" prop="type" />
<el-table-column label="业务状态" align="center" prop="businessStatus" />
<el-table-column label="所属类别" align="center" prop="type">
<template #default="scope">
<dict-tag :options="customer_type" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="业务状态" align="center" prop="businessStatus">
<template #default="scope">
<dict-tag :options="customer_business_status" :value="scope.row.businessStatus"/>
</template>
</el-table-column>
<el-table-column label="联系人姓名" align="center" prop="contactsName" />
<el-table-column label="联系人电话" align="center" prop="contactsPhone" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button
link
size="mini"
icon="edit"
type="primary"
@click="handleUpdate(scope.row)"
@ -87,7 +94,6 @@
>修改</el-button>
<el-button
link
size="mini"
icon="delete"
type="danger"
@click="handleDelete(scope.row)"
@ -267,7 +273,7 @@ function handleUpdate(row) {
/** 提交按钮 */
function submitForm() {
validateForm.then(() => {
validateForm().then(() => {
if (form.value.id != null) {
updateCustomer(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");

@ -61,11 +61,15 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="所属客户" align="center" prop="customerId" />
<el-table-column label="员工姓名" align="center" prop="name" />
<el-table-column label="性别" align="center" prop="sex" />
<el-table-column label="性别" align="center" prop="sex">
<template #default="scope">
<dict-tag :options="customer_sex" :value="scope.row.sex"/>
</template>
</el-table-column>
<el-table-column label="员工职位" align="center" prop="post" />
<el-table-column label="员工电话" align="center" prop="phone" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template #default="scope">
<el-button
link
type="primary"
@ -117,7 +121,7 @@
<el-input v-model="form.name" placeholder="请输入员工姓名" />
</el-form-item>
<el-form-item label="员工性别" prop="sex">
<el-select v-model="form.type" placeholder="请选择性别">
<el-select v-model="form.sex" placeholder="请选择性别">
<el-option
v-for="item in customer_sex"
:key="item.value"
@ -127,7 +131,7 @@
</el-select>
</el-form-item>
<el-form-item label="员工职位" prop="post">
<el-input v-model="form.name" placeholder="请输入员工职位" />
<el-input v-model="form.post" placeholder="请输入员工职位" />
</el-form-item>
<el-form-item label="员工电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入员工电话" />
@ -274,7 +278,7 @@ function handleUpdate(row) {
/** 提交按钮 */
function submitForm() {
validateForm.then(() => {
validateForm().then(() => {
if (form.value.id != null) {
updateCustomerStaff(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");

@ -79,8 +79,8 @@ const systemName = import.meta.env.VITE_APP_TITLE;
const copyright = import.meta.env.VITE_APP_COPYRIGHT;
const loginForm = ref({
username: "admin",
password: "admin123",
username: import.meta.env.VITE_APP_ENV == 'production' ? "" : 'admin',
password: import.meta.env.VITE_APP_ENV == 'production' ? '' : "admin123",
rememberMe: false,
code: "",
uuid: ""

@ -67,13 +67,17 @@
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="产品编码" align="center" prop="code" />
<el-table-column label="产品名称" align="center" prop="name" />
<el-table-column label="产品别名" align="center" prop="alias" />
<el-table-column label="产品编码" align="center" prop="code" />
<el-table-column label="产品类型" align="center" prop="productsTypeId" />
<el-table-column label="规格" align="center" prop="specs" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="标签" align="center" prop="label" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="一级分类名称" align="center" prop="levelOne" />
<el-table-column label="二级分类名称" align="center" prop="levelTwo" />
<el-table-column label="三级分类名称" align="center" prop="levelThree" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button
@ -104,7 +108,7 @@
<!-- 添加或修改产品归档对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
<el-form ref="formRef" :model="form" :rules="rules" label-width="90px">
<el-form-item label="产品名称" prop="name">
<el-input v-model="form.name" placeholder="请输入产品名称" />
</el-form-item>
@ -126,6 +130,86 @@
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="产品类型" prop="productsTypeId">
<el-select
v-model="form.productsTypeId"
filterable
remote
placeholder="请输入关键词搜索"
remote-show-suffix
:remote-method="($event) => remoteMethod($event, remoteProductType)"
:loading="remoteLoading"
>
<el-option
v-for="item in productTypeList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="一级分类" prop="levelOneId">
<el-select
v-model="form.levelOneId"
filterable
remote
placeholder="请输入关键词搜索"
remote-show-suffix
:remote-method="($event) => remoteMethod($event, remoteCategory)"
:loading="remoteLoading"
@focus="remoteFocus(0)"
@change="handleLevelChange($event, 0)"
>
<el-option
v-for="item in categoryList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="二级分类" prop="levelTwoId">
<el-select
v-model="form.levelTwoId"
filterable
remote
placeholder="请输入关键词搜索"
remote-show-suffix
:disabled="form.levelOneId == null"
:remote-method="($event) => remoteMethod($event, remoteCategory)"
:loading="remoteLoading"
@focus="remoteFocus(1)"
@change="handleLevelChange($event, 1)"
>
<el-option
v-for="item in categoryList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="三级分类" prop="levelThreeId">
<el-select
v-model="form.levelThreeId"
filterable
remote
placeholder="请输入关键词搜索"
remote-show-suffix
:disabled="form.levelTwoId == null"
:remote-method="($event) => remoteMethod($event, remoteCategory)"
:loading="remoteLoading"
@focus="remoteFocus(2)"
@change="handleLevelChange($event, null)"
>
<el-option
v-for="item in categoryList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -137,8 +221,11 @@
<script setup>
import { listProductsRecord, getProductsRecord, delProductsRecord, addProductsRecord, updateProductsRecord } from "@/api/product/productsRecord";
import { listCategory } from "@/api/product/category";
import { listProductsType } from "@/api/product/productsType";
import useForm from '@/hooks/useForm.js';
import useRemote from "@/hooks/useRemote";
const defaultForm = {
id: null,
@ -180,21 +267,28 @@ const data = reactive({
showSearch: true,
//
total: 0,
//
//
recordList: [],
//
categoryList: [],
//
productTypeList: [],
//
title: "",
//
open: false,
//
rules: {
}
},
categoryType: null,
levelPIds: ['', ''],
})
const { loading, ids, single, multiple, showSearch, total, recordList, title, open, rules } = toRefs(data);
const { loading, ids, single, multiple, showSearch, total, recordList, title, open, rules, categoryList, categoryType, productTypeList, levelPIds } = toRefs(data);
const { form, validateForm, resetForm } = useForm(formRef, defaultForm)
const { form: queryParams, resetForm: resetQueryForm } = useForm(queryRef, defaultParams)
const { loading: remoteLoading, remoteMethod } = useRemote();
getList();
@ -207,6 +301,49 @@ function getList() {
});
}
function remoteCategory (query) {
const params = {
pageNum: 1,
pageSize: 50,
type: categoryType.value,
name: query
}
if (categoryType.value) {
params.pid = levelPIds.value[categoryType.value - 1];
}
return listCategory(params).then(response => {
categoryList.value = response.rows;
});
}
function remoteProductType (query) {
const params = {
pageNum: 1,
pageSize: 50,
name: query
}
return listProductsType(params).then(response => {
productTypeList.value = response.rows;
});
}
function remoteFocus (type) {
// 0: 1 2
categoryList.value = [];
categoryType.value = type;
}
function handleLevelChange (id, index) {
if (index == null) return;
if (index === 0) {
form.value.levelTwoId = form.value.levelThreeId = null;
}
levelPIds.value[index] = id;
}
//
function cancel() {
open.value = false;

@ -1,15 +1,7 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="部门ID" prop="deptId">
<el-input
v-model="queryParams.deptId"
placeholder="请输入部门ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="分类名称" prop="name">
<el-form-item label="类型" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入分类名称"
@ -17,14 +9,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="分类编码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入分类编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="search" @click="handleQuery"></el-button>
<el-button icon="refresh" @click="resetQuery"></el-button>
@ -75,11 +59,10 @@
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="分类名称" align="center" prop="name" />
<el-table-column label="分类编码" align="center" prop="code" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="类型" align="center" prop="name" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template #default="scope">
<el-button
link
type="primary"
@ -109,14 +92,11 @@
<!-- 添加或修改产品类型对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="分类名称" prop="name">
<el-input v-model="form.name" placeholder="请输入分类名称" />
</el-form-item>
<el-form-item label="分类编码" prop="code">
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" placeholder="请输入分类编码" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-form-item label="类型" prop="name">
<el-input v-model="form.name" placeholder="请输入分类名称" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -135,15 +115,13 @@ import useForm from '@/hooks/useForm.js';
const defaultForm = {
id: null,
name: null,
code: null,
remark: null
code: null
}
const defaultParams = {
pageNum: 1,
pageSize: 10,
name: null,
code: null
name: null
}
const formRef = ref(null);
@ -241,7 +219,7 @@ function handleUpdate(row) {
/** 提交按钮 */
function submitForm() {
validateForm.then(() => {
validateForm().then(() => {
if (form.value.id != null) {
updateProductsType(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");

@ -167,7 +167,7 @@
<el-date-picker clearable
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
placeholder="请选择供应商经营开始时间">
</el-date-picker>
</el-form-item>
@ -239,7 +239,7 @@
<el-date-picker clearable
v-model="form.approvalTime"
type="date"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
placeholder="请选择供应商核准时间">
</el-date-picker>
</el-form-item>
@ -259,7 +259,7 @@
<el-date-picker clearable
v-model="form.expirationTime"
type="date"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
placeholder="请选择合同有效期">
</el-date-picker>
</el-form-item>
@ -280,6 +280,7 @@
v-model="form.attachment"
placeholder="请选择"
clearable
@change="attachmentChanged"
>
<el-option
v-for="item in [{ value: 0, label: '否' }, { value: 1, label: '是' }]"
@ -290,9 +291,10 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-if="form.attachment">
<el-col :span="24" v-show="form.attachment">
<el-form-item label="执照相片" prop="licenseImg">
<image-upload
v-model="form.licenseImg"
:limit="1"
>
</image-upload>
@ -392,6 +394,11 @@ function getList() {
});
}
function attachmentChanged (value) {
if (value) return;
form.value.licenseImg = null;
}
//
function cancel() {
open.value = false;
@ -442,7 +449,7 @@ function handleUpdate(row) {
/** 提交按钮 */
function submitForm() {
validateForm.then(() => {
validateForm().then(() => {
if (form.value.id != null) {
updateSupplierRecord(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");

@ -0,0 +1,11 @@
<template>
<div>
</div>
</template>
<script>
</script>
<style lang="scss" scoped>
</style>

@ -0,0 +1,11 @@
<template>
<div>
</div>
</template>
<script>
</script>
<style lang="scss" scoped>
</style>

@ -10,7 +10,7 @@ export default defineConfig(({ mode, command }) => {
// 部署生产环境和开发环境下的URL。
// 默认情况下vite 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
base: VITE_APP_ENV === "production" ? "/" : "/",
base: VITE_APP_ENV === "production" ? "" : "/",
plugins: createVitePlugins(env, command === "build"),
resolve: {
// https://cn.vitejs.dev/config/#resolve-alias
@ -31,7 +31,8 @@ export default defineConfig(({ mode, command }) => {
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
"/dev-api": {
target: "http://192.168.0.111:8080",
// target: "http://192.168.0.111:8080",
target: "http://aeo.gdguanhui.com/aeo",
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, ""),
},

Loading…
Cancel
Save