pc端
This commit is contained in:
parent
373857292b
commit
4d29b79be1
@ -1,5 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { parseStrEmpty } from "@/utils/xinelu";
|
import { parseStrEmpty } from "@/utils/xinyilu";
|
||||||
|
|
||||||
// 查询用户列表
|
// 查询用户列表
|
||||||
export function listUser(query) {
|
export function listUser(query) {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 121 KiB |
@ -9,10 +9,10 @@
|
|||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
style="display: none"
|
style="display: none"
|
||||||
|
:data="filetype"
|
||||||
ref="upload"
|
ref="upload"
|
||||||
v-if="this.type == 'url'"
|
v-if="this.type == 'url'"
|
||||||
>
|
></el-upload>
|
||||||
</el-upload>
|
|
||||||
<div class="editor" ref="editor" :style="styles"></div>
|
<div class="editor" ref="editor" :style="styles"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -56,13 +56,21 @@ export default {
|
|||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "url",
|
default: "url",
|
||||||
}
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: "/common/richTextPictureUrl",
|
||||||
|
},
|
||||||
|
// filetypes: {
|
||||||
|
// type: String,
|
||||||
|
// default: "",
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
uploadUrl: process.env.VUE_APP_BASE_API, // 上传的图片服务器地址
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken()
|
Authorization: "Bearer " + getToken(),
|
||||||
},
|
},
|
||||||
Quill: null,
|
Quill: null,
|
||||||
currentValue: "",
|
currentValue: "",
|
||||||
@ -73,23 +81,31 @@ export default {
|
|||||||
modules: {
|
modules: {
|
||||||
// 工具栏配置
|
// 工具栏配置
|
||||||
toolbar: [
|
toolbar: [
|
||||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||||
["blockquote", "code-block"], // 引用 代码块
|
["blockquote", "code-block"], // 引用 代码块
|
||||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||||
[{ align: [] }], // 对齐方式
|
[{ align: [] }], // 对齐方式
|
||||||
["clean"], // 清除文本格式
|
["clean"], // 清除文本格式
|
||||||
["link", "image", "video"] // 链接、图片、视频
|
["link", "image"], // 链接、图片、视频
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
placeholder: "请输入内容",
|
placeholder: "请输入内容",
|
||||||
readOnly: this.readOnly,
|
readOnly: this.readOnly,
|
||||||
},
|
},
|
||||||
|
filetype: {
|
||||||
|
type: "",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.uploadUrl = process.env.VUE_APP_BASE_API + this.url;
|
||||||
|
// console.log(this.url)
|
||||||
|
// this.filetype.type = this.filetypes;
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
styles() {
|
styles() {
|
||||||
let style = {};
|
let style = {};
|
||||||
@ -126,7 +142,7 @@ export default {
|
|||||||
const editor = this.$refs.editor;
|
const editor = this.$refs.editor;
|
||||||
this.Quill = new Quill(editor, this.options);
|
this.Quill = new Quill(editor, this.options);
|
||||||
// 如果设置了上传地址则自定义图片上传事件
|
// 如果设置了上传地址则自定义图片上传事件
|
||||||
if (this.type == 'url') {
|
if (this.type == "url") {
|
||||||
let toolbar = this.Quill.getModule("toolbar");
|
let toolbar = this.Quill.getModule("toolbar");
|
||||||
toolbar.addHandler("image", (value) => {
|
toolbar.addHandler("image", (value) => {
|
||||||
this.uploadType = "image";
|
this.uploadType = "image";
|
||||||
@ -176,7 +192,13 @@ export default {
|
|||||||
// 获取光标所在位置
|
// 获取光标所在位置
|
||||||
let length = quill.getSelection().index;
|
let length = quill.getSelection().index;
|
||||||
// 插入图片 res.url为服务器返回的图片地址
|
// 插入图片 res.url为服务器返回的图片地址
|
||||||
quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
|
quill.insertEmbed(
|
||||||
|
length,
|
||||||
|
"image",
|
||||||
|
process.env.VUE_APP_BASE_API + res.fileName
|
||||||
|
);
|
||||||
|
console.log(res);
|
||||||
|
this.$emit("imgs", res.fileName);
|
||||||
// 调整光标到最后
|
// 调整光标到最后
|
||||||
quill.setSelection(length + 1);
|
quill.setSelection(length + 1);
|
||||||
} else {
|
} else {
|
||||||
@ -191,7 +213,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.editor, .ql-toolbar {
|
.editor,
|
||||||
|
.ql-toolbar {
|
||||||
white-space: pre-wrap !important;
|
white-space: pre-wrap !important;
|
||||||
line-height: normal !important;
|
line-height: normal !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* v-dialogDrag 弹窗拖拽
|
* v-dialogDrag 弹窗拖拽
|
||||||
* Copyright (c) 2019 xinelu
|
* Copyright (c) 2019 xinyilu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* v-dialogDragWidth 可拖动弹窗高度(右下角)
|
* v-dialogDragWidth 可拖动弹窗高度(右下角)
|
||||||
* Copyright (c) 2019 xinelu
|
* Copyright (c) 2019 xinyilu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* v-dialogDragWidth 可拖动弹窗宽度(右侧边)
|
* v-dialogDragWidth 可拖动弹窗宽度(右侧边)
|
||||||
* Copyright (c) 2019 xinelu
|
* Copyright (c) 2019 xinyilu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* v-clipboard 文字复制剪贴
|
* v-clipboard 文字复制剪贴
|
||||||
* Copyright (c) 2021 xinelu
|
* Copyright (c) 2021 xinyilu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Clipboard from 'clipboard'
|
import Clipboard from 'clipboard'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* v-hasPermi 操作权限处理
|
* v-hasPermi 操作权限处理
|
||||||
* Copyright (c) 2019 xinelu
|
* Copyright (c) 2019 xinyilu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* v-hasRole 角色权限处理
|
* v-hasRole 角色权限处理
|
||||||
* Copyright (c) 2019 xinelu
|
* Copyright (c) 2019 xinyilu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
|
|||||||
@ -9,13 +9,13 @@
|
|||||||
<template v-if="device!=='mobile'">
|
<template v-if="device!=='mobile'">
|
||||||
<search id="header-search" class="right-menu-item" />
|
<search id="header-search" class="right-menu-item" />
|
||||||
|
|
||||||
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||||
<ruo-yi-git id="xinelu-git" class="right-menu-item hover-effect" />
|
<ruo-yi-git id="xinyilu-git" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
||||||
<ruo-yi-doc id="xinelu-doc" class="right-menu-item hover-effect" />
|
<ruo-yi-doc id="xinyilu-doc" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip>
|
</el-tooltip> -->
|
||||||
|
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||||
|
|
||||||
@ -54,8 +54,8 @@ import Hamburger from '@/components/Hamburger'
|
|||||||
import Screenfull from '@/components/Screenfull'
|
import Screenfull from '@/components/Screenfull'
|
||||||
import SizeSelect from '@/components/SizeSelect'
|
import SizeSelect from '@/components/SizeSelect'
|
||||||
import Search from '@/components/HeaderSearch'
|
import Search from '@/components/HeaderSearch'
|
||||||
import xineluGit from '@/components/xinelu/Git'
|
import xinyiluGit from '@/components/xinyilu/Git'
|
||||||
import xineluDoc from '@/components/xinelu/Doc'
|
import xinyiluDoc from '@/components/xinyilu/Doc'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -65,8 +65,8 @@ export default {
|
|||||||
Screenfull,
|
Screenfull,
|
||||||
SizeSelect,
|
SizeSelect,
|
||||||
Search,
|
Search,
|
||||||
xineluGit,
|
xinyiluGit,
|
||||||
xineluDoc
|
xinyiluDoc
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import logoImg from '@/assets/logo/logo.png'
|
import logoImg from '@/assets/logo/lg.png'
|
||||||
import variables from '@/assets/styles/variables.scss'
|
import variables from '@/assets/styles/variables.scss'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -35,7 +35,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '新版小程序管理系统',
|
title: '泉医到家运营管理平台',
|
||||||
logo: logoImg
|
logo: logoImg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
||||||
<sidebar v-if="!sidebar.hide" class="sidebar-container" />
|
<sidebar v-if="!sidebar.hide" class="sidebar-container" />
|
||||||
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
|
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
|
||||||
|
<div :class="show ? 'bj' : ''">
|
||||||
<div :class="{'fixed-header':fixedHeader}">
|
<div :class="{'fixed-header':fixedHeader}">
|
||||||
<navbar />
|
<navbar />
|
||||||
<tags-view v-if="needTagsView" />
|
<tags-view v-if="needTagsView" />
|
||||||
@ -11,6 +12,7 @@
|
|||||||
<right-panel>
|
<right-panel>
|
||||||
<settings />
|
<settings />
|
||||||
</right-panel>
|
</right-panel>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -31,6 +33,11 @@ export default {
|
|||||||
Settings,
|
Settings,
|
||||||
Sidebar,
|
Sidebar,
|
||||||
TagsView
|
TagsView
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: true,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
mixins: [ResizeMixin],
|
mixins: [ResizeMixin],
|
||||||
computed: {
|
computed: {
|
||||||
@ -53,8 +60,27 @@ export default {
|
|||||||
variables() {
|
variables() {
|
||||||
return variables;
|
return variables;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.info();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
$route(to, from) {
|
||||||
|
if (to.path != "/index") {
|
||||||
|
this.show = false;
|
||||||
|
} else {
|
||||||
|
this.show = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
info() {
|
||||||
|
if (this.$route.path != "/index") {
|
||||||
|
this.show = false;
|
||||||
|
} else {
|
||||||
|
this.show = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
handleClickOutside() {
|
handleClickOutside() {
|
||||||
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
||||||
}
|
}
|
||||||
@ -65,7 +91,11 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "~@/assets/styles/mixin.scss";
|
@import "~@/assets/styles/mixin.scss";
|
||||||
@import "~@/assets/styles/variables.scss";
|
@import "~@/assets/styles/variables.scss";
|
||||||
|
.bj {
|
||||||
|
// background-image: url("../assets/images/body.png");
|
||||||
|
-moz-background-size: 100% 100%;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
.app-wrapper {
|
.app-wrapper {
|
||||||
@include clearfix;
|
@include clearfix;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
15
src/main.js
15
src/main.js
@ -6,7 +6,7 @@ import Element from 'element-ui'
|
|||||||
import './assets/styles/element-variables.scss'
|
import './assets/styles/element-variables.scss'
|
||||||
|
|
||||||
import '@/assets/styles/index.scss' // global css
|
import '@/assets/styles/index.scss' // global css
|
||||||
import '@/assets/styles/xinelu.scss' // xinelu css
|
import '@/assets/styles/xinyilu.scss' // xinyilu css
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
@ -18,7 +18,7 @@ import './assets/icons' // icon
|
|||||||
import './permission' // permission control
|
import './permission' // permission control
|
||||||
import { getDicts } from "@/api/system/dict/data";
|
import { getDicts } from "@/api/system/dict/data";
|
||||||
import { getConfigKey } from "@/api/system/config";
|
import { getConfigKey } from "@/api/system/config";
|
||||||
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/xinelu";
|
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/xinyilu";
|
||||||
// 分页组件
|
// 分页组件
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
// 自定义表格工具组件
|
// 自定义表格工具组件
|
||||||
@ -38,6 +38,7 @@ import VueMeta from 'vue-meta'
|
|||||||
// 字典数据组件
|
// 字典数据组件
|
||||||
import DictData from '@/components/DictData'
|
import DictData from '@/components/DictData'
|
||||||
|
|
||||||
|
|
||||||
// 全局方法挂载
|
// 全局方法挂载
|
||||||
Vue.prototype.getDicts = getDicts
|
Vue.prototype.getDicts = getDicts
|
||||||
Vue.prototype.getConfigKey = getConfigKey
|
Vue.prototype.getConfigKey = getConfigKey
|
||||||
@ -73,14 +74,14 @@ DictData.install()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Vue.use(Element, {
|
Vue.use(Element, {
|
||||||
size: Cookies.get('size') || 'medium' // set element-ui default size
|
size: Cookies.get('size') || 'medium' // set element-ui default size
|
||||||
})
|
})
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
router,
|
router,
|
||||||
store,
|
store,
|
||||||
render: h => h(App)
|
render: h => h(App)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -11,46 +11,46 @@ NProgress.configure({ showSpinner: false })
|
|||||||
const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
|
const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||||
/* has token*/
|
/* has token*/
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
|
} else {
|
||||||
|
if (store.getters.roles.length === 0) {
|
||||||
|
isRelogin.show = true
|
||||||
|
// 判断当前用户是否已拉取完user_info信息
|
||||||
|
store.dispatch('GetInfo').then(() => {
|
||||||
|
isRelogin.show = false
|
||||||
|
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||||
|
// 根据roles权限生成可访问的路由表
|
||||||
|
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||||
|
next({...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||||
|
})
|
||||||
|
}).catch(err => {
|
||||||
|
store.dispatch('LogOut').then(() => {
|
||||||
|
Message.error(err)
|
||||||
|
next({ path: '/' })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (store.getters.roles.length === 0) {
|
// 没有token
|
||||||
isRelogin.show = true
|
if (whiteList.indexOf(to.path) !== -1) {
|
||||||
// 判断当前用户是否已拉取完user_info信息
|
// 在免登录白名单,直接进入
|
||||||
store.dispatch('GetInfo').then(() => {
|
next()
|
||||||
isRelogin.show = false
|
} else {
|
||||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||||
// 根据roles权限生成可访问的路由表
|
NProgress.done()
|
||||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
}
|
||||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
|
||||||
})
|
|
||||||
}).catch(err => {
|
|
||||||
store.dispatch('LogOut').then(() => {
|
|
||||||
Message.error(err)
|
|
||||||
next({ path: '/' })
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
next()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// 没有token
|
|
||||||
if (whiteList.indexOf(to.path) !== -1) {
|
|
||||||
// 在免登录白名单,直接进入
|
|
||||||
next()
|
|
||||||
} else {
|
|
||||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
|
||||||
NProgress.done()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
})
|
})
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { Message } from 'element-ui'
|
|||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import errorCode from '@/utils/errorCode'
|
import errorCode from '@/utils/errorCode'
|
||||||
import { blobValidate } from "@/utils/xinelu";
|
import { blobValidate } from "@/utils/xinyilu";
|
||||||
|
|
||||||
const baseURL = process.env.VUE_APP_BASE_API
|
const baseURL = process.env.VUE_APP_BASE_API
|
||||||
|
|
||||||
|
|||||||
@ -2,95 +2,95 @@ import { login, logout, getInfo } from '@/api/login'
|
|||||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||||
|
|
||||||
const user = {
|
const user = {
|
||||||
state: {
|
state: {
|
||||||
token: getToken(),
|
token: getToken(),
|
||||||
name: '',
|
name: '',
|
||||||
avatar: '',
|
avatar: '',
|
||||||
roles: [],
|
roles: [],
|
||||||
permissions: []
|
permissions: []
|
||||||
},
|
},
|
||||||
|
|
||||||
mutations: {
|
mutations: {
|
||||||
SET_TOKEN: (state, token) => {
|
SET_TOKEN: (state, token) => {
|
||||||
state.token = token
|
state.token = token
|
||||||
|
},
|
||||||
|
SET_NAME: (state, name) => {
|
||||||
|
state.name = name
|
||||||
|
},
|
||||||
|
SET_AVATAR: (state, avatar) => {
|
||||||
|
state.avatar = avatar
|
||||||
|
},
|
||||||
|
SET_ROLES: (state, roles) => {
|
||||||
|
state.roles = roles
|
||||||
|
},
|
||||||
|
SET_PERMISSIONS: (state, permissions) => {
|
||||||
|
state.permissions = permissions
|
||||||
|
}
|
||||||
},
|
},
|
||||||
SET_NAME: (state, name) => {
|
|
||||||
state.name = name
|
actions: {
|
||||||
},
|
// 登录
|
||||||
SET_AVATAR: (state, avatar) => {
|
Login({ commit }, userInfo) {
|
||||||
state.avatar = avatar
|
const username = userInfo.username.trim()
|
||||||
},
|
const password = userInfo.password
|
||||||
SET_ROLES: (state, roles) => {
|
const code = userInfo.code
|
||||||
state.roles = roles
|
const uuid = userInfo.uuid
|
||||||
},
|
return new Promise((resolve, reject) => {
|
||||||
SET_PERMISSIONS: (state, permissions) => {
|
login(username, password, code, uuid).then(res => {
|
||||||
state.permissions = permissions
|
setToken(res.token)
|
||||||
|
commit('SET_TOKEN', res.token)
|
||||||
|
resolve()
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
GetInfo({ commit, state }) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
getInfo().then(res => {
|
||||||
|
const user = res.user
|
||||||
|
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
|
||||||
|
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||||
|
commit('SET_ROLES', res.roles)
|
||||||
|
commit('SET_PERMISSIONS', res.permissions)
|
||||||
|
} else {
|
||||||
|
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||||
|
}
|
||||||
|
commit('SET_NAME', user.userName)
|
||||||
|
commit('SET_AVATAR', avatar)
|
||||||
|
resolve(res)
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 退出系统
|
||||||
|
LogOut({ commit, state }) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
logout(state.token).then(() => {
|
||||||
|
commit('SET_TOKEN', '')
|
||||||
|
commit('SET_ROLES', [])
|
||||||
|
commit('SET_PERMISSIONS', [])
|
||||||
|
removeToken()
|
||||||
|
resolve()
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 前端 登出
|
||||||
|
FedLogOut({ commit }) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
commit('SET_TOKEN', '')
|
||||||
|
removeToken()
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
actions: {
|
|
||||||
// 登录
|
|
||||||
Login({ commit }, userInfo) {
|
|
||||||
const username = userInfo.username.trim()
|
|
||||||
const password = userInfo.password
|
|
||||||
const code = userInfo.code
|
|
||||||
const uuid = userInfo.uuid
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
login(username, password, code, uuid).then(res => {
|
|
||||||
setToken(res.token)
|
|
||||||
commit('SET_TOKEN', res.token)
|
|
||||||
resolve()
|
|
||||||
}).catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取用户信息
|
|
||||||
GetInfo({ commit, state }) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
getInfo().then(res => {
|
|
||||||
const user = res.user
|
|
||||||
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
|
|
||||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
|
||||||
commit('SET_ROLES', res.roles)
|
|
||||||
commit('SET_PERMISSIONS', res.permissions)
|
|
||||||
} else {
|
|
||||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
|
||||||
}
|
|
||||||
commit('SET_NAME', user.userName)
|
|
||||||
commit('SET_AVATAR', avatar)
|
|
||||||
resolve(res)
|
|
||||||
}).catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 退出系统
|
|
||||||
LogOut({ commit, state }) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
logout(state.token).then(() => {
|
|
||||||
commit('SET_TOKEN', '')
|
|
||||||
commit('SET_ROLES', [])
|
|
||||||
commit('SET_PERMISSIONS', [])
|
|
||||||
removeToken()
|
|
||||||
resolve()
|
|
||||||
}).catch(error => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 前端 登出
|
|
||||||
FedLogOut({ commit }) {
|
|
||||||
return new Promise(resolve => {
|
|
||||||
commit('SET_TOKEN', '')
|
|
||||||
removeToken()
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default user
|
export default user
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { mergeRecursive } from "@/utils/xinelu";
|
import { mergeRecursive } from "@/utils/xinyilu";
|
||||||
import DictMeta from './DictMeta'
|
import DictMeta from './DictMeta'
|
||||||
import DictData from './DictData'
|
import DictData from './DictData'
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { mergeRecursive } from "@/utils/xinelu";
|
import { mergeRecursive } from "@/utils/xinyilu";
|
||||||
import DictOptions from './DictOptions'
|
import DictOptions from './DictOptions'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,32 +1,32 @@
|
|||||||
import { mergeRecursive } from "@/utils/xinelu";
|
import { mergeRecursive } from "@/utils/xinyilu";
|
||||||
import dictConverter from './DictConverter'
|
import dictConverter from './DictConverter'
|
||||||
|
|
||||||
export const options = {
|
export const options = {
|
||||||
metas: {
|
metas: {
|
||||||
'*': {
|
'*': {
|
||||||
/**
|
/**
|
||||||
* 字典请求,方法签名为function(dictMeta: DictMeta): Promise
|
* 字典请求,方法签名为function(dictMeta: DictMeta): Promise
|
||||||
*/
|
*/
|
||||||
request: (dictMeta) => {
|
request: (dictMeta) => {
|
||||||
console.log(`load dict ${dictMeta.type}`)
|
console.log(`load dict ${dictMeta.type}`)
|
||||||
return Promise.resolve([])
|
return Promise.resolve([])
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData
|
* 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData
|
||||||
*/
|
*/
|
||||||
responseConverter,
|
responseConverter,
|
||||||
labelField: 'label',
|
labelField: 'label',
|
||||||
valueField: 'value',
|
valueField: 'value',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
/**
|
||||||
/**
|
* 默认标签字段
|
||||||
* 默认标签字段
|
*/
|
||||||
*/
|
DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'],
|
||||||
DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'],
|
/**
|
||||||
/**
|
* 默认值字段
|
||||||
* 默认值字段
|
*/
|
||||||
*/
|
DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'],
|
||||||
DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,16 +36,16 @@ export const options = {
|
|||||||
* @returns {DictData}
|
* @returns {DictData}
|
||||||
*/
|
*/
|
||||||
function responseConverter(response, dictMeta) {
|
function responseConverter(response, dictMeta) {
|
||||||
const dicts = response.content instanceof Array ? response.content : response
|
const dicts = response.content instanceof Array ? response.content : response
|
||||||
if (dicts === undefined) {
|
if (dicts === undefined) {
|
||||||
console.warn(`no dict data of "${dictMeta.type}" found in the response`)
|
console.warn(`no dict data of "${dictMeta.type}" found in the response`)
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
return dicts.map(d => dictConverter(d, dictMeta))
|
return dicts.map(d => dictConverter(d, dictMeta))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mergeOptions(src) {
|
export function mergeOptions(src) {
|
||||||
mergeRecursive(options, src)
|
mergeRecursive(options, src)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default options
|
export default options
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { parseTime } from './xinelu'
|
import { parseTime } from './xinyilu'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格时间格式化
|
* 表格时间格式化
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { Notification, MessageBox, Message, Loading } from 'element-ui'
|
|||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import errorCode from '@/utils/errorCode'
|
import errorCode from '@/utils/errorCode'
|
||||||
import { tansParams, blobValidate } from "@/utils/xinelu";
|
import { tansParams, blobValidate } from "@/utils/xinyilu";
|
||||||
import cache from '@/plugins/cache'
|
import cache from '@/plugins/cache'
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
|
|
||||||
@ -14,52 +14,52 @@ export let isRelogin = { show: false };
|
|||||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||||
baseURL: process.env.VUE_APP_BASE_API,
|
baseURL: process.env.VUE_APP_BASE_API,
|
||||||
// 超时
|
// 超时
|
||||||
timeout: 10000
|
timeout: 10000
|
||||||
})
|
})
|
||||||
|
|
||||||
// request拦截器
|
// request拦截器
|
||||||
service.interceptors.request.use(config => {
|
service.interceptors.request.use(config => {
|
||||||
// 是否需要设置 token
|
// 是否需要设置 token
|
||||||
const isToken = (config.headers || {}).isToken === false
|
const isToken = (config.headers || {}).isToken === false
|
||||||
// 是否需要防止数据重复提交
|
// 是否需要防止数据重复提交
|
||||||
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
|
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
|
||||||
if (getToken() && !isToken) {
|
if (getToken() && !isToken) {
|
||||||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||||
}
|
|
||||||
// get请求映射params参数
|
|
||||||
if (config.method === 'get' && config.params) {
|
|
||||||
let url = config.url + '?' + tansParams(config.params);
|
|
||||||
url = url.slice(0, -1);
|
|
||||||
config.params = {};
|
|
||||||
config.url = url;
|
|
||||||
}
|
|
||||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
|
||||||
const requestObj = {
|
|
||||||
url: config.url,
|
|
||||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
|
||||||
time: new Date().getTime()
|
|
||||||
}
|
}
|
||||||
const sessionObj = cache.session.getJSON('sessionObj')
|
// get请求映射params参数
|
||||||
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
if (config.method === 'get' && config.params) {
|
||||||
cache.session.setJSON('sessionObj', requestObj)
|
let url = config.url + '?' + tansParams(config.params);
|
||||||
} else {
|
url = url.slice(0, -1);
|
||||||
const s_url = sessionObj.url; // 请求地址
|
config.params = {};
|
||||||
const s_data = sessionObj.data; // 请求数据
|
config.url = url;
|
||||||
const s_time = sessionObj.time; // 请求时间
|
|
||||||
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
|
|
||||||
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
|
|
||||||
const message = '数据正在处理,请勿重复提交';
|
|
||||||
console.warn(`[${s_url}]: ` + message)
|
|
||||||
return Promise.reject(new Error(message))
|
|
||||||
} else {
|
|
||||||
cache.session.setJSON('sessionObj', requestObj)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||||
return config
|
const requestObj = {
|
||||||
|
url: config.url,
|
||||||
|
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||||
|
time: new Date().getTime()
|
||||||
|
}
|
||||||
|
const sessionObj = cache.session.getJSON('sessionObj')
|
||||||
|
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
||||||
|
cache.session.setJSON('sessionObj', requestObj)
|
||||||
|
} else {
|
||||||
|
const s_url = sessionObj.url; // 请求地址
|
||||||
|
const s_data = sessionObj.data; // 请求数据
|
||||||
|
const s_time = sessionObj.time; // 请求时间
|
||||||
|
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
|
||||||
|
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
|
||||||
|
const message = '数据正在处理,请勿重复提交';
|
||||||
|
console.warn(`[${s_url}]: ` + message)
|
||||||
|
return Promise.reject(new Error(message))
|
||||||
|
} else {
|
||||||
|
cache.session.setJSON('sessionObj', requestObj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return config
|
||||||
}, error => {
|
}, error => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
Promise.reject(error)
|
Promise.reject(error)
|
||||||
@ -72,87 +72,86 @@ service.interceptors.response.use(res => {
|
|||||||
// 获取错误信息
|
// 获取错误信息
|
||||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||||
// 二进制数据则直接返回
|
// 二进制数据则直接返回
|
||||||
if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){
|
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
|
||||||
return res.data
|
return res.data
|
||||||
}
|
}
|
||||||
if (code === 401) {
|
if (code === 401) {
|
||||||
if (!isRelogin.show) {
|
if (!isRelogin.show) {
|
||||||
isRelogin.show = true;
|
isRelogin.show = true;
|
||||||
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
||||||
confirmButtonText: '重新登录',
|
confirmButtonText: '重新登录',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
isRelogin.show = false;
|
||||||
|
store.dispatch('LogOut').then(() => {
|
||||||
|
location.href = '/index';
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
isRelogin.show = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
).then(() => {
|
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||||
isRelogin.show = false;
|
|
||||||
store.dispatch('LogOut').then(() => {
|
|
||||||
location.href = '/index';
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
isRelogin.show = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
|
||||||
} else if (code === 500) {
|
} else if (code === 500) {
|
||||||
Message({
|
Message({
|
||||||
message: msg,
|
message: msg,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
return Promise.reject(new Error(msg))
|
return res.data & Promise.reject(new Error(msg))
|
||||||
|
} else if (code === 600) {
|
||||||
|
return Promise.reject(new Error(msg))
|
||||||
} else if (code !== 200) {
|
} else if (code !== 200) {
|
||||||
Notification.error({
|
Notification.error({
|
||||||
title: msg
|
title: msg
|
||||||
})
|
})
|
||||||
return Promise.reject('error')
|
return Promise.reject('error')
|
||||||
} else {
|
} else {
|
||||||
return res.data
|
return res.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
console.log('err' + error)
|
console.log('err' + error)
|
||||||
let { message } = error;
|
let { message } = error;
|
||||||
if (message == "Network Error") {
|
if (message == "Network Error") {
|
||||||
message = "后端接口连接异常";
|
message = "后端接口连接异常";
|
||||||
|
} else if (message.includes("timeout")) {
|
||||||
|
message = "系统接口请求超时";
|
||||||
|
} else if (message.includes("Request failed with status code")) {
|
||||||
|
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||||
|
}
|
||||||
|
Message({
|
||||||
|
message: message,
|
||||||
|
type: 'error',
|
||||||
|
duration: 5 * 1000
|
||||||
|
})
|
||||||
|
return Promise.reject(error)
|
||||||
}
|
}
|
||||||
else if (message.includes("timeout")) {
|
|
||||||
message = "系统接口请求超时";
|
|
||||||
}
|
|
||||||
else if (message.includes("Request failed with status code")) {
|
|
||||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
|
||||||
}
|
|
||||||
Message({
|
|
||||||
message: message,
|
|
||||||
type: 'error',
|
|
||||||
duration: 5 * 1000
|
|
||||||
})
|
|
||||||
return Promise.reject(error)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// 通用下载方法
|
// 通用下载方法
|
||||||
export function download(url, params, filename) {
|
export function download(url, params, filename) {
|
||||||
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
|
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
|
||||||
return service.post(url, params, {
|
return service.post(url, params, {
|
||||||
transformRequest: [(params) => { return tansParams(params) }],
|
transformRequest: [(params) => { return tansParams(params) }],
|
||||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
}).then(async (data) => {
|
}).then(async (data) => {
|
||||||
const isLogin = await blobValidate(data);
|
const isLogin = await blobValidate(data);
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
const blob = new Blob([data])
|
const blob = new Blob([data])
|
||||||
saveAs(blob, filename)
|
saveAs(blob, filename)
|
||||||
} else {
|
} else {
|
||||||
const resText = await data.text();
|
const resText = await data.text();
|
||||||
const rspObj = JSON.parse(resText);
|
const rspObj = JSON.parse(resText);
|
||||||
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||||
Message.error(errMsg);
|
Message.error(errMsg);
|
||||||
}
|
}
|
||||||
downloadLoadingInstance.close();
|
downloadLoadingInstance.close();
|
||||||
}).catch((r) => {
|
}).catch((r) => {
|
||||||
console.error(r)
|
console.error(r)
|
||||||
Message.error('下载文件出现错误,请联系管理员!')
|
Message.error('下载文件出现错误,请联系管理员!')
|
||||||
downloadLoadingInstance.close();
|
downloadLoadingInstance.close();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default service
|
export default service
|
||||||
@ -1,30 +1,497 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container home">
|
<div class="app-container home">
|
||||||
<el-row :gutter="20">
|
<div class="homes">
|
||||||
<el-col :sm="24" :lg="12" style="padding-left: 20px">
|
<div class="count" @click="goodsCount">
|
||||||
<h2>新医路新版小程序管理系统</h2>
|
<div class="el-icon-picture-outline icons"></div>
|
||||||
<p>
|
<div class="counts">{{ List.goodsCount }}</div>
|
||||||
</p>
|
<div class="total">商品总数量</div>
|
||||||
<p>
|
</div>
|
||||||
</p>
|
<div class="count member" @click="patientCount">
|
||||||
</el-col>
|
<div class="el-icon-user-solid icons"></div>
|
||||||
<el-col :sm="24" :lg="12" style="padding-left: 50px">
|
<div class="counts">{{ List.patientCount }}</div>
|
||||||
<el-row>
|
<div class="total">会员总数量</div>
|
||||||
</el-row>
|
</div>
|
||||||
</el-col>
|
<div class="count order" @click="appointmentOrderCount">
|
||||||
|
<div class="el-icon-shopping-cart-2 icons"></div>
|
||||||
|
<div class="counts">{{ List.appointmentOrderCount }}</div>
|
||||||
|
<div class="total">预约订单总数量</div>
|
||||||
|
</div>
|
||||||
|
<div class="count shop" @click="goodsOrderCount">
|
||||||
|
<div class="el-icon-s-data icons"></div>
|
||||||
|
<div class="counts">{{ List.goodsOrderCount }}</div>
|
||||||
|
<div class="total">商品订单总数量</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="today">
|
||||||
|
<!-- 今日概括 -->
|
||||||
|
<div class="todayitem">
|
||||||
|
<div class="el-icon-sell icon"></div>
|
||||||
|
<div class="goodsinfo">今日上架商品数量</div>
|
||||||
|
<div class="totals">{{ summaryTodayList.goodsCount }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="todayitem">
|
||||||
|
<div class="el-icon-user icon"></div>
|
||||||
|
<div class="goodsinfo">今日新增会员数</div>
|
||||||
|
<div class="totals">{{ summaryTodayList.patientCount }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="todayitem">
|
||||||
|
<div class="el-icon-shopping-cart-full icon"></div>
|
||||||
|
<div class="goodsinfo">今日订单数</div>
|
||||||
|
<div class="totals">{{ summaryTodayList.orderCount }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="todayitem">
|
||||||
|
<div class="el-icon-money icon"></div>
|
||||||
|
<div class="goodsinfo">今日交易额</div>
|
||||||
|
<div class="totals">{{ summaryTodayList.totalPrice }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="main2" id="main2" style="width: 1200px; height: 500px"></div>
|
||||||
|
<div class="main" id="main" style="width: 1200px; height: 500px"></div>
|
||||||
|
<el-row>
|
||||||
|
<div class="title">热卖商品TOP10</div>
|
||||||
|
<el-table :data="list" style="width: 96%; margin: 0 auto">
|
||||||
|
<el-table-column label="排名" type="index" width="130" align="center" />
|
||||||
|
<el-table-column label="商品名称" align="center" prop="goodsName" />
|
||||||
|
<el-table-column label="价格" align="center" prop="sumTotalPrice" />
|
||||||
|
<el-table-column
|
||||||
|
label="销量"
|
||||||
|
align="center"
|
||||||
|
width="130"
|
||||||
|
prop="sumGoodsCount"
|
||||||
|
/>
|
||||||
|
</el-table>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-divider />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { informationStatistics, summaryToday } from "@/api/system/index";
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
import {
|
||||||
|
getWeekGoodsTradeTrend,
|
||||||
|
getWeekTradeAppointmentTrend,
|
||||||
|
selectHotGoodsList,
|
||||||
|
} from "@/api/system/homepage.js";
|
||||||
export default {
|
export default {
|
||||||
name: "index",
|
name: "index",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
queryParams: {
|
||||||
|
goodsCount: null,
|
||||||
|
patientCount: null,
|
||||||
|
orderCount: null,
|
||||||
|
storeCount: null,
|
||||||
|
},
|
||||||
|
// 基本信息查询
|
||||||
|
List: [],
|
||||||
|
// 概述查询
|
||||||
|
summaryTodayList: [],
|
||||||
|
// 版本号
|
||||||
|
version: "0.0.1",
|
||||||
|
list: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.info();
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.tableinfo();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
tableinfo() {
|
||||||
|
selectHotGoodsList().then((res) => {
|
||||||
|
this.list = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
info() {
|
||||||
|
getWeekTradeAppointmentTrend().then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
var timedata = [];
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
timedata.push(e.clickDate);
|
||||||
|
});
|
||||||
|
var totalPricedata = [];
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
totalPricedata.push(e.totalPrice);
|
||||||
|
});
|
||||||
|
var numberdata = [];
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
numberdata.push(e.count);
|
||||||
|
});
|
||||||
|
var chartDom = document.getElementById("main2");
|
||||||
|
var myChart = echarts.init(chartDom);
|
||||||
|
var option;
|
||||||
|
option = {
|
||||||
|
title: {
|
||||||
|
text: "预约订单交易走势",
|
||||||
|
left: "50%",
|
||||||
|
textAlign: "center",
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#ddd",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
backgroundColor: "rgba(255,255,255,1)",
|
||||||
|
padding: [5, 10],
|
||||||
|
textStyle: {
|
||||||
|
color: "#7588E4",
|
||||||
|
},
|
||||||
|
extraCssText: "box-shadow: 0 0 5px rgba(0,0,0,0.3)",
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
right: 20,
|
||||||
|
orient: "vertical",
|
||||||
|
x: "left",
|
||||||
|
y: "top",
|
||||||
|
data: ["订单数量", "订单金额"],
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
data: timedata,
|
||||||
|
boundaryGap: false,
|
||||||
|
splitLine: {
|
||||||
|
show: true,
|
||||||
|
interval: "auto",
|
||||||
|
lineStyle: {
|
||||||
|
color: ["#ffffff"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#609ee9",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
margin: 10,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 14,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: "value",
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: ["#f0f0f0"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#609ee9",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
margin: 10,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 14,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "订单数量",
|
||||||
|
type: "line",
|
||||||
|
smooth: true,
|
||||||
|
showSymbol: false,
|
||||||
|
symbol: "circle",
|
||||||
|
symbolSize: 6,
|
||||||
|
data: numberdata,
|
||||||
|
areaStyle: {
|
||||||
|
normal: {
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "#d6e3fd",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "#d6e3fd",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
false
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#87B1F7",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lineStyle: {
|
||||||
|
normal: {
|
||||||
|
width: 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "订单金额",
|
||||||
|
type: "line",
|
||||||
|
smooth: true,
|
||||||
|
showSymbol: false,
|
||||||
|
symbol: "circle",
|
||||||
|
symbolSize: 6,
|
||||||
|
data: totalPricedata,
|
||||||
|
areaStyle: {
|
||||||
|
normal: {
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "#D6F5E9",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "#D6F5E9",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
false
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#57D1A0",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lineStyle: {
|
||||||
|
normal: {
|
||||||
|
width: 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
option && myChart.setOption(option);
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getWeekGoodsTradeTrend().then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
var timedata = [];
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
timedata.push(e.clickDate);
|
||||||
|
});
|
||||||
|
var numberdata = [];
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
numberdata.push(e.count);
|
||||||
|
});
|
||||||
|
var totalPricedata = [];
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
totalPricedata.push(e.totalPrice);
|
||||||
|
});
|
||||||
|
var moneydata = [];
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
numberdata.push(e.count);
|
||||||
|
});
|
||||||
|
var chartDom = document.getElementById("main");
|
||||||
|
var myChart = echarts.init(chartDom);
|
||||||
|
var option;
|
||||||
|
option = {
|
||||||
|
title: {
|
||||||
|
text: "商品订单交易走势",
|
||||||
|
left: "50%",
|
||||||
|
textAlign: "center",
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#ddd",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
backgroundColor: "rgba(255,255,255,1)",
|
||||||
|
padding: [5, 10],
|
||||||
|
textStyle: {
|
||||||
|
color: "#7588E4",
|
||||||
|
},
|
||||||
|
extraCssText: "box-shadow: 0 0 5px rgba(0,0,0,0.3)",
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
right: 20,
|
||||||
|
orient: "vertical",
|
||||||
|
x: "left",
|
||||||
|
y: "top",
|
||||||
|
data: ["订单数量", "订单金额"],
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
data: timedata,
|
||||||
|
boundaryGap: false,
|
||||||
|
splitLine: {
|
||||||
|
show: true,
|
||||||
|
interval: "auto",
|
||||||
|
lineStyle: {
|
||||||
|
color: ["#ffffff"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#609ee9",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
margin: 10,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 14,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: "value",
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: ["#D4DFF5"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#609ee9",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
margin: 10,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 14,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "订单数量",
|
||||||
|
type: "line",
|
||||||
|
smooth: true,
|
||||||
|
showSymbol: false,
|
||||||
|
symbol: "circle",
|
||||||
|
symbolSize: 6,
|
||||||
|
data: numberdata,
|
||||||
|
areaStyle: {
|
||||||
|
normal: {
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "#d6e3fd",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "#d6e3fd",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
false
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#87B1F7",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lineStyle: {
|
||||||
|
normal: {
|
||||||
|
width: 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "订单金额",
|
||||||
|
type: "line",
|
||||||
|
smooth: true,
|
||||||
|
showSymbol: false,
|
||||||
|
symbol: "circle",
|
||||||
|
symbolSize: 6,
|
||||||
|
data: totalPricedata,
|
||||||
|
areaStyle: {
|
||||||
|
normal: {
|
||||||
|
color: new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "#D6F5E9",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "#D6F5E9",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
false
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#57D1A0",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lineStyle: {
|
||||||
|
normal: {
|
||||||
|
width: 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
option && myChart.setOption(option);
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
goodsCount() {
|
||||||
|
this.$router.push("/Shopping/operateGoodsInfo");
|
||||||
|
},
|
||||||
|
patientCount() {
|
||||||
|
this.$router.push("/patient/patientArchives");
|
||||||
|
},
|
||||||
|
appointmentOrderCount() {
|
||||||
|
this.$router.push("/order/order");
|
||||||
|
},
|
||||||
|
goodsOrderCount() {
|
||||||
|
this.$router.push("/order/goodsOrder");
|
||||||
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
informationStatistics(this.queryParams).then((response) => {
|
||||||
|
this.List = response.data;
|
||||||
|
});
|
||||||
|
summaryToday(this.queryParams).then((response) => {
|
||||||
|
this.summaryTodayList = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
goTarget(href) {
|
goTarget(href) {
|
||||||
window.open(href, "_blank");
|
window.open(href, "_blank");
|
||||||
},
|
},
|
||||||
@ -33,66 +500,128 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.home {
|
.main2 {
|
||||||
blockquote {
|
margin: 0 auto;
|
||||||
padding: 10px 20px;
|
}
|
||||||
margin: 0 0 20px;
|
.main {
|
||||||
font-size: 17.5px;
|
margin: 0 auto;
|
||||||
border-left: 5px solid #eee;
|
}
|
||||||
}
|
.title {
|
||||||
hr {
|
margin: 20px 0 20px 2%;
|
||||||
margin-top: 20px;
|
font-size: 18px;
|
||||||
margin-bottom: 20px;
|
font-weight: 600;
|
||||||
border: 0;
|
}
|
||||||
border-top: 1px solid #eee;
|
.count {
|
||||||
}
|
color: white;
|
||||||
.col-item {
|
width: 30%;
|
||||||
margin-bottom: 20px;
|
background-image: linear-gradient(
|
||||||
}
|
109.6deg,
|
||||||
|
rgba(111, 167, 183, 0.6) 11.2%,
|
||||||
ul {
|
#b3e9d8 100.2%
|
||||||
padding: 0;
|
);
|
||||||
margin: 0;
|
transition: 0.35s;
|
||||||
}
|
-webkit-box-shadow: 1px 3px 12px rgb(255 113 113 / 30%);
|
||||||
|
height: 84px;
|
||||||
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
border-radius: 0.4em;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
.count:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-transform: translateY(-10px);
|
||||||
|
transform: translateY(-10px);
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
.member {
|
||||||
|
background-image: linear-gradient(
|
||||||
|
109.6deg,
|
||||||
|
rgba(161, 191, 239, 0.6) 11.2%,
|
||||||
|
#86c5e2 100.2%
|
||||||
|
);
|
||||||
|
-webkit-box-shadow: 1px 3px 12px rgb(255 170 113 / 30%);
|
||||||
|
box-shadow: 1px 3px 12px rgb(255 170 113 / 30%);
|
||||||
|
}
|
||||||
|
.order {
|
||||||
|
background-image: linear-gradient(
|
||||||
|
109.6deg,
|
||||||
|
rgba(161, 191, 214, 0.6) 11.2%,
|
||||||
|
#688eab 100.2%
|
||||||
|
);
|
||||||
|
-webkit-box-shadow: 1px 3px 12px rgb(147 181 225 / 30%);
|
||||||
|
box-shadow: 1px 3px 12px rgb(147 181 225 / 30%);
|
||||||
|
}
|
||||||
|
.shop {
|
||||||
|
background-image: linear-gradient(
|
||||||
|
109.6deg,
|
||||||
|
rgba(138, 203, 158, 0.6) 11.2%,
|
||||||
|
#81c195 100.2%
|
||||||
|
);
|
||||||
|
-webkit-box-shadow: 1px 3px 12px rgb(132 140 207 / 30%);
|
||||||
|
box-shadow: 1px 3px 12px rgb(132 140 207 / 30%);
|
||||||
|
}
|
||||||
|
.counts {
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-left: 35%;
|
||||||
|
line-height: 1;
|
||||||
|
font-size: 21px;
|
||||||
|
}
|
||||||
|
.total {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-left: 35%;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #676a6c;
|
}
|
||||||
overflow-x: hidden;
|
.icon {
|
||||||
|
margin-top: 10px;
|
||||||
ul {
|
margin-left: 16px;
|
||||||
list-style-type: none;
|
font-size: 31px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.icons {
|
||||||
|
margin-top: 30px;
|
||||||
|
margin-left: 35px;
|
||||||
|
position: absolute;
|
||||||
|
font-size: 31px;
|
||||||
|
}
|
||||||
|
.today {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: -10px;
|
||||||
|
}
|
||||||
|
.todayitem {
|
||||||
|
transition: 0.35s;
|
||||||
|
margin: 10px;
|
||||||
|
width: 30%;
|
||||||
|
height: 100px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border-radius: 0.4em;
|
||||||
|
font-weight: 700;
|
||||||
|
background: hsla(0, 0%, 92.2%, 0.5333333333333333);
|
||||||
|
padding: 20px;
|
||||||
|
.goodsinfo {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-left: 32%;
|
||||||
}
|
}
|
||||||
|
.totals {
|
||||||
h4 {
|
color: #ff5c58;
|
||||||
margin-top: 0px;
|
margin-left: 32%;
|
||||||
}
|
margin-top: 5px;
|
||||||
|
font-size: 21px;
|
||||||
h2 {
|
|
||||||
margin-top: 10px;
|
|
||||||
font-size: 26px;
|
|
||||||
font-weight: 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin-top: 10px;
|
|
||||||
|
|
||||||
b {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.update-log {
|
|
||||||
ol {
|
|
||||||
display: block;
|
|
||||||
list-style-type: decimal;
|
|
||||||
margin-block-start: 1em;
|
|
||||||
margin-block-end: 1em;
|
|
||||||
margin-inline-start: 0;
|
|
||||||
margin-inline-end: 0;
|
|
||||||
padding-inline-start: 40px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.todayitem:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-transform: translateY(-10px);
|
||||||
|
transform: translateY(-10px);
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
.home {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
.homes {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
<el-form
|
||||||
<h3 class="title">若依后台管理系统</h3>
|
ref="loginForm"
|
||||||
|
:model="loginForm"
|
||||||
|
:rules="loginRules"
|
||||||
|
class="login-form"
|
||||||
|
>
|
||||||
|
<h3 class="title">泉医到家运营管理平台</h3>
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="loginForm.username"
|
v-model="loginForm.username"
|
||||||
type="text"
|
type="text"
|
||||||
auto-complete="off"
|
auto-complete="off"
|
||||||
placeholder="账号"
|
placeholder="账号"
|
||||||
|
style="width: 310px"
|
||||||
>
|
>
|
||||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
<svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="user"
|
||||||
|
class="el-input__icon input-icon"
|
||||||
|
/>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
@ -19,8 +29,13 @@
|
|||||||
auto-complete="off"
|
auto-complete="off"
|
||||||
placeholder="密码"
|
placeholder="密码"
|
||||||
@keyup.enter.native="handleLogin"
|
@keyup.enter.native="handleLogin"
|
||||||
|
style="width: 310px"
|
||||||
>
|
>
|
||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
<svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="password"
|
||||||
|
class="el-input__icon input-icon"
|
||||||
|
/>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code" v-if="captchaOnOff">
|
<el-form-item prop="code" v-if="captchaOnOff">
|
||||||
@ -28,35 +43,59 @@
|
|||||||
v-model="loginForm.code"
|
v-model="loginForm.code"
|
||||||
auto-complete="off"
|
auto-complete="off"
|
||||||
placeholder="验证码"
|
placeholder="验证码"
|
||||||
style="width: 63%"
|
style="width: 200px"
|
||||||
@keyup.enter.native="handleLogin"
|
@keyup.enter.native="handleLogin"
|
||||||
>
|
>
|
||||||
<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" @click="getCode" class="login-code-img" />
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
|
<el-checkbox
|
||||||
<el-form-item style="width:100%;">
|
v-model="loginForm.rememberMe"
|
||||||
|
style="margin: 0px 0px 25px 0px"
|
||||||
|
>记住密码</el-checkbox
|
||||||
|
>
|
||||||
|
<el-form-item style="width: 100%">
|
||||||
<el-button
|
<el-button
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
size="medium"
|
size="medium"
|
||||||
type="primary"
|
style="
|
||||||
style="width:100%;"
|
width: 300px;
|
||||||
|
height: 50px;
|
||||||
|
background-image: linear-gradient(to right, #01a4ff, #1259ee);
|
||||||
|
border-radius: -33px;
|
||||||
|
border: none;
|
||||||
|
color: #ffffff;
|
||||||
|
border-radius: 20px;
|
||||||
|
"
|
||||||
@click.native.prevent="handleLogin"
|
@click.native.prevent="handleLogin"
|
||||||
>
|
>
|
||||||
<span v-if="!loading">登 录</span>
|
<span v-if="!loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
<div style="float: right;" v-if="register">
|
<div style="float: right" v-if="register">
|
||||||
<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>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<div class="bg" style="border-radius: 0 6px 6px 0; padding: 0">
|
||||||
|
<img
|
||||||
|
src="../assets/images/bg3.png"
|
||||||
|
alt=""
|
||||||
|
style="width: 1400px; height: 700px; border-radius: 0 6px 6px 0"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
<div class="el-login-footer">
|
<div class="el-login-footer">
|
||||||
<span>Copyright © 2018-2022 xinelu.vip All Rights Reserved.</span>
|
<!-- <span>Copyright © 2018-2022 xinyilu.vip All Rights Reserved.</span> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -64,7 +103,7 @@
|
|||||||
<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",
|
||||||
@ -76,32 +115,32 @@ export default {
|
|||||||
password: "",
|
password: "",
|
||||||
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,
|
||||||
// 验证码开关
|
// 验证码开关
|
||||||
captchaOnOff: true,
|
captchaOnOff: true,
|
||||||
// 注册开关
|
// 注册开关
|
||||||
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();
|
||||||
@ -109,8 +148,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCode() {
|
getCode() {
|
||||||
getCodeImg().then(res => {
|
getCodeImg().then((res) => {
|
||||||
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
this.captchaOnOff =
|
||||||
|
res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
||||||
if (this.captchaOnOff) {
|
if (this.captchaOnOff) {
|
||||||
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;
|
||||||
@ -120,61 +160,93 @@ export default {
|
|||||||
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:
|
||||||
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
|
password === undefined ? this.loginForm.password : decrypt(password),
|
||||||
|
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), {
|
||||||
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
|
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
|
||||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
.dispatch("Login", this.loginForm)
|
||||||
}).catch(() => {
|
.then(() => {
|
||||||
this.loading = false;
|
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
|
||||||
if (this.captchaOnOff) {
|
setTimeout(() => {
|
||||||
this.getCode();
|
this.loading = false;
|
||||||
}
|
}, 1500);
|
||||||
});
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
if (this.captchaOnOff) {
|
||||||
|
this.getCode();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss">
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
.bg {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
// .el-input el-input--medium el-input--prefix{
|
||||||
|
// height: 50px;
|
||||||
|
// line-height: 36px;
|
||||||
|
// background-color: red;
|
||||||
|
// border: none;
|
||||||
|
// border-radius: 10px;
|
||||||
|
// }
|
||||||
|
.el-input--medium ::v-deep .el-input__inner {
|
||||||
|
height: 50px;
|
||||||
|
line-height: 36px;
|
||||||
|
// background-color: red;
|
||||||
|
border: none;
|
||||||
|
border: 1px solid #e5e5e5;
|
||||||
|
border-radius: 36px;
|
||||||
|
}
|
||||||
.login {
|
.login {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-image: url("../assets/images/login-background.jpg");
|
background-image: url("../assets/images/bg2.png");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
margin: 0px auto 30px auto;
|
margin: 0px 40px 30px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #707070;
|
color: #707070;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-form {
|
.login-form {
|
||||||
|
margin-left: 20%;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
padding: 25px 25px 5px 25px;
|
padding: 25px 25px 5px 25px;
|
||||||
|
z-index: 999;
|
||||||
|
margin-right: 50%;
|
||||||
.el-input {
|
.el-input {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
input {
|
input {
|
||||||
@ -184,7 +256,8 @@ export default {
|
|||||||
.input-icon {
|
.input-icon {
|
||||||
height: 39px;
|
height: 39px;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
margin-left: 2px;
|
margin-left: 5px;
|
||||||
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.login-tip {
|
.login-tip {
|
||||||
@ -196,6 +269,7 @@ export default {
|
|||||||
width: 33%;
|
width: 33%;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
float: right;
|
float: right;
|
||||||
|
margin-right: 30px;
|
||||||
img {
|
img {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
@ -215,5 +289,20 @@ export default {
|
|||||||
}
|
}
|
||||||
.login-code-img {
|
.login-code-img {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
// .el-button{
|
||||||
|
// background-image: linear-gradient(to right , #90C8DF, #4CA8CD);
|
||||||
|
// border-radius: -33px;
|
||||||
|
// border: none;
|
||||||
|
// height: 50px;
|
||||||
|
// color: #FFFFFF;
|
||||||
|
// border-radius: 20px;
|
||||||
|
|
||||||
|
// }
|
||||||
|
// .el-button--primary {
|
||||||
|
// color: #FFFFFF;
|
||||||
|
// // background-color: #1890ff;
|
||||||
|
// // border-color: #1890ff;
|
||||||
|
// }
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="register">
|
<div class="register">
|
||||||
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
|
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
|
||||||
<h3 class="title">若依后台管理系统</h3>
|
<h3 class="title">泉医到家护理站管理平台</h3>
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
|
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||||
@ -61,7 +61,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
<div class="el-register-footer">
|
<div class="el-register-footer">
|
||||||
<span>Copyright © 2018-2022 xinelu.vip All Rights Reserved.</span>
|
<span>Copyright © 2018-2022 xinyilu.vip All Rights Reserved.</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -151,7 +151,7 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-image: url("../assets/images/login-background.jpg");
|
background-image: url("../assets/images/bg.png");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
|
|||||||
@ -302,15 +302,19 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.configId != undefined) {
|
if (this.form.configId != undefined) {
|
||||||
updateConfig(this.form).then(response => {
|
updateConfig(this.form).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addConfig(this.form).then(response => {
|
addConfig(this.form).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -308,15 +308,19 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.deptId != undefined) {
|
if (this.form.deptId != undefined) {
|
||||||
updateDept(this.form).then(response => {
|
updateDept(this.form).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addDept(this.form).then(response => {
|
addDept(this.form).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -425,15 +425,19 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.menuId != undefined) {
|
if (this.form.menuId != undefined) {
|
||||||
updateMenu(this.form).then(response => {
|
updateMenu(this.form).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addMenu(this.form).then(response => {
|
addMenu(this.form).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -283,15 +283,19 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.noticeId != undefined) {
|
if (this.form.noticeId != undefined) {
|
||||||
updateNotice(this.form).then(response => {
|
updateNotice(this.form).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addNotice(this.form).then(response => {
|
addNotice(this.form).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!--部门数据-->
|
<!--部门数据-->
|
||||||
<el-col :span="4" :xs="24">
|
<!-- <el-col :span="4" :xs="24">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="deptName"
|
v-model="deptName"
|
||||||
@ -25,10 +25,17 @@
|
|||||||
@node-click="handleNodeClick"
|
@node-click="handleNodeClick"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
<!--用户数据-->
|
<!--用户数据-->
|
||||||
<el-col :span="20" :xs="24">
|
<el-col :span="24" :xs="24">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="用户名称" prop="userName">
|
<el-form-item label="用户名称" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.userName"
|
v-model="queryParams.userName"
|
||||||
@ -112,7 +119,7 @@
|
|||||||
v-hasPermi="['system:user:remove']"
|
v-hasPermi="['system:user:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="info"
|
type="info"
|
||||||
plain
|
plain
|
||||||
@ -131,17 +138,44 @@
|
|||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['system:user:export']"
|
v-hasPermi="['system:user:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
<el-table-column
|
||||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
label="用户编号"
|
||||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
align="center"
|
||||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
key="userId"
|
||||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
prop="userId"
|
||||||
|
v-if="columns[0].visible"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="用户名称"
|
||||||
|
align="center"
|
||||||
|
key="userName"
|
||||||
|
prop="userName"
|
||||||
|
v-if="columns[1].visible"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="用户昵称"
|
||||||
|
align="center"
|
||||||
|
key="nickName"
|
||||||
|
prop="nickName"
|
||||||
|
v-if="columns[2].visible"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<!-- <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> -->
|
||||||
|
<el-table-column
|
||||||
|
label="手机号码"
|
||||||
|
align="center"
|
||||||
|
key="phonenumber"
|
||||||
|
prop="phonenumber"
|
||||||
|
v-if="columns[4].visible"
|
||||||
|
width="120"
|
||||||
|
/>
|
||||||
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
@ -152,7 +186,13 @@
|
|||||||
></el-switch>
|
></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
v-if="columns[6].visible"
|
||||||
|
width="160"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
@ -178,15 +218,25 @@
|
|||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['system:user:remove']"
|
v-hasPermi="['system:user:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
|
<el-dropdown
|
||||||
|
size="mini"
|
||||||
|
@command="(command) => handleCommand(command, scope.row)"
|
||||||
|
v-hasPermi="['system:user:resetPwd', 'system:user:edit']"
|
||||||
|
>
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
<i class="el-icon-d-arrow-right el-icon--right"></i>更多
|
<i class="el-icon-d-arrow-right el-icon--right"></i>更多
|
||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
|
<el-dropdown-item
|
||||||
v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
|
command="handleResetPwd"
|
||||||
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check"
|
icon="el-icon-key"
|
||||||
v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>
|
v-hasPermi="['system:user:resetPwd']"
|
||||||
|
>重置密码</el-dropdown-item>
|
||||||
|
<el-dropdown-item
|
||||||
|
command="handleAuthRole"
|
||||||
|
icon="el-icon-circle-check"
|
||||||
|
v-hasPermi="['system:user:edit']"
|
||||||
|
>分配角色</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
@ -194,7 +244,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@ -202,7 +252,6 @@
|
|||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 添加或修改用户配置对话框 -->
|
<!-- 添加或修改用户配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
@ -213,10 +262,22 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
<el-form-item label="用户性别">
|
||||||
|
<el-select v-model="form.sex" placeholder="请选择性别">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.sys_user_sex"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="12">
|
||||||
<el-form-item label="归属部门" prop="deptId">
|
<el-form-item label="归属部门" prop="deptId">
|
||||||
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -238,19 +299,25 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
|
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
|
||||||
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
|
<el-input
|
||||||
|
v-model="form.password"
|
||||||
|
placeholder="请输入用户密码"
|
||||||
|
type="password"
|
||||||
|
maxlength="20"
|
||||||
|
show-password
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户性别">
|
<el-form-item label="护理站" prop="nurseStationIds">
|
||||||
<el-select v-model="form.sex" placeholder="请选择性别">
|
<el-select v-model="form.nurseStationIdstwo" placeholder="请选择护理站" multiple>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.sys_user_sex"
|
v-for="item in nurseStationlist"
|
||||||
:key="dict.value"
|
:key="item.id"
|
||||||
:label="dict.label"
|
:label="item.nurseStationName"
|
||||||
:value="dict.value"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -262,13 +329,13 @@
|
|||||||
v-for="dict in dict.type.sys_normal_disable"
|
v-for="dict in dict.type.sys_normal_disable"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
<el-form-item label="岗位">
|
<el-form-item label="岗位">
|
||||||
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
|
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
|
||||||
<el-option
|
<el-option
|
||||||
@ -280,7 +347,7 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="角色">
|
<el-form-item label="角色">
|
||||||
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
|
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
|
||||||
@ -308,7 +375,6 @@
|
|||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 用户导入对话框 -->
|
<!-- 用户导入对话框 -->
|
||||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||||
<el-upload
|
<el-upload
|
||||||
@ -324,13 +390,21 @@
|
|||||||
drag
|
drag
|
||||||
>
|
>
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">
|
||||||
|
将文件拖到此处,或
|
||||||
|
<em>点击上传</em>
|
||||||
|
</div>
|
||||||
<div class="el-upload__tip text-center" slot="tip">
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
<div class="el-upload__tip" slot="tip">
|
<div class="el-upload__tip" slot="tip">
|
||||||
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
|
||||||
</div>
|
</div>
|
||||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
:underline="false"
|
||||||
|
style="font-size: 12px; vertical-align: baseline"
|
||||||
|
@click="importTemplate"
|
||||||
|
>下载模板</el-link>
|
||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -340,17 +414,24 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
import {
|
||||||
|
listUser,
|
||||||
|
getUser,
|
||||||
|
delUser,
|
||||||
|
addUser,
|
||||||
|
updateUser,
|
||||||
|
resetUserPwd,
|
||||||
|
changeUserStatus
|
||||||
|
} from "@/api/system/user";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import { treeselect } from "@/api/system/dept";
|
import { treeselect } from "@/api/system/dept";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import { list } from "@/api/system/stationConsumable";
|
||||||
export default {
|
export default {
|
||||||
name: "User",
|
name: "User",
|
||||||
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
dicts: ["sys_normal_disable", "sys_user_sex"],
|
||||||
components: { Treeselect },
|
components: { Treeselect },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -366,6 +447,8 @@ export default {
|
|||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
|
total2: 0,
|
||||||
|
nurseStationlist: [],
|
||||||
// 用户表格数据
|
// 用户表格数据
|
||||||
userList: null,
|
userList: null,
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
@ -414,6 +497,26 @@ export default {
|
|||||||
status: undefined,
|
status: undefined,
|
||||||
deptId: undefined
|
deptId: undefined
|
||||||
},
|
},
|
||||||
|
// 查询参数
|
||||||
|
nurseStationqueryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 999,
|
||||||
|
areaCode: null,
|
||||||
|
userId: null,
|
||||||
|
nurseStationCode: null,
|
||||||
|
nurseStationName: null,
|
||||||
|
nurseStationType: null,
|
||||||
|
agencyIntroduce: null,
|
||||||
|
nurseStationDescription: null,
|
||||||
|
longitude: null,
|
||||||
|
latitude: null,
|
||||||
|
phone: null,
|
||||||
|
address: null,
|
||||||
|
dutyPerson: null,
|
||||||
|
dutyPhone: null,
|
||||||
|
stationPictureUrl: null,
|
||||||
|
sort: null
|
||||||
|
},
|
||||||
// 列信息
|
// 列信息
|
||||||
columns: [
|
columns: [
|
||||||
{ key: 0, label: `用户编号`, visible: true },
|
{ key: 0, label: `用户编号`, visible: true },
|
||||||
@ -428,14 +531,27 @@ export default {
|
|||||||
rules: {
|
rules: {
|
||||||
userName: [
|
userName: [
|
||||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
||||||
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
{
|
||||||
|
min: 2,
|
||||||
|
max: 20,
|
||||||
|
message: "用户名称长度必须介于 2 和 20 之间",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
|
// nurseStationIds: [
|
||||||
|
// { required: true, message: "护理站不能为空", trigger: "blur" },
|
||||||
|
// ],
|
||||||
nickName: [
|
nickName: [
|
||||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
||||||
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
|
{
|
||||||
|
min: 5,
|
||||||
|
max: 20,
|
||||||
|
message: "用户密码长度必须介于 5 和 20 之间",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
email: [
|
email: [
|
||||||
{
|
{
|
||||||
@ -463,15 +579,23 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
|
this.listinfo();
|
||||||
this.getConfigKey("sys.user.initPassword").then(response => {
|
this.getConfigKey("sys.user.initPassword").then(response => {
|
||||||
this.initPassword = response.msg;
|
this.initPassword = response.msg;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
listinfo() {
|
||||||
|
list(this.nurseStationqueryParams).then(res => {
|
||||||
|
this.nurseStationlist = res.rows;
|
||||||
|
this.total2 = res.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 查询用户列表 */
|
/** 查询用户列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
|
||||||
|
response => {
|
||||||
this.userList = response.rows;
|
this.userList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -497,13 +621,17 @@ export default {
|
|||||||
// 用户状态修改
|
// 用户状态修改
|
||||||
handleStatusChange(row) {
|
handleStatusChange(row) {
|
||||||
let text = row.status === "0" ? "启用" : "停用";
|
let text = row.status === "0" ? "启用" : "停用";
|
||||||
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
|
this.$modal
|
||||||
return changeUserStatus(row.userId, row.status);
|
.confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
|
||||||
}).then(() => {
|
.then(function() {
|
||||||
this.$modal.msgSuccess(text + "成功");
|
return changeUserStatus(row.userId, row.status);
|
||||||
}).catch(function() {
|
})
|
||||||
row.status = row.status === "0" ? "1" : "0";
|
.then(() => {
|
||||||
});
|
this.$modal.msgSuccess(text + "成功");
|
||||||
|
})
|
||||||
|
.catch(function() {
|
||||||
|
row.status = row.status === "0" ? "1" : "0";
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -524,7 +652,9 @@ export default {
|
|||||||
status: "0",
|
status: "0",
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
postIds: [],
|
postIds: [],
|
||||||
roleIds: []
|
roleIds: [],
|
||||||
|
nurseStationIdstwo: null,
|
||||||
|
nurseStationIds: null
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@ -576,7 +706,28 @@ export default {
|
|||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
const userId = row.userId || this.ids;
|
const userId = row.userId || this.ids;
|
||||||
getUser(userId).then(response => {
|
getUser(userId).then(response => {
|
||||||
|
response.data.nurseStationIdstwo = JSON.parse(
|
||||||
|
JSON.stringify(response.data.nurseStationIds)
|
||||||
|
);
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
if (this.form.nurseStationIds) {
|
||||||
|
this.form.nurseStationIdstwo = this.form.nurseStationIdstwo.split(
|
||||||
|
","
|
||||||
|
);
|
||||||
|
this.form.nurseStationIdstwo = this.form.nurseStationIdstwo.map(e => {
|
||||||
|
return (e = Number(e));
|
||||||
|
});
|
||||||
|
// this.form.nurseStationIds = [];
|
||||||
|
} else {
|
||||||
|
// this.form.nurseStationIds = Number(this.form.nurseStationIds);
|
||||||
|
}
|
||||||
|
// if (
|
||||||
|
// !this.form.nurseStationIds ||
|
||||||
|
// this.form.nurseStationIds == null ||
|
||||||
|
// this.form.nurseStationIds.length == 0
|
||||||
|
// ) {getList
|
||||||
|
// } else {
|
||||||
|
// }
|
||||||
this.postOptions = response.posts;
|
this.postOptions = response.posts;
|
||||||
this.roleOptions = response.roles;
|
this.roleOptions = response.roles;
|
||||||
this.form.postIds = response.postIds;
|
this.form.postIds = response.postIds;
|
||||||
@ -594,11 +745,13 @@ export default {
|
|||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
inputPattern: /^.{5,20}$/,
|
inputPattern: /^.{5,20}$/,
|
||||||
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间"
|
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间"
|
||||||
}).then(({ value }) => {
|
})
|
||||||
|
.then(({ value }) => {
|
||||||
resetUserPwd(row.userId, value).then(response => {
|
resetUserPwd(row.userId, value).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||||
});
|
});
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 分配角色操作 */
|
/** 分配角色操作 */
|
||||||
handleAuthRole: function(row) {
|
handleAuthRole: function(row) {
|
||||||
@ -609,13 +762,31 @@ export default {
|
|||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
// this.form.nurseStationIds = JSON.stringify(this.form.nurseStationIds);
|
||||||
|
// var obj = [];
|
||||||
|
// obj.push(this.form.nurseStationIds);
|
||||||
|
// this.form.nurseStationIds = obj;
|
||||||
if (this.form.userId != undefined) {
|
if (this.form.userId != undefined) {
|
||||||
|
if (!this.form.nurseStationIdstwo) {
|
||||||
|
this.form.nurseStationIds = null;
|
||||||
|
} else {
|
||||||
|
this.form.nurseStationIds = this.form.nurseStationIdstwo.join(
|
||||||
|
","
|
||||||
|
);
|
||||||
|
}
|
||||||
updateUser(this.form).then(response => {
|
updateUser(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
if (this.form.nurseStationIdstwo) {
|
||||||
|
this.form.nurseStationIds = this.form.nurseStationIdstwo.join(
|
||||||
|
","
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.form.nurseStationIds = null;
|
||||||
|
}
|
||||||
addUser(this.form).then(response => {
|
addUser(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -628,18 +799,26 @@ export default {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const userIds = row.userId || this.ids;
|
const userIds = row.userId || this.ids;
|
||||||
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
|
this.$modal
|
||||||
return delUser(userIds);
|
.confirm("是否确认删除此用户?")
|
||||||
}).then(() => {
|
.then(function() {
|
||||||
this.getList();
|
return delUser(userIds);
|
||||||
this.$modal.msgSuccess("删除成功");
|
})
|
||||||
}).catch(() => {});
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('system/user/export', {
|
this.download(
|
||||||
...this.queryParams
|
"system/user/export",
|
||||||
}, `user_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...this.queryParams
|
||||||
|
},
|
||||||
|
`user_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
},
|
},
|
||||||
/** 导入按钮操作 */
|
/** 导入按钮操作 */
|
||||||
handleImport() {
|
handleImport() {
|
||||||
@ -648,8 +827,11 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 下载模板操作 */
|
/** 下载模板操作 */
|
||||||
importTemplate() {
|
importTemplate() {
|
||||||
this.download('system/user/importTemplate', {
|
this.download(
|
||||||
}, `user_template_${new Date().getTime()}.xlsx`)
|
"system/user/importTemplate",
|
||||||
|
{},
|
||||||
|
`user_template_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
},
|
},
|
||||||
// 文件上传中处理
|
// 文件上传中处理
|
||||||
handleFileUploadProgress(event, file, fileList) {
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
@ -660,7 +842,13 @@ export default {
|
|||||||
this.upload.open = false;
|
this.upload.open = false;
|
||||||
this.upload.isUploading = false;
|
this.upload.isUploading = false;
|
||||||
this.$refs.upload.clearFiles();
|
this.$refs.upload.clearFiles();
|
||||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
this.$alert(
|
||||||
|
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||||
|
response.msg +
|
||||||
|
"</div>",
|
||||||
|
"导入结果",
|
||||||
|
{ dangerouslyUseHTMLString: true }
|
||||||
|
);
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
// 提交上传文件
|
// 提交上传文件
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<el-form-item prop="packageName">
|
<el-form-item prop="packageName">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
生成包路径
|
生成包路径
|
||||||
<el-tooltip content="生成在哪个java包下,例如 com.xinelu.system" placement="top">
|
<el-tooltip content="生成在哪个java包下,例如 com.xinyilu.system" placement="top">
|
||||||
<i class="el-icon-question"></i>
|
<i class="el-icon-question"></i>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -267,7 +267,7 @@ export default {
|
|||||||
this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath);
|
this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "xinelu");
|
this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "xinyilu");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 同步数据库操作 */
|
/** 同步数据库操作 */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user