多个页面一张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值。

相关推荐
码云之上2 分钟前
聊聊如何设计一个高效、稳定的 Node.js 接入层
前端·后端·node.js
kyriewen35 分钟前
我读了一遍 Babel 编译后的 async/await,终于搞懂了它的原理(附 20 行手写实现)
前端·javascript·面试
IT_陈寒1 小时前
Vite项目build后路由404了?你可能漏了这个小配置
前端·人工智能·后端
lichenyang4531 小时前
AI 聊天从纯文本到结构化卡片:SSE done 帧携带 card + 历史记录卡片恢复实战
前端
梦曦i2 小时前
@meng-xi/vite-plugin v0.1.5:告别手动 import,精简工具层
前端
梦曦i2 小时前
Vite 0.1.6重磅更新:智能导入+路由安全
前端
gxf5203088069882 小时前
Flutter 裁剪图片
前端·app
ITMan彪叔3 小时前
赋能UE运行态编辑平台: 网络图片下载的插件改造与复盘
前端
RANxy3 小时前
🚀 Umi Max 项目从0到1:企业级 React 脚手架实战
前端·前端框架
拾年2753 小时前
深入理解 V8 引擎:从代码执行到垃圾回收的完整链路
前端·javascript·v8