You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

517 lines
14 KiB

  1. /*大屏*/
  2. //自调用函数
  3. //;(function () {
  4. // // 1、页面一加载就要知道页面宽度计算
  5. // var setFont = function () {
  6. // // 因为要定义变量可能和别的变量相互冲突,污染,所有用自调用函数
  7. // var html = document.documentElement // 获取html
  8. // // 获取宽度
  9. // var width = html.clientWidth
  10. // // 判断
  11. // if (width < 1024) width = 1024
  12. // if (width > 1920) width = 1920
  13. // // 设置html的基准值
  14. // var fontSize = width / 80 + 'px'
  15. // // 设置给html
  16. // html.style.fontSize = fontSize
  17. // }
  18. // setFont()
  19. // // 2、页面改变的时候也需要设置
  20. // // 尺寸改变事件
  21. // window.onresize = function () {
  22. // setFont()
  23. // }
  24. //})()
  25. ;(function () {
  26. //事件委托
  27. $('.monitor').on('click', ' a', function () {
  28. //点击当前的a 加类名 active 他的兄弟删除类名
  29. $(this).addClass('active').siblings().removeClass('active')
  30. //获取一一对应的下标
  31. var index = $(this).index()
  32. //选取content 然后狗日对应下标的 显示 当前的兄弟.content隐藏
  33. $('.content').eq(index).show().siblings('.content').hide()
  34. })
  35. //滚动
  36. //原理:把marquee下面的子盒子都复制一遍 加入到marquee中
  37. // 然后动画向上滚动,滚动到一半重新开始滚动
  38. //因为选取的是两个marquee 所以要遍历
  39. $('.monitor .marquee').each(function (index, dom) {
  40. //将每个 的所有子级都复制一遍
  41. //var rows = $(dom).children().clone()
  42. ////再将新的到的加入原来的
  43. //$(dom).append(rows)
  44. })
  45. })()
  46. //;(function () {
  47. // var myechart = echarts.init($('.pie')[0])
  48. // option = {
  49. // // 控制提示
  50. // tooltip: {
  51. // // 非轴图形,使用item的意思是放到数据对应图形上触发提示
  52. // trigger: 'item',
  53. // // 格式化提示内容:
  54. // // a 代表图表名称 b 代表数据名称 c 代表数据 d代表 当前数据/总数据的比例
  55. // formatter: '{a} <br/>{b} : {c} ({d}%)'
  56. // },
  57. // // 控制图表
  58. // series: [
  59. // {
  60. // // 图表名称
  61. // name: '地区',
  62. // // 图表类型
  63. // type: 'pie',
  64. // // 南丁格尔玫瑰图 有两个圆 内圆半径10% 外圆半径70%
  65. // // 百分比基于 图表DOM容器的半径
  66. // radius: ['10%', '70%'],
  67. // // 图表中心位置 left 50% top 50% 距离图表DOM容器
  68. // center: ['50%', '50%'],
  69. // // 半径模式,另外一种是 area 面积模式
  70. // roseType: 'radius',
  71. // // 数据集 value 数据的值 name 数据的名称
  72. // data: [
  73. // { value: 20, name: '云南' },
  74. // { value: 5, name: '北京' },
  75. // { value: 15, name: '山东' },
  76. // { value: 25, name: '河北' },
  77. // { value: 20, name: '江苏' },
  78. // { value: 35, name: '浙江' },
  79. // { value: 30, name: '四川' },
  80. // { value: 40, name: '湖北' }
  81. // ],
  82. // //文字调整
  83. // label: {
  84. // fontSize: 10
  85. // },
  86. // //引导线
  87. // labelLine: {
  88. // length: 8,
  89. // length2: 10
  90. // }
  91. // }
  92. // ],
  93. // color: [
  94. // '#006cff',
  95. // '#60cda0',
  96. // '#ed8884',
  97. // '#ff9f7f',
  98. // '#0096ff',
  99. // '#9fe6b8',
  100. // '#32c5e9',
  101. // '#1d9dff'
  102. // ]
  103. // }
  104. // myechart.setOption(option)
  105. // myechart.on('click', function (param) {
  106. // alert(
  107. // "click"
  108. // )
  109. // setTimeout(function () {
  110. // location.href = ''
  111. // }, 20000)
  112. // })
  113. //})()
  114. // 用户
  115. //;(function () {
  116. // // 中间省略的数据 准备三项
  117. // var item = {
  118. // name: '',
  119. // value: 1200,
  120. // // 柱子颜色
  121. // itemStyle: {
  122. // color: '#254065'
  123. // },
  124. // // 鼠标经过柱子颜色
  125. // emphasis: {
  126. // itemStyle: {
  127. // color: '#254065'
  128. // }
  129. // },
  130. // // 工具提示隐藏
  131. // tooltip: {
  132. // extraCssText: 'opacity:0'
  133. // }
  134. // }
  135. // option = {
  136. // // 工具提示
  137. // tooltip: {
  138. // // 触发类型 经过轴触发axis 经过轴触发item
  139. // trigger: 'item',
  140. // // 轴触发提示才有效
  141. // axisPointer: {
  142. // // 默认为直线,可选为:'line' 线效果 | 'shadow' 阴影效果
  143. // type: 'shadow'
  144. // }
  145. // },
  146. // // 图表边界控制
  147. // grid: {
  148. // // 距离 上右下左 的距离
  149. // left: '0',
  150. // right: '3%',
  151. // bottom: '3%',
  152. // top: '5%',
  153. // // 大小是否包含文本【类似于boxsizing】
  154. // containLabel: true,
  155. // //显示边框
  156. // show: true,
  157. // //边框颜色
  158. // borderColor: 'rgba(0, 240, 255, 0.3)'
  159. // },
  160. // // 控制x轴
  161. // xAxis: [
  162. // {
  163. // // 使用类目,必须有data属性
  164. // type: 'category',
  165. // // 使用 data 中的数据设为刻度文字
  166. // data: [
  167. // '上海',
  168. // '广州',
  169. // '北京',
  170. // '深圳',
  171. // '合肥',
  172. // '',
  173. // '......',
  174. // '',
  175. // '杭州',
  176. // '厦门',
  177. // '济南',
  178. // '成都',
  179. // '重庆'
  180. // ],
  181. // // 刻度设置
  182. // axisTick: {
  183. // // true意思:图形在刻度中间
  184. // // false意思:图形在刻度之间
  185. // alignWithLabel: false,
  186. // show: false
  187. // },
  188. // //文字
  189. // axisLabel: {
  190. // color: '#4c9bfd'
  191. // }
  192. // }
  193. // ],
  194. // // 控制y轴
  195. // yAxis: [
  196. // {
  197. // // 使用数据的值设为刻度文字
  198. // type: 'value',
  199. // axisTick: {
  200. // // true意思:图形在刻度中间
  201. // // false意思:图形在刻度之间
  202. // alignWithLabel: false,
  203. // show: false
  204. // },
  205. // //文字
  206. // axisLabel: {
  207. // color: '#4c9bfd'
  208. // },
  209. // splitLine: {
  210. // lineStyle: {
  211. // color: 'rgba(0, 240, 255, 0.3)'
  212. // }
  213. // }
  214. // }
  215. // ],
  216. // // 控制x轴
  217. // series: [
  218. // {
  219. // // series配置
  220. // // 颜色
  221. // itemStyle: {
  222. // // 提供的工具函数生成渐变颜色
  223. // color: new echarts.graphic.LinearGradient(
  224. // // (x1,y2) 点到点 (x2,y2) 之间进行渐变
  225. // 0,
  226. // 0,
  227. // 0,
  228. // 1,
  229. // [
  230. // { offset: 0, color: '#00fffb' }, // 0 起始颜色
  231. // { offset: 1, color: '#0061ce' } // 1 结束颜色
  232. // ]
  233. // )
  234. // },
  235. // // 图表数据名称
  236. // name: '用户统计',
  237. // // 图表类型
  238. // type: 'bar',
  239. // // 柱子宽度
  240. // barWidth: '60%',
  241. // // 数据
  242. // data: [
  243. // 2100,
  244. // 1900,
  245. // 1700,
  246. // 1560,
  247. // 1400,
  248. // item,
  249. // item,
  250. // item,
  251. // 900,
  252. // 750,
  253. // 600,
  254. // 480,
  255. // 240
  256. // ]
  257. // }
  258. // ]
  259. // }
  260. // var myechart = echarts.init($('.users .bar')[0])
  261. // myechart.setOption(option)
  262. // myechart.on('click', function (param) {
  263. // alert(
  264. // " "
  265. // )
  266. // setTimeout(function () {
  267. // location.href = ''
  268. // }, 20000)
  269. // })
  270. //})()
  271. ////订单
  272. //;(function () {
  273. // var data = {
  274. // day365: { orders: '20,301,987', amount: '99834' },
  275. // day90: { orders: '301,987', amount: '9834' },
  276. // day30: { orders: '1,987', amount: '3834' },
  277. // day1: { orders: '987', amount: '834' }
  278. // }
  279. // //点击事件
  280. // $('.order').on('click', '.filter a', function () {
  281. // //点击之后加类名
  282. // $(this).addClass('active').siblings().removeClass('active')
  283. // // 先获取点击a的 data-key自定义属性
  284. // var key = $(this).attr('data-key')
  285. // //获取自定义属性
  286. // // data{}==>data.shuxing data['shuxing]
  287. // key = data[key] //
  288. // $('.order .item h4:eq(0)').text(key.orders)
  289. // $('.order .item h4:eq(1)').text(key.amount)
  290. // })
  291. // //定时器
  292. // var index = 0
  293. // var aclick = $('.order a')
  294. // setInterval(function () {
  295. // index++
  296. // if (index > 3) {
  297. // index = 0
  298. // }
  299. // //每san秒调用点击事件
  300. // aclick.eq(index).click()
  301. // }, 3000)
  302. //})()
  303. //销售
  304. //;(function () {
  305. // var option = {
  306. // //鼠标提示工具
  307. // tooltip: {
  308. // trigger: 'axis'
  309. // },
  310. // xAxis: {
  311. // // 类目类型
  312. // type: 'category',
  313. // // x轴刻度文字
  314. // data: [
  315. // '1月',
  316. // '2月',
  317. // '3月',
  318. // '4月',
  319. // '5月',
  320. // '6月',
  321. // '7月',
  322. // '8月',
  323. // '9月',
  324. // '10月',
  325. // '11月',
  326. // '12月'
  327. // ],
  328. // axisTick: {
  329. // show: false //去除刻度线
  330. // },
  331. // axisLabel: {
  332. // color: '#4c9bfd' //文本颜色
  333. // },
  334. // axisLine: {
  335. // show: false //去除轴线
  336. // },
  337. // boundaryGap: false //去除轴内间距
  338. // },
  339. // yAxis: {
  340. // // 数据作为刻度文字
  341. // type: 'value',
  342. // axisTick: {
  343. // show: false //去除刻度线
  344. // },
  345. // axisLabel: {
  346. // color: '#4c9bfd' //文本颜色
  347. // },
  348. // axisLine: {
  349. // show: false //去除轴线
  350. // },
  351. // boundaryGap: false //去除轴内间距
  352. // },
  353. // //图例组件
  354. // legend: {
  355. // textStyle: {
  356. // color: '#4c9bfd' // 图例文字颜色
  357. // },
  358. // right: '10%' //距离右边10%
  359. // },
  360. // // 设置网格样式
  361. // grid: {
  362. // show: true, // 显示边框
  363. // top: '20%',
  364. // left: '3%',
  365. // right: '4%',
  366. // bottom: '3%',
  367. // borderColor: '#012f4a', // 边框颜色
  368. // containLabel: true // 包含刻度文字在内
  369. // },
  370. // series: [
  371. // {
  372. // name: '预期销售额',
  373. // // 数据
  374. // data: [24, 40, 101, 134, 90, 230, 210, 230, 120, 230, 210, 120],
  375. // // 图表类型
  376. // type: 'line',
  377. // // 圆滑连接
  378. // smooth: true,
  379. // itemStyle: {
  380. // color: '#00f2f1' // 线颜色
  381. // }
  382. // },
  383. // {
  384. // name: '实际销售额',
  385. // // 数据
  386. // data: [40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79],
  387. // // 图表类型
  388. // type: 'line',
  389. // // 圆滑连接
  390. // smooth: true,
  391. // itemStyle: {
  392. // color: '#ed3f35' // 线颜色
  393. // }
  394. // }
  395. // ]
  396. // }
  397. // var myechart = echarts.init($('.line')[0])
  398. // myechart.setOption(option)
  399. // //点击效果
  400. // var data = {
  401. // year: [
  402. // [24, 40, 101, 134, 90, 230, 210, 230, 120, 230, 210, 120],
  403. // [40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79]
  404. // ],
  405. // quarter: [
  406. // [23, 75, 12, 97, 21, 67, 98, 21, 43, 64, 76, 38],
  407. // [43, 31, 65, 23, 78, 21, 82, 64, 43, 60, 19, 34]
  408. // ],
  409. // month: [
  410. // [34, 87, 32, 76, 98, 12, 32, 87, 39, 36, 29, 36],
  411. // [56, 43, 98, 21, 56, 87, 43, 12, 43, 54, 12, 98]
  412. // ],
  413. // week: [
  414. // [43, 73, 62, 54, 91, 54, 84, 43, 86, 43, 54, 53],
  415. // [32, 54, 34, 87, 32, 45, 62, 68, 93, 54, 54, 24]
  416. // ]
  417. // }
  418. // $('.sales ').on('click', '.caption a', function () {
  419. // $(this).addClass('active').siblings('a').removeClass('active')
  420. // //option series data
  421. // //获取自定义属性值
  422. // var key = $(this).attr('data-type')
  423. // //取出对应的值
  424. // key = data[key]
  425. // //将值设置到 图表中
  426. // option.series[0].data = key[0]
  427. // option.series[1].data = key[1]
  428. // //再次调用才能在页面显示
  429. // myechart.setOption(option)
  430. // })
  431. // //定时器
  432. // var index = 0
  433. // var timer = setInterval(function () {
  434. // index++
  435. // if (index > 4) {
  436. // index = 0
  437. // }
  438. // $('.sales .caption a').eq(index).click()
  439. // }, 2000)
  440. //})()
  441. //;(function () {
  442. // var option = {
  443. // series: [
  444. // {
  445. // type: 'pie',
  446. // radius: ['130%', '150%'], // 放大图形
  447. // center: ['50%', '80%'], // 往下移动 套住75%文字
  448. // label: {
  449. // show: false
  450. // },
  451. // startAngle: 180,
  452. // hoverOffset: 0, // 鼠标经过不变大
  453. // data: [
  454. // {
  455. // value: 100,
  456. // itemStyle: {
  457. // // 颜色渐变#00c9e0->#005fc1
  458. // color: {
  459. // type: 'linear',
  460. // x: 0,
  461. // y: 0,
  462. // x2: 0,
  463. // y2: 1,
  464. // colorStops: [
  465. // { offset: 0, color: '#00c9e0' },
  466. // { offset: 1, color: '#005fc1' }
  467. // ]
  468. // }
  469. // }
  470. // },
  471. // { value: 100, itemStyle: { color: '#12274d' } }, // 颜色#12274d
  472. // { value: 200, itemStyle: { color: 'transparent' } } // 透明隐藏第三块区域
  473. // ]
  474. // }
  475. // ]
  476. // }
  477. // var myechart = echarts.init($('.gauge')[0])
  478. // myechart.setOption(option)
  479. //})()
  480. //;(function () {
  481. // var data = [
  482. // { name: '可爱多', num: '9,086' },
  483. // { name: '娃哈哈', num: '8,341' },
  484. // { name: '喜之郎', num: '7,407' },
  485. // { name: '八喜', num: '6,080' },
  486. // { name: '小洋人', num: '6,724' },
  487. // { name: '好多鱼', num: '2,170' }
  488. // ]
  489. // $('.inner').on('mouseenter', '.sup li', function () {
  490. // $(this).addClass('active').siblings().removeClass('active')
  491. // //获取随机的值 sort方法 是给数组排序 a-b是从小到大
  492. // //.5-随机0-1的数 可能为正可能为负 排序就会随机
  493. // var radomData = data.sort(function (a, b) {
  494. // return 0.5 - Math.random()
  495. // })
  496. // var html = ''
  497. // radomData.forEach(function (item) {
  498. // html += `<li><span>${item.name}</span><span>${item.num} <s class="icon-up"></s></span></li>`
  499. // })
  500. // //渲染
  501. // $('.sub').html(html)
  502. // })
  503. // $('.province .sup li').eq(0).mouseenter()
  504. // var index = 0
  505. // var timer = setInterval(() => {
  506. // index++
  507. // if (index > 5) {
  508. // index = 0
  509. // }
  510. // $('.sup li').eq(index).mouseenter()
  511. // }, 2000)
  512. //})()