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

相关推荐
集成显卡1 小时前
PlayWright | 初识微软出品的 WEB 应用自动化测试框架
前端·chrome·测试工具·microsoft·自动化·edge浏览器
前端小趴菜052 小时前
React - 组件通信
前端·react.js·前端框架
Amy_cx2 小时前
在表单输入框按回车页面刷新的问题
前端·elementui
dancing9992 小时前
cocos3.X的oops框架oops-plugin-excel-to-json改进兼容多表单导出功能
前端·javascript·typescript·游戏程序
后海 0_o3 小时前
2025前端微服务 - 无界 的实战应用
前端·微服务·架构
Scabbards_3 小时前
CPT304-2425-S2-Software Engineering II
前端
小满zs3 小时前
Zustand 第二章(状态处理)
前端·react.js
程序猿小D3 小时前
第16节 Node.js 文件系统
linux·服务器·前端·node.js·编辑器·vim
萌萌哒草头将军3 小时前
🚀🚀🚀Prisma 发布无 Rust 引擎预览版,安装和使用更轻量;支持任何 ORM 连接引擎;支持自动备份...
前端·javascript·vue.js
狼性书生3 小时前
uniapp实现的简约美观的星级评分组件
前端·uni-app·vue·组件