diff --git a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js index 332046f..67ca457 100644 --- a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js +++ b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js @@ -240,6 +240,29 @@ export const JeecgListMixin = { } }); }, + handleDeleteQx: function (record) { + getAction(this.url.checkqx,{createBy:record.createBy}).then((res)=>{ + if (res.success) { + if (!this.url.delete) { + this.$message.error("请设置url.delete属性!") + return + } + var that = this; + deleteAction(that.url.delete, {id: record.id}).then((res) => { + if (res.success) { + //重新计算分页问题 + that.reCalculatePage(1) + that.$message.success(res.message); + that.loadData(); + } else { + that.$message.warning(res.message); + } + }); + }else{ + this.$message.warning(res.message); + } + }); + }, startorstop: function (id) { if (!this.url.update) { this.$message.error("请设置url.update属性!") diff --git a/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue b/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue index a4b316c..62e6f94 100644 --- a/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue +++ b/ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue @@ -79,9 +79,9 @@ - 编辑 + 编辑 - + 删除 @@ -104,6 +104,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import RequirementTypeModal from './modules/RequirementTypeModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' + import { httpAction, getAction } from '@/api/manage' export default { name: 'RequirementTypeList', @@ -156,7 +157,7 @@ deleteBatch: "/requirementtype/requirementType/deleteBatch", exportXlsUrl: "/requirementtype/requirementType/exportXls", importExcelUrl: "requirementtype/requirementType/importExcel", - + checkqx:"/requirementtype/requirementType/checkqx", }, dictOptions:{}, superFieldList:[], @@ -171,6 +172,17 @@ }, }, methods: { + checkqx(record){ + getAction(this.url.checkqx,{createBy:record.createBy}).then((res)=>{ + if (res.success) { + this.$refs.modalForm.edit(record); + this.$refs.modalForm.title = "编辑"; + this.$refs.modalForm.disableSubmit = false; + }else{ + this.$message.warning(res.message); + } + }); + }, initDictConfig(){ }, getSuperFieldList(){ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java index e4e65594..5670d50 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java @@ -9,8 +9,11 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.demo.requirementtype.entity.RequirementType; import org.jeecg.modules.demo.requirementtype.service.IRequirementTypeService; @@ -215,5 +218,25 @@ public class RequirementTypeController extends JeecgController checkqx(@RequestParam(name="createBy",required=true) String createBy,HttpServletRequest req) { + LoginUser principal = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if(!principal.getUsername().equals("admin")){ + if(!principal.getUsername().equals(createBy)){ + return Result.error("无该操作权限"); + }else{ + return Result.OK(""); + } + }else{ + return Result.OK(""); + } + } }