当前位置: 首页 > news >正文

做软装搭配的网站高端装修公司门头设计效果图

做软装搭配的网站,高端装修公司门头设计效果图,大连工商网站查询企业信息,福步外贸论坛app1.数据库表设计 生成树结构的主要列是id列和parent_id列#xff0c;后者指向他的父级 2.来到前端代码生成器页面 导入你刚刚写出该格式的数据库表 3.点击编辑#xff0c;来到字段 祖籍列表是为了好找到直接父类#xff0c;不属于代码生成器方法#xff0c;需要后台编…1.数据库表设计 生成树结构的主要列是id列和parent_id列后者指向他的父级 2.来到前端代码生成器页面 导入你刚刚写出该格式的数据库表 3.点击编辑来到字段 祖籍列表是为了好找到直接父类不属于代码生成器方法需要后台编写 4.改变生成结构为树表结构 5.提交然后生成代码并复制到对应目录当中 6.修改serviceImpl当中插入和修改方法 /*** 新增原料** param tIngredient 原料* return 结果*/Overridepublic int insertTIngredient(TIngredient tIngredient) {TIngredient info tIngredientMapper.selectTIngredientById(tIngredient.getParentId());// 如果父节点不为正常状态,则不允许新增子节点if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {throw new ServiceException(原料类型停用不允许新增);}tIngredient.setAncestors(info.getAncestors() , tIngredient.getParentId());tIngredient.setCreateTime(DateUtils.getNowDate());return tIngredientMapper.insertTIngredient(tIngredient);}/*** 修改原料** param tIngredient 原料* return 结果*/Overridepublic int updateTIngredient(TIngredient tIngredient) {TIngredient newParentDept tIngredientMapper.selectTIngredientById(tIngredient.getParentId());TIngredient oldDept tIngredientMapper.selectTIngredientById(tIngredient.getId());if (StringUtils.isNotNull(newParentDept) StringUtils.isNotNull(oldDept)) {String newAncestors newParentDept.getAncestors() , newParentDept.getId();String oldAncestors oldDept.getAncestors();tIngredient.setAncestors(newAncestors);updateDeptChildren(tIngredient.getId(), newAncestors, oldAncestors);}tIngredient.setUpdateTime(DateUtils.getNowDate());int result tIngredientMapper.updateTIngredient(tIngredient);if (UserConstants.DEPT_NORMAL.equals(tIngredient.getStatus()) StringUtils.isNotEmpty(tIngredient.getAncestors()) !StringUtils.equals(0, tIngredient.getAncestors())) {// 如果该部门是启用状态则启用该部门的所有上级部门updateParentDeptStatusNormal(tIngredient);}return result;} 用到了两个额外对数操作方法联动子父级菜单的修改 /*** 修改该部门的父级部门状态** param tIngredient 当前部门*/private void updateParentDeptStatusNormal(TIngredient tIngredient) {String ancestors tIngredient.getAncestors();Long[] deptIds Convert.toLongArray(ancestors);tIngredientMapper.enableTIngredientByIds(deptIds);}/*** 修改子元素关系** param deptId 被修改的部门ID* param newAncestors 新的父ID集合* param oldAncestors 旧的父ID集合*/public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {ListTIngredient children tIngredientMapper.selectChildrenTIngredientById(deptId);for (TIngredient child : children) {child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));}if (children.size() 0) {tIngredientMapper.updateTIngredientChildren(children);}} 生成完毕额外处理自己表中数据也是在新增或者修改当中写 来到想要使用的前端页面其他页面使用 1.导入依赖 第一个依赖是生成树的请求第二个组件是vue.js的树形选择组件第三个是树形组件的css样式 import { listIngredient } from /api/bases/ingredient; import Treeselect from riophae/vue-treeselect; import riophae/vue-treeselect/dist/vue-treeselect.css;2.注册树形组件 components: {Treeselect},3.要使用的核心方法 /** 查询原料下拉树结构 */getTreeselect () {listIngredient().then(response {this.ingredientOptions [];const data { id: 0, ingredientName: 顶级节点, children: [] };data.children this.handleTree(response.data, id, parentId);this.ingredientOptions.push(data);});},/** 转换原料数据结构 */normalizer (node) {if (node.children !node.children.length) {delete node.children;}return {id: node.id,label: node.ingredientName,children: node.children};},4调用方法我是通过新增按钮来实现的 /** 新增原料操作 */handleAddIngredientVO () {this.reset();this.getTreeselect();this.openAddIngredientVO true;this.titleAddIngredientVO 添加产品原料;}, 5.调用方法的下拉框表单 !-- 新增或者修改原料 --el-dialog:titletitleAddIngredientVO:visible.syncopenAddIngredientVOwidth500pxappend-to-bodyel-formrefformVO:modelformVO:rulesruleslabel-width80pxel-form-itemlabel产品编码propbreedIdel-inputv-modelformVO.breedIdplaceholder请输入产品编码//el-form-itemel-form-itemlabel父级propmaterialIdtreeselectv-modelformVO.materialId:optionsingredientOptions:normalizernormalizer:disable-branch-nodestrueplaceholder请选择原料//el-form-itemel-form-itemlabelkg/每米propremarkel-inputv-modelformVO.remarkplaceholder请输入每米多少千克//el-form-item/el-formdivslotfooterclassdialog-footerel-buttontypeprimaryclicksubmitForm确 定/el-buttonel-button clickcancel取 消/el-button/div/el-dialog **重点** 6.附treeselect组件常用属性 treeselect:multipletruev-modelform.postIds//多选id值可赋值可传给后台:optionspostOptions//下拉树桩多选框的数据:show-counttrue//展示下拉总数数据:flattrue//设置平面模式选中的标签不联动子节点和父节点:limit5//展示多选的标签个数:limitTextcount 及其它${count}项//多选的超出文字展示方式:auto-deselect-descendantstrue//取消节点时取消其接点的子节点仅可在平面模式下使用:auto-select-descendantstrue//选择节点时取消其接点的子节点仅可在平面模式下使用placeholder请选择区域:disable-branch-nodestrue//只能选择末级节点/
http://www.hkea.cn/news/14259254/

相关文章:

  • 汕头快速优化排名seo线上培训班
  • 泰安网站建设步骤项目免费推广平台
  • 网站空间服务器排名甘肃园区网络搭建
  • 河北seo网站优化电话郑州优化网站推广
  • 多城市网站设计周浦高端网站建设公司
  • 景德镇网站建设宝安做网站公司
  • 高校校园网站建设项目的要求网站建设及推广服务公司
  • 中国建设网站银行百度知道首页登录入口
  • 虚拟主机怎么做网站网站多域名
  • 做的好看的国内网站欣赏网上做头像用什么网站
  • 网站建设时间计划表广州口碑好的网站建设定制
  • 网站建设开源模板网站开发的未来发展趋势
  • 公司网站建设企业关于网站建设的专家研讨会
  • 视觉中国网站住房和建设部信息网站
  • 新品销售网站建设广州哪家网站建设最好
  • 剪辑素材网站莱芜都市网帖子怎么删除
  • 从化手机网站建设wordpress 版权
  • 大公司网站色彩设计郑州网络安全科技馆
  • 网站建设信息安全要求服务器云平台
  • 网站建设新际平台门户建设
  • 宁波市住房和城乡建设局网站首页团购网站设计
  • 网站建设服务亮点信息类网站
  • 网页兼容性 网站开发wordpress添加数据库文件
  • o2o网站源码app宝安沙井房价
  • 开网站制作公司广东汕头网络科技有限公司
  • 广西网站建设策划网站建设质量体系审核指导
  • 爱站网查询东莞网站建设报价 一呼百应
  • 网站内链 外链做网站运营有前景么
  • 贵州城乡住房和建设厅网站响应式网站的意义
  • 收费的网站怎么做的做微信扫码网站