Commit b8ea022c authored by shangtx's avatar shangtx

feat: 用户管理

parent 00348101
import {axios} from '@/util/axios/request' import { axios } from '@/util/axios/request'
const api = { const api = {
getPage: '/sys/role/page', getPage: '/sys/role/page',
...@@ -46,3 +46,11 @@ export function changeStatus(id) { ...@@ -46,3 +46,11 @@ export function changeStatus(id) {
useFullLoading: true useFullLoading: true
}) })
} }
export function getAll() {
return axios({
url: '/sys/role/all-available',
method: 'get'
})
}
\ No newline at end of file
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
props: { props: {
title: { title: {
type: String, type: String,
default: '服务预约管理', default: '城市匠人管理',
required: false required: false
}, },
showTitle: { showTitle: {
......
...@@ -74,7 +74,13 @@ export default { ...@@ -74,7 +74,13 @@ export default {
columns, columns,
useYScroll: true, useYScroll: true,
title: '首页通知管理', title: '首页通知管理',
codes: [['BIZ0003'], []] codes: [['BIZ0003'], []],
toolbar: [
{
text: '新建',
handler: 'add'
}
]
} }
}, },
methods: { methods: {
...@@ -123,6 +129,9 @@ export default { ...@@ -123,6 +129,9 @@ export default {
}, },
detail(id) { detail(id) {
this.$refs.NoticeDetail.show(id) this.$refs.NoticeDetail.show(id)
},
add() {
this.$refs.NoticeDetail.show(null)
} }
} }
} }
......
<template>
<keep-alive v-if="keepAlive">
<router-view/>
</keep-alive>
<router-view v-else/>
</template>
<script>
export default {
name: "SysRoleRouteView",
computed: {
keepAlive() {
return this.$route.meta.keepAlive
}
},
}
</script>
\ No newline at end of file
...@@ -3,106 +3,82 @@ ...@@ -3,106 +3,82 @@
<a-form @submit="handleSubmit" :form="form" class="cust-detail-form"> <a-form @submit="handleSubmit" :form="form" class="cust-detail-form">
<header-tool-bar> <header-tool-bar>
<span class="cust-title" slot="title"> <span class="cust-title" slot="title">
<a-icon type="hdd"/>系统用户详情 <a-icon type="hdd" />系统用户详情
</span> </span>
<a-button-group slot="extra"> <a-button-group slot="extra">
<a-button type='primary' htmlType='submit'>保存</a-button> <a-button type="primary" htmlType="submit">保存</a-button>
<a-button type="primary" @click="back" ghost>返回</a-button> <a-button type="primary" @click="back" ghost>返回</a-button>
</a-button-group> </a-button-group>
</header-tool-bar> </header-tool-bar>
<a-card title="用户基础数据" class="cust-normal-card"> <a-card title="用户基础数据" class="cust-normal-card">
<a-row :gutter="gutter"> <a-row :gutter="gutter">
<a-col :span="span"> <a-col :span="span">
<a-form-item <a-form-item v-bind="formItemLayout" label="用户名">
v-bind="formItemLayout"
label='用户名' >
<a-input <a-input
v-decorator="['username', {initialValue: userDate.username, rules: [{ required: true, message: '请输入用户名!' }]}]" v-decorator="[
'userName',
{
initialValue: userDate.userName,
rules: [{ required: true, message: '请输入用户名!' }]
}
]"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="span"> <a-col :span="span">
<a-form-item <a-form-item v-bind="formItemLayout" label="真实姓名">
v-bind="formItemLayout"
label='真实姓名' >
<a-input <a-input
v-decorator="['realName', {initialValue: userDate.realName, rules: [{ required: true, message: '请输入真实姓名!' }]}]" v-decorator="[
'realName',
{
initialValue: userDate.realName,
rules: [{ required: true, message: '请输入真实姓名!' }]
}
]"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="span"> <a-col :span="span">
<a-form-item <a-form-item v-bind="formItemLayout" label="联系电话">
v-bind="formItemLayout"
label='联系电话' >
<a-input <a-input
oninput = "value=value.replace(/[^\d]/g,'')" oninput="value=value.replace(/[^\d]/g,'')"
v-decorator="['mobile', {initialValue: userDate.mobile, rules: [{ required: true, message: '请输入电话!' }]}]" v-decorator="[
'phone',
{
initialValue: userDate.phone,
rules: [{ required: true, message: '请输入电话!' }]
}
]"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="span"> <a-col :span="span">
<a-form-item <a-form-item v-bind="formItemLayout" label="邮箱">
v-bind="formItemLayout"
label='邮箱' >
<a-input <a-input
v-decorator="['email', {initialValue: userDate.email, rules: [{ required: false, message: '请输入电话!' }]}]" v-decorator="[
'email',
{
initialValue: userDate.email,
rules: [{ required: false, message: '请输入电话!' }]
}
]"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :span="6">
<a-form-item
v-bind="formItemLayout"
label='所属分局: '>
<a-select
style='width: 100%'
v-decorator="['communityId', {initialValue: userDate.communityId, rules: [{ required: true, message: '选择分局' }]}]"
>
<a-select-option v-for="item in officeList" :key="item.id" :value="item.id">{{item.name}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item
v-bind="formItemLayout"
label='所属科室: '>
<a-select
style='width: 100%'
v-decorator="['org', {initialValue: userDate.org, rules: [{ required: true, message: '选择科室' }]}]"
>
<a-select-option v-for="item in orgList" :key="item.id" :value="item.valueInt">{{item.name}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item
v-bind="formItemLayout"
label='数据权限: '>
<a-select
style='width: 100%'
v-decorator="['dataAccessType', {initialValue: userDate.dataAccessType, rules: [{ required: true, message: '选择权限' }]}]"
>
<a-select-option v-for="item in authorityTypeList" :key="item.id" :value="item.valueInt">{{item.name}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :utter="gutter"> <a-row :utter="gutter">
<a-col :span="6"> <a-col :span="6">
<a-form-item <a-form-item v-bind="formItemLayout" label="头像">
v-bind="formItemLayout"
label='头像' >
<a-upload <a-upload
:rows="3" :rows="3"
v-decorator="['avatar', { v-decorator="[
'avatar',
{
valuePropName: 'imageList', valuePropName: 'imageList',
getValueFromEvent: normFile, getValueFromEvent: normFile,
rules: [{ required: false, message: '请上传用户头像' }] rules: [{ required: false, message: '请上传用户头像' }]
}]" }
]"
style="width: 100%" style="width: 100%"
:defaultFileList="imageList" :defaultFileList="imageList"
:fileList="imageList" :fileList="imageList"
...@@ -113,21 +89,35 @@ ...@@ -113,21 +89,35 @@
@preview="handlePreview" @preview="handlePreview"
> >
<div v-if="imageList.length < 1"> <div v-if="imageList.length < 1">
<a-icon type="plus"/> <a-icon type="plus" />
<div class="ant-upload-text">上传图片</div> <div class="ant-upload-text">上传图片</div>
</div> </div>
</a-upload> </a-upload>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel"> <a-modal
<img alt="example" style="width: 100%" :src="previewImage"/> :visible="previewVisible"
:footer="null"
@cancel="handleCancel"
>
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal> </a-modal>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item <a-form-item
:labelCol="{span: 4}" :labelCol="{ span: 4 }"
:wrapperCol="{span: 20}" :wrapperCol="{ span: 20 }"
label='备注' > label="备注"
<a-textarea :rows="3" v-decorator="['remark', {initialValue: userDate.remark, rules: [{ required: false, message: '' }]}]"/> >
<a-textarea
:rows="3"
v-decorator="[
'remark',
{
initialValue: userDate.remark,
rules: [{ required: false, message: '' }]
}
]"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -140,7 +130,10 @@ ...@@ -140,7 +130,10 @@
size="middle" size="middle"
:pagination="false" :pagination="false"
class="cust-card-table" class="cust-card-table"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: updateSelect}" :rowSelection="{
selectedRowKeys: selectedRowKeys,
onChange: updateSelect
}"
bordered bordered
> >
</a-table> </a-table>
...@@ -150,27 +143,27 @@ ...@@ -150,27 +143,27 @@
</template> </template>
<script> <script>
import HeaderToolBar from '@/components/page/HeaderToolBar' import HeaderToolBar from '@/components/page/HeaderToolBar'
import {getDetail, save,} from '@/api/system/sysUserApi' import { getDetail, save } from '@/api/system/sysUserApi'
import {getCommonCode} from "@/api/system/sysCode"; import {
import {
getOneImageURL, getOneImageURL,
getUploadImageHeader, getUploadImageHeader,
getUploadImageUrl, getUploadImageUrl,
isLoading, isLoading,
isUpdateSuccess isUpdateSuccess
} from "@/api/common/fileUpload"; } from '@/api/common/fileUpload'
import { getAll } from '@/api/system/sysRole'
let listPathName = 'sysuserlist'; let listPathName = 'sysUserList'
const columns = [ const columns = [
{title: '角色名称', dataIndex: 'name', width: 250}, { title: '角色名称', dataIndex: 'name', width: 250 },
{title: '角色Code', dataIndex: 'code',}, { title: '角色Code', dataIndex: 'code' },
{title: '备注', dataIndex: 'remark',}, { title: '备注', dataIndex: 'remark' }
] ]
export default { export default {
name: "SysUserDetail", name: 'SysUserDetail',
components: {HeaderToolBar}, components: { HeaderToolBar },
data() { data() {
return { return {
id: 0, id: 0,
...@@ -181,9 +174,9 @@ ...@@ -181,9 +174,9 @@
columns: columns, columns: columns,
currentEditDate: {}, currentEditDate: {},
selectedRowKeys: [], selectedRowKeys: [],
officeList:[], officeList: [],
visible: false, visible: false,
imageList:[], imageList: [],
orgList: [], orgList: [],
authorityTypeList: [], authorityTypeList: [],
loading: false, loading: false,
...@@ -193,24 +186,24 @@ ...@@ -193,24 +186,24 @@
uploadImageHeader: getUploadImageHeader(), uploadImageHeader: getUploadImageHeader(),
formItemLayout: { formItemLayout: {
labelCol: { labelCol: {
sm: { span: 8 }, sm: { span: 8 }
}, },
wrapperCol: { wrapperCol: {
sm: { span: 16 }, sm: { span: 16 }
}, }
}, },
gutter: 8, gutter: 8,
span: 6, span: 6
} }
}, },
activated() { activated() {
this.getSysCode(); this.getSysCode()
}, },
deactivated() { deactivated() {
this.form.resetFields() this.form.resetFields()
this.userDate = {}; this.userDate = {}
this.selectedRowKeys = []; this.selectedRowKeys = []
this.imageList = []; this.imageList = []
}, },
methods: { methods: {
getUploadImageUrl, getUploadImageUrl,
...@@ -218,43 +211,52 @@ ...@@ -218,43 +211,52 @@
isLoading, isLoading,
getOneImageURL, getOneImageURL,
initData() { initData() {
this.id = this.$route.query.id || 0; this.id = this.$route.query.id || 0
getDetail(this.id).then(resp => { getDetail(this.id).then((resp) => {
if (resp && resp.code == SYS_CONST.REQUEST.SUCCEED) { if (resp && resp.code == SYS_CONST.REQUEST.SUCCEED) {
this.userDate = resp.data.sysUserDetail; this.userDate = resp.data.sysUserDetail
this.roleList = resp.data.sysUserRoleList || []; this.selectedRowKeys = resp.data.sysUserCheckedRoleList || []
this.officeList = resp.data.officeList || [];
this.selectedRowKeys = resp.data.sysUserCheckedRoleList || [];
if (this.userDate.avatar != null) { if (this.userDate.avatar != null) {
let image = { let image = {
uid: '-1', uid: '-1',
name: 'xxx.png', name: 'xxx.png',
status: 'done', status: 'done',
url: this.userDate.avatar, url: this.userDate.avatar
}; }
this.imageList.push(image); this.imageList.push(image)
} }
} }
}) })
}, },
handleSubmit(e) { handleSubmit(e) {
e.preventDefault(); e.preventDefault()
this.form.validateFieldsAndScroll((err, values) => { this.form.validateFieldsAndScroll((err, values) => {
if (!err) { if (!err) {
if (this.selectedRowKeys.length === 0) { if (this.selectedRowKeys.length === 0) {
this.$notification.error({message: '系统提示', description: "至少勾选一个角色", duration: 4,}); this.$notification.error({
message: '系统提示',
description: '至少勾选一个角色',
duration: 4
})
return return
} }
values.avatar = getOneImageURL(this.imageList); values.avatar = getOneImageURL(this.imageList)
let saveData = { let saveData = {
sysUserDetail: this.$valueCopy(this.userDate, values), sysUserDetail: this.$valueCopy(this.userDate, values),
sysUserCheckedRoleList: this.selectedRowKeys, sysUserCheckedRoleList: this.selectedRowKeys
}; }
save(saveData).then(resp => { save(saveData).then((resp) => {
if (resp && resp.code == SYS_CONST.REQUEST.SUCCEED) { if (resp && resp.code == SYS_CONST.REQUEST.SUCCEED) {
this.$notification.success({message: '系统提示', description: "保存成功", duration: 4,}); this.$notification.success({
this.$router.push({name: listPathName, query: {isModify: this.id != 0}}) message: '系统提示',
description: '保存成功',
duration: 4
})
this.$router.push({
name: listPathName,
query: { isModify: this.id != 0 }
})
} }
}) })
} }
...@@ -264,7 +266,7 @@ ...@@ -264,7 +266,7 @@
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
}, },
back() { back() {
this.$router.push({name: listPathName}) this.$router.push({ name: listPathName })
}, },
normFile(e) { normFile(e) {
if (Array.isArray(e)) { if (Array.isArray(e)) {
...@@ -272,29 +274,25 @@ ...@@ -272,29 +274,25 @@
} }
return e && e.fileList return e && e.fileList
}, },
handleChangeImg({fileList}) { handleChangeImg({ fileList }) {
this.isUpdateSuccess(fileList); this.isUpdateSuccess(fileList)
this.loading = this.isLoading(fileList); this.loading = this.isLoading(fileList)
this.imageList = fileList; this.imageList = fileList
}, },
handlePreview(file) { handlePreview(file) {
this.previewImage = file.url || file.thumbUrl; this.previewImage = file.url || file.thumbUrl
this.previewVisible = true; this.previewVisible = true
}, },
handleCancel() { handleCancel() {
this.previewVisible = false; this.previewVisible = false
}, },
getSysCode() { getSysCode() {
getCommonCode([SYS_CONST.CODE.UNIT_TYPE, SYS_CONST.CODE.AUTHORITY_TYPE]).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.orgList = response.data.data[SYS_CONST.CODE.UNIT_TYPE];
this.authorityTypeList = response.data.data[SYS_CONST.CODE.AUTHORITY_TYPE];
}
this.initData() this.initData()
getAll().then(({ data }) => {
this.roleList = data
}) })
},
} }
}; }
}
</script> </script>
<template> <template>
<div> <table-template :soul="this">
<a-card class="cust-list-cart"> <template #tags="{ record }">
<div>
<a-form layout="horizontal" class="ant-advanced-search-form">
<div>
<a-row>
<a-col :span="6">
<a-form-item label="用户名" v-bind="formItemLayout">
<a-input @pressEnter="search" v-model="query.username" placeholder="请输入"/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="真实姓名" v-bind="formItemLayout">
<a-input
@pressEnter="search"
style="width: 100%"
v-model="query.realName"
placeholder="请输入"/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="电话" v-bind="formItemLayout">
<a-input-number
@pressEnter="search"
style="width: 100%"
v-model="query.mobile"
placeholder="请输入"/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="状态" v-bind="formItemLayout">
<a-select
placeholder="请选择状态"
v-model="query.available"
@change="this.onChangeStatus"
:allowClear="true">
<a-select-option
v-for="option in availabStatus"
v-bind:value="option.valueInt"
v-bind:key="option.id">
{{ option.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</div>
</a-form>
</div>
<div>
<a-table
size="middle"
@change="sortChange"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:rowKey="rowKey"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: updateSelect}"
bordered
>
<div slot="title" slot-scope="data">
<span class="cust-title">
<a-icon type="hdd"/>系统用户{{data.none}}
</span>
<div class="cust-table-operator">
<a-button-group>
<a-button type="primary" @click="search">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="addNew">新建</a-button>
</a-button-group>
</div>
</div>
<div slot="footer" slot-scope="data">
{{data.none}}
<a-pagination
@change="pageChange"
:defaultPageSize="defaultPageSize"
:pageSizeOptions="$pageSizeOptions"
@showSizeChange="sizeChange"
class="cust-pagination"
size="small"
:total="total"
showSizeChanger
showQuickJumper
:showTotal="$showTotal"/>
</div>
<span slot="action" slot-scope="text, record" v-if="record.id!=1">
<a @click="editRow(record)">编辑</a>
<a-divider type="vertical"/>
<a @click="resetPwd(record)">重置密码</a>
</span>
<span slot="tags" slot-scope="text, record">
<a-switch <a-switch
:disabled="record.id == 1" :disabled="record.id == 1"
checkedChildren="启用" checkedChildren="启用"
unCheckedChildren="禁用" unCheckedChildren="禁用"
@click="setStatus(record)" @click="setStatus(record)"
:checked="record.available" :checked="record.available"
:key="record.id"/> />
</span> </template>
</a-table> <template #action="{ record }">
</div> <a @click="editRow(record)" v-if="record.id != 1">编辑</a>
</a-card> <a-divider type="vertical" v-if="record.id != 1" />
</div> <a @click="resetPwd(record)" v-if="record.id != 1">重置密码</a>
</template>
</table-template>
</template> </template>
<script> <script>
import { changeStatus,getPage, resetPwd} from "@/api/system/sysUserApi"; import { TableTemplate, TableScript, SearchType } from '@/components/table'
import {getCommonCode} from "@/api/system/sysCode"; import { changeStatus, getPage, resetPwd } from '@/api/system/sysUserApi'
import {formatDate, humpToLine, setOrder} from "@/util/util"; import dayjs from 'dayjs'
const dataSource = [] const columns = [
const columns = [ {
{title: '用户名', dataIndex: 'username', width: 120}, title: '用户名',
{title: '真实姓名', dataIndex: 'realName', width: 90}, dataIndex: 'userName',
{title: '联系电话', dataIndex: 'mobile', width: 100}, width: 120,
{title: '邮箱', dataIndex: 'email', width: 150}, filter: { type: SearchType.STRING }
{title: '备注', dataIndex: 'remark'}, },
// {title: '创建人', dataIndex: 'ct_user_name', width:70}, {
title: '真实姓名',
dataIndex: 'realName',
width: 90,
filter: { type: SearchType.STRING }
},
{
title: '联系电话',
dataIndex: 'phone',
width: 100,
filter: { type: SearchType.STRING }
},
{ title: '邮箱', dataIndex: 'email', width: 150 },
{ title: '备注', dataIndex: 'remark' },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'ctDate', dataIndex: 'ctDate',
width: 120, width: 170,
sorter: true, sorter: true,
customRender: (text) => formatDate(new Date(text), 'yyyy-MM-dd hh:mm') customRender: (text) => dayjs(text).format('YYYY-MM-DD HH:mm:ss')
}, },
// {title: '修改人', dataIndex: 'lm_user_name',width:70},
{ {
title: '修改时间', title: '修改时间',
dataIndex: 'lmDate', dataIndex: 'lmDate',
width: 140, width: 170,
sorter: true, sorter: true,
customRender: (text) => formatDate(new Date(text), 'yyyy-MM-dd hh:mm') customRender: (text) => dayjs(text).format('YYYY-MM-DD HH:mm:ss')
}, },
{title: '状态', dataIndex: 'available', width: 80, scopedSlots: {customRender: 'tags'}}, {
// {title: '状态', dataIndex: 'available', width: 60, }, title: '状态',
{title: '操作', key: 'operation', width: 130, scopedSlots: {customRender: 'action'}} dataIndex: 'available',
]; width: 80,
align: 'center',
let detailPathName = 'sysuserdetail' scopedSlots: { customRender: 'tags' },
enum: 'SYS0002',
filter: { type: SearchType.ENUM }
},
{
title: '操作',
key: 'operation',
width: 130,
scopedSlots: { customRender: 'action' }
}
]
export default { export default {
name: 'SysUserList', name: 'SysUserList',
mixins: [TableScript],
components: { TableTemplate },
data() { data() {
return { return {
query: { title: '系统用户',
page: 1, columns,
size: 10, codes: [['SYS0002'], []],
username: "", toolbar: [
realName: "", {
mobile: "", text: '新建',
available: "", handler: 'addNew'
order: "",
sort: ""
},
total: 0,
rowKey: "id",
columns: columns,
dataSource: dataSource,
selectedRowKeys: [],
selectedRows: [],
coachList: [],
currentEditDate: {},
coachId: {},
sysUserId: {},
rowDate: {},
availabStatus: {},
formItemLayout: {
labelCol: {
sm: {span: 8},
},
wrapperCol: {
sm: {span: 16},
},
}
} }
}, ]
computed: {
defaultPageSize: function () {
return this.$defaultPageSize()
} }
}, },
methods: { methods: {
search() { queryData: getPage,
this.query.page = 1;
this.loadData();
},
reset() {
this.query.page = 1;
this.query.username = "";
this.query.realName = "";
this.query.mobile = "";
this.query.available = "";
this.loadData();
},
pageChange(page) {
this.query.page = page;
this.loadData();
},
sizeChange(current, size) {
this.query.size = size;
this.loadData();
},
loadData(pageSize) {
if (pageSize && !isNaN(pageSize)) {
this.query.size = pageSize
}
getPage(this.query).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
let respData = response.data;
this.total = respData.total;
this.dataSource = respData.list;
}
});
},
sortChange(pagination, filters, sorter) {
this.query.sort = humpToLine(sorter.field);
this.query.order = setOrder(sorter.order);
this.loadData();
},
setStatus(record) {
changeStatus(record.id).then(response=> {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.loadData();
}
});
},
addNew() { addNew() {
this.editRow() this.editRow()
}, },
editRow(row) { editRow(row) {
this.$router.push({name: detailPathName, query: {id: row ? row.id : 0}}) this.$router.push({name: 'sysUserDetail', query: {id: row ? row.id : 0}})
}, },
updateSelect(selectedRowKeys) { setStatus(record) {
this.selectedRowKeys = selectedRowKeys changeStatus(record.id).then(({ code }) => {
}, if (code == 200) {
onChangeStatus() { this.loadData()
this.loadData(); }
})
}, },
resetPwd(rowData) { resetPwd(rowData) {
let _this = this; let _this = this
let contText = '确定重置[' + rowData.realName + ']的密码?' let contText = '确定重置[' + rowData.realName + ']的密码?'
this.$confirm({ this.$confirm({
title: '提示', title: '提示',
content: contText, content: contText,
onOk() { onOk() {
resetPwd(rowData.id).then(response => { resetPwd(rowData.id).then((response) => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) { if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
_this.$notification.success({ _this.$notification.success({
message: '系统提示', message: '系统提示',
description: "重置密码成功", description: '重置密码成功',
duration: 4, duration: 4
});
}
}) })
},
onCancel() {
},
});
},
getavailable() {
getCommonCode([SYS_CONST.CODE.SYS_AVAILABLE_STATUS]).then(response => {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
this.availabStatus = response.data.data[SYS_CONST.CODE.SYS_AVAILABLE_STATUS];
} }
}) })
}, },
}, onCancel() {}
mounted() { })
// 查询状态下拉菜单
this.getavailable();
this.loadData(this.defaultPageSize);
},
activated() {
if (this.isFirstLoad == true) {
this.loadData(this.defaultPageSize)
this.isFirstLoad = false
} else {
let isModify = this.$route.query.isModify
if (isModify == true) {
this.loadData()
} else if (isModify != undefined) {
this.loadData()
}
}
} }
} }
}
</script> </script>
\ No newline at end of file
<template>
<keep-alive v-if="keepAlive">
<router-view />
</keep-alive>
<router-view v-else />
</template>
<script>
export default {
name: "SysUserRouteView",
computed: {
keepAlive () {
return this.$route.meta.keepAlive
}
},
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment