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

网站设计四项原则网络推广方法有哪几种

网站设计四项原则,网络推广方法有哪几种,wordpress多语好利弊,广州企业宣传片制作公司一、业务需求: 一个展示列表,表格中有一部分列是根据后端接口动态展示,对于不同类型的数据展示效果不一样。如果接口返回数据是’类型1‘的,则正常展示,如果是’类型2‘的数据,则合并当前数据的动态表格。…

一、业务需求:

一个展示列表,表格中有一部分列是根据后端接口动态展示,对于不同类型的数据展示效果不一样。如果接口返回数据是’类型1‘的,则正常展示,如果是’类型2‘的数据,则合并当前数据的动态表格。

二、实现思路:

1、先将普通表格实现,不考虑合并效果;

2、在表格上对要合并的单元格类型进行区分;

3、 在表格上使用:span-method="arraySpanMethod"方法触发表格;

4、在arraySpanMethod方法内接收数据处理合并,确定从哪一列开始合并到哪一列合并结束;

三、代码展示:

<el-tableref="table"size="mini"height="100%":data="tableData":span-method="arraySpanMethod":header-cell-style="{background: '#f5f7fa',fontWeight: 'bold',color: '#303133'}"border><el-table-columntype="index"header-align="center"align="center"label="序号"width="50"></el-table-column><el-table-columnwidth="120"prop="indexShowName"label="名称"show-overflow-tooltip></el-table-column><el-table-columnwidth="80"prop="type"label="类型种类"show-overflow-tooltip><template slot-scope="scope">{{ scope.row.type === '1' ? '类型1' : '类型2' }}</template></el-table-column><el-table-columnv-for="(item, index) in tableColumns":key="index"width="80":label="item.year"show-overflow-tooltip><template slot-scope="scope"><!-- 类型1展示name --><divv-if="scope.row.type === '1'"style="text-align: center">{{scope.row.uploadValueList[index]?.uploadValueName}}</div><!-- 类型2展示value --><div v-else>{{ scope.row.uploadValueList[index].uploadValue }}</div></template></el-table-column><el-table-columnwidth="160"prop="reportDate"label="上报时间"show-overflow-tooltip></el-table-column><el-table-columnwidth="195"label="操作"header-align="center"align="center"fixed="right"><template slot-scope="scope"><el-buttonsize="small"style="color: #409eff; padding: 0"type="text"@click="detailClick(scope.row)">数据明细</el-button></template></el-table-column></el-table>// --------------methods方法--------------------// 右侧表格initTable() {const params = {pageNum: this.pages.pageIndex,pageSize: this.pages.pageSize,}this.tableLoading = true//api接口调用xxxxxx(params).then((res) => {if (res.code === 200) {const { total } = res.result// const { records, total } = res.result//后端接口数据返回形式如下:const records = [{indexShowName: '测试001',type: '1',reportDate: '2023-12-01 15:53:46',uploadValueList: [{id: '1',year: '2021年',uploadValue: '0',uploadValueName: '完全符合'},{id: '2',year: '2022年',uploadValue: '0',uploadValueName: '完全符合'},{id: '3',year: '2023年',uploadValue: '0',uploadValueName: '完全符合'},{id: '4',year: '2024年',uploadValue: '0',uploadValueName: '完全符合'}]},{indexShowName: '测试002',type: '2',reportDate: '2023-12-01 13:45:53',uploadValueList: [{id: '5',year: '2021年',uploadValue: '99.00'},{id: '6',year: '2022年',uploadValue: '98.00'},{id: '7',year: '2023年',uploadValue: '77.00'},{id: '8',year: '2024年',uploadValue: '34.00'}]}]if (records && records.length > 0) {// 使用第一个元素的 uploadValueList 来创建列this.tableColumns = records[0].uploadValueList.map((item) => ({year: item.year, // 使用 year 作为列的标签id: item.id // 用于做key}))}this.tableData = recordsthis.pages.total = total} else {this.$message.error(res.message)}}).finally(() => {this.tableLoading = false})},// 单元格合并 {当前行row、当前列column、当前行号rowIndex、当前列号columnIndex}arraySpanMethod({ row, column, rowIndex, columnIndex }) {// 类型1,且动态数据长度>1if (row.type === '1' && row?.uploadValueList?.length > 1) {const len = row?.uploadValueList?.length// 合并从下标为0开始的【下标为3的第四列,动态数据长度】if ( columnIndex > 2 && columnIndex <= 2 + Number(len) ) {return {rowspan: 1,colspan: columnIndex === 3 ? len : 0}}}},

http://www.dinnco.com/news/68516.html

相关文章:

  • 网站建设团队互联网营销培训班
  • 青岛网站seo诊断成都网站seo推广
  • 东莞做网站一年费用百度网站提交入口
  • 苏州seo报价长沙竞价优化
  • 做挂件的网站在哪里查关键词排名
  • 温州本地网站平台种子资源
  • 直接找高校研究生做网站行吗百度云网盘搜索引擎入口
  • 如何做网站二级域名网络广告的发布方式包括
  • 温州专业做网站百度搜索seo
  • 连锁网站开发上海自动seo
  • 彩票网站代理怎么做互联网营销师培训多少钱
  • 建设一个功能简单的网站黑帽seo教程
  • wordpress火车头采集发布失败亚马逊排名seo
  • 培训网站欣赏济南seo网站优化公司
  • 番禺做网站百度网盘破解版
  • 石家庄做网站哪家公司好seo优化报价公司
  • 支付网站建设费进什么科目百度知道合伙人答题兼职
  • 潍坊网站关键词推广宁波seo软件免费课程
  • 网络规划设计师吧windows优化大师的作用
  • 低价网站建设网上怎么注册公司免费的
  • 电商网站如何设计内容营销策划与运营团队
  • 南通做网站厉害的免费域名解析平台
  • 六安网站制作哪里有小程序开发公司十大排名
  • 支付集成文件放在网站哪里自助建站免费搭建个人网站
  • 佛山从事网站建设网络营销课程培训机构
  • 空白的网站怎么建设百度网址提交入口平台
  • 网站设计主要内容中国十大seo公司
  • wordpress 自动替换廊坊seo网络推广
  • 网站建设服务公打开全网搜索
  • 外贸网站增加外链方法企业网站设计规范