4000-520-616
欢迎来到免疫在线!(蚂蚁淘生物旗下平台)  请登录 |  免费注册 |  询价篮
主营:原厂直采,平行进口,授权代理(蚂蚁淘为您服务)
咨询热线电话
4000-520-616
当前位置: 首页 > 新闻动态 >
新闻详情
Vue电商项目—商品管理—分类参数模块_爱吃瓜的猴的博客-CSDN博客
来自 : CSDN技术社区 发布时间:2021-03-25
// 如果新添加的参数是没有展开项数据的 item.attr_vals item.attr_vals ? item.attr_vals.split( ) : []; // 解决 当点击一个 New Tag 其他行的也受影响问题 以及文本框中的内容 共用问题 // 往参数列表数组中 新增两个属性 // 控制文本框的显示与隐藏 item.inputVisible false; // 文本框中输入的值 item.inputValue ; console.log(res.data); // 判断获取的数据是动态参数 还是静态属性 if(this.activeName many ) { this.manyTableData res.data; }else { this.onlyTableData res.data; // 点击 添加参数 按钮 显示添加参数对话框 showAddDialog() { this.addCateDialogVisible true; // 添加参数对话框的关闭事件 addDialogClosed() { this.$refs.addCataRef.resetFields(); // 点击 确定 添加参数 addParams() { this.$refs.addCataRef.validate( async valid { // 预验证失败 if(!valid) return // 发送请求 const {data: res} await this.$http.post( categories/${this.cateId}/attributes , { attr_name: this.addCataForm.attr_name, attr_sel: this.activeName if(res.meta.status ! 201) { return this.$message.error( 添加参数失败 ); this.$message.success( 添加参数成功 ); // 隐藏对话框 this.addCateDialogVisible false; // 刷新数据列表 this.getParamsData(); // 点击 编辑 按钮 显示修改参数对话框 async showEditDialog(attrId) { // 根据获取的ID 发送请求 const {data: res} await this.$http.get( categories/${this.cateId}/attributes/${attrId} , { attr_sel: this.activeName if(res.meta.status ! 200) { return this.$message.error( 获取参数信息失败 ); this.editCataForm res.data; this.editCateDialogVisible true; // 重置表单数据 editDialogClosed() { this.$refs.editCataRef.resetFields(); // 点击 修改按钮 修改参数信息 editParams() { this.$refs.editCataRef.validate(async valid { if(!valid) return const {data: res} await this.$http.put( categories/${this.cateId}/attributes/${this.editCataForm.attr_id} , { attr_name: this.editCataForm.attr_name, attr_sel: this.activeName if(res.meta.status ! 200) { return this.$message.error( 修改参数信息失败 ); this.$message.success( 修改参数信息成功 ); this.getParamsData(); this.editCateDialogVisible false; // 点击 删除按钮 删除对应的参数信息 async deleteCate(attrId) { this.deleteCateDialogVisible true; const confirm await this.$confirm( 此操作将永久删除这条数据, 是否继续? , 提示 , { confirmButtonText: 确定 , cancelButtonText: 取消 , type: warning }).catch(err err);

本文链接: http://mattrid.immuno-online.com/view-772285.html

发布于 : 2021-03-25 阅读(0)