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

相关推荐
白嫖叫上我27 分钟前
Vue3封装主题色完善版
前端
a11177628 分钟前
细胞结构实验室(react 开源)
前端·javascript·开源·html
aaaak_29 分钟前
PDD 直播间 评论 , wss hex Protobuf 解析流程分析学习
java·前端·学习
ikoala36 分钟前
用了几周明基 RD280UG,我终于明白程序员为什么需要一台“专用显示器”
前端·后端·程序员
文心快码BaiduComate44 分钟前
Comate搭载DeepSeek-V4
前端·后端
豹哥学前端1 小时前
5分钟搞懂事件委托
前端·javascript·面试
Awu12271 小时前
🍎把数学公式搬进 Web 表格:一个 VTable 实战案例
前端
江无行者1 小时前
aly oss技能应用
前端
朝阳391 小时前
单向数据流
前端
小小小小宇1 小时前
H5 嵌入微信 / 支付宝 / 抖音小程序 WebView:调用原生能力完整方案
前端