46 changed files with 232 additions and 1045 deletions
@ -1,34 +0,0 @@ |
|||||||
package com.cloud.kicc.system.api.dto; |
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
|
|
||||||
/** |
|
||||||
*<p> |
|
||||||
* 登录信息 |
|
||||||
*</p> |
|
||||||
* |
|
||||||
* @Author: entfrm开发团队-王翔 |
|
||||||
* @Date: 2022/2/24 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
public class LoginDto { |
|
||||||
/** |
|
||||||
* 用户名 |
|
||||||
*/ |
|
||||||
private String userName; |
|
||||||
|
|
||||||
/** |
|
||||||
* 用户密码 |
|
||||||
*/ |
|
||||||
private String password; |
|
||||||
|
|
||||||
/** |
|
||||||
* 验证码 |
|
||||||
*/ |
|
||||||
private String code; |
|
||||||
|
|
||||||
/** |
|
||||||
* redis验证码存储密钥 |
|
||||||
*/ |
|
||||||
private String realKey; |
|
||||||
} |
|
@ -1,28 +0,0 @@ |
|||||||
package com.cloud.kicc.system.api.entity; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId; |
|
||||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||||
import com.cloud.kicc.common.data.entity.TreeEntity; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import lombok.experimental.Accessors; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 地址管理实体 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 9:57 2022/3/21 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = false) |
|
||||||
@Accessors(chain = true) |
|
||||||
@TableName(value="sys_address", excludeProperty = {"delFlag"}) |
|
||||||
public class Address extends TreeEntity<Address> { |
|
||||||
|
|
||||||
@TableId |
|
||||||
private String id; |
|
||||||
|
|
||||||
private String code; |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,42 +0,0 @@ |
|||||||
package com.cloud.kicc.system.api.entity; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId; |
|
||||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||||
import com.cloud.kicc.common.data.entity.CommonEntity; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import lombok.experimental.Accessors; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 医院管理实体 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 9:57 2022/3/21 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = false) |
|
||||||
@Accessors(chain = true) |
|
||||||
@TableName(value="sys_hospital") |
|
||||||
public class Hospital extends CommonEntity { |
|
||||||
|
|
||||||
@TableId |
|
||||||
private String id; |
|
||||||
|
|
||||||
private String name; |
|
||||||
|
|
||||||
private String contactsName; |
|
||||||
|
|
||||||
private String contactsTel; |
|
||||||
|
|
||||||
private String contactsTitle; |
|
||||||
|
|
||||||
private Integer payment; |
|
||||||
|
|
||||||
private String addressId; |
|
||||||
|
|
||||||
private String detailAddress; |
|
||||||
|
|
||||||
private Integer state; |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,27 +0,0 @@ |
|||||||
package com.cloud.kicc.system.api.entity; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId; |
|
||||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||||
import com.cloud.kicc.common.data.entity.TreeEntity; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import lombok.experimental.Accessors; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 项目 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 9:27 2022/3/24 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = false) |
|
||||||
@Accessors(chain = true) |
|
||||||
@TableName(value="sys_project_manager") |
|
||||||
public class ProjectManager extends TreeEntity<ProjectManager> { |
|
||||||
|
|
||||||
@TableId |
|
||||||
private String id; |
|
||||||
|
|
||||||
private String code; |
|
||||||
|
|
||||||
} |
|
@ -1,48 +0,0 @@ |
|||||||
package com.cloud.kicc.system.api.entity; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId; |
|
||||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||||
import com.cloud.kicc.common.data.entity.CommonEntity; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import lombok.experimental.Accessors; |
|
||||||
|
|
||||||
/** |
|
||||||
*<p> |
|
||||||
* 快捷方式对象 Shortcut |
|
||||||
*</p> |
|
||||||
* |
|
||||||
* @Author: entfrm开发团队-王翔 |
|
||||||
* @Date: 2022/2/24 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = false) |
|
||||||
@Accessors(chain = true) |
|
||||||
@TableName("sys_shortcut") |
|
||||||
public class Shortcut extends CommonEntity { |
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
/** 编号 */ |
|
||||||
@TableId |
|
||||||
private String id; |
|
||||||
|
|
||||||
/** 名称 */ |
|
||||||
private String name; |
|
||||||
|
|
||||||
/** 区域 */ |
|
||||||
private String region; |
|
||||||
|
|
||||||
/** 图标 */ |
|
||||||
private String icon; |
|
||||||
|
|
||||||
/** 背景颜色 */ |
|
||||||
private String bgColor; |
|
||||||
|
|
||||||
/** 路径 */ |
|
||||||
private String path; |
|
||||||
|
|
||||||
/** 顺序 */ |
|
||||||
private Integer sort; |
|
||||||
|
|
||||||
} |
|
@ -1,103 +0,0 @@ |
|||||||
package com.cloud.kicc.system.controller; |
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil; |
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
||||||
import com.cloud.kicc.system.api.entity.Address; |
|
||||||
import com.cloud.kicc.system.service.AddressService; |
|
||||||
import com.cloud.kicc.common.core.api.R; |
|
||||||
import com.cloud.kicc.common.core.constant.AppConstants; |
|
||||||
import io.swagger.annotations.Api; |
|
||||||
import lombok.RequiredArgsConstructor; |
|
||||||
import org.springframework.web.bind.annotation.*; |
|
||||||
|
|
||||||
import java.util.Arrays; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 地址管理 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 10:22 2022/3/21 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@RequiredArgsConstructor |
|
||||||
@RequestMapping(AppConstants.APP_SYSTEM + "/address") |
|
||||||
@Api(value = "app", tags = "地址管理模块") |
|
||||||
public class AddressController { |
|
||||||
|
|
||||||
private final AddressService addressService; |
|
||||||
|
|
||||||
/** |
|
||||||
* 新增节点 |
|
||||||
* @param address 节点dto |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/add") |
|
||||||
public R add(@RequestBody Address address){ |
|
||||||
addressService.save(address); |
|
||||||
return R.ok(address); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 修改节点 |
|
||||||
* @param address 修改对象 |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PutMapping("/update") |
|
||||||
public R update(@RequestBody Address address){ |
|
||||||
addressService.updateById(address); |
|
||||||
return R.ok(address); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 删除地址节点 |
|
||||||
* @param ids 节点id |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@DeleteMapping("/remove/{ids}") |
|
||||||
public R remove(@PathVariable("ids") String[] ids){ |
|
||||||
addressService.removeBatchByIds(Arrays.asList(ids)); |
|
||||||
return R.ok(); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询根据id |
|
||||||
* @param id |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@GetMapping("/query/{id}") |
|
||||||
public R getById(@PathVariable("id") String id) { |
|
||||||
return R.ok(addressService.getById(id)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询根据条件 |
|
||||||
* @param address |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@GetMapping("/list") |
|
||||||
public R list(Address address) { |
|
||||||
List<Address> addressList = addressService.list(getQueryWrapper(address)); |
|
||||||
if (addressList.size() > 0) { |
|
||||||
for (Address address1 : addressList) { |
|
||||||
if (StrUtil.isNotBlank(address.getName())) { |
|
||||||
address1.setParentId("0"); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
return R.ok(addressList, addressList.size()); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
private QueryWrapper<Address> getQueryWrapper(Address address) { |
|
||||||
return new QueryWrapper<Address>() |
|
||||||
.like(StrUtil.isNotBlank(address.getName()), "name", address.getName()) |
|
||||||
.between(!StrUtil.hasBlank(address.getBeginTime(),address.getEndTime()),"create_time", |
|
||||||
address.getBeginTime(), |
|
||||||
address.getEndTime()) |
|
||||||
.eq(StrUtil.isNotBlank(address.getCode()),"code", address.getCode()) |
|
||||||
.orderByAsc("sort"); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,100 +0,0 @@ |
|||||||
package com.cloud.kicc.system.controller; |
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil; |
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
||||||
import com.cloud.kicc.system.api.entity.Hospital; |
|
||||||
import com.cloud.kicc.system.service.HospitalService; |
|
||||||
import com.cloud.kicc.common.core.api.R; |
|
||||||
import com.cloud.kicc.common.core.constant.AppConstants; |
|
||||||
import io.swagger.annotations.Api; |
|
||||||
import lombok.RequiredArgsConstructor; |
|
||||||
import org.springframework.web.bind.annotation.*; |
|
||||||
|
|
||||||
import java.util.Arrays; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 15:32 2022/3/24 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@RequiredArgsConstructor |
|
||||||
@RequestMapping(AppConstants.APP_SYSTEM + "/hospital") |
|
||||||
@Api(value = "app", tags = "医院管理模块") |
|
||||||
public class HospitalController { |
|
||||||
|
|
||||||
private final HospitalService hospitalService; |
|
||||||
|
|
||||||
/** |
|
||||||
* 新增节点 |
|
||||||
* @param hospital 节点dto |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/add") |
|
||||||
public R add(@RequestBody Hospital hospital){ |
|
||||||
hospitalService.save(hospital); |
|
||||||
return R.ok(hospital); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 修改节点 |
|
||||||
* @param hospital 修改对象 |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PutMapping("/update") |
|
||||||
public R update(@RequestBody Hospital hospital){ |
|
||||||
hospitalService.updateById(hospital); |
|
||||||
return R.ok(hospital); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 删除节点 |
|
||||||
* @param ids 节点id |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@DeleteMapping("/remove/{ids}") |
|
||||||
public R remove(@PathVariable("ids") String[] ids){ |
|
||||||
hospitalService.removeBatchByIds(Arrays.asList(ids)); |
|
||||||
return R.ok(); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询根据id |
|
||||||
* @param id |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@GetMapping("/query/{id}") |
|
||||||
public R getById(@PathVariable("id") String id) { |
|
||||||
return R.ok(hospitalService.getById(id)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询根据条件 |
|
||||||
* @param hospital |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@GetMapping("/list") |
|
||||||
public R list(Hospital hospital) { |
|
||||||
List<Hospital> hospitalList = hospitalService.list(getQueryWrapper(hospital)); |
|
||||||
return R.ok(hospitalList, hospitalList.size()); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
private QueryWrapper<Hospital> getQueryWrapper(Hospital hospital) { |
|
||||||
return new QueryWrapper<Hospital>() |
|
||||||
.like(StrUtil.isNotBlank(hospital.getName()), "name", hospital.getName()) |
|
||||||
.like(StrUtil.isNotBlank(hospital.getContactsName()), "contacts_name", hospital.getContactsName()) |
|
||||||
.like(StrUtil.isNotBlank(hospital.getContactsTel()), "contacts_tel", hospital.getContactsTel()) |
|
||||||
.like(StrUtil.isNotBlank(hospital.getContactsTitle()), "contacts_title", hospital.getContactsTitle()) |
|
||||||
.like(StrUtil.isNotBlank(hospital.getDetailAddress()), "detail_address", hospital.getDetailAddress()) |
|
||||||
.between(!StrUtil.hasBlank(hospital.getBeginTime(),hospital.getEndTime()),"create_time", |
|
||||||
hospital.getBeginTime(), |
|
||||||
hospital.getEndTime()) |
|
||||||
.orderByAsc("create_time"); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,102 +0,0 @@ |
|||||||
package com.cloud.kicc.system.controller; |
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil; |
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
||||||
import com.cloud.kicc.system.api.entity.ProjectManager; |
|
||||||
import com.cloud.kicc.system.service.ProjectManagerService; |
|
||||||
import com.cloud.kicc.common.core.api.R; |
|
||||||
import com.cloud.kicc.common.core.constant.AppConstants; |
|
||||||
import io.swagger.annotations.Api; |
|
||||||
import lombok.RequiredArgsConstructor; |
|
||||||
import org.springframework.web.bind.annotation.*; |
|
||||||
|
|
||||||
import java.util.Arrays; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 项目管理api |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 9:36 2022/3/24 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@RequiredArgsConstructor |
|
||||||
@RequestMapping(AppConstants.APP_SYSTEM + "/projectManager") |
|
||||||
@Api(value = "app", tags = "项目管理模块") |
|
||||||
public class ProjectManagerController { |
|
||||||
|
|
||||||
private final ProjectManagerService projectManagerService; |
|
||||||
|
|
||||||
/** |
|
||||||
* 新增节点 |
|
||||||
* @param projectManager 节点dto |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/add") |
|
||||||
public R add(@RequestBody ProjectManager projectManager){ |
|
||||||
projectManagerService.save(projectManager); |
|
||||||
return R.ok(projectManager); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 修改节点 |
|
||||||
* @param projectManager 修改对象 |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PutMapping("/update") |
|
||||||
public R update(@RequestBody ProjectManager projectManager){ |
|
||||||
projectManagerService.updateById(projectManager); |
|
||||||
return R.ok(projectManager); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 删除节点 |
|
||||||
* @param ids 节点id |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@DeleteMapping("/remove/{ids}") |
|
||||||
public R remove(@PathVariable("ids") String[] ids){ |
|
||||||
projectManagerService.removeBatchByIds(Arrays.asList(ids)); |
|
||||||
return R.ok(); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询根据id |
|
||||||
* @param id |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@GetMapping("/query/{id}") |
|
||||||
public R getById(@PathVariable("id") String id) { |
|
||||||
return R.ok(projectManagerService.getById(id)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询根据条件 |
|
||||||
* @param projectManager |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@GetMapping("/list") |
|
||||||
public R list(ProjectManager projectManager) { |
|
||||||
List<ProjectManager> projectList = projectManagerService.list(getQueryWrapper(projectManager)); |
|
||||||
if (projectList.size() > 0) { |
|
||||||
for (ProjectManager project1 : projectList) { |
|
||||||
if (StrUtil.isNotBlank(projectManager.getName())) { |
|
||||||
project1.setParentId("0"); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
return R.ok(projectList, projectList.size()); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
private QueryWrapper<ProjectManager> getQueryWrapper(ProjectManager projectManager) { |
|
||||||
return new QueryWrapper<ProjectManager>() |
|
||||||
.like(StrUtil.isNotBlank(projectManager.getName()), "name", projectManager.getName()) |
|
||||||
.between(!StrUtil.hasBlank(projectManager.getBeginTime(),projectManager.getEndTime()),"create_time", |
|
||||||
projectManager.getBeginTime(), |
|
||||||
projectManager.getEndTime()) |
|
||||||
.eq(StrUtil.isNotBlank(projectManager.getCode()),"code", projectManager.getCode()) |
|
||||||
.orderByAsc("sort"); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,83 +0,0 @@ |
|||||||
package com.cloud.kicc.system.controller; |
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil; |
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
||||||
import com.cloud.kicc.system.api.entity.Shortcut; |
|
||||||
import com.cloud.kicc.system.service.ShortcutService; |
|
||||||
import com.cloud.kicc.common.core.api.R; |
|
||||||
import com.cloud.kicc.common.core.constant.AppConstants; |
|
||||||
import com.cloud.kicc.common.log.annotation.SysLog; |
|
||||||
import lombok.AllArgsConstructor; |
|
||||||
import org.springframework.security.access.prepost.PreAuthorize; |
|
||||||
import org.springframework.web.bind.annotation.*; |
|
||||||
|
|
||||||
import java.util.Arrays; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
*<p> |
|
||||||
* 快捷方式Controller |
|
||||||
*</p> |
|
||||||
* |
|
||||||
* @Author: entfrm开发团队-王翔 |
|
||||||
* @Date: 2022/2/24 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@AllArgsConstructor |
|
||||||
@RequestMapping(AppConstants.APP_SYSTEM + "/shortcut") |
|
||||||
public class ShortcutController { |
|
||||||
|
|
||||||
private final ShortcutService shortcutService; |
|
||||||
|
|
||||||
private QueryWrapper<Shortcut> getQueryWrapper(Shortcut shortcut) { |
|
||||||
return new QueryWrapper<Shortcut>() |
|
||||||
.like(StrUtil.isNotBlank(shortcut.getName()), "name", shortcut.getName()) |
|
||||||
.eq(StrUtil.isNotBlank(shortcut.getRegion()), "region", shortcut.getRegion()) |
|
||||||
.orderByAsc("sort"); |
|
||||||
} |
|
||||||
|
|
||||||
@GetMapping("/list") |
|
||||||
@PreAuthorize("@pms.hasPermission('shortcut_view')") |
|
||||||
public R list(Page page, Shortcut shortcut) { |
|
||||||
IPage<Shortcut> shortcutPage = shortcutService.page(page, getQueryWrapper(shortcut)); |
|
||||||
return R.ok(shortcutPage.getRecords(), shortcutPage.getTotal()); |
|
||||||
} |
|
||||||
|
|
||||||
@GetMapping("/shortcutList") |
|
||||||
@PreAuthorize("@pms.hasPermission('shortcut_view')") |
|
||||||
public R shortcutList(Shortcut shortcut) { |
|
||||||
List<Shortcut> shortcutList = shortcutService.list(getQueryWrapper(shortcut)); |
|
||||||
return R.ok(shortcutList); |
|
||||||
} |
|
||||||
|
|
||||||
@GetMapping("/{id:\\w+}") |
|
||||||
public R getById(@PathVariable String id) { |
|
||||||
return R.ok(shortcutService.getById(id)); |
|
||||||
} |
|
||||||
|
|
||||||
@SysLog("快捷方式新增") |
|
||||||
@PostMapping("/save") |
|
||||||
@PreAuthorize("@pms.hasPermission('shortcut_add')") |
|
||||||
public R save(@RequestBody Shortcut shortcut) { |
|
||||||
shortcutService.saveOrUpdate(shortcut); |
|
||||||
return R.ok(); |
|
||||||
} |
|
||||||
|
|
||||||
@SysLog("快捷方式修改") |
|
||||||
@PutMapping("/update") |
|
||||||
@PreAuthorize("@pms.hasPermission('shortcut_edit')") |
|
||||||
public R update(@RequestBody Shortcut shortcut) { |
|
||||||
shortcutService.updateById(shortcut); |
|
||||||
return R.ok(); |
|
||||||
} |
|
||||||
|
|
||||||
@SysLog("快捷方式删除") |
|
||||||
@DeleteMapping("/remove/{id:[\\w,]+}") |
|
||||||
@PreAuthorize("@pms.hasPermission('shortcut_del')") |
|
||||||
public R remove(@PathVariable String[] id) { |
|
||||||
return R.ok(shortcutService.removeByIds(Arrays.asList(id))); |
|
||||||
} |
|
||||||
} |
|
@ -1,14 +0,0 @@ |
|||||||
package com.cloud.kicc.system.mapper; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||||
import com.cloud.kicc.system.api.entity.Address; |
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 11:07 2022/3/21 |
|
||||||
*/ |
|
||||||
public interface AddressMapper extends BaseMapper<Address> { |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,13 +0,0 @@ |
|||||||
package com.cloud.kicc.system.mapper; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||||
import com.cloud.kicc.system.api.entity.Hospital; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 医院管理 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 15:28 2022/3/24 |
|
||||||
*/ |
|
||||||
public interface HospitalMapper extends BaseMapper<Hospital> { |
|
||||||
} |
|
@ -1,15 +0,0 @@ |
|||||||
package com.cloud.kicc.system.mapper; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||||
import com.cloud.kicc.system.api.entity.ProjectManager; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 9:32 2022/3/24 |
|
||||||
*/ |
|
||||||
public interface ProjectManagerMapper extends BaseMapper<ProjectManager> { |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,16 +0,0 @@ |
|||||||
package com.cloud.kicc.system.mapper; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||||
import com.cloud.kicc.system.api.entity.Shortcut; |
|
||||||
|
|
||||||
/** |
|
||||||
*<p> |
|
||||||
* 快捷方式Mapper接口 |
|
||||||
*</p> |
|
||||||
* |
|
||||||
* @Author: entfrm开发团队-王翔 |
|
||||||
* @Date: 2022/2/24 |
|
||||||
*/ |
|
||||||
public interface ShortcutMapper extends BaseMapper<Shortcut>{ |
|
||||||
|
|
||||||
} |
|
@ -1,15 +0,0 @@ |
|||||||
package com.cloud.kicc.system.service; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService; |
|
||||||
import com.cloud.kicc.system.api.entity.Address; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 10:23 2022/3/21 |
|
||||||
*/ |
|
||||||
public interface AddressService extends IService<Address> { |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,13 +0,0 @@ |
|||||||
package com.cloud.kicc.system.service; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService; |
|
||||||
import com.cloud.kicc.system.api.entity.Hospital; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 医院管理 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 15:29 2022/3/24 |
|
||||||
*/ |
|
||||||
public interface HospitalService extends IService<Hospital> { |
|
||||||
} |
|
@ -1,15 +0,0 @@ |
|||||||
package com.cloud.kicc.system.service; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService; |
|
||||||
import com.cloud.kicc.system.api.entity.ProjectManager; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 项目业务 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 9:32 2022/3/24 |
|
||||||
*/ |
|
||||||
public interface ProjectManagerService extends IService<ProjectManager> { |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,16 +0,0 @@ |
|||||||
package com.cloud.kicc.system.service; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService; |
|
||||||
import com.cloud.kicc.system.api.entity.Shortcut; |
|
||||||
|
|
||||||
/** |
|
||||||
*<p> |
|
||||||
* 快捷方式Service接口 |
|
||||||
*</p> |
|
||||||
* |
|
||||||
* @Author: entfrm开发团队-王翔 |
|
||||||
* @Date: 2022/2/24 |
|
||||||
*/ |
|
||||||
public interface ShortcutService extends IService<Shortcut> { |
|
||||||
|
|
||||||
} |
|
@ -1,24 +0,0 @@ |
|||||||
package com.cloud.kicc.system.service.impl; |
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
||||||
import com.cloud.kicc.system.api.entity.Address; |
|
||||||
import com.cloud.kicc.system.mapper.AddressMapper; |
|
||||||
import com.cloud.kicc.system.service.AddressService; |
|
||||||
import lombok.RequiredArgsConstructor; |
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 地址管理业务实现 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 10:24 2022/3/21 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
@RequiredArgsConstructor |
|
||||||
@Slf4j |
|
||||||
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService { |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,18 +0,0 @@ |
|||||||
package com.cloud.kicc.system.service.impl; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
||||||
import com.cloud.kicc.system.api.entity.Hospital; |
|
||||||
import com.cloud.kicc.system.mapper.HospitalMapper; |
|
||||||
import com.cloud.kicc.system.service.HospitalService; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: 医院管理 |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 15:30 2022/3/24 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> implements HospitalService { |
|
||||||
|
|
||||||
} |
|
@ -1,19 +0,0 @@ |
|||||||
package com.cloud.kicc.system.service.impl; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
||||||
import com.cloud.kicc.system.api.entity.ProjectManager; |
|
||||||
import com.cloud.kicc.system.mapper.ProjectManagerMapper; |
|
||||||
import com.cloud.kicc.system.service.ProjectManagerService; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Author: TangSheng |
|
||||||
* @Description: |
|
||||||
* @Since 1.0 |
|
||||||
* @Date Created in 9:35 2022/3/24 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
public class ProjectManagerServiceImpl extends ServiceImpl<ProjectManagerMapper, ProjectManager> implements ProjectManagerService { |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,20 +0,0 @@ |
|||||||
package com.cloud.kicc.system.service.impl; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
||||||
import com.cloud.kicc.system.api.entity.Shortcut; |
|
||||||
import com.cloud.kicc.system.mapper.ShortcutMapper; |
|
||||||
import com.cloud.kicc.system.service.ShortcutService; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
|
|
||||||
/** |
|
||||||
*<p> |
|
||||||
* 快捷方式Service业务层 |
|
||||||
*</p> |
|
||||||
* |
|
||||||
* @Author: entfrm开发团队-王翔 |
|
||||||
* @Date: 2022/2/24 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
public class ShortcutServiceImpl extends ServiceImpl<ShortcutMapper, Shortcut> implements ShortcutService { |
|
||||||
|
|
||||||
} |
|
@ -1,4 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8" ?> |
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
|
||||||
<mapper namespace="com.cloud.kicc.system.mapper.AddressMapper"> |
|
||||||
</mapper> |
|
@ -1,4 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8" ?> |
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
|
||||||
<mapper namespace="com.cloud.kicc.system.mapper.HospitalMapper"> |
|
||||||
</mapper> |
|
@ -1,4 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8" ?> |
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
|
||||||
<mapper namespace="com.cloud.kicc.system.mapper.ProjectManagerMapper"> |
|
||||||
</mapper> |
|
@ -1,24 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8" ?> |
|
||||||
<!DOCTYPE mapper |
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
||||||
<mapper namespace="com.cloud.kicc.system.mapper.ShortcutMapper"> |
|
||||||
|
|
||||||
<resultMap type="Shortcut" id="ShortcutResult"> |
|
||||||
<result property="id" column="id"/> |
|
||||||
<result property="name" column="name"/> |
|
||||||
<result property="region" column="region"/> |
|
||||||
<result property="icon" column="icon"/> |
|
||||||
<result property="path" column="path"/> |
|
||||||
<result property="sort" column="sort"/> |
|
||||||
<result property="createById" column="create_by_id"/> |
|
||||||
<result property="createByName" column="create_by_name"/> |
|
||||||
<result property="createTime" column="create_time"/> |
|
||||||
<result property="updateById" column="update_by_id"/> |
|
||||||
<result property="updateByName" column="update_by_name"/> |
|
||||||
<result property="updateTime" column="update_time"/> |
|
||||||
<result property="remarks" column="remarks"/> |
|
||||||
<result property="delFlag" column="del_flag"/> |
|
||||||
</resultMap> |
|
||||||
|
|
||||||
</mapper> |
|
@ -1,9 +1,16 @@ |
|||||||
export interface BasicPageParams { |
|
||||||
page: number; |
/** 对应后端的Page */ |
||||||
pageSize: number; |
export interface Page { |
||||||
|
size: number; |
||||||
|
current: number; |
||||||
|
total: number; |
||||||
|
[key: string]: any; |
||||||
} |
} |
||||||
|
|
||||||
export interface BasicFetchResult<T extends any> { |
/** 对应后端的R */ |
||||||
items: T[]; |
export interface R<T extends any> { |
||||||
|
code: number; |
||||||
|
msg: string; |
||||||
total: number; |
total: number; |
||||||
|
data: T; |
||||||
} |
} |
||||||
|
@ -1,29 +1,24 @@ |
|||||||
// 引入基础包
|
// 引入基础包
|
||||||
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; |
import { Page, R } from '/@/api/model/baseModel'; |
||||||
|
|
||||||
// 定义查询参数
|
// 查询参数
|
||||||
export type MenuVO = BasicPageParams & { |
export type MenuDto = Page & Menu; |
||||||
name?: string; |
|
||||||
path?: string; |
|
||||||
}; |
|
||||||
|
|
||||||
// 定义菜单对象
|
// 菜单对象
|
||||||
export interface Menu { |
export interface Menu { |
||||||
id: string; |
id: string; |
||||||
name: string; |
name: string; |
||||||
permission: string; |
parentId: string; |
||||||
|
type: string; |
||||||
path: string; |
path: string; |
||||||
component: string; |
component: string; |
||||||
parentId: string; |
permission: string; |
||||||
icon: string; |
icon: string; |
||||||
sort: string; |
|
||||||
keepAlive: string; |
keepAlive: string; |
||||||
type: string; |
hideMenu: string; |
||||||
hidden: string; |
sort: string; |
||||||
target: string; |
[key: string]: any; |
||||||
status: number; |
|
||||||
menu: []; |
|
||||||
} |
} |
||||||
|
|
||||||
// 根据菜单对象生成响应模型
|
// 响应模型
|
||||||
export type MenuDTO = BasicFetchResult<Menu>; |
export type MenuVo = R<Menu[]>; |
||||||
|
@ -1,37 +1,25 @@ |
|||||||
// 引入基础包
|
// 引入基础包
|
||||||
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; |
import { Page, R } from '/@/api/model/baseModel'; |
||||||
|
|
||||||
// 定义查询参数
|
// 查询参数
|
||||||
export type RoleVO = BasicPageParams & { |
export type RoleDto = Page & Role; |
||||||
id?: string; |
|
||||||
roleName?: string; |
|
||||||
}; |
|
||||||
|
|
||||||
// 定义角色对象
|
// 角色对象
|
||||||
export interface Role { |
export interface Role { |
||||||
id: string; |
id: string; |
||||||
roleName: string; |
name: string; |
||||||
roleCode: string; |
code: string; |
||||||
description: string; |
|
||||||
sort: string; |
sort: string; |
||||||
status: string; |
status: string; |
||||||
} |
createById: string; |
||||||
|
createByName: string; |
||||||
// 根据角色对象生成响应模型
|
|
||||||
export type RoleDTO = BasicFetchResult<Role>; |
|
||||||
|
|
||||||
export type MenuParams = { |
|
||||||
menuName?: string; |
|
||||||
status?: string; |
|
||||||
}; |
|
||||||
|
|
||||||
export interface MenuListItem { |
|
||||||
id: string; |
|
||||||
createTime: string; |
createTime: string; |
||||||
status: number; |
updateById: string; |
||||||
icon: string; |
updateByName: string; |
||||||
component: string; |
updateTime: string; |
||||||
permission: string; |
remarks: string; |
||||||
|
[key: string]: any; |
||||||
} |
} |
||||||
|
|
||||||
export type MenuListGetResultModel = BasicFetchResult<MenuListItem>; |
// 响应模型
|
||||||
|
export type RoleVo = R<Role[]>; |
||||||
|
@ -1,31 +1,29 @@ |
|||||||
import { Role, RoleVO, RoleDTO, MenuParams, MenuListGetResultModel } from './model/roleModel'; |
import { Role, RoleVo, RoleDto } from './model/roleModel'; |
||||||
import { defHttp } from '/@/utils/http/axios'; |
import { defHttp } from '/@/utils/http/axios'; |
||||||
|
|
||||||
enum Api { |
enum Api { |
||||||
Page = '/mate-system/role/page', |
list = 'system_proxy/system/role/list', |
||||||
Set = '/mate-system/role/set', |
add = 'system_proxy/system/role/save', |
||||||
Del = '/mate-system/role/delete', |
get = 'system_proxy/system/role', |
||||||
SetStatus = '/mate-system/role/set-status', |
edit = 'system_proxy/system/role/update', |
||||||
AllList = '/mate-system/role/all-list', |
del = 'system_proxy/system/role/remove', |
||||||
MenuList = '/mate-system/menu/list', |
changeStatus = 'system_proxy/system/role/changeStatus' |
||||||
} |
} |
||||||
|
|
||||||
// 菜单树
|
// 查询角色列表
|
||||||
export const rolePage = (params?: RoleVO) => defHttp.get<RoleDTO>({ url: Api.Page, params }); |
export const listRole = (params?: RoleDto) => defHttp.get<RoleVo>({ url: Api.list, params }); |
||||||
|
|
||||||
// 保存
|
// 新增角色
|
||||||
export const roleSet = (params: Role) => defHttp.post<Role>({ url: Api.Set, params }); |
export const addRole = (params: Role) => defHttp.post({ url: Api.add, data: params }); |
||||||
|
|
||||||
// 删除
|
// 修改角色
|
||||||
export const roleDel = (params: { ids: String }) => |
export const editRole = (params: Role) => defHttp.put({ url: Api.edit, data: params }); |
||||||
defHttp.post<boolean>({ url: Api.Del + `?ids=${params.ids}` }); |
|
||||||
|
|
||||||
// 设置状态
|
// 查询角色详细
|
||||||
export const roleSetStatus = (id: number, status: string) => |
export const getRole = (params: { id: String }) => defHttp.get<Role>({ url: `${Api.get}/${params.id}` }); |
||||||
defHttp.post({ url: Api.SetStatus, params: { id, status } }); |
|
||||||
|
|
||||||
// 查询所有角色列表
|
// 删除角色
|
||||||
export const roleAllList = (params?: RoleVO) => defHttp.get<RoleDTO>({ url: Api.AllList, params }); |
export const delRole = (params: { id: String }) => defHttp.delete({ url: `${Api.del}/${params.id}` }); |
||||||
|
|
||||||
export const getMenuList = (params?: MenuParams) => |
// 修改角色状态
|
||||||
defHttp.get<MenuListGetResultModel>({ url: Api.MenuList, params }); |
export const roleSetStatus = (params: Role) => defHttp.post({ url: Api.changeStatus, data: params }); |
||||||
|
@ -1,99 +1,118 @@ |
|||||||
<template> |
<template> |
||||||
<div> |
<div> |
||||||
<BasicTable @register="registerTable"> |
<BasicTable @register="registerTable" @selection-change="handleSelectionChange"> |
||||||
<template #toolbar> |
<template #toolbar> |
||||||
<a-button type="primary" @click="handleCreate"> 新增角色 </a-button> |
<a-button v-auth="['role_add']" |
||||||
|
type="primary" |
||||||
|
@click="handleAdd()" |
||||||
|
>新增角色</a-button> |
||||||
|
<a-button v-auth="['role_add']" |
||||||
|
type="primary" |
||||||
|
:disabled="state.single" |
||||||
|
@click="handleAdd()" |
||||||
|
>修改角色</a-button> |
||||||
|
<a-button v-auth="['role_add']" |
||||||
|
type="primary" |
||||||
|
:disabled="state.multiple" |
||||||
|
@click="handleAdd()" |
||||||
|
>删除角色</a-button> |
||||||
</template> |
</template> |
||||||
<template #action="{ record }"> |
<template #action="{ record }"> |
||||||
<TableAction |
<TableAction :actions="[ |
||||||
:actions="[ |
{ |
||||||
{ |
label: '编辑', |
||||||
icon: 'clarity:note-edit-line', |
icon: 'fa6-regular:pen-to-square', |
||||||
onClick: handleEdit.bind(null, record), |
auth: ['menu_edit'], |
||||||
|
onClick: handleEdit.bind(null, record) |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '删除', |
||||||
|
icon: 'ant-design:delete-outlined', |
||||||
|
auth: ['menu_del'], |
||||||
|
color: 'error', |
||||||
|
popConfirm: { |
||||||
|
title: '是否确认删除', |
||||||
|
confirm: handleDel.bind(null, record), |
||||||
}, |
}, |
||||||
{ |
}]" |
||||||
icon: 'ant-design:delete-outlined', |
|
||||||
color: 'error', |
|
||||||
popConfirm: { |
|
||||||
title: '是否确认删除', |
|
||||||
confirm: handleDelete.bind(null, record), |
|
||||||
}, |
|
||||||
}, |
|
||||||
]" |
|
||||||
/> |
/> |
||||||
</template> |
</template> |
||||||
</BasicTable> |
</BasicTable> |
||||||
<RoleDrawer @register="registerDrawer" @success="handleSuccess" /> |
<RoleDrawer @register="registerDrawer" @success="handleSuccess"/> |
||||||
</div> |
</div> |
||||||
</template> |
</template> |
||||||
<script lang="ts"> |
<script lang="ts" setup> |
||||||
import { defineComponent } from 'vue'; |
/** |
||||||
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||||
|
* author entfrm开发团队-王翔 |
||||||
|
*/ |
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
||||||
import { roleDel, rolePage } from '/@/api/system/role'; |
import { listRole, delRole } from '/@/api/system/role'; |
||||||
import { useDrawer } from '/@/components/Drawer'; |
import { useDrawer } from '/@/components/Drawer'; |
||||||
import RoleDrawer from './RoleDrawer.vue'; |
import RoleDrawer from './RoleDrawer.vue'; |
||||||
import { columns, searchFormSchema } from './role.data'; |
import { columns, searchFormSchema } from './role.data'; |
||||||
import { useMessage } from '/@/hooks/web/useMessage'; |
import { useMessage } from '/@/hooks/web/useMessage'; |
||||||
|
import { reactive } from 'vue'; |
||||||
|
|
||||||
|
const state = reactive({ |
||||||
|
// 选中数组 |
||||||
|
ids: [], |
||||||
|
// 非单个禁用 |
||||||
|
single: true, |
||||||
|
// 非多个禁用 |
||||||
|
multiple: true |
||||||
|
}); |
||||||
const { createMessage } = useMessage(); |
const { createMessage } = useMessage(); |
||||||
|
const [registerDrawer, { openDrawer }] = useDrawer(); |
||||||
|
const [registerTable, { reload }] = useTable({ |
||||||
|
title: '角色列表', |
||||||
|
api: listRole, |
||||||
|
columns, |
||||||
|
formConfig: { |
||||||
|
labelWidth: 120, |
||||||
|
schemas: searchFormSchema |
||||||
|
}, |
||||||
|
useSearchForm: true, |
||||||
|
showTableSetting: true, |
||||||
|
bordered: true, |
||||||
|
rowSelection: { type: 'checkbox' }, |
||||||
|
showIndexColumn: false, |
||||||
|
actionColumn: { |
||||||
|
width: 220, |
||||||
|
title: '操作', |
||||||
|
dataIndex: 'action', |
||||||
|
slots: { customRender: 'action' }, |
||||||
|
fixed: false |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
export default defineComponent({ |
/** 处理多选框选中数据 */ |
||||||
name: 'RoleManagement', |
function handleSelectionChange(selection) { |
||||||
components: { BasicTable, RoleDrawer, TableAction }, |
state.ids = selection.map(item => item.id); |
||||||
setup() { |
state.single = selection.length != 1; |
||||||
const [registerDrawer, { openDrawer }] = useDrawer(); |
state.multiple = !selection.length; |
||||||
const [registerTable, { reload }] = useTable({ |
} |
||||||
title: '角色列表', |
|
||||||
api: rolePage, |
|
||||||
columns, |
|
||||||
formConfig: { |
|
||||||
labelWidth: 120, |
|
||||||
schemas: searchFormSchema, |
|
||||||
}, |
|
||||||
useSearchForm: true, |
|
||||||
showTableSetting: true, |
|
||||||
bordered: true, |
|
||||||
showIndexColumn: false, |
|
||||||
actionColumn: { |
|
||||||
width: 80, |
|
||||||
title: '操作', |
|
||||||
dataIndex: 'action', |
|
||||||
slots: { customRender: 'action' }, |
|
||||||
fixed: undefined, |
|
||||||
}, |
|
||||||
}); |
|
||||||
|
|
||||||
function handleCreate() { |
/** 新增按钮操作,行内新增与工具栏局域新增通用 */ |
||||||
openDrawer(true, { |
function handleAdd(record?: Recordable) { |
||||||
isUpdate: false, |
openDrawer(true,{ _tag: 'add', record }); |
||||||
}); |
} |
||||||
} |
|
||||||
|
|
||||||
function handleEdit(record: Recordable) { |
/** 编辑按钮操作,行内编辑 */ |
||||||
openDrawer(true, { |
function handleEdit(record: Recordable) { |
||||||
record, |
openDrawer(true, { _tag: 'edit', record }); |
||||||
isUpdate: true, |
} |
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) { |
/** 删除按钮操作,行内删除 */ |
||||||
await roleDel({ ids: record.id }); |
async function handleDel(record: Recordable) { |
||||||
createMessage.success('删除成功!'); |
await delRole({ id: record.id }); |
||||||
handleSuccess(); |
createMessage.success('删除成功!'); |
||||||
} |
handleSuccess(); |
||||||
|
} |
||||||
|
|
||||||
function handleSuccess() { |
/** 处理表单提交成功 */ |
||||||
reload(); |
function handleSuccess() { |
||||||
} |
reload(); |
||||||
|
} |
||||||
|
|
||||||
return { |
|
||||||
registerTable, |
|
||||||
registerDrawer, |
|
||||||
handleCreate, |
|
||||||
handleEdit, |
|
||||||
handleDelete, |
|
||||||
handleSuccess, |
|
||||||
}; |
|
||||||
}, |
|
||||||
}); |
|
||||||
</script> |
</script> |
||||||
|
Loading…
Reference in new issue