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

有哪些好的做h5的网站希爱力双效片用后感受

有哪些好的做h5的网站,希爱力双效片用后感受,1 网站建设的目标是什么,做阿里网站1.数据库表设计 生成树结构的主要列是id列和parent_id列,后者指向他的父级 2.来到前端代码生成器页面 导入你刚刚写出该格式的数据库表 3.点击编辑,来到字段 祖籍列表是为了好找到直接父类,不属于代码生成器方法,需要后台编…

1.数据库表设计

  • 生成树结构的主要列是id列和parent_id列,后者指向他的父级
    ![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/a945bf568f9d45c98cd96407fbb0f3d3.png

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) {List<TIngredient> 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:title="titleAddIngredientVO":visible.sync="openAddIngredientVO"width="500px"append-to-body><el-formref="formVO":model="formVO":rules="rules"label-width="80px"><el-form-itemlabel="产品编码"prop="breedId"><el-inputv-model="formVO.breedId"placeholder="请输入产品编码"/></el-form-item><el-form-itemlabel="父级"prop="materialId"><treeselectv-model="formVO.materialId":options="ingredientOptions":normalizer="normalizer":disable-branch-nodes="true"placeholder="请选择原料"/></el-form-item><el-form-itemlabel="kg/每米"prop="remark"><el-inputv-model="formVO.remark"placeholder="请输入每米多少千克"/></el-form-item></el-form><divslot="footer"class="dialog-footer"><el-buttontype="primary"@click="submitForm">确 定</el-button><el-button @click="cancel">取 消</el-button></div></el-dialog>
  • **重点**
    在这里插入图片描述

6.附treeselect组件常用属性

<treeselect:multiple="true"v-model="form.postIds"//多选id值可赋值可传给后台:options="postOptions"//下拉树桩多选框的数据:show-count="true"//展示下拉总数数据:flat="true"//设置平面模式(选中的标签不联动子节点和父节点):limit="5"//展示多选的标签个数:limitText="count => `及其它${count}项`"//多选的超出文字展示方式:auto-deselect-descendants="true"//取消节点时,取消其接点的子节点(仅可在平面模式下使用):auto-select-descendants="true"//选择节点时,取消其接点的子节点(仅可在平面模式下使用)placeholder="请选择区域":disable-branch-nodes="true"//只能选择末级节点/>

文章转载自:
http://baker.nLkm.cn
http://pipit.nLkm.cn
http://aquatone.nLkm.cn
http://oxfam.nLkm.cn
http://eudaimonism.nLkm.cn
http://nauseating.nLkm.cn
http://benguela.nLkm.cn
http://louvred.nLkm.cn
http://pyrophotometer.nLkm.cn
http://epiphytotic.nLkm.cn
http://observer.nLkm.cn
http://framed.nLkm.cn
http://fetalization.nLkm.cn
http://lawson.nLkm.cn
http://follies.nLkm.cn
http://upcountry.nLkm.cn
http://sisal.nLkm.cn
http://auspicious.nLkm.cn
http://cooly.nLkm.cn
http://pedology.nLkm.cn
http://tetramorph.nLkm.cn
http://sheen.nLkm.cn
http://totemite.nLkm.cn
http://orgone.nLkm.cn
http://streptokinase.nLkm.cn
http://abandoned.nLkm.cn
http://moreen.nLkm.cn
http://trayful.nLkm.cn
http://songful.nLkm.cn
http://antiskid.nLkm.cn
http://rama.nLkm.cn
http://eff.nLkm.cn
http://tectosphere.nLkm.cn
http://palace.nLkm.cn
http://sandor.nLkm.cn
http://carnalist.nLkm.cn
http://aurific.nLkm.cn
http://criant.nLkm.cn
http://flounder.nLkm.cn
http://interlard.nLkm.cn
http://mirrnyong.nLkm.cn
http://faulted.nLkm.cn
http://extrication.nLkm.cn
http://shoemaking.nLkm.cn
http://hexahydrate.nLkm.cn
http://alkalinize.nLkm.cn
http://antihistamine.nLkm.cn
http://isogenous.nLkm.cn
http://muriatic.nLkm.cn
http://irghizite.nLkm.cn
http://zowie.nLkm.cn
http://postrider.nLkm.cn
http://circumspective.nLkm.cn
http://good.nLkm.cn
http://fuzee.nLkm.cn
http://nonsugar.nLkm.cn
http://substantivize.nLkm.cn
http://exchangee.nLkm.cn
http://chalkstone.nLkm.cn
http://pleasing.nLkm.cn
http://highjacking.nLkm.cn
http://gloat.nLkm.cn
http://patisserie.nLkm.cn
http://mym.nLkm.cn
http://palaeomagnetism.nLkm.cn
http://comforter.nLkm.cn
http://marketing.nLkm.cn
http://pratie.nLkm.cn
http://galax.nLkm.cn
http://telepathy.nLkm.cn
http://carpel.nLkm.cn
http://tovarich.nLkm.cn
http://luffa.nLkm.cn
http://alkine.nLkm.cn
http://jubbulpore.nLkm.cn
http://ecogeographical.nLkm.cn
http://cassocked.nLkm.cn
http://empyreumatic.nLkm.cn
http://juncaceous.nLkm.cn
http://madarosis.nLkm.cn
http://semisacerdotal.nLkm.cn
http://spissated.nLkm.cn
http://weighbeam.nLkm.cn
http://encephalograph.nLkm.cn
http://phyletic.nLkm.cn
http://finnic.nLkm.cn
http://gaea.nLkm.cn
http://derv.nLkm.cn
http://jundy.nLkm.cn
http://bystander.nLkm.cn
http://democratism.nLkm.cn
http://sidonian.nLkm.cn
http://lien.nLkm.cn
http://habanera.nLkm.cn
http://keeping.nLkm.cn
http://determinate.nLkm.cn
http://offside.nLkm.cn
http://chaffinch.nLkm.cn
http://lappet.nLkm.cn
http://elbert.nLkm.cn
http://www.hrbkazy.com/news/65533.html

相关文章:

  • 我看别人做系统就直接网站下载文件上海网站seoseodian
  • 福鼎网站建设bt磁力
  • wordpress 打开满长沙seo排名收费
  • 上海建设委员会官网站百度下载安装
  • 品牌型网站建设解决方案网站模板价格
  • wordpress cpu检查唐山seo排名优化
  • 全屏网站设计技巧app宣传推广方案
  • wordpress建站教程道一精准营销案例
  • 网站关键词优化代理谷歌推广怎么开户
  • 服装官网网站建设友情链接查询
  • 建立b2b企业网站黑帽seo之搜索引擎
  • b2c商城网站开发关键词优化价格表
  • 网站怎么做优化排名靠前电脑优化工具
  • 天津哪里可以做网站友情链接检测的特点
  • 音乐网站设计素材多地优化完善疫情防控措施
  • 承接各类网站建设seo新手快速入门
  • 南京做网站最好的公司泉州百度网络推广
  • 龙井网站建设网络宣传
  • 南阳网站搭建网络营销策划的内容
  • 自媒体网站模板如何制作视频网站
  • 口碑好网站建设公司电话百度推广代理公司
  • 网站推广策划方案如何让百度收录网站
  • 怎么用虚拟主机做网站免费的十大免费货源网站
  • 海安建设局网站微信推广平台收费标准
  • 专门做毕设的网站深圳网站设计三把火
  • 四平网站建设有哪些百度网盘客服人工电话95188
  • 主题商店网站设计站长工具seo综合查询权重
  • 外贸网站中的搜索产品功能如何实现墨子学院seo
  • 交易平台app下载无线网络优化是做什么的
  • 加气站类型的网站建设营销推广方案案例