1 Star 0 Fork 0

骅骝漫轻舞/tunTest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.html 4.46 KB
一键复制 编辑 原始数据 按行查看 历史
骅骝漫轻舞 提交于 2022-10-11 01:31 . update index.html.
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body style="color:red;width:100%;height: 100%;font-size: 20px;;" class="display-center">
<div style="width:100%;flex-wrap:wrap;" class="display-center">
<div style="width:100%;" class="display-center">
前提:使用vue.js框架,使用JavaScript 类(class)
</div>
<div style="height: 50px;line-height: 50px;">题目请查看控制台</div>
</div>
</body>
</html>
<script>
console.log('1.使用递归,将下面数组arr处理为二维数组,数组格式为变量res');
var res = [
{
id:1,
name:'移动端',
code:'MobileManagement',
parentId:0,
}, {
id:2,
name:'申领单',
code:'applyForm',
parentId:1,
}, {
id:3,
name:'申领',
code:'applyForm_Apply',
parentId:2,
},
]
var arr = [
{
id:1,
name:'移动端',
code:'MobileManagement',
parentId:0,
children:[
{
id:2,
name: "申领单",
code: "applyForm",
parentId:1,
children:[
{
id:3,
name: "申领",
code: "applyForm_Apply",
parentId:2
} ,{
id:4,
name: "审核",
code: "applyForm_Audit",
parentId:2
} ,{
id:5,
name: "编辑",
code: "applyForm_Editor",
parentId:2
}
]
}
]
}, {
id:6,
name:'PC端',
code:'PC',
parentId:0,
children:[
{
id:7,
name: "项目管理",
code: "BuildingManage",
parentId:6,
children:[
{
id:8,
name: "楼盘档案",
code: "BuildingRecord",
parentId:7,
children:[
{
id:10,
name: "编辑",
code: "BuildingRecord_Editor",
parentId:8
} ,{
id:11,
name: "详情",
code: "BuildingRecord_Particulars",
parentId:8
} ,{
id:12,
name: "新增",
code: "BuildingRecord_NewAdd",
parentId:8
}
]
} ,{
id:9,
name: "工地档案",
code: "BuildingManage",
parentId:7,
children:[
{
id:13,
name: "编辑",
code: "BuildingSiteRecord_Editor",
parentId:9
} ,{
id:14,
name: "详情",
code: "BuildingSiteRecord_Particulars",
parentId:9
} ,{
id:15,
name: "新增",
code: "BuildingSiteRecord_NewAdd",
parentId:9
}
]
}
]
}
]
}
]
console.info('arr',arr);
console.info('res',res);
console.log('------------------------');
console.log('2.使用vue,写出一个简单的计算器(包含加减乘除,不要求样式好坏)');
console.log('------------------------');
console.log('3.对数组[1,1,2,120,99,6,5,2,40,1]和[1,7,10,6],进行合并,然后进行去重并倒序排列');
console.log('------------------------');
console.log('4.获取当前日期(年-月-日 时:分:秒)。var time = 2022-06-01 10:20:20,请处理变量time和当前日期,封装函数最终返回结果 (月-日 时:分) 或 (年-月-日) ');
console.log('------------------------');
console.log('5.请求接口https://admin.56topyun.top/bill/class-list/index');
console.log('处理返回的数据,根据type不同分类');
console.log('处理结果如:res2');
var res2 = [
{
type:1,
list:[
{
"id":"1",
"name":"\u652f\u4ed8\u5b9d",
"create_time":"2021-11-17 23:48:24",
"update_time":"2021-11-17 23:48:24",
"user_id":"0",
"sort":"0",
"type":"1"
}
]
}
]
console.info('res2',res2);
</script>
<style>
html{
height: 100%;
}
.display-center{
display: flex;
align-items: center;
justify-content: center;
}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/HuaLiuManQingWu/tun-test.git
git@gitee.com:HuaLiuManQingWu/tun-test.git
HuaLiuManQingWu
tun-test
tunTest
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385