Compare commits
2 Commits
d2975044b7
...
0dc727670e
Author | SHA1 | Date |
---|---|---|
|
0dc727670e | |
|
53011db35a |
|
@ -210,7 +210,6 @@ public class LabourApiController extends BaseController {
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
SurProjectAttendanceUser surProjectAttendanceUser = list.get(0);
|
SurProjectAttendanceUser surProjectAttendanceUser = list.get(0);
|
||||||
surProjectAttendanceUser.setName(req.getName());
|
surProjectAttendanceUser.setName(req.getName());
|
||||||
surProjectAttendanceUser.setVendorsCode(VendorsCodeEnum.YANZHU.getCode());
|
|
||||||
surProjectAttendanceUser.setEthnic(req.getEthnic());
|
surProjectAttendanceUser.setEthnic(req.getEthnic());
|
||||||
surProjectAttendanceUser.setNativePlace(req.getNativePlace());
|
surProjectAttendanceUser.setNativePlace(req.getNativePlace());
|
||||||
surProjectAttendanceUser.setGender(req.getGender());
|
surProjectAttendanceUser.setGender(req.getGender());
|
||||||
|
@ -230,6 +229,7 @@ public class LabourApiController extends BaseController {
|
||||||
surProjectAttendanceUser.setEnterDate(req.getEnterDate());
|
surProjectAttendanceUser.setEnterDate(req.getEnterDate());
|
||||||
surProjectAttendanceUser.setCompanyId(req.getCompanyId());
|
surProjectAttendanceUser.setCompanyId(req.getCompanyId());
|
||||||
surProjectAttendanceUser.setCompanyName(req.getCompanyName());
|
surProjectAttendanceUser.setCompanyName(req.getCompanyName());
|
||||||
|
surProjectAttendanceUser.setLeader(req.getGroupLeader());
|
||||||
surProjectAttendanceUser.setIsDel(req.getIsDel());
|
surProjectAttendanceUser.setIsDel(req.getIsDel());
|
||||||
surProjectAttendanceUser.setUpdateBy(sysApplyConfig.getAppId());
|
surProjectAttendanceUser.setUpdateBy(sysApplyConfig.getAppId());
|
||||||
surProjectAttendanceUser.setUpdateTime(new Date());
|
surProjectAttendanceUser.setUpdateTime(new Date());
|
||||||
|
@ -238,7 +238,9 @@ public class LabourApiController extends BaseController {
|
||||||
SurProjectAttendanceUser surProjectAttendanceUser = new SurProjectAttendanceUser();
|
SurProjectAttendanceUser surProjectAttendanceUser = new SurProjectAttendanceUser();
|
||||||
surProjectAttendanceUser.setAppId(sysApplyConfig.getAppId());
|
surProjectAttendanceUser.setAppId(sysApplyConfig.getAppId());
|
||||||
surProjectAttendanceUser.setCfgid(sysApplyConfig.getCfgId());
|
surProjectAttendanceUser.setCfgid(sysApplyConfig.getCfgId());
|
||||||
|
surProjectAttendanceUser.setWorkerId(req.getWorkerId());
|
||||||
surProjectAttendanceUser.setName(req.getName());
|
surProjectAttendanceUser.setName(req.getName());
|
||||||
|
surProjectAttendanceUser.setVendorsCode(VendorsCodeEnum.YANZHU.getCode());
|
||||||
surProjectAttendanceUser.setEthnic(req.getEthnic());
|
surProjectAttendanceUser.setEthnic(req.getEthnic());
|
||||||
surProjectAttendanceUser.setNativePlace(req.getNativePlace());
|
surProjectAttendanceUser.setNativePlace(req.getNativePlace());
|
||||||
surProjectAttendanceUser.setGender(req.getGender());
|
surProjectAttendanceUser.setGender(req.getGender());
|
||||||
|
@ -251,6 +253,8 @@ public class LabourApiController extends BaseController {
|
||||||
surProjectAttendanceUser.setEnterDate(req.getEnterDate());
|
surProjectAttendanceUser.setEnterDate(req.getEnterDate());
|
||||||
surProjectAttendanceUser.setCompanyId(req.getCompanyId());
|
surProjectAttendanceUser.setCompanyId(req.getCompanyId());
|
||||||
surProjectAttendanceUser.setCompanyName(req.getCompanyName());
|
surProjectAttendanceUser.setCompanyName(req.getCompanyName());
|
||||||
|
surProjectAttendanceUser.setLeader(req.getGroupLeader());
|
||||||
|
surProjectAttendanceUser.setVendorId(0L);
|
||||||
surProjectAttendanceUser.setIsDel(req.getIsDel());
|
surProjectAttendanceUser.setIsDel(req.getIsDel());
|
||||||
surProjectAttendanceUser.setCreateBy(sysApplyConfig.getAppId());
|
surProjectAttendanceUser.setCreateBy(sysApplyConfig.getAppId());
|
||||||
surProjectAttendanceUser.setCreateTime(new Date());
|
surProjectAttendanceUser.setCreateTime(new Date());
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
package com.yanzhu.manage.api.vo;
|
|
||||||
|
|
||||||
import com.ruoyi.common.utils.AuthRsaUtils;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.sign.Md5Utils;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 劳务人员签名推送信息 请求参数
|
|
||||||
*
|
|
||||||
* @author: JiangYuQi
|
|
||||||
* @date: 2024/01/13 12:21
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Slf4j
|
|
||||||
public class LabourSignetVo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 签名
|
|
||||||
* RSA(dataMd5 + 时间戳)加密
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "签名不能为空")
|
|
||||||
private String sign;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 推送数据 明文参数
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "推送数据不能为空")
|
|
||||||
private String data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 时间戳
|
|
||||||
*/
|
|
||||||
@NotNull(message = "时间戳不能为空")
|
|
||||||
private Long timestamp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取数据签名
|
|
||||||
*
|
|
||||||
* @author: JiangYuQi
|
|
||||||
* @date: 2024/01/13 10:17
|
|
||||||
*/
|
|
||||||
public Boolean getDataSign(String privateKey) {
|
|
||||||
boolean signFlag = false;
|
|
||||||
try {
|
|
||||||
String decryptByPrivateKey = AuthRsaUtils.decryptByPrivateKey(privateKey,sign);
|
|
||||||
String privateDataStr = Md5Utils.hash(data) + timestamp;
|
|
||||||
log.info("签名值...{}",privateDataStr);
|
|
||||||
log.info("解密值...{}",decryptByPrivateKey);
|
|
||||||
if (StringUtils.equals(privateDataStr, decryptByPrivateKey)) {
|
|
||||||
signFlag = true;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
}
|
|
||||||
return signFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 效验时间签名[30分钟有效期]
|
|
||||||
*/
|
|
||||||
public Boolean checkTimestamp() {
|
|
||||||
boolean timestampFlag = true;
|
|
||||||
/**long timePoor = Math.abs(timestamp - System.currentTimeMillis());
|
|
||||||
if (timePoor < 1000 * 60 * 30) {
|
|
||||||
timestampFlag = true;
|
|
||||||
}*/
|
|
||||||
return timestampFlag;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.yanzhu.manage.api.vo;
|
package com.yanzhu.manage.api.vo;
|
||||||
|
|
||||||
|
import com.yanzhu.common.core.annotation.Excel;
|
||||||
|
|
||||||
import javax.validation.constraints.Max;
|
import javax.validation.constraints.Max;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
@ -80,6 +82,10 @@ public class LabourUserReqVo {
|
||||||
@Size(max = 64, message = "分包商名称最大64位")
|
@Size(max = 64, message = "分包商名称最大64位")
|
||||||
private String companyName;
|
private String companyName;
|
||||||
|
|
||||||
|
/** 是否班组长 */
|
||||||
|
@NotNull(message = "是否班组长")
|
||||||
|
private Integer groupLeader;
|
||||||
|
|
||||||
/** 数据是否有效 */
|
/** 数据是否有效 */
|
||||||
@NotNull(message = "数据是否有效不能为空")
|
@NotNull(message = "数据是否有效不能为空")
|
||||||
@Max(value = 1, message = "数据是否有效格式异常,0有效|1无效")
|
@Max(value = 1, message = "数据是否有效格式异常,0有效|1无效")
|
||||||
|
@ -205,6 +211,14 @@ public class LabourUserReqVo {
|
||||||
this.companyName = companyName;
|
this.companyName = companyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getGroupLeader() {
|
||||||
|
return groupLeader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupLeader(Integer groupLeader) {
|
||||||
|
this.groupLeader = groupLeader;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getIsDel() {
|
public Long getIsDel() {
|
||||||
return isDel;
|
return isDel;
|
||||||
}
|
}
|
||||||
|
@ -212,4 +226,5 @@ public class LabourUserReqVo {
|
||||||
public void setIsDel(Long isDel) {
|
public void setIsDel(Long isDel) {
|
||||||
this.isDel = isDel;
|
this.isDel = isDel;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.yanzhu.manage.controller;
|
package com.yanzhu.manage.controller;
|
||||||
|
|
||||||
|
import com.yanzhu.common.core.constant.CacheConstants;
|
||||||
import com.yanzhu.common.core.enums.ApplyCfgTypeEnum;
|
import com.yanzhu.common.core.enums.ApplyCfgTypeEnum;
|
||||||
import com.yanzhu.common.core.enums.ShiFouEnum;
|
import com.yanzhu.common.core.enums.ShiFouEnum;
|
||||||
import com.yanzhu.common.core.enums.VendorsCodeEnum;
|
import com.yanzhu.common.core.enums.VendorsCodeEnum;
|
||||||
|
@ -10,8 +11,10 @@ import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||||
import com.yanzhu.common.log.annotation.Log;
|
import com.yanzhu.common.log.annotation.Log;
|
||||||
import com.yanzhu.common.log.enums.BusinessType;
|
import com.yanzhu.common.log.enums.BusinessType;
|
||||||
|
import com.yanzhu.common.redis.service.RedisService;
|
||||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||||
import com.yanzhu.manage.domain.AttendanceCfg;
|
import com.yanzhu.manage.domain.AttendanceCfg;
|
||||||
|
import com.yanzhu.manage.domain.ProProjectInfo;
|
||||||
import com.yanzhu.manage.domain.SysApplyConfig;
|
import com.yanzhu.manage.domain.SysApplyConfig;
|
||||||
import com.yanzhu.manage.service.IAttendanceCfgService;
|
import com.yanzhu.manage.service.IAttendanceCfgService;
|
||||||
import com.yanzhu.manage.service.ISysApplyConfigService;
|
import com.yanzhu.manage.service.ISysApplyConfigService;
|
||||||
|
@ -33,6 +36,9 @@ import java.util.List;
|
||||||
@RequestMapping("/applyConfig")
|
@RequestMapping("/applyConfig")
|
||||||
public class SysApplyConfigController extends BaseController
|
public class SysApplyConfigController extends BaseController
|
||||||
{
|
{
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysApplyConfigService sysApplyConfigService;
|
private ISysApplyConfigService sysApplyConfigService;
|
||||||
|
|
||||||
|
@ -82,6 +88,9 @@ public class SysApplyConfigController extends BaseController
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SysApplyConfig sysApplyConfig)
|
public AjaxResult add(@RequestBody SysApplyConfig sysApplyConfig)
|
||||||
{
|
{
|
||||||
|
ProProjectInfo proProjectInfo = redisService.getCacheObject(CacheConstants.PRO_PROJECT+sysApplyConfig.getProjectId());
|
||||||
|
sysApplyConfig.setDeptId(proProjectInfo.getComId());
|
||||||
|
sysApplyConfig.setIsDel(ShiFouEnum.FOU.getCode());
|
||||||
if(ApplyCfgTypeEnum.LABOUR.getCode().equals(sysApplyConfig.getCfgType())){
|
if(ApplyCfgTypeEnum.LABOUR.getCode().equals(sysApplyConfig.getCfgType())){
|
||||||
AttendanceCfg attendanceCfg = new AttendanceCfg();
|
AttendanceCfg attendanceCfg = new AttendanceCfg();
|
||||||
attendanceCfg.setProjectId(sysApplyConfig.getProjectId());
|
attendanceCfg.setProjectId(sysApplyConfig.getProjectId());
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.yanzhu.manage.service.impl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||||
|
import com.yanzhu.common.core.exception.ServiceException;
|
||||||
import com.yanzhu.common.core.utils.DateUtils;
|
import com.yanzhu.common.core.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -55,6 +56,12 @@ public class AttendanceCfgServiceImpl implements IAttendanceCfgService
|
||||||
@Override
|
@Override
|
||||||
public int insertAttendanceCfg(AttendanceCfg attendanceCfg)
|
public int insertAttendanceCfg(AttendanceCfg attendanceCfg)
|
||||||
{
|
{
|
||||||
|
AttendanceCfg query = new AttendanceCfg();
|
||||||
|
query.setProjectId(attendanceCfg.getProjectId());
|
||||||
|
List<AttendanceCfg> cfgs = attendanceCfgMapper.selectAttendanceCfgList(query);
|
||||||
|
if(cfgs.size()>0){
|
||||||
|
throw new ServiceException("当前项目已配置考勤信息...");
|
||||||
|
}
|
||||||
attendanceCfg.setCreateBy(SecurityContextHolder.getUserName());
|
attendanceCfg.setCreateBy(SecurityContextHolder.getUserName());
|
||||||
attendanceCfg.setCreateTime(DateUtils.getNowDate());
|
attendanceCfg.setCreateTime(DateUtils.getNowDate());
|
||||||
return attendanceCfgMapper.insertAttendanceCfg(attendanceCfg);
|
return attendanceCfgMapper.insertAttendanceCfg(attendanceCfg);
|
||||||
|
|
|
@ -129,9 +129,9 @@ public class SysUserController extends BaseController {
|
||||||
if (StringUtils.isNull(sysUser)) {
|
if (StringUtils.isNull(sysUser)) {
|
||||||
throw new ServiceException("用户名或密码错误");
|
throw new ServiceException("用户名或密码错误");
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(sysUser.getRoles())) {
|
/**if (StringUtils.isEmpty(sysUser.getRoles())) {
|
||||||
throw new ServiceException("用户未查询到分配角色,请联系管理员!!!");
|
throw new ServiceException("用户未查询到分配角色,请联系管理员!!!");
|
||||||
}
|
}*/
|
||||||
// 重写登录方法
|
// 重写登录方法
|
||||||
if (!sysUser.isAdmin() && sysUser.getRoles().size() > 1) {
|
if (!sysUser.isAdmin() && sysUser.getRoles().size() > 1) {
|
||||||
List<SysRole> gsAdmins = sysUser.getRoles().stream().filter(role -> role.getRoleId() == 2L).collect(Collectors.toList());
|
List<SysRole> gsAdmins = sysUser.getRoles().stream().filter(role -> role.getRoleId() == 2L).collect(Collectors.toList());
|
||||||
|
|
|
@ -42,3 +42,11 @@ export function delApplyConfig(id) {
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成AppId
|
||||||
|
export function createAppId() {
|
||||||
|
return request({
|
||||||
|
url: '/manage/applyConfig/createAppId',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="88px">
|
||||||
<el-form-item label="项目名称" prop="projectName">
|
<el-form-item label="项目名称" prop="projectName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.projectName"
|
v-model="queryParams.projectName"
|
||||||
|
@ -43,26 +43,6 @@
|
||||||
v-hasPermi="['manage:applyConfig:add']"
|
v-hasPermi="['manage:applyConfig:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="Edit"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['manage:applyConfig:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['manage:applyConfig:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
|
@ -84,18 +64,40 @@
|
||||||
<dict-tag :options="sys_apply_cfg_type" :value="scope.row.cfgType"/>
|
<dict-tag :options="sys_apply_cfg_type" :value="scope.row.cfgType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="配置主键" align="center" prop="cfgId" />
|
<el-table-column label="应用AppId" align="center" prop="appId" />
|
||||||
<el-table-column label="应用主键" align="center" prop="appId" />
|
<el-table-column label="应用Secret" align="center" prop="privateKey" />
|
||||||
<el-table-column label="公钥" align="center" prop="publicKey" />
|
<el-table-column
|
||||||
<el-table-column label="私钥" align="center" prop="privateKey" />
|
label="是否启用"
|
||||||
<el-table-column label="项目主键" align="center" prop="projectId" />
|
align="center"
|
||||||
<el-table-column label="部门主键" align="center" prop="deptId" />
|
prop="isDel"
|
||||||
<el-table-column label="是否删除" align="center" prop="isDel" />
|
width="100"
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
v-hasPermi="['manage:applyConfig:edit']"
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:applyConfig:edit']">修改</el-button>
|
<el-tooltip :content="scope.row.isDel == '0' ? '启用' : '停用'" placement="top">
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:applyConfig:remove']">删除</el-button>
|
<el-switch
|
||||||
|
active-value="0"
|
||||||
|
inactive-value="1"
|
||||||
|
v-model="scope.row.isDel"
|
||||||
|
@change="setStatus($event, scope.row)"
|
||||||
|
/>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="是否启用"
|
||||||
|
align="center"
|
||||||
|
prop="isDel"
|
||||||
|
width="100"
|
||||||
|
v-notHasPermi="['manage:applyConfig:edit']"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="sys_normal_disable" :value="scope.row.isDel" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -109,10 +111,15 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改系统应用注册对话框 -->
|
<!-- 添加或修改系统应用注册对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="720px" append-to-body>
|
||||||
<el-form ref="applyConfigRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="applyConfigRef" :model="form" :rules="rules" label-width="108px">
|
||||||
|
<el-form-item label="所属项目" prop="projectId">
|
||||||
|
<el-select v-model="form.projectId" placeholder="请选择所属项目" style="width:100%;">
|
||||||
|
<el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="配置类型" prop="cfgType">
|
<el-form-item label="配置类型" prop="cfgType">
|
||||||
<el-select v-model="form.cfgType" placeholder="请选择配置类型">
|
<el-select v-model="form.cfgType" placeholder="请选择配置类型" style="width:100%">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in sys_apply_cfg_type"
|
v-for="dict in sys_apply_cfg_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -121,29 +128,11 @@
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="配置主键" prop="cfgId">
|
<el-form-item label="应用AppId" prop="appId">
|
||||||
<el-input v-model="form.cfgId" placeholder="请输入配置主键" />
|
<el-input v-model="form.appId" disabled placeholder="请输入应用AppId" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="应用主键" prop="appId">
|
<el-form-item label="应用Secret" prop="privateKey">
|
||||||
<el-input v-model="form.appId" placeholder="请输入应用主键" />
|
<el-input v-model="form.privateKey" type="textarea" disabled placeholder="保存后系统自动生成应用Secret" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="公钥" prop="publicKey">
|
|
||||||
<el-input v-model="form.publicKey" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="私钥" prop="privateKey">
|
|
||||||
<el-input v-model="form.privateKey" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="项目主键" prop="projectId">
|
|
||||||
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="部门主键" prop="deptId">
|
|
||||||
<el-input v-model="form.deptId" placeholder="请输入部门主键" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否删除" prop="isDel">
|
|
||||||
<el-input v-model="form.isDel" placeholder="请输入是否删除" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -157,10 +146,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="ApplyConfig">
|
<script setup name="ApplyConfig">
|
||||||
import { listApplyConfig, getApplyConfig, delApplyConfig, addApplyConfig, updateApplyConfig } from "@/api/manage/applyConfig";
|
import { listApplyConfig, getApplyConfig, delApplyConfig, addApplyConfig, updateApplyConfig, createAppId } from "@/api/manage/applyConfig";
|
||||||
|
import { findMyProjectList } from '@/api/publics'
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { sys_apply_cfg_type } = proxy.useDict('sys_apply_cfg_type');
|
const { sys_normal_disable,sys_apply_cfg_type } = proxy.useDict('sys_normal_disable','sys_apply_cfg_type');
|
||||||
|
|
||||||
const applyConfigList = ref([]);
|
const applyConfigList = ref([]);
|
||||||
const open = ref(false);
|
const open = ref(false);
|
||||||
|
@ -171,6 +161,7 @@ const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
|
const projects = ref([]);
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
|
@ -182,6 +173,9 @@ const data = reactive({
|
||||||
cfgType: null
|
cfgType: null
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
projectId: [{ required: true, trigger: 'change', message: '请选择所属项目' }],
|
||||||
|
cfgType: [{ required: true, trigger: 'change', message: '请选择配置类型' }],
|
||||||
|
appId: [{ required: true, trigger: ['blur', 'change'], message: '请输入应用AppId' }],
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -248,6 +242,9 @@ function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加系统应用注册";
|
title.value = "添加系统应用注册";
|
||||||
|
createAppId().then(res =>{
|
||||||
|
form.value.appId = res.msg;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
|
@ -282,6 +279,34 @@ function submitForm() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 状态滑块控制 */
|
||||||
|
function setStatus(val, row) {
|
||||||
|
proxy.$modal
|
||||||
|
.confirm(`是否确认${val == "0" ? "启用" : "停用"}当前数据项?`)
|
||||||
|
.then(function () {
|
||||||
|
let _data = { id: row.id, isDel: val };
|
||||||
|
return updateApplyConfig(_data);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// 取消时恢复原始开关状态
|
||||||
|
if (val == "0") {
|
||||||
|
row.isDel = "1";
|
||||||
|
} else {
|
||||||
|
row.isDel = "0";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getProjectList() {
|
||||||
|
findMyProjectList({ pageNum: 1, pageSize: 100 }).then((response) => {
|
||||||
|
projects.value = response.rows
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _ids = row.id || ids.value;
|
const _ids = row.id || ids.value;
|
||||||
|
@ -300,5 +325,6 @@ function handleExport() {
|
||||||
}, `applyConfig_${new Date().getTime()}.xlsx`)
|
}, `applyConfig_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getProjectList();
|
||||||
getList();
|
getList();
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue