需求类型

master
Gitea 1 year ago
parent feb826a916
commit 6a05b15c00
  1. 23
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  2. 18
      ant-design-vue-jeecg/src/views/requirementtype/RequirementTypeList.vue
  3. 23
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/controller/RequirementTypeController.java

@ -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) { startorstop: function (id) {
if (!this.url.update) { if (!this.url.update) {
this.$message.error("请设置url.update属性!") this.$message.error("请设置url.update属性!")

@ -79,9 +79,9 @@
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="checkqx(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteQx(record)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
<a-divider type="vertical" /> <a-divider type="vertical" />
@ -104,6 +104,7 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RequirementTypeModal from './modules/RequirementTypeModal' import RequirementTypeModal from './modules/RequirementTypeModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { httpAction, getAction } from '@/api/manage'
export default { export default {
name: 'RequirementTypeList', name: 'RequirementTypeList',
@ -156,7 +157,7 @@
deleteBatch: "/requirementtype/requirementType/deleteBatch", deleteBatch: "/requirementtype/requirementType/deleteBatch",
exportXlsUrl: "/requirementtype/requirementType/exportXls", exportXlsUrl: "/requirementtype/requirementType/exportXls",
importExcelUrl: "requirementtype/requirementType/importExcel", importExcelUrl: "requirementtype/requirementType/importExcel",
checkqx:"/requirementtype/requirementType/checkqx",
}, },
dictOptions:{}, dictOptions:{},
superFieldList:[], superFieldList:[],
@ -171,6 +172,17 @@
}, },
}, },
methods: { 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(){ initDictConfig(){
}, },
getSuperFieldList(){ getSuperFieldList(){

@ -9,8 +9,11 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.requirementtype.entity.RequirementType; import org.jeecg.modules.demo.requirementtype.entity.RequirementType;
import org.jeecg.modules.demo.requirementtype.service.IRequirementTypeService; import org.jeecg.modules.demo.requirementtype.service.IRequirementTypeService;
@ -215,5 +218,25 @@ public class RequirementTypeController extends JeecgController<RequirementType,
return Result.OK(""); return Result.OK("");
} }
/**
* 判断非管理员用户的修改删除权限
*
* @return
*/
@AutoLog(value = "判断非管理员用户的修改删除权限")
@ApiOperation(value="判断非管理员用户的修改删除权限", notes="判断非管理员用户的修改删除权限")
@GetMapping(value = "/checkqx")
public Result<?> 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("");
}
}
} }

Loading…
Cancel
Save