Commit 823c64d2 authored by 小费同学阿's avatar 小费同学阿 💬

文章管理

parent 663556a7
...@@ -67,14 +67,14 @@ export const constantRoutes = [ ...@@ -67,14 +67,14 @@ export const constantRoutes = [
component: () => import('@/views/document-management/privacy-policy/privacy-policy'), component: () => import('@/views/document-management/privacy-policy/privacy-policy'),
hidden: true hidden: true
}, },
//设备详情页路由 // 设备详情页路由
{ {
path:'/equipment-management', path: '/equipment-management',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['*:*:*'], permissions: ['*:*:*'],
children: [ children: [
//设备 // 设备
{ {
path: 'equipment-management/equipment-detail:id', path: 'equipment-management/equipment-detail:id',
props: true, props: true,
...@@ -84,19 +84,19 @@ export const constantRoutes = [ ...@@ -84,19 +84,19 @@ export const constantRoutes = [
meta: { meta: {
title: '设备详情', title: '设备详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/equipment-management/equipment-management', activeMenu: '/equipment-management/equipment-management'
} }
}, }
] ]
}, },
{ {
path:'/customer-management', path: '/customer-management',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['*:*:*'], permissions: ['*:*:*'],
children: [ children: [
//设备 // 设备
{ {
path: 'pet-owner-management', path: 'pet-owner-management',
props: true, props: true,
...@@ -106,9 +106,9 @@ export const constantRoutes = [ ...@@ -106,9 +106,9 @@ export const constantRoutes = [
meta: { meta: {
title: '宠主管理', title: '宠主管理',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/customer-management/pet-owner-management', activeMenu: '/customer-management/pet-owner-management'
} }
}, }
] ]
}, },
...@@ -178,10 +178,10 @@ export const constantRoutes = [ ...@@ -178,10 +178,10 @@ export const constantRoutes = [
name: 'ArticleDetail', name: 'ArticleDetail',
props: true, props: true,
meta: { meta: {
title: '文章详情',icon: 'component' title: '文章详情', icon: 'component'
} }
}, },
// 文章添加路由 // 文章添加路由
{ {
path: 'article-insert', path: 'article-insert',
component: () => import('@/views/article-management/article-insert'), component: () => import('@/views/article-management/article-insert'),
...@@ -195,26 +195,26 @@ export const constantRoutes = [ ...@@ -195,26 +195,26 @@ export const constantRoutes = [
] ]
}, },
//行政详情路由 // 行政详情路由
{ {
path:'/administrative-management', path: '/administrative-management',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['*:*:*'], permissions: ['*:*:*'],
children: [ children: [
{ {
"name":"Department-management", 'name': 'Department-management',
"path":"department-management", 'path': 'department-management',
"hidden":false, 'hidden': false,
component: () => import('@/views/administrative-management/department-management/department-management'), component: () => import('@/views/administrative-management/department-management/department-management'),
"meta":{ 'meta': {
"title":"科室管理", 'title': '科室管理',
"icon":"download", 'icon': 'download',
"noCache":false, 'noCache': false,
"link":null 'link': null
} }
}, },
//兽医 // 兽医
{ {
path: 'veterinary-management/veterinary-detail/:id', path: 'veterinary-management/veterinary-detail/:id',
props: true, props: true,
...@@ -224,10 +224,10 @@ export const constantRoutes = [ ...@@ -224,10 +224,10 @@ export const constantRoutes = [
meta: { meta: {
title: '兽医详情', title: '兽医详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/administrative-management/veterinary-management', activeMenu: '/administrative-management/veterinary-management'
} }
}, },
//人员 // 人员
{ {
path: 'personnel-management/personnel-detail/:id', path: 'personnel-management/personnel-detail/:id',
props: true, props: true,
...@@ -237,10 +237,10 @@ export const constantRoutes = [ ...@@ -237,10 +237,10 @@ export const constantRoutes = [
meta: { meta: {
title: '人员详情', title: '人员详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/administrative-management/personnel-management', activeMenu: '/administrative-management/personnel-management'
} }
}, },
//科室 // 科室
{ {
path: 'department-management/department-detail/:id', path: 'department-management/department-detail/:id',
props: true, props: true,
...@@ -250,7 +250,7 @@ export const constantRoutes = [ ...@@ -250,7 +250,7 @@ export const constantRoutes = [
meta: { meta: {
title: '科室详情', title: '科室详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/administrative-management/department-management', activeMenu: '/administrative-management/department-management'
} }
}, },
// 诊室 // 诊室
...@@ -263,7 +263,7 @@ export const constantRoutes = [ ...@@ -263,7 +263,7 @@ export const constantRoutes = [
meta: { meta: {
title: '诊室详情', title: '诊室详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/administrative-management/consulting-room-management', activeMenu: '/administrative-management/consulting-room-management'
} }
}, },
// 诊室新增 // 诊室新增
...@@ -276,21 +276,21 @@ export const constantRoutes = [ ...@@ -276,21 +276,21 @@ export const constantRoutes = [
meta: { meta: {
title: '诊室新增', title: '诊室新增',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/administrative-management/consulting-room-management', activeMenu: '/administrative-management/consulting-room-management'
} }
} }
] ]
}, },
//病历路由 // 病历路由
{ {
path: '', path: '',
hidden: true, hidden: true,
component: Layout, component: Layout,
redirect: 'index', redirect: 'index',
children: [ children: [
//病历详情页 // 病历详情页
{ {
path:'/medical-detail/:id', path: '/medical-detail/:id',
props: true, props: true,
permissions: ['*:*:*'], permissions: ['*:*:*'],
component: () => import('@/views/medical-record-management/medical-detail'), component: () => import('@/views/medical-record-management/medical-detail'),
...@@ -298,20 +298,20 @@ export const constantRoutes = [ ...@@ -298,20 +298,20 @@ export const constantRoutes = [
meta: { meta: {
title: '病历详情', title: '病历详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/medical-record-management', activeMenu: '/medical-record-management'
} }
}, },
//预约设备页面 // 预约设备页面
{ {
path:'/reservation-equipment/:id:pet', path: '/reservation-equipment/:id:pet',
props: true, props: true,
permissions: ['*:*:*'], permissions: ['*:*:*'],
component: ()=>import('@/views/medical-record-management/reservation-equipment'), component: () => import('@/views/medical-record-management/reservation-equipment'),
name:'ReservationEquipment', name: 'ReservationEquipment',
meta:{ meta: {
title:'预约设备', title: '预约设备',
icom:'dashboard', icom: 'dashboard',
activeMenu: '/medical-record-management/medical-detail', activeMenu: '/medical-record-management/medical-detail'
} }
} }
] ]
...@@ -343,7 +343,7 @@ export const constantRoutes = [ ...@@ -343,7 +343,7 @@ export const constantRoutes = [
component: () => import('@/views/hospital-management/hospital-update'), component: () => import('@/views/hospital-management/hospital-update'),
name: 'HospitalUpdate', name: 'HospitalUpdate',
meta: { title: '医院修改页', icon: 'dashboard', activeMenu: '/hospital-management' } meta: { title: '医院修改页', icon: 'dashboard', activeMenu: '/hospital-management' }
}, }
] ]
}, },
{ {
...@@ -448,7 +448,7 @@ export const dynamicRoutes = [ ...@@ -448,7 +448,7 @@ export const dynamicRoutes = [
meta: { meta: {
title: '宠物主人详情', title: '宠物主人详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/customer-management/pet-owner-management', activeMenu: '/customer-management/pet-owner-management'
} }
}, { }, {
path: 'pet-management/pet-detail/:id', path: 'pet-management/pet-detail/:id',
...@@ -459,31 +459,31 @@ export const dynamicRoutes = [ ...@@ -459,31 +459,31 @@ export const dynamicRoutes = [
meta: { meta: {
title: '宠物详情', title: '宠物详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/customer-management/pet-management', activeMenu: '/customer-management/pet-management'
} }
}] }]
}, },
//行政详情路由 // 行政详情路由
{ {
path:'/administrative-management', path: '/administrative-management',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['*:*:*'], permissions: ['*:*:*'],
children: [ children: [
//兽医 // 兽医
{ {
path: 'veterinary-management/veterinary-detail/:id', path: 'veterinary-management/veterinary-detail/:id',
props: true, props: true,
permissions: ['*:*:*'], permissions: ['*:*:*'],
component: () => import('@/views/administrative-management/veterinary-management/veterinary-detail'), component: () => import('@/views/administrative-management/veterinary-management/veterinary-detail'),
name: 'veterinaryDetail', name: 'veterinaryDetail',
meta: { meta: {
title: '兽医详情', title: '兽医详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/administrative-management/veterinary-management', activeMenu: '/administrative-management/veterinary-management'
} }
}, },
//人员 // 人员
{ {
path: 'personnel-management/personnel-detail/:id', path: 'personnel-management/personnel-detail/:id',
props: true, props: true,
...@@ -493,10 +493,10 @@ export const dynamicRoutes = [ ...@@ -493,10 +493,10 @@ export const dynamicRoutes = [
meta: { meta: {
title: '人员详情', title: '人员详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/administrative-management/personnel-management', activeMenu: '/administrative-management/personnel-management'
} }
}, },
//科室 // 科室
{ {
path: 'department-management/department-detail/:id', path: 'department-management/department-detail/:id',
props: true, props: true,
...@@ -506,16 +506,16 @@ export const dynamicRoutes = [ ...@@ -506,16 +506,16 @@ export const dynamicRoutes = [
meta: { meta: {
title: '科室详情', title: '科室详情',
icon: 'dashboard', icon: 'dashboard',
activeMenu: '/administrative-management/department-management', activeMenu: '/administrative-management/department-management'
} }
} }
] ]
}, }
] ]
// 防止连续点击多次路由报错 // 防止连续点击多次路由报错
let routerPush = Router.prototype.push; const routerPush = Router.prototype.push
Router.prototype.push = function push(location) { Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(err => err) return routerPush.call(this, location).catch(err => err)
} }
......
...@@ -3,16 +3,18 @@ ...@@ -3,16 +3,18 @@
<div class="pet-owner-detail"> <div class="pet-owner-detail">
<el-card class="box-card"> <el-card class="box-card">
<!-- 头部标题--> <!-- 头部标题-->
<div style="padding-top:32px;text-align: center;"> <div style="padding-top:32px;text-align: center;">
<span style="font-size: 24px; <span
style="font-size: 24px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei; font-family: Microsoft YaHei-Bold, Microsoft YaHei;
font-weight: bold; font-weight: bold;
color: #333333;">查看</span> color: #333333;"
>查看</span>
</div> </div>
<div style="padding: 20px;"> <div style="padding: 20px;">
<div style="display: flex"> <div style="display: flex">
<!-- 文章信息 --> <!-- 文章信息 -->
<div class="tip-green"/> <div class="tip-green" />
<div <div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei;font-weight: bold;color: #333333;" style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei;font-weight: bold;color: #333333;"
>文章信息 >文章信息
...@@ -21,36 +23,40 @@ color: #333333;">查看</span> ...@@ -21,36 +23,40 @@ color: #333333;">查看</span>
<!-- 0-- 文章信息的页面--修改文章信息 --> <!-- 0-- 文章信息的页面--修改文章信息 -->
<div class="base-msg"> <div class="base-msg">
<div style="display:flex;"> <div style="display:flex;">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item style="padding-top: 32px;" label="文章标题" prop="articleTitle"> <el-form-item style="padding-top: 32px;" label="文章标题" prop="articleTitle">
<el-input disabled v-model="form.articleTitle" placeholder="请输入文章标题"/> <el-input v-model="form.articleTitle" disabled placeholder="请输入文章标题" />
</el-form-item> </el-form-item>
<el-form-item label="权重" prop="articleWeight"> <el-form-item label="权重" prop="articleWeight">
<el-input-number disabled v-model="form.articleWeight" :max="9999" :min="1" controls-position="right" <el-input-number
></el-input-number> v-model="form.articleWeight"
disabled
:max="9999"
:min="1"
controls-position="right"
/>
</el-form-item> </el-form-item>
<el-form-item label="文章封面" prop="articleCover"> <el-form-item label="文章封面" prop="articleCover">
<!-- 0-- 文章信息的页面--文章封面 --> <!-- 0-- 文章信息的页面--文章封面 -->
<div class="base-msg"> <div class="base-msg">
<div class="petPicture" style="padding-bottom: 20px;"> <div class="petPicture" style="padding-bottom: 20px;">
<el-card shadow="hover" style="width: 150px;height: 150px;position: center"> <el-card shadow="hover" style="width: 150px;height: 150px;position: center">
<el-image :src="baseURL+form.articleCover" fit="cover"/> <el-image :src="baseURL+form.articleCover" fit="cover" />
</el-card> </el-card>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="articleStatus"> <el-form-item label="状态" prop="articleStatus">
<div style="display: flex; "> <div style="display: flex; ">
<div style="padding-right: 15px;"> <div style="padding-right: 15px;">
<el-switch <el-switch
disabled
v-model="form.articleStatus" v-model="form.articleStatus"
active-color="#13ce66" disabled
active-value="0" active-color="#13ce66"
inactive-color="#ff4949" active-value="0"
inactive-value="1" inactive-color="#ff4949"
> inactive-value="1"
</el-switch> />
</div> </div>
<div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div> <div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div>
<div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div> <div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div>
...@@ -59,7 +65,7 @@ color: #333333;">查看</span> ...@@ -59,7 +65,7 @@ color: #333333;">查看</span>
<!-- 2-- 文章信息--文章内容 --> <!-- 2-- 文章信息--文章内容 -->
<div style="display: flex"> <div style="display: flex">
<!-- 文章内容--> <!-- 文章内容-->
<div class="tip-green"/> <div class="tip-green" />
<div <div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei;font-weight: bold;color: #333333;" style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei;font-weight: bold;color: #333333;"
>文章内容 >文章内容
...@@ -68,7 +74,7 @@ color: #333333;">查看</span> ...@@ -68,7 +74,7 @@ color: #333333;">查看</span>
<!-- 2-- 文章信息的页面--文章内容 --> <!-- 2-- 文章信息的页面--文章内容 -->
<div class="base-msg" style="padding-top: 32px; padding-bottom: 20px; padding-left: 1%;"> <div class="base-msg" style="padding-top: 32px; padding-bottom: 20px; padding-left: 1%;">
<el-row> <el-row>
<div v-html="form.articleContent"></div> <div v-html="form.articleContent" />
</el-row> </el-row>
</div> </div>
</el-form> </el-form>
...@@ -84,13 +90,13 @@ color: #333333;">查看</span> ...@@ -84,13 +90,13 @@ color: #333333;">查看</span>
</template> </template>
<script> <script>
//导入获取文章信息的接口 // 导入获取文章信息的接口
import { checkRole } from '@/utils/permission' import { checkRole } from '@/utils/permission'
import { selectDictLabel } from '@/utils/ruoyi' import { selectDictLabel } from '@/utils/ruoyi'
import { addArticle, getArticle, listArticle, updateArticle } from '@/api/business/article' import { addArticle, getArticle, updateArticle } from '@/api/business/article'
export default { export default {
name: 'article-edit', name: 'ArticleEdit',
// 数据字典 // 数据字典
dicts: ['article_status'], dicts: ['article_status'],
...@@ -112,7 +118,7 @@ export default { ...@@ -112,7 +118,7 @@ export default {
open: false, open: false,
// 状态位 // 状态位
value: true, value: true,
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
...@@ -187,7 +193,6 @@ export default { ...@@ -187,7 +193,6 @@ export default {
.box-card { .box-card {
} }
//模块tip样式--绿色 //模块tip样式--绿色
.tip-green { .tip-green {
height: 30px; height: 30px;
...@@ -222,7 +227,6 @@ export default { ...@@ -222,7 +227,6 @@ export default {
//margin-left: 5%; //margin-left: 5%;
} }
//表格内容选中后的样式-all //表格内容选中后的样式-all
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell { ::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #F6FCF5 !important; background-color: #F6FCF5 !important;
......
...@@ -3,16 +3,18 @@ ...@@ -3,16 +3,18 @@
<div class="pet-owner-detail"> <div class="pet-owner-detail">
<el-card class="box-card"> <el-card class="box-card">
<!-- 头部标题--> <!-- 头部标题-->
<div style="padding-top:32px;text-align: center;"> <div style="padding-top:32px;text-align: center;">
<span style="font-size: 24px; <span
style="font-size: 24px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei; font-family: Microsoft YaHei-Bold, Microsoft YaHei;
font-weight: bold; font-weight: bold;
color: #333333;">编辑</span> color: #333333;"
>编辑</span>
</div> </div>
<div style="padding: 20px;"> <div style="padding: 20px;">
<div style="display: flex"> <div style="display: flex">
<!-- 0-- 文章信息--标签头 --> <!-- 0-- 文章信息--标签头 -->
<div class="tip-green"/> <div class="tip-green" />
<div style="padding-top: 3px;padding-left: 18px; color: #666666; font-weight: 600; font-size: 17px;">文章信息 <div style="padding-top: 3px;padding-left: 18px; color: #666666; font-weight: 600; font-size: 17px;">文章信息
</div> </div>
</div> </div>
...@@ -21,32 +23,36 @@ color: #333333;">编辑</span> ...@@ -21,32 +23,36 @@ color: #333333;">编辑</span>
<div style="display:flex;"> <div style="display:flex;">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文章标题" prop="articleTitle"> <el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="form.articleTitle" placeholder="请输入文章标题"/> <el-input v-model="form.articleTitle" placeholder="请输入文章标题" />
</el-form-item> </el-form-item>
<el-form-item label="权重" prop="articleWeight"> <el-form-item label="权重" prop="articleWeight">
<el-input-number v-model="form.articleWeight" :max="9999" :min="1" controls-position="right" <el-input-number
></el-input-number> v-model="form.articleWeight"
:max="9999"
:min="1"
controls-position="right"
/>
</el-form-item> </el-form-item>
<el-form-item label="文章封面" prop="articleCover"> <el-form-item label="文章封面" prop="articleCover">
<image-upload v-model="form.articleCover" limit="1"/> <image-upload v-model="form.articleCover" limit="1" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="articleStatus"> <el-form-item label="状态" prop="articleStatus">
<div style="display: flex;"> <div style="display: flex;">
<div style="padding-right: 15px;"> <div style="padding-right: 15px;">
<el-switch v-model="form.articleStatus" <el-switch
active-color="#13ce66" v-model="form.articleStatus"
active-value="0" active-color="#13ce66"
inactive-color="#ff4949" active-value="0"
inactive-value="1" inactive-color="#ff4949"
> inactive-value="1"
</el-switch> />
</div> </div>
<div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div> <div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div>
<div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div> <div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="文章内容"> <el-form-item label="文章内容">
<editor v-model="form.articleContent" :min-height="192"/> <editor v-model="form.articleContent" :min-height="192" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -62,13 +68,13 @@ color: #333333;">编辑</span> ...@@ -62,13 +68,13 @@ color: #333333;">编辑</span>
</template> </template>
<script> <script>
//导入获取文章信息的接口 // 导入获取文章信息的接口
import { checkRole } from '@/utils/permission' import { checkRole } from '@/utils/permission'
import { selectDictLabel } from '@/utils/ruoyi' import { selectDictLabel } from '@/utils/ruoyi'
import { addArticle, getArticle, listArticle, updateArticle } from '@/api/business/article' import { addArticle, getArticle, updateArticle } from '@/api/business/article'
export default { export default {
name: 'article-edit', name: 'ArticleEdit',
// 数据字典 // 数据字典
dicts: ['article_status'], dicts: ['article_status'],
...@@ -87,7 +93,7 @@ export default { ...@@ -87,7 +93,7 @@ export default {
open: false, open: false,
// 状态位 // 状态位
value: true, value: true,
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
...@@ -163,7 +169,6 @@ export default { ...@@ -163,7 +169,6 @@ export default {
margin: 20px 20px 20px 20px; margin: 20px 20px 20px 20px;
} }
//模块tip样式--绿色 //模块tip样式--绿色
.tip-green { .tip-green {
height: 30px; height: 30px;
...@@ -198,7 +203,6 @@ export default { ...@@ -198,7 +203,6 @@ export default {
margin-left: 5%; margin-left: 5%;
} }
//表格内容选中后的样式-all //表格内容选中后的样式-all
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell { ::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #F6FCF5 !important; background-color: #F6FCF5 !important;
......
...@@ -3,16 +3,18 @@ ...@@ -3,16 +3,18 @@
<div class="pet-owner-detail"> <div class="pet-owner-detail">
<el-card class="box-card"> <el-card class="box-card">
<!-- 头部标题--> <!-- 头部标题-->
<div style="padding-top:32px;text-align: center;"> <div style="padding-top:32px;text-align: center;">
<span style="font-size: 24px; <span
style="font-size: 24px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei; font-family: Microsoft YaHei-Bold, Microsoft YaHei;
font-weight: bold; font-weight: bold;
color: #333333;">新增</span> color: #333333;"
>新增</span>
</div> </div>
<div style="padding: 20px;"> <div style="padding: 20px;">
<div style="display: flex"> <div style="display: flex">
<!-- 0-- 文章信息--标签头 --> <!-- 0-- 文章信息--标签头 -->
<div class="tip-green"/> <div class="tip-green" />
<div style="padding-top: 3px;padding-left: 18px; color: #666666; font-weight: 600; font-size: 17px;">文章信息 <div style="padding-top: 3px;padding-left: 18px; color: #666666; font-weight: 600; font-size: 17px;">文章信息
</div> </div>
</div> </div>
...@@ -21,31 +23,31 @@ color: #333333;">新增</span> ...@@ -21,31 +23,31 @@ color: #333333;">新增</span>
<div style="display:flex;"> <div style="display:flex;">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文章标题" prop="articleTitle"> <el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="form.articleTitle" maxlength="40" show-word-limit placeholder="请输入文章标题"/> <el-input v-model="form.articleTitle" maxlength="40" show-word-limit placeholder="请输入文章标题" />
</el-form-item> </el-form-item>
<el-form-item label="权重" prop="articleWeight"> <el-form-item label="权重" prop="articleWeight">
<el-input-number v-model="form.articleWeight" :min="1" :max="9999" controls-position="right"></el-input-number> <el-input-number v-model="form.articleWeight" :min="1" :max="9999" controls-position="right" />
</el-form-item> </el-form-item>
<el-form-item label="文章封面" prop="articleCover"> <el-form-item label="文章封面" prop="articleCover">
<image-upload v-model="form.articleCover" limit="1"/> <image-upload v-model="form.articleCover" limit="1" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="articleStatus"> <el-form-item label="状态" prop="articleStatus">
<div style="display: flex;"> <div style="display: flex;">
<div style="padding-right: 15px;"> <div style="padding-right: 15px;">
<el-switch v-model="form.articleStatus" <el-switch
active-color="#13ce66" v-model="form.articleStatus"
active-value="0" active-color="#13ce66"
inactive-color="#ff4949" active-value="0"
inactive-value="1" inactive-color="#ff4949"
> inactive-value="1"
</el-switch> />
</div> </div>
<div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div> <div v-if="form.articleStatus==='0'" style="padding-top: 1px;">已上架</div>
<div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div> <div v-else-if="form.articleStatus==='1'" style="padding-top: 1px;">已下架</div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="文章内容"> <el-form-item label="文章内容">
<editor v-model="form.articleContent" :min-height="192"/> <editor v-model="form.articleContent" :min-height="192" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -61,13 +63,12 @@ color: #333333;">新增</span> ...@@ -61,13 +63,12 @@ color: #333333;">新增</span>
</template> </template>
<script> <script>
//导入获取文章信息的接口 // 导入获取文章信息的接口
import { checkRole } from '@/utils/permission'
import { selectDictLabel } from '@/utils/ruoyi' import { selectDictLabel } from '@/utils/ruoyi'
import { addArticle, getArticle, listArticle, updateArticle } from '@/api/business/article' import { addArticle } from '@/api/business/article'
export default { export default {
name: 'article-insert', name: 'ArticleInsert',
// 数据字典 // 数据字典
dicts: ['article_status'], dicts: ['article_status'],
...@@ -86,14 +87,14 @@ export default { ...@@ -86,14 +87,14 @@ export default {
open: false, open: false,
// 状态位 // 状态位
value: true, value: true,
// 表单参数 // 表单参数
form: { form: {
// 权重 // 权重
articleWeight: '0', articleWeight: '0',
// 状态位 // 状态位
articleStatus: '0', articleStatus: '0',
// 创建时间 // 创建时间
articleCreateTime:'' articleCreateTime: ''
}, },
// 表单校验 // 表单校验
rules: { rules: {
...@@ -107,7 +108,7 @@ export default { ...@@ -107,7 +108,7 @@ export default {
this.addDate() this.addDate()
}, },
methods: { methods: {
//获取当前年月日 // 获取当前年月日
addDate() { addDate() {
const nowDate = new Date() const nowDate = new Date()
const date = { const date = {
...@@ -118,15 +119,14 @@ export default { ...@@ -118,15 +119,14 @@ export default {
const newmonth = date.month > 10 ? date.month : '0' + date.month const newmonth = date.month > 10 ? date.month : '0' + date.month
const day = date.date > 10 ? date.date : '0' + date.date const day = date.date > 10 ? date.date : '0' + date.date
this.form.articleCreateTime = date.year + '-' + newmonth + '-' + day this.form.articleCreateTime = date.year + '-' + newmonth + '-' + day
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
addArticle(this.form).then(response => { addArticle(this.form).then(response => {
this.$modal.msgSuccess('新增成功') this.$modal.msgSuccess('新增成功')
}) })
} }
}) })
}, },
...@@ -149,7 +149,6 @@ export default { ...@@ -149,7 +149,6 @@ export default {
margin: 20px 20px 20px 20px; margin: 20px 20px 20px 20px;
} }
//模块tip样式--绿色 //模块tip样式--绿色
.tip-green { .tip-green {
height: 30px; height: 30px;
...@@ -184,7 +183,6 @@ export default { ...@@ -184,7 +183,6 @@ export default {
margin-left: 5%; margin-left: 5%;
} }
//表格内容选中后的样式-all //表格内容选中后的样式-all
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell { ::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #F6FCF5 !important; background-color: #F6FCF5 !important;
......
<template> <template>
<div style="background-color: #FFFFFF;"> <div style="background-color: #FFFFFF;">
<div class="app-container"> <div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small"> <!--顶部搜索区-->
<el-form-item prop="articleTitle"> <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
<el-input <el-form-item prop="articleTitle">
v-model="queryParams.articleTitle" <el-input
clearable v-model="queryParams.articleTitle"
placeholder="请输入文章标题关键字" clearable
@keyup.enter.native="handleQuery" placeholder="请输入文章标题关键字"
/> @keyup.enter.native="handleQuery"
</el-form-item>
<el-form-item prop="articleCreateTime">
<el-date-picker v-model="queryParams.articleCreateTime"
clearable
placeholder="请选择创建时间"
type="date"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<el-form-item prop="articleStatus">
<el-select v-model="queryParams.articleStatus" clearable placeholder="请选择文章状态">
<el-option
v-for="dict in dict.type.article_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item prop="sort">
<el-select
v-model="queryParams.params.sort"
clearable
placeholder="请选择排序方式"
>
<el-option
v-for="dict in sortList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/> />
</el-select>
</el-form-item>
<el-form-item>
<!-- 新增文章-->
<el-button
v-hasPermi="['business:article:add']"
icon="el-icon-circle-plus-outline"
size="mini" class="fourWordsBtn"
@click="handleAdd"
>新增文章
</el-button>
<el-button icon="el-icon-search" size="mini" class="queryBtn" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" class="resetBtn" @click="resetQuery">重置</el-button>
<!-- 选择全部-->
<el-button v-hasPermi="['system:manage:export']" icon="el-icon-right" size="mini" class="fourWordsBtn"
@click="selectAll"
>选择全部
</el-button>
<!-- 反向选择-->
<el-button v-hasPermi="['system:manage:export']"
icon="el-icon-back"
size="mini" class="fourWordsBtn"
@click="reverseSelect"
>反向选择
</el-button>
<!-- 批量导入-->
<el-button
v-hasPermi="['system:pets:export']"
icon="el-icon-download"
size="mini"
class="fourWordsBtn"
@click="handleExport"
>批量导入
</el-button>
<!-- 批量导出-->
<el-button
v-hasPermi="['system:pets:export']"
icon="el-icon-upload2"
size="mini"
class="fourWordsBtn"
@click="handleExport"
>批量导出
</el-button>
</el-form-item>
</el-form>
<el-table ref="table" v-loading="loading" :data="articleList" :header-cell-style="{background:'#E8E9E8'}" border
row-key="id" @selection-change="handleSelectionChange" @select-all="selectAll($event, false)"
>
<el-table-column align="center" type="selection" width="55" reserve-selection/>
<el-table-column align="center" label="序号" min-width="80" type="index"/>
<el-table-column :show-overflow-tooltip="true" align="center" label="文章标题" prop="articleTitle" width="200"/>
<el-table-column :show-overflow-tooltip="true" align="center" label="文章内容" prop="articleContent" width="200"/>
<!-- <template #default="{row: {articleContent}}">-->
<!-- <div v-html="articleContent"></div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="权重" min-width="55" prop="articleWeight"/>
<el-table-column align="center" label="创建时间" min-width="80" prop="articleCreateTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.articleCreateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="状态" min-width="60" prop="articleStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.article_status" :value="scope.row.articleStatus"/>
</template>
</el-table-column>
<el-table-column align="center" min-width="100" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<div style="display: flex;">
<div style="padding-right: 10px;"><el-button
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(95,181,75);"
type="success"
@click="handleDetail(scope.row)"
>详情
</el-button></div>
<div style="padding-right: 10px;"><el-button
v-hasPermi="['business:article:edit']"
icon="el-icon-edit"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary"
@click="handleUpdate(scope.row)"
>编辑
</el-button></div>
<div v-if="scope.row.articleStatus==='1'">
<el-button
v-hasPermi="['business:article:remove']"
icon="el-icon-delete"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(219,71,71);"
type="danger"
@click="handleDelete(scope.row)"
>删除
</el-button>
</div>
<div v-else-if="scope.row.articleStatus==='0'">
<el-button
icon="el-icon-video-pause"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(255,157,78);"
type="warning"
@click="handleChange(scope.row)"
>下架
</el-button>
</div>
</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改文章对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="60%">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="form.articleTitle" placeholder="请输入文章标题"/>
</el-form-item> </el-form-item>
<el-form-item label="文章内容"> <el-form-item prop="articleCreateTime">
<editor v-model="form.articleContent" :min-height="192"/> <el-date-picker
v-model="queryParams.articleCreateTime"
clearable
placeholder="请选择创建时间"
type="date"
value-format="yyyy-MM-dd"
/>
</el-form-item> </el-form-item>
<el-form-item label="权重" prop="articleWeight"> <el-form-item prop="articleStatus">
<el-input-number v-model="form.articleWeight" :min="0" controls-position="right"></el-input-number> <el-select v-model="queryParams.articleStatus" clearable placeholder="请选择文章状态">
<el-option
v-for="dict in dict.type.article_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="articleCreateTime"> <el-form-item prop="sort">
<el-date-picker v-model="form.articleCreateTime" <el-select
clearable v-model="queryParams.params.sort"
placeholder="请选择创建时间" clearable
type="date" placeholder="请选择排序方式"
value-format="yyyy-MM-dd"
> >
</el-date-picker> <el-option
</el-form-item> v-for="dict in sortList"
<el-form-item label="状态" prop="articleStatus">
<el-radio-group v-model="form.articleStatus">
<el-radio
v-for="dict in dict.type.article_status"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.label"
>{{ dict.label }} :value="dict.value"
</el-radio> />
</el-radio-group> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="文章封面" prop="articleCover"> <!--顶部操作按钮-->
<image-upload v-model="form.articleCover"/> <el-form-item>
<!--新增文章-->
<el-button
v-hasPermi="['business:article:add']"
class="fourWordsBtn"
icon="el-icon-circle-plus-outline"
size="mini"
@click="handleAdd"
>新增文章
</el-button>
<!--搜索 重置-->
<el-button class="queryBtn" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button class="resetBtn" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<!--选择全部-->
<el-button
v-hasPermi="['system:manage:export']"
class="fourWordsBtn"
icon="el-icon-right"
size="mini"
@click="selectAll"
>选择全部
</el-button>
<!--反向选择-->
<el-button
v-hasPermi="['system:manage:export']"
class="fourWordsBtn"
icon="el-icon-back"
size="mini"
@click="reverseSelect"
>反向选择
</el-button>
<!--批量导入-->
<el-button
v-hasPermi="['system:pets:export']"
class="fourWordsBtn"
icon="el-icon-download"
size="mini"
@click="handleExport"
>批量导入
</el-button>
<!--批量导出-->
<el-button
v-hasPermi="['system:pets:export']"
class="fourWordsBtn"
icon="el-icon-upload2"
size="mini"
@click="handleExport"
>批量导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <!--列表-->
<el-button @click="cancel"> </el-button> <el-table
</div> ref="table"
</el-dialog> v-loading="loading"
</div> :data="articleList"
:header-cell-style="{background:'#E8E9E8'}"
border
row-key="id"
@selection-change="handleSelectionChange"
@select-all="selectAll($event, false)"
>
<!-- <el-table-column align="center" reserve-selection type="selection" width="55" />-->
<el-table-column align="center" label="序号" min-width="80" show-overflow-tooltip type="index" />
<el-table-column align="center" label="文章标题" prop="articleTitle" show-overflow-tooltip width="200" />
<el-table-column
:show-overflow-tooltip="true"
align="center"
label="文章内容"
prop="articleContent"
width="200"
/>
<el-table-column align="center" show-overflow-tooltip label="权重" min-width="55" prop="articleWeight" />
<el-table-column align="center" show-overflow-tooltip label="创建时间" min-width="80" prop="articleCreateTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.articleCreateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" label="状态" min-width="60" prop="articleStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.article_status" :value="scope.row.articleStatus" />
</template>
</el-table-column>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" min-width="100">
<template slot-scope="scope">
<div style="display: flex;">
<div style="padding-right: 10px;">
<el-button
icon="el-icon-document"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(95,181,75);"
type="success"
@click="handleDetail(scope.row)"
>详情
</el-button>
</div>
<div style="padding-right: 10px;">
<el-button
v-hasPermi="['business:article:edit']"
icon="el-icon-edit"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(52,144,206);"
type="primary"
@click="handleUpdate(scope.row)"
>编辑
</el-button>
</div>
<div v-if="scope.row.articleStatus==='1'">
<el-button
v-hasPermi="['business:article:remove']"
icon="el-icon-delete"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(219,71,71);"
type="danger"
@click="handleDelete(scope.row)"
>删除
</el-button>
</div>
<div v-else-if="scope.row.articleStatus==='0'">
<el-button
icon="el-icon-video-pause"
plain
size="mini"
style="width: 50px; border-radius: 6px 6px 6px 6px;border: 1px solid rgb(255,157,78);"
type="warning"
@click="handleChange(scope.row)"
>下架
</el-button>
</div>
</div>
</template>
</el-table-column>
</el-table>
<!--分页-->
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改文章对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="60%">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="form.articleTitle" placeholder="请输入文章标题" />
</el-form-item>
<el-form-item label="文章内容">
<editor v-model="form.articleContent" :min-height="192" />
</el-form-item>
<el-form-item label="权重" prop="articleWeight">
<el-input-number v-model="form.articleWeight" :min="0" controls-position="right" />
</el-form-item>
<el-form-item label="创建时间" prop="articleCreateTime">
<el-date-picker
v-model="form.articleCreateTime"
clearable
placeholder="请选择创建时间"
type="date"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="状态" prop="articleStatus">
<el-radio-group v-model="form.articleStatus">
<el-radio
v-for="dict in dict.type.article_status"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="文章封面" prop="articleCover">
<image-upload v-model="form.articleCover" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</div> </div>
</template> </template>
<script> <script>
import { listArticle, delArticle, addArticle, updateArticle, getArticle, listAllArticle } from '@/api/business/article' import { listArticle, delArticle, addArticle, updateArticle, listAllArticle } from '@/api/business/article'
import { parseTime } from '../../utils/ruoyi'
import dict from '@/utils/dict'
export default { export default {
name: 'Article', name: 'Article',
...@@ -261,9 +289,7 @@ export default { ...@@ -261,9 +289,7 @@ export default {
} }
}, },
// 表单参数 // 表单参数
form: { form: {},
},
// 表单校验 // 表单校验
rules: { rules: {
articleStatus: [ articleStatus: [
...@@ -274,15 +300,16 @@ export default { ...@@ -274,15 +300,16 @@ export default {
}, },
created() { created() {
this.getList() this.getList()
}, },
methods: { methods: {
dict,
parseTime,
/** 首先进界面---查询文章列表 */ /** 首先进界面---查询文章列表 */
getList() { getList() {
this.loading = true this.loading = true
listArticle(this.queryParams).then(response => { listArticle(this.queryParams).then(response => {
this.articleList = response.rows this.articleList = response.rows
console.log("这是首先列表页调出来的数据:",this.articleList) console.log('这是首先列表页调出来的数据:', this.articleList)
this.total = response.total this.total = response.total
this.loading = false this.loading = false
}) })
...@@ -305,9 +332,9 @@ export default { ...@@ -305,9 +332,9 @@ export default {
}, },
/** 编辑按钮操作--跳转文章编辑页 */ /** 编辑按钮操作--跳转文章编辑页 */
handleUpdate(row) { handleUpdate(row) {
console.log("start to edit..." + row) console.log('start to edit...' + row)
this.reset() this.reset()
console.log("start to edit...") console.log('start to edit...')
this.$router.push({ this.$router.push({
name: 'Article-edit', params: { id: row.id } name: 'Article-edit', params: { id: row.id }
}) })
...@@ -331,7 +358,7 @@ export default { ...@@ -331,7 +358,7 @@ export default {
id: row.id, id: row.id,
articleStatus: '1' articleStatus: '1'
} }
console.log('articleobj',articleObj) console.log('articleobj', articleObj)
this.$modal.confirm('是否确认下架文章编号为"' + ids + '"的数据项?').then( this.$modal.confirm('是否确认下架文章编号为"' + ids + '"的数据项?').then(
// 调用修改接口 // 调用修改接口
updateArticle(articleObj).then(rows => { updateArticle(articleObj).then(rows => {
...@@ -342,7 +369,6 @@ export default { ...@@ -342,7 +369,6 @@ export default {
this.getList() this.getList()
}).catch(() => { }).catch(() => {
}) })
}, },
// 弹窗取消按钮 // 弹窗取消按钮
...@@ -413,7 +439,7 @@ export default { ...@@ -413,7 +439,7 @@ export default {
await this.changeTableSelect() await this.changeTableSelect()
} }
}, },
//反向选择 // 反向选择
reverseSelect() { reverseSelect() {
this.changeTableSelect(this.ids) this.changeTableSelect(this.ids)
}, },
...@@ -480,6 +506,7 @@ export default { ...@@ -480,6 +506,7 @@ export default {
::v-deep .status-offshelf { ::v-deep .status-offshelf {
color: #f5aa6c; color: #f5aa6c;
} }
//所有表格内容选中后的样式-all //所有表格内容选中后的样式-all
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell { ::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #F6FCF5 !important; background-color: #F6FCF5 !important;
......
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<el-row> <el-row>
<el-col :span="12" class="left-login"> <el-col :span="12" class="left-login">
<img class="logo-login" src="../assets/images/logo1.png" /> <img class="logo-login" src="../assets/images/logo1.png">
<div class="chinese-title">萌宠医院信息管理系统</div> <div class="chinese-title">萌宠医院信息管理系统</div>
<span class="english-title">Pet Hospital Information Management System</span> <span class="english-title">Pet Hospital Information Management System</span>
<img class="picture-login" src="../assets/images/pic1.png" /> <img class="picture-login" src="../assets/images/pic1.png">
</el-col> </el-col>
<el-col :span="12" class="right-login"> <el-col :span="12" class="right-login">
<div class="right-layout"> <div class="right-layout">
<div class="top"> <div class="top">
<img class="question-mark" src="../assets/images/shuoming.png" /> 登录说明 <img class="question-mark" src="../assets/images/shuoming.png"> 登录说明
</div> </div>
<h3 class="title">用户登录 User Login</h3> <h3 class="title">用户登录 User Login</h3>
<div class="welcome">欢迎来到萌宠医院信息管理系统平台,请登录您的账号!</div> <div class="welcome">欢迎来到萌宠医院信息管理系统平台,请登录您的账号!</div>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<div class="input-prompt">验证码</div> <div class="input-prompt">验证码</div>
<el-form-item prop="code" v-if="captchaEnabled"> <el-form-item v-if="captchaEnabled" prop="code">
<el-input <el-input
v-model="loginForm.code" v-model="loginForm.code"
auto-complete="off" auto-complete="off"
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input> </el-input>
<div class="login-code"> <div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/> <img :src="codeUrl" class="login-code-img" @click="getCode">
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="width:100%;"> <el-form-item style="width:100%;">
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</el-button> </el-button>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-button style="position: absolute; right: 40px" type="text">忘记密码</el-button> <el-button style="position: absolute; right: 40px" type="text">忘记密码</el-button>
<div style="float: right;" v-if="register"> <div v-if="register" style="float: right;">
<router-link class="link-type" :to="'/register'">立即注册</router-link> <router-link class="link-type" :to="'/register'">立即注册</router-link>
</div> </div>
</el-form-item> </el-form-item>
...@@ -83,30 +83,30 @@ ...@@ -83,30 +83,30 @@
</template> </template>
<script> <script>
import { getCodeImg } from "@/api/login"; import { getCodeImg } from '@/api/login'
import Cookies from "js-cookie"; import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt' import { encrypt, decrypt } from '@/utils/jsencrypt'
export default { export default {
name: "Login", name: 'Login',
data() { data() {
return { return {
codeUrl: "", codeUrl: '',
loginForm: { loginForm: {
username: "admin", username: 'admin',
password: "admin123", password: 'admin123',
rememberMe: false, rememberMe: false,
code: "", code: '',
uuid: "" uuid: ''
}, },
loginRules: { loginRules: {
username: [ username: [
{ required: true, trigger: "blur", message: "请输入您的账号" } { required: true, trigger: 'blur', message: '请输入您的账号' }
], ],
password: [ password: [
{ required: true, trigger: "blur", message: "请输入您的密码" } { required: true, trigger: 'blur', message: '请输入您的密码' }
], ],
code: [{ required: true, trigger: "change", message: "请输入验证码" }] code: [{ required: true, trigger: 'change', message: '请输入验证码' }]
}, },
loading: false, loading: false,
// 验证码开关 // 验证码开关
...@@ -114,66 +114,66 @@ export default { ...@@ -114,66 +114,66 @@ export default {
// 注册开关 // 注册开关
register: false, register: false,
redirect: undefined redirect: undefined
}; }
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler: function(route) {
this.redirect = route.query && route.query.redirect; this.redirect = route.query && route.query.redirect
}, },
immediate: true immediate: true
} }
}, },
created() { created() {
this.getCode(); this.getCode()
this.getCookie(); this.getCookie()
}, },
methods: { methods: {
getCode() { getCode() {
getCodeImg().then(res => { getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled; this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) { if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img; this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid; this.loginForm.uuid = res.uuid
} }
}); })
}, },
getCookie() { getCookie() {
const username = Cookies.get("username"); const username = Cookies.get('username')
const password = Cookies.get("password"); const password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe') const rememberMe = Cookies.get('rememberMe')
this.loginForm = { this.loginForm = {
username: username === undefined ? this.loginForm.username : username, username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password), password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe) rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
}; }
}, },
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
this.loading = true; this.loading = true
if (this.loginForm.rememberMe) { if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 }); Cookies.set('username', this.loginForm.username, { expires: 30 })
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 }); Cookies.set('password', encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else { } else {
Cookies.remove("username"); Cookies.remove('username')
Cookies.remove("password"); Cookies.remove('password')
Cookies.remove('rememberMe'); Cookies.remove('rememberMe')
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch('Login', this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); this.$router.push({ path: this.redirect || '/' }).catch(() => {})
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false
if (this.captchaEnabled) { if (this.captchaEnabled) {
this.getCode(); this.getCode()
} }
}); })
} }
}); })
} }
} }
}; }
</script> </script>
<style> <style>
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="68px">
<el-form-item label="表名称" prop="tableName"> <el-form-item label="表名称" prop="tableName">
<el-input <el-input
v-model="queryParams.tableName" v-model="queryParams.tableName"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
></el-date-picker> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
...@@ -37,54 +37,54 @@ ...@@ -37,54 +37,54 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
v-hasPermi="['tool:gen:code']"
type="primary" type="primary"
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleGenTable" @click="handleGenTable"
v-hasPermi="['tool:gen:code']"
>生成</el-button> >生成</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
v-hasPermi="['tool:gen:import']"
type="info" type="info"
plain plain
icon="el-icon-upload" icon="el-icon-upload"
size="mini" size="mini"
@click="openImportTable" @click="openImportTable"
v-hasPermi="['tool:gen:import']"
>导入</el-button> >导入</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
v-hasPermi="['tool:gen:edit']"
type="success" type="success"
plain plain
icon="el-icon-edit" icon="el-icon-edit"
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleEditTable" @click="handleEditTable"
v-hasPermi="['tool:gen:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
v-hasPermi="['tool:gen:remove']"
type="danger" type="danger"
plain plain
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['tool:gen:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
</el-row> </el-row>
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"></el-table-column> <el-table-column type="selection" align="center" width="55" />
<el-table-column label="序号" type="index" width="50" align="center"> <el-table-column label="序号" type="index" width="50" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span> <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -113,39 +113,39 @@ ...@@ -113,39 +113,39 @@
<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 slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-hasPermi="['tool:gen:preview']"
type="text" type="text"
size="small" size="small"
icon="el-icon-view" icon="el-icon-view"
@click="handlePreview(scope.row)" @click="handlePreview(scope.row)"
v-hasPermi="['tool:gen:preview']"
>预览</el-button> >预览</el-button>
<el-button <el-button
v-hasPermi="['tool:gen:edit']"
type="text" type="text"
size="small" size="small"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleEditTable(scope.row)" @click="handleEditTable(scope.row)"
v-hasPermi="['tool:gen:edit']"
>编辑</el-button> >编辑</el-button>
<el-button <el-button
v-hasPermi="['tool:gen:remove']"
type="text" type="text"
size="small" size="small"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['tool:gen:remove']"
>删除</el-button> >删除</el-button>
<el-button <el-button
v-hasPermi="['tool:gen:edit']"
type="text" type="text"
size="small" size="small"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="handleSynchDb(scope.row)" @click="handleSynchDb(scope.row)"
v-hasPermi="['tool:gen:edit']"
>同步</el-button> >同步</el-button>
<el-button <el-button
v-hasPermi="['tool:gen:code']"
type="text" type="text"
size="small" size="small"
icon="el-icon-download" icon="el-icon-download"
@click="handleGenTable(scope.row)" @click="handleGenTable(scope.row)"
v-hasPermi="['tool:gen:code']"
>生成代码</el-button> >生成代码</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -162,12 +162,12 @@ ...@@ -162,12 +162,12 @@
<el-tabs v-model="preview.activeName"> <el-tabs v-model="preview.activeName">
<el-tab-pane <el-tab-pane
v-for="(value, key) in preview.data" v-for="(value, key) in preview.data"
:key="key"
:label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))" :label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
:name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))" :name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
:key="key"
> >
<el-link :underline="false" icon="el-icon-document-copy" v-clipboard:copy="value" v-clipboard:success="clipboardSuccess" style="float:right">复制</el-link> <el-link v-clipboard:copy="value" v-clipboard:success="clipboardSuccess" :underline="false" icon="el-icon-document-copy" style="float:right">复制</el-link>
<pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre> <pre><code class="hljs" v-html="highlightedCode(value, key)" /></pre>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-dialog> </el-dialog>
...@@ -176,26 +176,26 @@ ...@@ -176,26 +176,26 @@
</template> </template>
<script> <script>
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"; import { listTable, previewTable, delTable, genCode, synchDb } from '@/api/tool/gen'
import importTable from "./importTable"; import importTable from './importTable'
import hljs from "highlight.js/lib/highlight"; import hljs from 'highlight.js/lib/highlight'
import "highlight.js/styles/github-gist.css"; import 'highlight.js/styles/github-gist.css'
hljs.registerLanguage("java", require("highlight.js/lib/languages/java")); hljs.registerLanguage('java', require('highlight.js/lib/languages/java'))
hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml")); hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'))
hljs.registerLanguage("html", require("highlight.js/lib/languages/xml")); hljs.registerLanguage('html', require('highlight.js/lib/languages/xml'))
hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml")); hljs.registerLanguage('vue', require('highlight.js/lib/languages/xml'))
hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript")); hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'))
hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql")); hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql'))
export default { export default {
name: "Gen", name: 'Gen',
components: { importTable }, components: { importTable },
data() { data() {
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 唯一标识符 // 唯一标识符
uniqueId: "", uniqueId: '',
// 选中数组 // 选中数组
ids: [], ids: [],
// 选中表数组 // 选中表数组
...@@ -211,7 +211,7 @@ export default { ...@@ -211,7 +211,7 @@ export default {
// 表数据 // 表数据
tableList: [], tableList: [],
// 日期范围 // 日期范围
dateRange: "", dateRange: '',
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -222,116 +222,116 @@ export default { ...@@ -222,116 +222,116 @@ export default {
// 预览参数 // 预览参数
preview: { preview: {
open: false, open: false,
title: "代码预览", title: '代码预览',
data: {}, data: {},
activeName: "domain.java" activeName: 'domain.java'
} }
}; }
}, },
created() { created() {
this.getList(); this.getList()
}, },
activated() { activated() {
const time = this.$route.query.t; const time = this.$route.query.t
if (time != null && time != this.uniqueId) { if (time != null && time != this.uniqueId) {
this.uniqueId = time; this.uniqueId = time
this.queryParams.pageNum = Number(this.$route.query.pageNum); this.queryParams.pageNum = Number(this.$route.query.pageNum)
this.getList(); this.getList()
} }
}, },
methods: { methods: {
/** 查询表集合 */ /** 查询表集合 */
getList() { getList() {
this.loading = true; this.loading = true
listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => { listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.tableList = response.rows; this.tableList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
} }
); )
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 生成代码操作 */ /** 生成代码操作 */
handleGenTable(row) { handleGenTable(row) {
const tableNames = row.tableName || this.tableNames; const tableNames = row.tableName || this.tableNames
if (tableNames == "") { if (tableNames == '') {
this.$modal.msgError("请选择要生成的数据"); this.$modal.msgError('请选择要生成的数据')
return; return
} }
if(row.genType === "1") { if (row.genType === '1') {
genCode(row.tableName).then(response => { genCode(row.tableName).then(response => {
this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath); this.$modal.msgSuccess('成功生成到自定义路径:' + row.genPath)
}); })
} else { } else {
this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi.zip"); this.$download.zip('/tool/gen/batchGenCode?tables=' + tableNames, 'ruoyi.zip')
} }
}, },
/** 同步数据库操作 */ /** 同步数据库操作 */
handleSynchDb(row) { handleSynchDb(row) {
const tableName = row.tableName; const tableName = row.tableName
this.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function() { this.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function() {
return synchDb(tableName); return synchDb(tableName)
}).then(() => { }).then(() => {
this.$modal.msgSuccess("同步成功"); this.$modal.msgSuccess('同步成功')
}).catch(() => {}); }).catch(() => {})
}, },
/** 打开导入表弹窗 */ /** 打开导入表弹窗 */
openImportTable() { openImportTable() {
this.$refs.import.show(); this.$refs.import.show()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = []
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
/** 预览按钮 */ /** 预览按钮 */
handlePreview(row) { handlePreview(row) {
previewTable(row.tableId).then(response => { previewTable(row.tableId).then(response => {
this.preview.data = response.data; this.preview.data = response.data
this.preview.open = true; this.preview.open = true
this.preview.activeName = "domain.java"; this.preview.activeName = 'domain.java'
}); })
}, },
/** 高亮显示 */ /** 高亮显示 */
highlightedCode(code, key) { highlightedCode(code, key) {
const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm")); const vmName = key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))
var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length); var language = vmName.substring(vmName.indexOf('.') + 1, vmName.length)
const result = hljs.highlight(language, code || "", true); const result = hljs.highlight(language, code || '', true)
return result.value || '&nbsp;'; return result.value || '&nbsp;'
}, },
/** 复制代码成功 */ /** 复制代码成功 */
clipboardSuccess() { clipboardSuccess() {
this.$modal.msgSuccess("复制成功"); this.$modal.msgSuccess('复制成功')
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.tableId); this.ids = selection.map(item => item.tableId)
this.tableNames = selection.map(item => item.tableName); this.tableNames = selection.map(item => item.tableName)
this.single = selection.length != 1; this.single = selection.length != 1
this.multiple = !selection.length; this.multiple = !selection.length
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleEditTable(row) { handleEditTable(row) {
const tableId = row.tableId || this.ids[0]; const tableId = row.tableId || this.ids[0]
const tableName = row.tableName || this.tableNames[0]; const tableName = row.tableName || this.tableNames[0]
const params = { pageNum: this.queryParams.pageNum }; const params = { pageNum: this.queryParams.pageNum }
this.$tab.openPage("修改[" + tableName + "]生成配置", '/tool/gen-edit/index/' + tableId, params); this.$tab.openPage('修改[' + tableName + ']生成配置', '/tool/gen-edit/index/' + tableId, params)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const tableIds = row.tableId || this.ids; const tableIds = row.tableId || this.ids
this.$modal.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?').then(function() {
return delTable(tableIds); return delTable(tableIds)
}).then(() => { }).then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess('删除成功')
}).catch(() => {}); }).catch(() => {})
} }
} }
}; }
</script> </script>
...@@ -33,13 +33,13 @@ module.exports = { ...@@ -33,13 +33,13 @@ module.exports = {
} }
} }
// vue.config.js 配置说明 // vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions // 官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档 // 这里只列一部分,具体配置参考文档
module.exports = { module.exports = {
// 部署生产环境和开发环境下的URL。 // 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/", publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist', outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
...@@ -64,12 +64,13 @@ module.exports = { ...@@ -64,12 +64,13 @@ module.exports = {
port: port, port: port,
open: true, open: true,
headers: { headers: {
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*'
}, },
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8091`, // target: `http://localhost:8091`,
target: `http://114.67.241.140:8091`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''
...@@ -90,7 +91,7 @@ module.exports = { ...@@ -90,7 +91,7 @@ module.exports = {
output: { output: {
library: 'pet-business-web', library: 'pet-business-web',
libraryTarget: 'umd', // 把微应用打包成 umd 库格式 libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_pet-business-web`, jsonpFunction: `webpackJsonp_pet-business-web`
}, },
resolve: { resolve: {
alias: { alias: {
...@@ -100,13 +101,13 @@ module.exports = { ...@@ -100,13 +101,13 @@ module.exports = {
plugins: [ plugins: [
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({ new CompressionPlugin({
cache: false, // 不启用文件缓存 cache: false, // 不启用文件缓存
test: /\.(js|css|html)?$/i, // 压缩文件格式 test: /\.(js|css|html)?$/i, // 压缩文件格式
filename: '[path].gz[query]', // 压缩后的文件名 filename: '[path].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩 algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8 // 压缩率小于1才会压缩 minRatio: 0.8 // 压缩率小于1才会压缩
}) })
], ]
}, },
chainWebpack(config) { chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test config.plugins.delete('preload') // TODO: need test
...@@ -166,8 +167,8 @@ module.exports = { ...@@ -166,8 +167,8 @@ module.exports = {
}) })
config.optimization.runtimeChunk('single'), config.optimization.runtimeChunk('single'),
{ {
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 from: path.resolve(__dirname, './public/robots.txt'), // 防爬虫文件
to: './' //到根目录下 to: './' // 到根目录下
} }
} }
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment