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

相关推荐
用户658681803384019 分钟前
一个前端CLAUDE.md
前端
前端那点事20 分钟前
彻底解决KeepAlive缓存乱象!Vue3精细化按需缓存+路径重置终极方案
前端·vue.js
前端那点事21 分钟前
Vue 的 template 标签不能用 v-show?底层机制+踩坑复盘+生产级解决方案
前端·vue.js
前端那点事25 分钟前
从零落地前端性能优化:全链路避坑+实战调优方案
前端·vue.js
沸点小助手37 分钟前
「妈,我真不是修电脑的」获奖名单公示|本周互动话题上新🎊
前端·人工智能
兵麒麟1 小时前
JavaScript Promise 完全掌握:从外卖订单到优雅异步
前端
转转技术团队1 小时前
不写一行代码,用 Xmind 思维导图跑通多端自动化回归
前端
铁皮饭盒1 小时前
同样是算力巨头,为什么华为死磕英伟达,AMD 却 "躺平看戏"?
前端·后端
文心快码BaiduComate1 小时前
用Comate 7天完成”鹅鸭杀”游戏网站开发
前端·后端·程序员
2401_865439631 小时前
CSS中隐藏元素的多重技巧与应用场景
开发语言·前端·javascript