量表代码提交
This commit is contained in:
parent
7bd5adae9c
commit
023334bb04
|
@ -23,13 +23,13 @@
|
||||||
"animate.css": "4.1.1",
|
"animate.css": "4.1.1",
|
||||||
"await-to-js": "^3.0.0",
|
"await-to-js": "^3.0.0",
|
||||||
"axios": "^1.3.4",
|
"axios": "^1.3.4",
|
||||||
|
"crypto-js": "^4.1.1",
|
||||||
"echarts": "5.4.0",
|
"echarts": "5.4.0",
|
||||||
"element-plus": "2.2.27",
|
"element-plus": "2.6.3",
|
||||||
"file-saver": "2.0.5",
|
"file-saver": "2.0.5",
|
||||||
"fuse.js": "6.6.2",
|
"fuse.js": "6.6.2",
|
||||||
"js-cookie": "3.0.1",
|
"js-cookie": "3.0.1",
|
||||||
"jsencrypt": "3.3.1",
|
"jsencrypt": "3.3.1",
|
||||||
"crypto-js": "^4.1.1",
|
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"path-browserify": "1.0.1",
|
"path-browserify": "1.0.1",
|
||||||
"path-to-regexp": "6.2.0",
|
"path-to-regexp": "6.2.0",
|
||||||
|
@ -73,10 +73,10 @@
|
||||||
"unplugin-auto-import": "0.13.0",
|
"unplugin-auto-import": "0.13.0",
|
||||||
"unplugin-icons": "0.15.1",
|
"unplugin-icons": "0.15.1",
|
||||||
"unplugin-vue-components": "0.23.0",
|
"unplugin-vue-components": "0.23.0",
|
||||||
|
"unplugin-vue-setup-extend-plus": "0.4.9",
|
||||||
"vite": "4.3.1",
|
"vite": "4.3.1",
|
||||||
"vite-plugin-compression": "0.5.1",
|
"vite-plugin-compression": "0.5.1",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"unplugin-vue-setup-extend-plus": "0.4.9",
|
|
||||||
"vitest": "^0.29.7",
|
"vitest": "^0.29.7",
|
||||||
"vue-eslint-parser": "9.1.0",
|
"vue-eslint-parser": "9.1.0",
|
||||||
"vue-tsc": "0.35.0"
|
"vue-tsc": "0.35.0"
|
||||||
|
|
|
@ -30,8 +30,8 @@ dependencies:
|
||||||
specifier: 5.4.0
|
specifier: 5.4.0
|
||||||
version: 5.4.0
|
version: 5.4.0
|
||||||
element-plus:
|
element-plus:
|
||||||
specifier: 2.2.27
|
specifier: 2.6.3
|
||||||
version: 2.2.27(vue@3.2.45)
|
version: 2.6.3(vue@3.2.45)
|
||||||
file-saver:
|
file-saver:
|
||||||
specifier: 2.0.5
|
specifier: 2.0.5
|
||||||
version: 2.0.5
|
version: 2.0.5
|
||||||
|
@ -422,6 +422,14 @@ packages:
|
||||||
vue: 3.2.45
|
vue: 3.2.45
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@element-plus/icons-vue@2.3.1(vue@3.2.45):
|
||||||
|
resolution: {integrity: sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==}
|
||||||
|
peerDependencies:
|
||||||
|
vue: ^3.2.0
|
||||||
|
dependencies:
|
||||||
|
vue: 3.2.45
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@esbuild/android-arm64@0.17.19:
|
/@esbuild/android-arm64@0.17.19:
|
||||||
resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==}
|
resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
|
@ -2305,13 +2313,13 @@ packages:
|
||||||
resolution: {integrity: sha512-qRq74Mo7ChePOU6GHdfAJ0NREXU8vQTlVlfWz3wNygFay6xrd/fY2J7oGHwrhFeU30OVctGLdTh/FcnokTWpng==}
|
resolution: {integrity: sha512-qRq74Mo7ChePOU6GHdfAJ0NREXU8vQTlVlfWz3wNygFay6xrd/fY2J7oGHwrhFeU30OVctGLdTh/FcnokTWpng==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/element-plus@2.2.27(vue@3.2.45):
|
/element-plus@2.6.3(vue@3.2.45):
|
||||||
resolution: {integrity: sha512-P04HDOZBYDdvlYuleuCZRULzAc5xJVOBfLDK9xWxVo0vyo8ntdaXS5sTU+/76vrNzuO3FhLn9kvrsbiJEVa1jg==}
|
resolution: {integrity: sha512-U4L/mr+1r+EmAUYUHrs0V/8hHMdBGP07rPymSC72LZCN4jK1UwygQYICegTQ5us4mxeqBvW6wfoEfo003fwCqw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vue: ^3.2.0
|
vue: ^3.2.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@ctrl/tinycolor': 3.6.1
|
'@ctrl/tinycolor': 3.6.1
|
||||||
'@element-plus/icons-vue': 2.1.0(vue@3.2.45)
|
'@element-plus/icons-vue': 2.3.1(vue@3.2.45)
|
||||||
'@floating-ui/dom': 1.6.3
|
'@floating-ui/dom': 1.6.3
|
||||||
'@popperjs/core': /@sxzz/popperjs-es@2.11.7
|
'@popperjs/core': /@sxzz/popperjs-es@2.11.7
|
||||||
'@types/lodash': 4.17.0
|
'@types/lodash': 4.17.0
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { SysScaleVO, SysScaleForm, SysScaleQuery } from '@/api/scale/SysScale/ty
|
||||||
|
|
||||||
export const listSysScale = (query?: SysScaleQuery): AxiosPromise<SysScaleVO[]> => {
|
export const listSysScale = (query?: SysScaleQuery): AxiosPromise<SysScaleVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScale/list',
|
url: '/scale/info/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
});
|
});
|
||||||
|
@ -22,7 +22,7 @@ export const listSysScale = (query?: SysScaleQuery): AxiosPromise<SysScaleVO[]>
|
||||||
*/
|
*/
|
||||||
export const getSysScale = (scaleId: string | number): AxiosPromise<SysScaleVO> => {
|
export const getSysScale = (scaleId: string | number): AxiosPromise<SysScaleVO> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScale/' + scaleId,
|
url: '/scale/info/' + scaleId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -33,7 +33,7 @@ export const getSysScale = (scaleId: string | number): AxiosPromise<SysScaleVO>
|
||||||
*/
|
*/
|
||||||
export const addSysScale = (data: SysScaleForm) => {
|
export const addSysScale = (data: SysScaleForm) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScale',
|
url: '/scale/info',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
|
@ -45,7 +45,7 @@ export const addSysScale = (data: SysScaleForm) => {
|
||||||
*/
|
*/
|
||||||
export const updateSysScale = (data: SysScaleForm) => {
|
export const updateSysScale = (data: SysScaleForm) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScale',
|
url: '/scale/info',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
|
@ -57,7 +57,7 @@ export const updateSysScale = (data: SysScaleForm) => {
|
||||||
*/
|
*/
|
||||||
export const delSysScale = (scaleId: string | number | Array<string | number>) => {
|
export const delSysScale = (scaleId: string | number | Array<string | number>) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScale/' + scaleId,
|
url: '/scale/info/' + scaleId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { SysScaleFactorVO, SysScaleFactorForm, SysScaleFactorQuery } from '@/api
|
||||||
|
|
||||||
export const listSysScaleFactor = (query?: SysScaleFactorQuery): AxiosPromise<SysScaleFactorVO[]> => {
|
export const listSysScaleFactor = (query?: SysScaleFactorQuery): AxiosPromise<SysScaleFactorVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFactor/list',
|
url: '/scale/factor/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
});
|
});
|
||||||
|
@ -22,7 +22,7 @@ export const listSysScaleFactor = (query?: SysScaleFactorQuery): AxiosPromise<Sy
|
||||||
*/
|
*/
|
||||||
export const getSysScaleFactor = (factorId: string | number): AxiosPromise<SysScaleFactorVO> => {
|
export const getSysScaleFactor = (factorId: string | number): AxiosPromise<SysScaleFactorVO> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFactor/' + factorId,
|
url: '/scale/factor/' + factorId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -33,7 +33,7 @@ export const getSysScaleFactor = (factorId: string | number): AxiosPromise<SysSc
|
||||||
*/
|
*/
|
||||||
export const addSysScaleFactor = (data: SysScaleFactorForm) => {
|
export const addSysScaleFactor = (data: SysScaleFactorForm) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFactor',
|
url: '/scale/factor',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
|
@ -45,7 +45,7 @@ export const addSysScaleFactor = (data: SysScaleFactorForm) => {
|
||||||
*/
|
*/
|
||||||
export const updateSysScaleFactor = (data: SysScaleFactorForm) => {
|
export const updateSysScaleFactor = (data: SysScaleFactorForm) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFactor',
|
url: '/scale/factor',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
|
@ -57,7 +57,7 @@ export const updateSysScaleFactor = (data: SysScaleFactorForm) => {
|
||||||
*/
|
*/
|
||||||
export const delSysScaleFactor = (factorId: string | number | Array<string | number>) => {
|
export const delSysScaleFactor = (factorId: string | number | Array<string | number>) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFactor/' + factorId,
|
url: '/scale/factor/' + factorId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,6 +62,8 @@ export interface SysScaleFactorForm extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
formulaId?: string | number;
|
formulaId?: string | number;
|
||||||
|
|
||||||
|
questionIds:[]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SysScaleFactorQuery extends PageQuery {
|
export interface SysScaleFactorQuery extends PageQuery {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { SysScaleFormulaVO, SysScaleFormulaForm, SysScaleFormulaQuery } from '@/
|
||||||
|
|
||||||
export const listSysScaleFormula = (query?: SysScaleFormulaQuery): AxiosPromise<SysScaleFormulaVO[]> => {
|
export const listSysScaleFormula = (query?: SysScaleFormulaQuery): AxiosPromise<SysScaleFormulaVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFormula/list',
|
url: '/scale/formula/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
});
|
});
|
||||||
|
@ -22,7 +22,7 @@ export const listSysScaleFormula = (query?: SysScaleFormulaQuery): AxiosPromise<
|
||||||
*/
|
*/
|
||||||
export const getSysScaleFormula = (formulaId: string | number): AxiosPromise<SysScaleFormulaVO> => {
|
export const getSysScaleFormula = (formulaId: string | number): AxiosPromise<SysScaleFormulaVO> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFormula/' + formulaId,
|
url: '/scale/formula/' + formulaId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -33,7 +33,7 @@ export const getSysScaleFormula = (formulaId: string | number): AxiosPromise<Sys
|
||||||
*/
|
*/
|
||||||
export const addSysScaleFormula = (data: SysScaleFormulaForm) => {
|
export const addSysScaleFormula = (data: SysScaleFormulaForm) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFormula',
|
url: '/scale/formula',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
|
@ -45,7 +45,7 @@ export const addSysScaleFormula = (data: SysScaleFormulaForm) => {
|
||||||
*/
|
*/
|
||||||
export const updateSysScaleFormula = (data: SysScaleFormulaForm) => {
|
export const updateSysScaleFormula = (data: SysScaleFormulaForm) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFormula',
|
url: '/scale/formula',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
|
@ -57,7 +57,7 @@ export const updateSysScaleFormula = (data: SysScaleFormulaForm) => {
|
||||||
*/
|
*/
|
||||||
export const delSysScaleFormula = (formulaId: string | number | Array<string | number>) => {
|
export const delSysScaleFormula = (formulaId: string | number | Array<string | number>) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/scale/SysScaleFormula/' + formulaId,
|
url: '/scale/formula/' + formulaId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -149,6 +149,20 @@ export const dynamicRoutes: RouteOption[] = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/scale/scale-question',
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
permissions: ['scale:SysScale:edit'],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'index/:scaleId(\\d+)',
|
||||||
|
component: () => import('@/views/scale/SysScaleQuestion/index.vue'),
|
||||||
|
name: 'ScaleQuestion',
|
||||||
|
meta: { title: '问题列表', activeMenu: '/scale/question', icon: '' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/system/oss-config',
|
path: '/system/oss-config',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|
|
@ -1,413 +0,0 @@
|
||||||
<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="name">
|
|
||||||
<el-input v-model="queryParams.name" placeholder="请输入量表名称" clearable style="width: 240px"
|
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="量表编码" prop="code">
|
|
||||||
<el-input v-model="queryParams.code" placeholder="请输入量表编码" clearable style="width: 240px"
|
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="测评项" prop="ageRange">
|
|
||||||
<el-input v-model="queryParams.title" placeholder="请输入标题" clearable style="width: 240px"
|
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="适应人群" prop="subTitle">
|
|
||||||
<el-input v-model="queryParams.subTitle" placeholder="请输入子标题" clearable style="width: 240px"
|
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="量表类型" prop="tags">
|
|
||||||
<el-input v-model="queryParams.tags" placeholder="请输入标签" 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">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
|
||||||
v-hasPermi="['scale:ScaleInfo:add']">新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
|
||||||
v-hasPermi="['scale:ScaleInfo:edit']">修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
|
||||||
v-hasPermi="['scale:ScaleInfo:remove']">删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
|
||||||
v-hasPermi="['scale:ScaleInfo:export']">导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="ScaleInfoList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="封面" align="center" prop="converImg" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<image-preview :src="scope.row.coverImgUrl" :width="50" :height="50" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="量表名称" align="center" prop="name" />
|
|
||||||
<el-table-column label="量表编码" align="center" prop="code" />
|
|
||||||
<el-table-column label="标题" align="center" prop="title" />
|
|
||||||
<el-table-column label="标签" align="center" prop="tags" />
|
|
||||||
<el-table-column label="测评次数" align="center" prop="evalNums" />
|
|
||||||
|
|
||||||
<el-table-column label="分钟" align="center" prop="duration" />
|
|
||||||
<el-table-column label="状态" align="center" prop="status" />
|
|
||||||
<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="Edit" @click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['scale:ScaleInfo:edit']"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip content="删除" placement="top">
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['scale:ScaleInfo:remove']"></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>
|
|
||||||
<!-- 添加或修改心理测评量对话框 -->
|
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
|
||||||
<el-form ref="ScaleInfoFormRef" :model="form" :rules="rules" label-width="100px">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="量表名称" prop="name">
|
|
||||||
<el-input v-model="form.name" placeholder="请输入量表名称" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="量表编码" prop="code">
|
|
||||||
<el-input v-model="form.code" placeholder="请输入量表编码" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="价格/单次" prop="price">
|
|
||||||
<el-input v-model="form.price" placeholder="请输入价格/单次" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="标签" prop="tags">
|
|
||||||
<el-input v-model="form.tags" placeholder="请输入标签" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="标题" prop="title">
|
|
||||||
<el-input v-model="form.title" placeholder="请输入标题" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="子标题" prop="subTitle">
|
|
||||||
<el-input v-model="form.subTitle" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="测评时长" prop="duration">
|
|
||||||
<el-input v-model="form.duration" placeholder="请输入测评时长" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="题量" prop="questionsNum">
|
|
||||||
<el-input v-model="form.questionsNum" placeholder="请输入题量" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="类型" prop="ageRange">
|
|
||||||
<el-input v-model="form.ageRange" placeholder="请输入类型" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="适合年龄段" prop="ageRange">
|
|
||||||
<el-input v-model="form.ageRange" placeholder="请输入适合年龄段" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="量表维度" prop="evalNums">
|
|
||||||
<el-input v-model="form.evalNums" placeholder="请输入量表维度" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="适应人群" prop="evalNums">
|
|
||||||
<el-input v-model="form.evalNums" placeholder="请输入适应人群" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="描述" prop="note">
|
|
||||||
<el-input v-model="form.note" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="封面" prop="converImg">
|
|
||||||
<image-upload v-model="form.coverImg" :limit="1" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="ScaleInfo" lang="ts">
|
|
||||||
import { listScaleInfo, getScaleInfo, delScaleInfo, addScaleInfo, updateScaleInfo } from '@/api/scale/ScaleInfo';
|
|
||||||
import { ScaleInfoVO, ScaleInfoQuery, ScaleInfoForm } from '@/api/scale/ScaleInfo/types';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
|
|
||||||
const ScaleInfoList = ref<ScaleInfoVO[]>([]);
|
|
||||||
const buttonLoading = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
const ScaleInfoFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: ScaleInfoForm = {
|
|
||||||
id: undefined,
|
|
||||||
name: undefined,
|
|
||||||
code: undefined,
|
|
||||||
title: undefined,
|
|
||||||
subTitle: undefined,
|
|
||||||
tags: undefined,
|
|
||||||
ageRange: undefined,
|
|
||||||
evalNums: undefined,
|
|
||||||
converImg: undefined,
|
|
||||||
price: undefined,
|
|
||||||
note: undefined,
|
|
||||||
duration: undefined,
|
|
||||||
dimensionType: undefined,
|
|
||||||
status: undefined,
|
|
||||||
type: undefined,
|
|
||||||
questionsNum: undefined,
|
|
||||||
selectDirection: undefined,
|
|
||||||
}
|
|
||||||
const data = reactive<PageData<ScaleInfoForm, ScaleInfoQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
name: undefined,
|
|
||||||
code: undefined,
|
|
||||||
title: undefined,
|
|
||||||
subTitle: undefined,
|
|
||||||
tags: undefined,
|
|
||||||
ageRange: undefined,
|
|
||||||
evalNums: undefined,
|
|
||||||
converImg: undefined,
|
|
||||||
price: undefined,
|
|
||||||
note: undefined,
|
|
||||||
duration: undefined,
|
|
||||||
dimensionType: undefined,
|
|
||||||
status: undefined,
|
|
||||||
type: undefined,
|
|
||||||
questionsNum: undefined,
|
|
||||||
selectDirection: undefined,
|
|
||||||
params: {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
id: [
|
|
||||||
{ required: true, message: "主键不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
name: [
|
|
||||||
{ required: true, message: "量表名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
code: [
|
|
||||||
{ required: true, message: "量表编码不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
title: [
|
|
||||||
{ required: true, message: "标题不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
subTitle: [
|
|
||||||
{ required: true, message: "子标题不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
tags: [
|
|
||||||
{ required: true, message: "标签不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
ageRange: [
|
|
||||||
{ required: true, message: "适合年龄段不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
evalNums: [
|
|
||||||
{ required: true, message: "测评次数不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
converImg: [
|
|
||||||
{ required: true, message: "封面不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
price: [
|
|
||||||
{ required: true, message: "价格/单次不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
note: [
|
|
||||||
{ required: true, message: "描述不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
duration: [
|
|
||||||
{ required: true, message: "分钟不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
dimensionType: [
|
|
||||||
{ required: true, message: "维度类型:0:单项单维,1:多项单维型,2:多项多维型不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
status: [
|
|
||||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
type: [
|
|
||||||
{ required: true, message: "量表类别:如情感,字典不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
questionsNum: [
|
|
||||||
{ required: true, message: "题量不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
selectDirection: [
|
|
||||||
{ required: true, message: "0:高分异常,1:低分异常不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询心理测评量列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
const res = await listScaleInfo(queryParams.value);
|
|
||||||
ScaleInfoList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 取消按钮 */
|
|
||||||
const cancel = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
ScaleInfoFormRef.value?.resetFields();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: ScaleInfoVO[]) => {
|
|
||||||
ids.value = selection.map(item => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = "添加心理测评量";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = async (row?: ScaleInfoVO) => {
|
|
||||||
reset();
|
|
||||||
const _id = row?.id || ids.value[0]
|
|
||||||
const res = await getScaleInfo(_id);
|
|
||||||
Object.assign(form.value, res.data);
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = "修改心理测评量";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
ScaleInfoFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateScaleInfo(form.value).finally(() => buttonLoading.value = false);
|
|
||||||
} else {
|
|
||||||
await addScaleInfo(form.value).finally(() => buttonLoading.value = false);
|
|
||||||
}
|
|
||||||
proxy?.$modal.msgSuccess("修改成功");
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: ScaleInfoVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('是否确认删除心理测评量编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
|
||||||
await delScaleInfo(_ids);
|
|
||||||
proxy?.$modal.msgSuccess("删除成功");
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
const handleExport = () => {
|
|
||||||
proxy?.download('scale/ScaleInfo/export', {
|
|
||||||
...queryParams.value
|
|
||||||
}, `ScaleInfo_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -8,29 +8,17 @@
|
||||||
<el-input v-model="queryParams.scaleTitle" placeholder="请输入测评标题" clearable style="width: 240px"
|
<el-input v-model="queryParams.scaleTitle" placeholder="请输入测评标题" clearable style="width: 240px"
|
||||||
@keyup.enter="handleQuery" />
|
@keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="测评详情" prop="scaleDetails">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-input v-model="queryParams.scaleDetails" placeholder="请输入测评详情" clearable style="width: 240px"
|
<el-select v-model="queryParams.status" placeholder="请选择状态" style="width: 240px">
|
||||||
@keyup.enter="handleQuery" />
|
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="量表的总分计分公式" prop="formulaId">
|
<el-form-item label="量表类型" prop="scaleType">
|
||||||
<el-input v-model="queryParams.formulaId" placeholder="请输入量表的总分计分公式" clearable style="width: 240px"
|
<el-select v-model="queryParams.scaleType" placeholder="请选择量表类型" style="width: 240px"
|
||||||
@keyup.enter="handleQuery" />
|
@keyup.enter="handleQuery">
|
||||||
</el-form-item>
|
<el-option v-for="item in scaleTypeList" :key="item.dictCode" :label="item.dictLabel"
|
||||||
<el-form-item label="预警分数" prop="earlyWarningScore">
|
:value="item.dictValue" />
|
||||||
<el-input v-model="queryParams.earlyWarningScore" placeholder="请输入预警分数" clearable style="width: 240px"
|
</el-select>
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="测评开始时间" prop="startTime">
|
|
||||||
<el-date-picker clearable v-model="queryParams.startTime" type="date" value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择测评开始时间" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="测评时间" prop="scaleTime">
|
|
||||||
<el-input v-model="queryParams.scaleTime" placeholder="请输入测评时间" clearable style="width: 240px"
|
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="测评结束时间" prop="endTime">
|
|
||||||
<el-date-picker clearable v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择测评结束时间" />
|
|
||||||
</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>
|
||||||
|
@ -45,19 +33,19 @@
|
||||||
<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 type="primary" plain icon="Plus" @click="handleAdd"
|
||||||
v-hasPermi="['scale:SysScale:add']">新增</el-button>
|
v-hasPermi="['scale:info:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
||||||
v-hasPermi="['scale:SysScale:edit']">修改</el-button>
|
v-hasPermi="['scale:info:edit']">修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||||
v-hasPermi="['scale:SysScale:remove']">删除</el-button>
|
v-hasPermi="['scale:info:remove']">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||||
v-hasPermi="['scale:SysScale:export']">导出</el-button>
|
v-hasPermi="['scale:info:export']">导出</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>
|
||||||
|
@ -67,7 +55,13 @@
|
||||||
<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="scaleTitle" />
|
<el-table-column label="测评标题" align="center" prop="scaleTitle" />
|
||||||
<el-table-column label="测评详情" align="center" prop="scaleDetails" />
|
<el-table-column label="测评详情" align="center" prop="scaleDetails" />
|
||||||
<el-table-column label="状态" align="center" prop="status" />
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'" disable-transitions>
|
||||||
|
{{ scope.row.status === '0' ? '正常' : '停用' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="计分公式" align="center" prop="formulaId" />
|
<el-table-column label="计分公式" align="center" prop="formulaId" />
|
||||||
<el-table-column label="量表类型" align="center" prop="scaleType" />
|
<el-table-column label="量表类型" align="center" prop="scaleType" />
|
||||||
<el-table-column label="预警分数" align="center" prop="earlyWarningScore" />
|
<el-table-column label="预警分数" align="center" prop="earlyWarningScore" />
|
||||||
|
@ -82,17 +76,25 @@
|
||||||
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" width="350" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改" placement="top">
|
<el-tooltip content="修改" placement="top">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['scale:SysScale:edit']">
|
v-hasPermi="['scale:info:edit']">
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
|
<el-tooltip content="问题列表" placement="top">
|
||||||
|
<el-button link type="primary" icon="Grid" v-hasPermi="['scale:info:edit']">
|
||||||
|
<router-link :to="'/scale/scale-question/index/' + scope.row.scaleId" class="link-type">
|
||||||
|
<span>问题列表</span>
|
||||||
|
</router-link>
|
||||||
|
</el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
|
||||||
<el-tooltip content="因子列表" placement="top">
|
<el-tooltip content="因子列表" placement="top">
|
||||||
<el-button link type="primary" icon="Grid" v-hasPermi="['scale:SysScale:edit']">
|
<el-button link type="primary" icon="Grid" v-hasPermi="['scale:info:edit']">
|
||||||
<router-link :to="'/scale/scale-factor/index/' + scope.row.scaleId" class="link-type">
|
<router-link :to="'/scale/scale-factor/index/' + scope.row.scaleId" class="link-type">
|
||||||
<span>因子列表</span>
|
<span>因子列表</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
@ -101,7 +103,7 @@
|
||||||
|
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['scale:SysScale:remove']">
|
v-hasPermi="['scale:info:remove']">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
@ -123,8 +125,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group v-model="form.status">
|
||||||
<el-radio label="0">正常</el-radio>
|
<el-radio value="0">正常</el-radio>
|
||||||
<el-radio label="1">停用</el-radio>
|
<el-radio value="1">停用</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="总分计分公式" prop="formulaId">
|
<el-form-item label="总分计分公式" prop="formulaId">
|
||||||
|
@ -185,6 +187,11 @@ const total = ref(0);
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const SysScaleFormRef = ref<ElFormInstance>();
|
const SysScaleFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
const statusOptions = [
|
||||||
|
{ label: '正常', value: 0 },
|
||||||
|
{ label: '停用', value: 1 }
|
||||||
|
]
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
title: ''
|
title: ''
|
||||||
|
|
|
@ -8,21 +8,12 @@
|
||||||
<el-input v-model="queryParams.factorName" placeholder="请输入因子名称" clearable style="width: 240px"
|
<el-input v-model="queryParams.factorName" placeholder="请输入因子名称" clearable style="width: 240px"
|
||||||
@keyup.enter="handleQuery" />
|
@keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="因子所属量表id" prop="scaleId">
|
<el-form-item label="因子分计算公式" prop="formulaId" label-width="110px">
|
||||||
<el-input v-model="queryParams.scaleId" placeholder="请输入因子所属量表id" clearable style="width: 240px"
|
<el-select v-model="queryParams.formulaId" placeholder="请输入因子分计算公式" style="width: 240px"
|
||||||
@keyup.enter="handleQuery" />
|
@keyup.enter="handleQuery">
|
||||||
</el-form-item>
|
<el-option v-for="item in scaleFormulaList" :key="item.formulaId" :label="item.formulaName"
|
||||||
<el-form-item label="测评量表标题" prop="scaleTitle">
|
:value="item.formulaId" />
|
||||||
<el-input v-model="queryParams.scaleTitle" placeholder="请输入测评量表标题" clearable style="width: 240px"
|
</el-select>
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="分数范围及结果提示" prop="factorResult">
|
|
||||||
<el-input v-model="queryParams.factorResult" placeholder="请输入分数范围及结果提示" clearable style="width: 240px"
|
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="因子分计算公式" prop="formulaId">
|
|
||||||
<el-input v-model="queryParams.formulaId" placeholder="请输入因子分计算公式" clearable style="width: 240px"
|
|
||||||
@keyup.enter="handleQuery" />
|
|
||||||
</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>
|
||||||
|
@ -37,19 +28,19 @@
|
||||||
<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 type="primary" plain icon="Plus" @click="handleAdd"
|
||||||
v-hasPermi="['scale:SysScaleFactor:add']">新增</el-button>
|
v-hasPermi="['scale:factor:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
||||||
v-hasPermi="['scale:SysScaleFactor:edit']">修改</el-button>
|
v-hasPermi="['scale:factor:edit']">修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||||
v-hasPermi="['scale:SysScaleFactor:remove']">删除</el-button>
|
v-hasPermi="['scale:factor:remove']">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||||
v-hasPermi="['scale:SysScaleFactor:export']">导出</el-button>
|
v-hasPermi="['scale:factor:export']">导出</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>
|
||||||
|
@ -65,11 +56,11 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改" placement="top">
|
<el-tooltip content="修改" placement="top">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['scale:SysScaleFactor:edit']"></el-button>
|
v-hasPermi="['scale:factor:edit']"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['scale:SysScaleFactor:remove']"></el-button>
|
v-hasPermi="['scale:factor:remove']"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -94,6 +85,12 @@
|
||||||
:value="item.formulaId" />
|
:value="item.formulaId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="选择题目" prop="questionIds">
|
||||||
|
<el-checkbox-group v-model="form.questionIds">
|
||||||
|
<el-checkbox v-for="item in scaleQuestionList" :key="item.questionId" :label="item.questionOrder"
|
||||||
|
:value="item.questionId" />
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
|
@ -113,6 +110,9 @@ import { SysScaleFactorVO, SysScaleFactorQuery, SysScaleFactorForm } from '@/api
|
||||||
import { listSysScaleFormula } from '@/api/scale/SysScaleFormula'
|
import { listSysScaleFormula } from '@/api/scale/SysScaleFormula'
|
||||||
import { SysScaleFormulaVO } from '@/api/scale/SysScaleFormula/types';
|
import { SysScaleFormulaVO } from '@/api/scale/SysScaleFormula/types';
|
||||||
|
|
||||||
|
import { listSysScaleQuestion } from '@/api/scale/SysScaleQuestion'
|
||||||
|
import { SysScaleQuestionVO } from '@/api/scale/SysScaleQuestion/types';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
const scaleId = useRoute().params.scaleId;
|
const scaleId = useRoute().params.scaleId;
|
||||||
|
@ -141,6 +141,7 @@ const initFormData: SysScaleFactorForm = {
|
||||||
scaleTitle: undefined,
|
scaleTitle: undefined,
|
||||||
factorResult: undefined,
|
factorResult: undefined,
|
||||||
formulaId: undefined,
|
formulaId: undefined,
|
||||||
|
questionIds: []
|
||||||
}
|
}
|
||||||
const data = reactive<PageData<SysScaleFactorForm, SysScaleFactorQuery>>({
|
const data = reactive<PageData<SysScaleFactorForm, SysScaleFactorQuery>>({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
|
@ -174,6 +175,9 @@ const data = reactive<PageData<SysScaleFactorForm, SysScaleFactorQuery>>({
|
||||||
formulaId: [
|
formulaId: [
|
||||||
{ required: true, message: "因子分计算公式不能为空", trigger: "blur" }
|
{ required: true, message: "因子分计算公式不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
|
questionIds: [
|
||||||
|
{ required: true, message: "测评量表题目不能为空", trigger: "blur" }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -236,6 +240,12 @@ const handleUpdate = async (row?: SysScaleFactorVO) => {
|
||||||
dialog.title = "修改测评因子";
|
dialog.title = "修改测评因子";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(() => dialog.visible, (value) => {
|
||||||
|
if (value) {
|
||||||
|
getScaleQuestionList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
SysScaleFactorFormRef.value?.validate(async (valid: boolean) => {
|
SysScaleFactorFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
@ -275,6 +285,12 @@ async function getScaleFormulaList() {
|
||||||
scaleFormulaList.value = res.rows
|
scaleFormulaList.value = res.rows
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scaleQuestionList = ref<SysScaleQuestionVO[]>([]);
|
||||||
|
async function getScaleQuestionList() {
|
||||||
|
const res = await listSysScaleQuestion()
|
||||||
|
scaleQuestionList.value = res.rows
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
|
|
||||||
|
|
|
@ -29,19 +29,19 @@
|
||||||
<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 type="primary" plain icon="Plus" @click="handleAdd"
|
||||||
v-hasPermi="['scale:SysScaleFormula:add']">新增</el-button>
|
v-hasPermi="['scale:formula:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
||||||
v-hasPermi="['scale:SysScaleFormula:edit']">修改</el-button>
|
v-hasPermi="['scale:formula:edit']">修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||||
v-hasPermi="['scale:SysScaleFormula:remove']">删除</el-button>
|
v-hasPermi="['scale:formula:remove']">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||||
v-hasPermi="['scale:SysScaleFormula:export']">导出</el-button>
|
v-hasPermi="['scale:formula:export']">导出</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>
|
||||||
|
@ -56,11 +56,11 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改" placement="top">
|
<el-tooltip content="修改" placement="top">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['scale:SysScaleFormula:edit']"></el-button>
|
v-hasPermi="['scale:formula:edit']"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['scale:SysScaleFormula:remove']"></el-button>
|
v-hasPermi="['scale:formula:remove']"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
Loading…
Reference in New Issue