修改部署配置和菜单结构增加新页面
This commit is contained in:
parent
7553a6c0d9
commit
b353171ab4
|
@ -5,10 +5,10 @@ VITE_APP_TITLE = 云舒_心理健康平台
|
|||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = '/dev-api'
|
||||
VITE_APP_BASE_API = '/api'
|
||||
|
||||
# 应用访问路径 例如使用前缀 /admin/
|
||||
VITE_APP_CONTEXT_PATH = '/'
|
||||
VITE_APP_CONTEXT_PATH = '/manage/'
|
||||
|
||||
# 监控地址
|
||||
VITE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/applications'
|
||||
|
|
|
@ -5,7 +5,7 @@ VITE_APP_TITLE = 云舒_心理健康平台
|
|||
VITE_APP_ENV = 'production'
|
||||
|
||||
# 应用访问路径 例如使用前缀 /admin/
|
||||
VITE_APP_CONTEXT_PATH = '/'
|
||||
VITE_APP_CONTEXT_PATH = '/manage/'
|
||||
|
||||
# 监控地址
|
||||
VITE_APP_MONITRO_ADMIN = '/admin/applications'
|
||||
|
@ -14,7 +14,7 @@ VITE_APP_MONITRO_ADMIN = '/admin/applications'
|
|||
VITE_APP_POWERJOB_ADMIN = '/powerjob'
|
||||
|
||||
# 生产环境
|
||||
VITE_APP_BASE_API = '/prod-api'
|
||||
VITE_APP_BASE_API = '/api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
VITE_BUILD_COMPRESS = gzip
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vite serve --mode development",
|
||||
"build:prod": "vite build --mode production &&vue-tsc --noEmit",
|
||||
"build:prod": "vite build --mode production",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint src/**/*.{ts,js,vue} --fix",
|
||||
"prepare": "husky install",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { createWebHistory, createRouter, RouteOption } from 'vue-router';
|
||||
import { createWebHashHistory, createRouter, RouteOption } from 'vue-router';
|
||||
/* Layout */
|
||||
import Layout from '@/layout/index.vue';
|
||||
|
||||
|
@ -211,7 +211,7 @@ export const dynamicRoutes: RouteOption[] = [
|
|||
* 创建路由
|
||||
*/
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
|
||||
history: createWebHashHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
|
||||
routes: constantRoutes,
|
||||
// 刷新时,滚动条位置还原
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<el-table-column prop="status" label="状态">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status == 1 ? 'success' : 'danger'">{{ scope.row.status == 0 ? '未测' :
|
||||
'已测'}}</el-tag>
|
||||
'已测' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
|
@ -0,0 +1,190 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
||||
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div class="search" v-show="showSearch">
|
||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
||||
<el-form-item label="量表" prop="scaleNames">
|
||||
<el-input v-model="queryParams.scaleNames" placeholder="请输入量表名称 以逗号隔开" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门名称" prop="sessionName">
|
||||
<el-input v-model="queryParams.sessionName" placeholder="请输入场次名称" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发布时间" prop="deptId">
|
||||
<el-input v-model="queryParams.deptId" placeholder="请输入部门分组id" clearable style="width: 240px"
|
||||
@keyup.enter="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>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="scalePublishList">
|
||||
<el-table-column label="场次名称" align="center" prop="sessionName" />
|
||||
<el-table-column label="量表名称 以逗号隔开" align="center" prop="scaleNames" />
|
||||
|
||||
<el-table-column label="部门名称" align="center" prop="deptId" />
|
||||
<el-table-column label="截止日期" align="center" prop="expireTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.expireTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'" disable-transitions>
|
||||
{{ scope.row.status === 1 ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看测评结果" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleUpdate(scope.row)">
|
||||
<router-link :to="'/activity/index/' + scope.row.batchNo" class="link-type">
|
||||
<span>查看测评结果</span>
|
||||
</router-link>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</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" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ScalePublish" lang="ts">
|
||||
import { listScalePublish, getScalePublish } from '@/api/scale/scalePublish';
|
||||
import { ScalePublishVO, ScalePublishQuery, ScalePublishForm } from '@/api/scale/scalePublish/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const scalePublishList = ref<ScalePublishVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const scalePublishFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: ScalePublishForm = {
|
||||
batchNo: undefined,
|
||||
scaleIds: undefined,
|
||||
scaleNames: undefined,
|
||||
sessionName: undefined,
|
||||
deptId: undefined,
|
||||
partNum: undefined,
|
||||
expireTime: undefined,
|
||||
status: undefined,
|
||||
allowQueryResult: undefined,
|
||||
}
|
||||
const data = reactive<PageData<ScalePublishForm, ScalePublishQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
scaleIds: undefined,
|
||||
scaleNames: undefined,
|
||||
sessionName: undefined,
|
||||
deptId: undefined,
|
||||
partNum: undefined,
|
||||
expireTime: undefined,
|
||||
status: undefined,
|
||||
allowQueryResult: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
batchNo: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
scaleIds: [
|
||||
{ required: true, message: "量表id,以逗号隔开不能为空", trigger: "blur" }
|
||||
],
|
||||
scaleNames: [
|
||||
{ required: true, message: "量表名称 以逗号隔开不能为空", trigger: "blur" }
|
||||
],
|
||||
sessionName: [
|
||||
{ required: true, message: "场次名称不能为空", trigger: "blur" }
|
||||
],
|
||||
deptId: [
|
||||
{ required: true, message: "部门分组id不能为空", trigger: "blur" }
|
||||
],
|
||||
partNum: [
|
||||
{ required: true, message: "应参评人数不能为空", trigger: "blur" }
|
||||
],
|
||||
expireTime: [
|
||||
{ required: true, message: "截止日期不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态 0:正常;1:停用不能为空", trigger: "change" }
|
||||
],
|
||||
allowQueryResult: [
|
||||
{ required: true, message: "0:不允许,1:允许不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询量发布列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listScalePublish(queryParams.value);
|
||||
scalePublishList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
scalePublishFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: any) => {
|
||||
reset();
|
||||
const batchNo = row?.batchNo
|
||||
const res = await getScalePublish(batchNo)
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改量发布";
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
|
@ -6,6 +6,10 @@ import path from 'path';
|
|||
export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
return {
|
||||
build: {
|
||||
outDir: "manage",
|
||||
chunkSizeWarningLimit: 1600,
|
||||
},
|
||||
// 部署生产环境和开发环境下的URL。
|
||||
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||
|
|
Loading…
Reference in New Issue