|
@@ -2,60 +2,15 @@
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
<el-form-item label="分组名称" prop="groupName">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.groupName"
|
|
|
- placeholder="请输入分组名称"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
+ <el-input v-model="queryParams.groupName" placeholder="请输入分组名称" clearable @keyup.enter.native="handleQuery" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="创建人" prop="createBy">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.createBy"
|
|
|
- placeholder="请输入创建人"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
+ <el-form-item label="分组管理员" prop="groupManager">
|
|
|
+ <el-input v-model="queryParams.groupManager" placeholder="请输入分组管理员" clearable
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="创建时间" prop="createTime">
|
|
|
- <el-date-picker clearable
|
|
|
- v-model="queryParams.createTime"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- placeholder="请选择创建时间">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="更新人" prop="updateBy">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.updateBy"
|
|
|
- placeholder="请输入更新人"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="更新时间" prop="updateTime">
|
|
|
- <el-date-picker clearable
|
|
|
- v-model="queryParams.updateTime"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- placeholder="请选择更新时间">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="备注" prop="remark">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.remark"
|
|
|
- placeholder="请输入备注"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="逻辑删除标志;1/非1" prop="isDel">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.isDel"
|
|
|
- placeholder="请输入逻辑删除标志;1/非1"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
+ <el-form-item label="分组管理员姓名" prop="groupManagerName">
|
|
|
+ <el-input v-model="queryParams.groupManagerName" placeholder="请输入分组管理员姓名" clearable
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
@@ -65,46 +20,20 @@
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['doc:group:add']"
|
|
|
- >新增</el-button>
|
|
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
|
|
+ v-hasPermi="['doc:group:add']">新增</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- icon="el-icon-edit"
|
|
|
- size="mini"
|
|
|
- :disabled="single"
|
|
|
- @click="handleUpdate"
|
|
|
- v-hasPermi="['doc:group:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
|
|
+ v-hasPermi="['doc:group:edit']">修改</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- plain
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- :disabled="multiple"
|
|
|
- @click="handleDelete"
|
|
|
- v-hasPermi="['doc:group:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
|
|
+ v-hasPermi="['doc:group:remove']">删除</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- plain
|
|
|
- icon="el-icon-download"
|
|
|
- size="mini"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['doc:group:export']"
|
|
|
- >导出</el-button>
|
|
|
+ <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
|
+ v-hasPermi="['doc:group:export']">导出</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
@@ -113,47 +42,20 @@
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="分组ID" align="center" prop="groupId" />
|
|
|
<el-table-column label="分组名称" align="center" prop="groupName" />
|
|
|
- <el-table-column label="创建人" align="center" prop="createBy" />
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="更新人" align="center" prop="updateBy" />
|
|
|
- <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="备注" align="center" prop="remark" />
|
|
|
- <el-table-column label="逻辑删除标志;1/非1" align="center" prop="isDel" />
|
|
|
+ <el-table-column label="分组管理员" align="center" prop="groupManager" />
|
|
|
+ <el-table-column label="分组管理员姓名" align="center" prop="groupManagerName" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['doc:group:edit']"
|
|
|
- >修改</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['doc:group:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['doc:group:edit']">修改</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['doc:group:remove']">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList" />
|
|
|
|
|
|
<!-- 添加或修改分组对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
@@ -161,25 +63,21 @@
|
|
|
<el-form-item label="分组名称" prop="groupName">
|
|
|
<el-input v-model="form.groupName" placeholder="请输入分组名称" />
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="分组管理员" prop="groupManager">
|
|
|
+ <el-input v-model="form.groupManager" placeholder="请输入分组管理员" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="分组管理员姓名" prop="groupManagerName">
|
|
|
+ <el-input v-model="form.groupManagerName" placeholder="请输入分组管理员姓名" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="创建人ID" prop="creater">
|
|
|
+ <el-input v-model="form.creater" placeholder="请输入创建人ID" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="逻辑删除标志;1/非1" prop="isDel">
|
|
|
<el-input v-model="form.isDel" placeholder="请输入逻辑删除标志;1/非1" />
|
|
|
</el-form-item>
|
|
|
- <el-divider content-position="center">分组成员信息</el-divider>
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddDocGroupUser">添加</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteDocGroupUser">删除</el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-table :data="docGroupUserList" :row-class-name="rowDocGroupUserIndex" @selection-change="handleDocGroupUserSelectionChange" ref="docGroupUser">
|
|
|
- <el-table-column type="selection" width="50" align="center" />
|
|
|
- <el-table-column label="序号" align="center" prop="index" width="50"/>
|
|
|
- </el-table>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -190,181 +88,153 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listGroup, getGroup, delGroup, addGroup, updateGroup } from "@/api/doc/group";
|
|
|
+ import {
|
|
|
+ listGroup,
|
|
|
+ getGroup,
|
|
|
+ delGroup,
|
|
|
+ addGroup,
|
|
|
+ updateGroup
|
|
|
+ } from "@/api/doc/group";
|
|
|
|
|
|
-export default {
|
|
|
- name: "Group",
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 遮罩层
|
|
|
- loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 子表选中数据
|
|
|
- checkedDocGroupUser: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 分组表格数据
|
|
|
- groupList: [],
|
|
|
- // 分组成员表格数据
|
|
|
- docGroupUserList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- groupName: null,
|
|
|
- createBy: null,
|
|
|
- createTime: null,
|
|
|
- updateBy: null,
|
|
|
- updateTime: null,
|
|
|
- remark: null,
|
|
|
- isDel: null
|
|
|
- },
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- }
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /** 查询分组列表 */
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- listGroup(this.queryParams).then(response => {
|
|
|
- this.groupList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- groupId: null,
|
|
|
- groupName: null,
|
|
|
- createBy: null,
|
|
|
- createTime: null,
|
|
|
- updateBy: null,
|
|
|
- updateTime: null,
|
|
|
- remark: null,
|
|
|
- isDel: null
|
|
|
+ export default {
|
|
|
+ name: "Group",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 分组表格数据
|
|
|
+ groupList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ groupName: null,
|
|
|
+ groupManager: null,
|
|
|
+ groupManagerName: null,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {}
|
|
|
};
|
|
|
- this.docGroupUserList = [];
|
|
|
- this.resetForm("form");
|
|
|
},
|
|
|
- /** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
+ created() {
|
|
|
this.getList();
|
|
|
},
|
|
|
- /** 重置按钮操作 */
|
|
|
- resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.groupId)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
- },
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加分组";
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- const groupId = row.groupId || this.ids
|
|
|
- getGroup(groupId).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.docGroupUserList = response.data.docGroupUserList;
|
|
|
+ methods: {
|
|
|
+ /** 查询分组列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listGroup(this.queryParams).then(response => {
|
|
|
+ this.groupList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ groupId: null,
|
|
|
+ groupName: null,
|
|
|
+ groupManager: null,
|
|
|
+ groupManagerName: null,
|
|
|
+ creater: null,
|
|
|
+ createBy: null,
|
|
|
+ createTime: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ remark: null,
|
|
|
+ isDel: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.groupId)
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
this.open = true;
|
|
|
- this.title = "修改分组";
|
|
|
- });
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.form.docGroupUserList = this.docGroupUserList;
|
|
|
- if (this.form.groupId != null) {
|
|
|
- updateGroup(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addGroup(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ this.title = "添加分组";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const groupId = row.groupId || this.ids
|
|
|
+ getGroup(groupId).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改分组";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.groupId != null) {
|
|
|
+ updateGroup(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addGroup(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const groupIds = row.groupId || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除分组编号为"' + groupIds + '"的数据项?').then(function() {
|
|
|
- return delGroup(groupIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
- },
|
|
|
- /** 分组成员序号 */
|
|
|
- rowDocGroupUserIndex({ row, rowIndex }) {
|
|
|
- row.index = rowIndex + 1;
|
|
|
- },
|
|
|
- /** 分组成员添加按钮操作 */
|
|
|
- handleAddDocGroupUser() {
|
|
|
- let obj = {};
|
|
|
- this.docGroupUserList.push(obj);
|
|
|
- },
|
|
|
- /** 分组成员删除按钮操作 */
|
|
|
- handleDeleteDocGroupUser() {
|
|
|
- if (this.checkedDocGroupUser.length == 0) {
|
|
|
- this.$modal.msgError("请先选择要删除的分组成员数据");
|
|
|
- } else {
|
|
|
- const docGroupUserList = this.docGroupUserList;
|
|
|
- const checkedDocGroupUser = this.checkedDocGroupUser;
|
|
|
- this.docGroupUserList = docGroupUserList.filter(function(item) {
|
|
|
- return checkedDocGroupUser.indexOf(item.index) == -1
|
|
|
});
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const groupIds = row.groupId || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除分组编号为"' + groupIds + '"的数据项?').then(function() {
|
|
|
+ return delGroup(groupIds);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('doc/group/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `group_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
- },
|
|
|
- /** 复选框选中数据 */
|
|
|
- handleDocGroupUserSelectionChange(selection) {
|
|
|
- this.checkedDocGroupUser = selection.map(item => item.index)
|
|
|
- },
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.download('doc/group/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `group_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
-</script>
|
|
|
+ };
|
|
|
+</script>
|