index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <div>
  3. <el-card v-loading="loading">
  4. <template #header>
  5. <div class="card-header flex align-center">
  6. <span>贡献者列表</span>
  7. <el-button icon="Plus" type="primary" link @click="handleAdd">新增</el-button>
  8. </div>
  9. </template>
  10. <div class="user-box">
  11. <div class="group" v-for="item in data" :key="item.title">
  12. <div class="title flex" v-if="item.children">
  13. <div class="tit">{{ item.title }}</div>
  14. <div class="total">总人数{{ item.children.length }}</div>
  15. </div>
  16. <div class="user" v-if="item.children">
  17. <el-row :gutter="16" type="flex">
  18. <el-col :span="8" v-for="user in item.children" :key="user.id">
  19. <user-item :data="user" />
  20. </el-col>
  21. </el-row>
  22. </div>
  23. </div>
  24. </div>
  25. </el-card>
  26. <el-card class="mt-5">
  27. <template #header>
  28. <div class="card-header flex align-center">
  29. <span>贡献指南</span>
  30. </div>
  31. </template>
  32. <div class="text-box">
  33. <div class="box-item">
  34. <div class="title">
  35. <div class="tit">关于我们</div>
  36. </div>
  37. <div class="desc">
  38. 我们是一群热爱开源的人,我们希望通过开源的方式,让更多的人了解物联网,参与物联网,爱上物联网。我们需要你的贡献,一起让物联网平台物联网平台变的更好!
  39. </div>
  40. </div>
  41. <div class="box-item">
  42. <div class="title">
  43. <div class="tit">如何加入</div>
  44. </div>
  45. <div class="join-box">
  46. <div class="item" v-for="(item, index) in joinList" :key="index" @click="goLink(item.url)">
  47. <div class="icon">
  48. <svg-icon :icon-class="item.icon" className="icon-svg" color="#0070FF" />
  49. </div>
  50. <div class="text">{{ item.title }}</div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="box-item">
  55. <div class="title">
  56. <div class="tit">贡献规范</div>
  57. </div>
  58. <div class="norm-item">
  59. <div class="item-tit">文档规范</div>
  60. <div class="item-box">
  61. <div class="item">
  62. <div class="tit">格式:</div>
  63. <div class="txt-list">文章格式使用 <span>Markdown</span></div>
  64. </div>
  65. <div class="item">
  66. <div class="tit">内容:</div>
  67. <div class="txt-list">
  68. <ul>
  69. <li>撰写的内容需符合该部分主题</li>
  70. <li>不求文风华丽,只需结构清晰,表述简洁,易读易懂</li>
  71. <li>欢迎原创内容和新解读、新观点,不欢迎大篇幅摘抄和生搬硬套</li>
  72. <li>涉及参考资料的内容需要标明来源出处并获得作者授权(或符合作品许可证)</li>
  73. </ul>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="norm-item">
  79. <div class="item-tit">代码规范</div>
  80. <div class="item-box">
  81. <div class="desc">根据各项目下的代码规范</div>
  82. </div>
  83. </div>
  84. <div class="norm-item">
  85. <div class="item-tit">贡献方式</div>
  86. <div class="way-item">
  87. <div class="tit">直接提交PR:</div>
  88. <div class="desc">
  89. 如果你对阅读到的内容有任何修改建议,并且已经产出了修改后的内容,你可以通过 「Fork + PR」 或者 「轻量级
  90. PR」的方式提交内容进行贡献。你的 PR 会在通过编写小组和审校专家团队审核后合并进「物联网平台」的最终内容中。
  91. </div>
  92. </div>
  93. <div class="way-item">
  94. <div class="tit">提交 Issue:</div>
  95. <div class="desc">
  96. 如果你对阅读到的内容有任何修改建议,并且已经产出了修改后的内容,你可以通过 「Fork + PR」 或者 「轻量级
  97. PR」的方式提交内容进行贡献。你的 PR 会在通过编写小组和审校专家团队审核后合并进「物联网平台」的最终内容中。
  98. </div>
  99. </div>
  100. <div class="way-item">
  101. <div class="tit">领取 Issue:</div>
  102. <div class="desc">
  103. <p>
  104. 1、在
  105. 文档Issue或项目Issue页面中,会有官方和用户提出的各种有关「物联网平台」内容的需求,从中选择你擅长的内容进行评论认领,由编写组确认后即可开始编写。
  106. </p>
  107. <p>
  108. 2、评论内容为 「作者姓名+预计完成时间+备注」 ,如 「 开源爱好者,预计 9 月 18 日完成部分内容」 ,收到用户名为「xiwa」的账号回复
  109. 「已确认」 后,代表你就可以开始编写工作。
  110. </p>
  111. <p>
  112. 3、编写完成后通过 「Fork + PR」 或者 「轻量级 PR」的方式提交内容进行贡献。你的 PR
  113. 会在通过编写小组和审校专家团队审核后合并进「物联网平台」的最终内容中。
  114. </p>
  115. </div>
  116. </div>
  117. <div class="a-link">
  118. <a href="http://iotkit-open-source.gitee.io/document/"
  119. >文档地址
  120. <svg-icon icon-class="external" />
  121. </a>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </el-card>
  127. </div>
  128. </template>
  129. <script lang="ts" setup>
  130. import { ref } from 'vue'
  131. import { useRouter } from 'vue-router'
  132. import { getContributorList } from './api/index.api'
  133. import { postOptions } from './types/index.type'
  134. import UserItem from './components/user-item.vue'
  135. import SvgIcon from '@/components/SvgIcon/index.vue'
  136. const data = ref<any[]>([])
  137. const loading = ref(false)
  138. const getData = () => {
  139. loading.value = true
  140. getContributorList({
  141. // pageNum: 1,
  142. // pageSize: 10000,
  143. }).then((res) => {
  144. const list: any[] = []
  145. const maps = new Map()
  146. res.data.rows.forEach((item, index) => {
  147. if (!maps.has(item.post)) {
  148. maps.set(item.post, [])
  149. }
  150. console.log(item)
  151. console.log(maps)
  152. const arr = maps.get(item.post) || []
  153. arr.push(item)
  154. maps.set(item.post, arr)
  155. })
  156. maps.forEach((item, key) => {
  157. const obj = postOptions.find(f => f.value === key)
  158. list.push({
  159. title: obj?.label,
  160. children: item,
  161. })
  162. })
  163. console.log(list)
  164. data.value = list || []
  165. }).finally(() => {
  166. loading.value = false
  167. })
  168. }
  169. getData()
  170. const joinList = [{
  171. title: '贡献代码',
  172. icon: 'join_code',
  173. url: 'https://gitee.com/iotkit-open-source',
  174. }, {
  175. title: '贡献文档',
  176. icon: 'join_document',
  177. url: 'http://iotkit-open-source.gitee.io/document/',
  178. }, {
  179. title: '贡献测试用例',
  180. icon: 'join_example',
  181. url: 'https://gitee.com/iotkit-open-source',
  182. }, {
  183. title: '贡献示例',
  184. icon: 'join_testcase',
  185. url: 'https://gitee.com/open-iita/iotkit-parent#捐助支持',
  186. }, {
  187. title: '贡献翻译',
  188. icon: 'join_translate',
  189. url: 'https://gitee.com/open-iita/iotkit-parent#捐助支持',
  190. }, {
  191. title: '贡献建议',
  192. icon: 'join_proposal',
  193. url: 'https://gitee.com/open-iita/iotkit-parent#捐助支持',
  194. }, {
  195. title: '贡献资金',
  196. icon: 'join_capital',
  197. url: 'https://gitee.com/open-iita/iotkit-parent#捐助支持',
  198. }]
  199. const goLink = (url) => {
  200. window.open(url)
  201. }
  202. const router = useRouter()
  203. const handleAdd = () => {
  204. router.push({
  205. path: '/system/user-auth/detail/0/add',
  206. })
  207. }
  208. </script>
  209. <style lang="scss" scoped>
  210. .card-header {
  211. justify-content: space-between;
  212. padding-bottom: 8px;
  213. span {
  214. font-weight: 600;
  215. }
  216. }
  217. .user-box {
  218. .group {
  219. margin-bottom: 30px;
  220. &:last-child {
  221. margin-bottom: 0;
  222. }
  223. }
  224. }
  225. .text-box {
  226. .box-item {
  227. margin-bottom: 30px;
  228. .desc {
  229. color: #717C8E;
  230. font-size: 12px;
  231. }
  232. .join-box {
  233. display: flex;
  234. margin-left: 30px;
  235. .item {
  236. margin-right: 70px;
  237. text-align: center;
  238. cursor: pointer;
  239. &:hover {
  240. .icon {
  241. transform: scale(1.1);
  242. }
  243. .text {
  244. color: var(--el-color-primary);
  245. }
  246. }
  247. .icon {
  248. width: 40px;
  249. height: 40px;
  250. display: inline-block;
  251. transition: 0.6s ease;
  252. .icon-svg {
  253. width: 100%;
  254. height: 100%;
  255. }
  256. }
  257. .text {
  258. color: #717C8E;
  259. font-size: 12px;
  260. margin-top: 8px;
  261. }
  262. &:last-child {
  263. margin-right: 0;
  264. }
  265. }
  266. }
  267. .norm-item {
  268. padding-left: 16px;
  269. font-size: 12px;
  270. padding-bottom: 24px;
  271. margin-bottom: 24px;
  272. border-bottom: 1px solid #EFEFEF;
  273. .item-tit {
  274. font-weight: 600;
  275. color: #0B1D30;
  276. font-size: 12px;
  277. margin-bottom: 12px;
  278. }
  279. .item-box {
  280. padding-left: 10px;
  281. .item {
  282. display: flex;
  283. .tit {
  284. color: #54575E;
  285. width: 40px;
  286. font-size: 12px;
  287. margin-bottom: 12px;
  288. font-weight: 600;
  289. }
  290. .txt-list {
  291. ul {
  292. margin: 0;
  293. padding-left: 15px;
  294. li {
  295. margin-bottom: 8px;
  296. &:last-child {
  297. margin-bottom: 0;
  298. }
  299. }
  300. }
  301. }
  302. }
  303. }
  304. .way-item {
  305. padding-left: 10px;
  306. margin-top: 24px;
  307. .tit {
  308. padding-left: 10px;
  309. margin-bottom: 12px;
  310. font-weight: 600;
  311. }
  312. .desc {
  313. padding-left: 10px;
  314. line-height: 20px;
  315. }
  316. }
  317. .a-link {
  318. padding-left: 20px;
  319. a {
  320. display: flex;
  321. align-items: center;
  322. }
  323. svg {
  324. margin-left: 6px;
  325. }
  326. }
  327. }
  328. }
  329. .a-link {
  330. color: var(--el-color-primary);
  331. font-size: 12px;
  332. }
  333. }
  334. .title {
  335. align-items: center;
  336. margin-bottom: 16px;
  337. .tit {
  338. color: #0B1D30;
  339. font-size: 14px;
  340. font-weight: 600;
  341. padding-left: 10px;
  342. position: relative;
  343. &::after {
  344. content: '';
  345. position: absolute;
  346. top: 50%;
  347. left: 0;
  348. width: 2px;
  349. height: 12px;
  350. transform: translateY(-50%);
  351. background-color: var(--el-color-primary);
  352. }
  353. }
  354. .total {
  355. padding-left: 16px;
  356. font-size: 12px;
  357. color: #717C8E;
  358. span {
  359. color: #0B1D30;
  360. }
  361. }
  362. }
  363. </style>