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

文章管理

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