多个页面一张SQL表,前端放入type类型

前端有三个页面需要修改

1.List

html 复制代码
data () {
      return {
        // 类型
        queryParam: {
          type: "1",
        },
        type: 1,
       }

method:{
    handleAdd () {
        this.$refs.modalForm.add(this.type)
        this.$refs.modalForm.title = '新增'
        this.$refs.modalForm.disableSubmit = false
      },
      handleEdit (record) {
        this.$refs.modalForm.edit(record, this.type)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
      },
}

2.Modal

html 复制代码
      add (type) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add(type);
        })
      },
      edit (record,type) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record,type);
        })
      },

3.Form

html 复制代码
    data () {
      return {
        type: '1',
      }
    },

submitForm () {

        this.form.validateFields((err, values) => {
          if (!err) {
            
            if (this.type) {
              values['type'] = this.type;
            }

            let formData = Object.assign(this.model, values);

          }

        })
      },

两个setFieldsValue都要有 type

后端Controller

java 复制代码
        queryPageList

		QueryWrapper<YztSkillAchieve> queryWrapper = QueryGenerator.initQueryWrapper(yztSkillAchieve, req.getParameterMap());
		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
		queryWrapper.eq("SYS_ORG_CODE", sysUser.getOrgCode());
		queryWrapper.orderByDesc("CREATE_TIME");
		queryWrapper.orderByDesc("UPDATE_TIME");
		if(yztSkillAchieve.getType().isEmpty() == false){
			//筛选type
			queryWrapper.eq("type", yztSkillAchieve.getType());
		}else{
			throw new RuntimeException("未知的类型!");
		}

你有很多个菜单那么就要复制很多个List,Modal,Form,给他们写死不同的type值。

相关推荐
神算大模型APi--天枢6465 分钟前
合规与高效兼得:国产全栈架构赋能行业大模型定制,从教育到工业的轻量化落地
大数据·前端·人工智能·架构·硬件架构
千寻girling10 分钟前
马上元旦节了,手写一个《前端脚手架》庆祝一下 !
前端
嚣张丶小麦兜27 分钟前
认识vite
前端·javascript·vue.js
玲小珑1 小时前
请求 ID 跟踪模式:解决异步请求竞态条件
前端
开心_开心急了1 小时前
AI+PySide6实现自定义窗口标题栏目(titleBar)
前端
开心_开心急了1 小时前
Ai加Flutter实现自定义标题栏(appBar)
前端·flutter
布列瑟农的星空1 小时前
SSE与流式传输(Streamable HTTP)
前端·后端
GISer_Jing2 小时前
跨境营销前端AI应用业务领域
前端·人工智能·aigc
oak隔壁找我2 小时前
Node.js的package.json
前端·javascript
talenteddriver2 小时前
web: http请求(自用总结)
前端·网络协议·http