Browse Source

角色、菜单管理添加客户端类型

newDev
lzp 1 week ago
parent
commit
801e53136f
  1. 2
      acupuncture-后台/src/views/followFile/work.vue
  2. 2
      acupuncture-后台/src/views/medicalFile/index.vue
  3. 5
      acupuncture-后台/src/views/monitor/online/index.vue
  4. 33
      acupuncture-后台/src/views/monitor/server/index.vue
  5. 13
      acupuncture-后台/src/views/report/manage.vue
  6. 1
      acupuncture-后台/src/views/report/type.vue
  7. 45
      acupuncture-后台/src/views/system/dict/index.vue
  8. 30
      acupuncture-后台/src/views/system/menu/index.vue
  9. 221
      acupuncture-后台/src/views/system/notice/index.vue
  10. 388
      acupuncture-后台/src/views/system/role/index.vue
  11. BIN
      acupuncture-后台/南宁针灸后台ssl-4.zip

2
acupuncture-后台/src/views/followFile/work.vue

@ -530,7 +530,7 @@ export default {
created() {
let { name, phone } = this.$route.query;
this.queryParams.param.keywords = name || "";
this.queryParams.param.phone = phone || "";
this.queryParams.param.phone = phone !== 'null' ? phone : "";
this.getList();
this.getTenantsList(); //
},

2
acupuncture-后台/src/views/medicalFile/index.vue

@ -1369,7 +1369,7 @@ export default {
created() {
let { name, phone } = this.$route.query;
this.queryParams.param.keywords = name || "";
this.queryParams.param.phone = phone || "";
this.queryParams.param.phone = phone !== 'null' ? phone : "";
this.getList();
this.getTenantsList(); //
},

5
acupuncture-后台/src/views/monitor/online/index.vue

@ -45,6 +45,11 @@
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
</el-table-column>
<el-table-column label="最后访问时间" align="center" prop="lastVisitTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastVisitTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button

33
acupuncture-后台/src/views/monitor/server/index.vue

@ -171,6 +171,39 @@
</div>
</el-card>
</el-col>
<el-col :span="24" class="card-box">
<el-card>
<div slot="header">
<span><i class="el-icon-s-data"></i> 数据库状态</span>
</div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<table cellspacing="0" style="width: 100%;">
<thead>
<tr>
<th class="el-table__cell el-table__cell is-leaf"><div class="cell">盘符路径</div></th>
<th class="el-table__cell is-leaf"><div class="cell">文件系统</div></th>
<th class="el-table__cell is-leaf"><div class="cell">盘符类型</div></th>
<th class="el-table__cell is-leaf"><div class="cell">总大小</div></th>
<th class="el-table__cell is-leaf"><div class="cell">可用大小</div></th>
<th class="el-table__cell is-leaf"><div class="cell">已用大小</div></th>
<th class="el-table__cell is-leaf"><div class="cell">已用百分比</div></th>
</tr>
</thead>
<tbody v-if="server.sysFiles">
<tr v-for="(sysFile, index) in server.sysFiles" :key="index">
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.dirName }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.sysTypeName }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.typeName }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.total }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.free }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.used }}</div></td>
<td class="el-table__cell is-leaf"><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td>
</tr>
</tbody>
</table>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>

13
acupuncture-后台/src/views/report/manage.vue

@ -43,6 +43,18 @@
</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" show-overflow-tooltip min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.status === 0"> 未开始 </span>
<span v-if="scope.row.status === 1"> 进行中 </span>
<span v-if="scope.row.status === 2"> 已结束 </span>
</template>
</el-table-column>
<el-table-column label="开启/结束" align="center" prop="typeName" show-overflow-tooltip min-width="100">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
</template>
</el-table-column>
<el-table-column label="创建人/创建时间" align="center" min-width="140">
<template slot-scope="scope">
<div>{{scope.row.createBy}}</div>
@ -51,6 +63,7 @@
</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"

1
acupuncture-后台/src/views/report/type.vue

@ -25,6 +25,7 @@
<el-table v-loading="loading" :data="listData" @selection-change="handleSelectionChange" max-height="600">
<el-table-column type="selection" width="55" align="center" />
<el-table-column fixed label="类型名称" align="center" prop="typeName" min-width="100" />
<el-table-column label="备注" align="center" prop="remark" min-width="100" />
<el-table-column label="创建人/创建时间" align="center" min-width="140">
<template slot-scope="scope">
<div>{{scope.row.createBy}}</div>

45
acupuncture-后台/src/views/system/dict/index.vue

@ -168,6 +168,26 @@
</router-link>
</template>
</el-table-column>
<el-table-column label="数据类型" align="center" width="100">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.dataType === 0"></el-tag>
<el-tag type="info" v-if="scope.row.dataType === 1"></el-tag>
</template>
</el-table-column>
<!-- 长度是否必填是否唯一 -->
<el-table-column label="长度" align="center" prop="length" />
<el-table-column label="是否必填" align="center" width="100">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.isRequired === 0"></el-tag>
<el-tag type="info" v-if="scope.row.isRequired === 1"></el-tag>
</template>
</el-table-column>
<el-table-column label="是否唯一" align="center" width="100">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.isSole === 0"></el-tag>
<el-tag type="info" v-if="scope.row.isSole === 1"></el-tag>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
@ -235,6 +255,27 @@
<el-form-item label="字典类型" prop="dictType">
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
</el-form-item>
<el-form-item label="数据类型" prop="dataType">
<el-radio-group v-model="form.dataType">
<el-radio :label="0">数字</el-radio>
<el-radio :label="1">字符串</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="长度" prop="length">
<el-input v-model="form.length" placeholder="请输入长度" />
</el-form-item>
<el-form-item label="是否必填" prop="isRequired">
<el-radio-group v-model="form.isRequired">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否唯一" prop="isSole">
<el-radio-group v-model="form.isSole">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
@ -417,6 +458,10 @@ export default {
dictType: undefined,
status: "0",
remark: undefined,
dataType: 1,
length: '',
isRequired: 1,
isSole: 1,
};
this.resetForm("form");
},

30
acupuncture-后台/src/views/system/menu/index.vue

@ -19,6 +19,17 @@
/>
</el-select>
</el-form-item>
<el-form-item label="客户端类型" prop="status">
<el-select
v-model="queryParams.clientType"
placeholder="客户端类型"
clearable
style="width: 240px"
>
<el-option label="PC端" :value="0" />
<el-option label="移动端" :value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -70,6 +81,12 @@
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="客户端类型" align="center" width="100">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.clientType === 0">PC端</el-tag>
<el-tag type="info" v-if="scope.row.clientType === 1">移动端</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@ -278,6 +295,16 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="客户端类型">
<el-radio-group v-model="form.clientType">
<el-radio :label="0">PC端</el-radio>
<el-radio :label="1">移动端</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -389,7 +416,8 @@ export default {
isFrame: "1",
isCache: "0",
visible: "0",
status: "0"
status: "0",
clientType: 0
};
this.resetForm("form");
},

221
acupuncture-后台/src/views/system/notice/index.vue

@ -1,6 +1,13 @@
<template>
<div class="app-container">
<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="noticeTitle">
<el-input
v-model="queryParams.noticeTitle"
@ -18,7 +25,11 @@
/>
</el-form-item>
<el-form-item label="类型" prop="noticeType">
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable>
<el-select
v-model="queryParams.noticeType"
placeholder="公告类型"
clearable
>
<el-option
v-for="dict in dict.type.sys_notice_type"
:key="dict.value"
@ -28,8 +39,16 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
@ -42,7 +61,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:notice:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -53,7 +73,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -64,37 +85,88 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="noticeList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table-column
label="序号"
align="center"
prop="noticeId"
width="100"
/>
<el-table-column
label="公告标题"
align="center"
prop="noticeTitle"
:show-overflow-tooltip="true"
/>
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
<el-table-column
label="公告类型"
align="center"
prop="noticeType"
width="100"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
<dict-tag
:options="dict.type.sys_notice_type"
:value="scope.row.noticeType"
/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/>
<dict-tag
:options="dict.type.sys_notice_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
<el-table-column
label="创建者"
align="center"
prop="createBy"
width="100"
/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="100"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column
label="更新时间"
align="center"
prop="createTime"
width="140"
>
<template slot-scope="scope">
<span>{{
parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{i}")
}}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
@ -102,20 +174,22 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@ -128,7 +202,10 @@
<el-row>
<el-col :span="12">
<el-form-item label="公告标题" prop="noticeTitle">
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
<el-input
v-model="form.noticeTitle"
placeholder="请输入公告标题"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -143,6 +220,22 @@
</el-select>
</el-form-item>
</el-col>
<el-form-item label="通知用户" prop="userIdList">
<el-select
v-model="form.userIdList"
multiple
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.userId"
:label="`${item.userName}-${item.nickName}`"
:value="item.userId"
>
</el-option>
</el-select>
</el-form-item>
<el-col :span="24">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
@ -150,13 +243,14 @@
v-for="dict in dict.type.sys_notice_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容">
<editor v-model="form.noticeContent" :min-height="192"/>
<editor v-model="form.noticeContent" :min-height="192" />
</el-form-item>
</el-col>
</el-row>
@ -170,11 +264,17 @@
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import {
listNotice,
getNotice,
delNotice,
addNotice,
updateNotice,
} from "@/api/system/notice";
import { listUser } from "@/api/system/user";
export default {
name: "Notice",
dicts: ['sys_notice_status', 'sys_notice_type'],
dicts: ["sys_notice_status", "sys_notice_type"],
data() {
return {
//
@ -201,29 +301,43 @@ export default {
pageSize: 10,
noticeTitle: undefined,
createBy: undefined,
status: undefined
status: undefined,
},
//
form: {},
//
rules: {
noticeTitle: [
{ required: true, message: "公告标题不能为空", trigger: "blur" }
{ required: true, message: "公告标题不能为空", trigger: "blur" },
],
noticeType: [
{ required: true, message: "公告类型不能为空", trigger: "change" }
]
}
{ required: true, message: "公告类型不能为空", trigger: "change" },
],
userIdList: [
{ required: true, message: "通知用户不能为空", trigger: "change" },
],
},
userList: [],
};
},
created() {
this.getList();
this.getUserList();
},
methods: {
/** 查询用户列表 */
getUserList() {
listUser({
pageNum: 1,
pageSize: 1000000,
}).then((response) => {
this.userList = response.rows;
});
},
/** 查询公告列表 */
getList() {
this.loading = true;
listNotice(this.queryParams).then(response => {
listNotice(this.queryParams).then((response) => {
this.noticeList = response.rows;
this.total = response.total;
this.loading = false;
@ -241,7 +355,8 @@ export default {
noticeTitle: undefined,
noticeType: undefined,
noticeContent: undefined,
status: "0"
status: "0",
userIdList: [],
};
this.resetForm("form");
},
@ -257,9 +372,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.noticeId)
this.single = selection.length!=1
this.multiple = !selection.length
this.ids = selection.map((item) => item.noticeId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -270,25 +385,25 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const noticeId = row.noticeId || this.ids
getNotice(noticeId).then(response => {
const noticeId = row.noticeId || this.ids;
getNotice(noticeId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改公告";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.noticeId != undefined) {
updateNotice(this.form).then(response => {
updateNotice(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNotice(this.form).then(response => {
addNotice(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -299,14 +414,18 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const noticeIds = row.noticeId || this.ids
this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
return delNotice(noticeIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
const noticeIds = row.noticeId || this.ids;
this.$modal
.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?')
.then(function () {
return delNotice(noticeIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
},
};
</script>

388
acupuncture-后台/src/views/system/role/index.vue

@ -1,6 +1,12 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
>
<el-form-item label="角色名称" prop="roleName">
<el-input
v-model="queryParams.roleName"
@ -34,6 +40,17 @@
/>
</el-select>
</el-form-item>
<el-form-item label="客户端类型" prop="status">
<el-select
v-model="queryParams.clientType"
placeholder="客户端类型"
clearable
style="width: 240px"
>
<el-option label="PC端" :value="0" />
<el-option label="移动端" :value="1" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
@ -46,8 +63,16 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
@ -60,7 +85,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:role:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -71,7 +97,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:role:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -82,7 +109,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:role:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -92,16 +120,34 @@
size="mini"
@click="handleExport"
v-hasPermi="['system:role:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="roleList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="角色编号" prop="roleId" width="120" />
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
<el-table-column
label="角色名称"
prop="roleName"
:show-overflow-tooltip="true"
width="150"
/>
<el-table-column
label="权限字符"
prop="roleKey"
:show-overflow-tooltip="true"
width="150"
/>
<el-table-column label="显示顺序" prop="roleSort" width="100" />
<el-table-column label="状态" align="center" width="100">
<template slot-scope="scope">
@ -113,12 +159,27 @@
></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<el-table-column label="客户端类型" align="center" width="100">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.clientType === 0">PC端</el-tag>
<el-tag type="info" v-if="scope.row.clientType === 1">移动端</el-tag>
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button
size="mini"
@ -126,21 +187,37 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:role:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
>删除</el-button>
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
>删除</el-button
>
<el-dropdown
size="mini"
@command="(command) => handleCommand(command, scope.row)"
v-hasPermi="['system:role:edit']"
>
<el-button size="mini" type="text" icon="el-icon-d-arrow-right"
>更多</el-button
>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"
v-hasPermi="['system:role:edit']">数据权限</el-dropdown-item>
<el-dropdown-item command="handleAuthUser" icon="el-icon-user"
v-hasPermi="['system:role:edit']">分配用户</el-dropdown-item>
<el-dropdown-item
command="handleDataScope"
icon="el-icon-circle-check"
v-hasPermi="['system:role:edit']"
>数据权限</el-dropdown-item
>
<el-dropdown-item
command="handleAuthUser"
icon="el-icon-user"
v-hasPermi="['system:role:edit']"
>分配用户</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</template>
@ -148,7 +225,7 @@
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@ -163,7 +240,10 @@
</el-form-item>
<el-form-item prop="roleKey">
<span slot="label">
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
<el-tooltip
content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)"
placement="top"
>
<i class="el-icon-question"></i>
</el-tooltip>
权限字符
@ -171,7 +251,11 @@
<el-input v-model="form.roleKey" placeholder="请输入权限字符" />
</el-form-item>
<el-form-item label="角色顺序" prop="roleSort">
<el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
<el-input-number
v-model="form.roleSort"
controls-position="right"
:min="0"
/>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
@ -179,13 +263,32 @@
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item label="客户端类型">
<el-radio-group v-model="form.clientType">
<el-radio :label="0">PC端</el-radio>
<el-radio :label="1">移动端</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="菜单权限">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
<el-checkbox
v-model="menuExpand"
@change="handleCheckedTreeExpand($event, 'menu')"
>展开/折叠</el-checkbox
>
<el-checkbox
v-model="menuNodeAll"
@change="handleCheckedTreeNodeAll($event, 'menu')"
>全选/全不选</el-checkbox
>
<el-checkbox
v-model="form.menuCheckStrictly"
@change="handleCheckedTreeConnect($event, 'menu')"
>父子联动</el-checkbox
>
<el-tree
class="tree-border"
:data="menuOptions"
@ -198,7 +301,11 @@
></el-tree>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -208,7 +315,12 @@
</el-dialog>
<!-- 分配角色数据权限对话框 -->
<el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
<el-dialog
:title="title"
:visible.sync="openDataScope"
width="500px"
append-to-body
>
<el-form :model="form" label-width="80px">
<el-form-item label="角色名称">
<el-input v-model="form.roleName" :disabled="true" />
@ -227,9 +339,21 @@
</el-select>
</el-form-item>
<el-form-item label="数据权限" v-show="form.dataScope == 2">
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
<el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
<el-checkbox
v-model="deptExpand"
@change="handleCheckedTreeExpand($event, 'dept')"
>展开/折叠</el-checkbox
>
<el-checkbox
v-model="deptNodeAll"
@change="handleCheckedTreeNodeAll($event, 'dept')"
>全选/全不选</el-checkbox
>
<el-checkbox
v-model="form.deptCheckStrictly"
@change="handleCheckedTreeConnect($event, 'dept')"
>父子联动</el-checkbox
>
<el-tree
class="tree-border"
:data="deptOptions"
@ -252,12 +376,24 @@
</template>
<script>
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import {
listRole,
getRole,
delRole,
addRole,
updateRole,
dataScope,
changeRoleStatus,
deptTreeSelect,
} from "@/api/system/role";
import {
treeselect as menuTreeselect,
roleMenuTreeselect,
} from "@/api/system/menu";
export default {
name: "Role",
dicts: ['sys_normal_disable'],
dicts: ["sys_normal_disable"],
data() {
return {
//
@ -290,24 +426,24 @@ export default {
dataScopeOptions: [
{
value: "1",
label: "全部数据权限"
label: "全部数据权限",
},
{
value: "2",
label: "自定数据权限"
label: "自定数据权限",
},
{
value: "3",
label: "本部门数据权限"
label: "本部门数据权限",
},
{
value: "4",
label: "本部门及以下数据权限"
label: "本部门及以下数据权限",
},
{
value: "5",
label: "仅本人数据权限"
}
label: "仅本人数据权限",
},
],
//
menuOptions: [],
@ -319,26 +455,26 @@ export default {
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined
status: undefined,
},
//
form: {},
defaultProps: {
children: "children",
label: "label"
label: "label",
},
//
rules: {
roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" }
{ required: true, message: "角色名称不能为空", trigger: "blur" },
],
roleKey: [
{ required: true, message: "权限字符不能为空", trigger: "blur" }
{ required: true, message: "权限字符不能为空", trigger: "blur" },
],
roleSort: [
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
]
}
{ required: true, message: "角色顺序不能为空", trigger: "blur" },
],
},
};
},
created() {
@ -348,7 +484,8 @@ export default {
/** 查询角色列表 */
getList() {
this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.roleList = response.rows;
this.total = response.total;
this.loading = false;
@ -357,7 +494,7 @@ export default {
},
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
menuTreeselect().then((response) => {
this.menuOptions = response.data;
});
},
@ -381,14 +518,14 @@ export default {
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
return roleMenuTreeselect(roleId).then((response) => {
this.menuOptions = response.menus;
return response;
});
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then(response => {
return deptTreeSelect(roleId).then((response) => {
this.deptOptions = response.depts;
return response;
});
@ -396,13 +533,17 @@ export default {
//
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
return changeRoleStatus(row.roleId, row.status);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
this.$modal
.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?')
.then(function () {
return changeRoleStatus(row.roleId, row.status);
})
.then(() => {
this.$modal.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
//
cancel() {
@ -419,22 +560,23 @@ export default {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
}
this.menuExpand = false,
this.menuNodeAll = false,
this.deptExpand = true,
this.deptNodeAll = false,
this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
};
(this.menuExpand = false),
(this.menuNodeAll = false),
(this.deptExpand = true),
(this.deptNodeAll = false),
(this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined,
clientType: 0,
});
this.resetForm("form");
},
/** 搜索按钮操作 */
@ -450,9 +592,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
this.single = selection.length!=1
this.multiple = !selection.length
this.ids = selection.map((item) => item.roleId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
//
handleCommand(command, row) {
@ -469,12 +611,12 @@ export default {
},
// /
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
if (type == "menu") {
let treeList = this.menuOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
}
} else if (type == 'dept') {
} else if (type == "dept") {
let treeList = this.deptOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
@ -483,18 +625,18 @@ export default {
},
// /
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
} else if (type == 'dept') {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
if (type == "menu") {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions : []);
} else if (type == "dept") {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions : []);
}
},
//
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form.menuCheckStrictly = value ? true: false;
} else if (type == 'dept') {
this.form.deptCheckStrictly = value ? true: false;
if (type == "menu") {
this.form.menuCheckStrictly = value ? true : false;
} else if (type == "dept") {
this.form.deptCheckStrictly = value ? true : false;
}
},
/** 新增按钮操作 */
@ -507,19 +649,19 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const roleId = row.roleId || this.ids
const roleId = row.roleId || this.ids;
const roleMenu = this.getRoleMenuTreeselect(roleId);
getRole(roleId).then(response => {
getRole(roleId).then((response) => {
this.form = response.data;
this.open = true;
this.$nextTick(() => {
roleMenu.then(res => {
let checkedKeys = res.checkedKeys
roleMenu.then((res) => {
let checkedKeys = res.checkedKeys;
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
})
})
this.$nextTick(() => {
this.$refs.menu.setChecked(v, true, false);
});
});
});
});
});
@ -527,7 +669,7 @@ export default {
},
/** 选择角色权限范围触发 */
dataScopeSelectChange(value) {
if(value !== '2') {
if (value !== "2") {
this.$refs.dept.setCheckedKeys([]);
}
},
@ -535,11 +677,11 @@ export default {
handleDataScope(row) {
this.reset();
const deptTreeSelect = this.getDeptTree(row.roleId);
getRole(row.roleId).then(response => {
getRole(row.roleId).then((response) => {
this.form = response.data;
this.openDataScope = true;
this.$nextTick(() => {
deptTreeSelect.then(res => {
deptTreeSelect.then((res) => {
this.$refs.dept.setCheckedKeys(res.checkedKeys);
});
});
@ -547,24 +689,24 @@ export default {
this.title = "分配数据权限";
},
/** 分配用户操作 */
handleAuthUser: function(row) {
handleAuthUser: function (row) {
const roleId = row.roleId;
this.$router.push("/system/role-auth/user/" + roleId);
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys();
updateRole(this.form).then(response => {
updateRole(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form.menuIds = this.getMenuAllCheckedKeys();
addRole(this.form).then(response => {
addRole(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -574,10 +716,10 @@ export default {
});
},
/** 提交按钮(数据权限) */
submitDataScope: function() {
submitDataScope: function () {
if (this.form.roleId != undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys();
dataScope(this.form).then(response => {
dataScope(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.openDataScope = false;
this.getList();
@ -587,19 +729,27 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids;
this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
return delRole(roleIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.$modal
.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?')
.then(function () {
return delRole(roleIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
}
}
this.download(
"system/role/export",
{
...this.queryParams,
},
`role_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
</script>

BIN
acupuncture-后台/南宁后台ssl-3.zip → acupuncture-后台/南宁针灸后台ssl-4.zip

Binary file not shown.
Loading…
Cancel
Save