home.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <template>
  2. <div class="mainContentBox">
  3. <div class="content-head">
  4. <div class="head-box-all">
  5. <div class="box-all">
  6. <el-checkbox
  7. v-model="checkAll"
  8. :indeterminate="isIndeterminate"
  9. @change="handleCheckAllChange"
  10. >
  11. </el-checkbox>
  12. <span>显示全部</span>
  13. </div>
  14. <div class="box-num">{{ checkedCities.length }}</div>
  15. <div class="box-text">工程类型</div>
  16. </div>
  17. <div class="head-box-group">
  18. <el-checkbox-group
  19. v-model="checkedCities"
  20. @change="handleCheckedCitiesChange"
  21. >
  22. <div
  23. class="head-box-item"
  24. :class="[checkedCities.includes(city) ? 'active' : '']"
  25. v-for="city in cities"
  26. :key="city"
  27. >
  28. <el-checkbox label="" :value="city"></el-checkbox>
  29. <div class="name">射频类</div>
  30. <div class="num">99+</div>
  31. </div>
  32. </el-checkbox-group>
  33. </div>
  34. </div>
  35. <div class="content-body">
  36. <div class="cotent-btns">
  37. <div>工程列表</div>
  38. <div>
  39. <el-button type="primary" @click="showAddFun">
  40. <span class="add">+</span>
  41. 新增工程
  42. </el-button>
  43. <el-button class="active">
  44. <i />
  45. 按时间倒序
  46. </el-button>
  47. <el-button class="normal">
  48. <i />
  49. 按创建人姓名
  50. </el-button>
  51. </div>
  52. </div>
  53. <div class="content-list">
  54. <div
  55. v-for="(item, index) in engineeringList"
  56. :key="index"
  57. class="content-list-item"
  58. >
  59. <div class="list-item-flex">
  60. <div class="list-itme-tit">{{ item.engineeringProductName }}</div>
  61. <div class="list-item-switch">
  62. <span class="item-gray">发布</span><el-switch v-model="value" />
  63. </div>
  64. </div>
  65. <div class="list-item-flex">
  66. <div>
  67. <span class="item-gray">工程类型:</span
  68. >{{ item.engineeringType }}
  69. </div>
  70. <div><span class="item-gray">版本:</span>1</div>
  71. </div>
  72. <div class="list-item-flex">
  73. <div>
  74. <span class="item-gray">开发人员:</span>{{ item.creator }}
  75. </div>
  76. <div>
  77. <span class="item-gray">更新时间:</span>{{ item.string }}<
  78. </div>
  79. </div>
  80. <div class="list-item-btns">
  81. <span @click="showDetailsFun(item)">
  82. <el-icon>
  83. <Edit />
  84. </el-icon>
  85. </span>
  86. <span>
  87. <el-icon>
  88. <DeleteFilled />
  89. </el-icon>
  90. </span>
  91. <span>
  92. <el-icon>
  93. <Tools />
  94. </el-icon>
  95. </span>
  96. <span>
  97. <el-icon>
  98. <CaretRight />
  99. </el-icon>
  100. </span>
  101. </div>
  102. </div>
  103. </div>
  104. <el-pagination
  105. class="content-pag"
  106. background
  107. layout="prev, pager, next"
  108. :page-size="9"
  109. :total="1000"
  110. @change="handleChange"
  111. />
  112. </div>
  113. </div>
  114. <AddComponent
  115. :show="showAdd"
  116. @handleCancel="showAdd = false"
  117. @save="saveFun"
  118. />
  119. <DetailsComponent :show="showDetails" @handleCancel="showDetails = false" />
  120. </template>
  121. <script lang="ts" setup>
  122. import AddComponent from "./components/add.vue";
  123. import DetailsComponent from "./components/details.vue";
  124. import { ref } from "vue";
  125. import type { CheckboxValueType } from "element-plus";
  126. const checkAll = ref(false);
  127. const isIndeterminate = ref(true);
  128. const checkedCities = ref(["Shanghai", "Beijing"]);
  129. const cities = [
  130. "Shanghai",
  131. "Beijing",
  132. "Guangzhou",
  133. "Shenzhen",
  134. "1",
  135. "2",
  136. "3",
  137. "4",
  138. ];
  139. const handleCheckAllChange = (val: CheckboxValueType) => {
  140. checkedCities.value = val ? cities : [];
  141. isIndeterminate.value = false;
  142. };
  143. const handleCheckedCitiesChange = (value: CheckboxValueType[]) => {
  144. const checkedCount = value.length;
  145. checkAll.value = checkedCount === cities.length;
  146. isIndeterminate.value = checkedCount > 0 && checkedCount < cities.length;
  147. };
  148. const value = ref(true);
  149. interface VersionItem {
  150. id: string; // 主键 string
  151. engineeringProductName: string; // 产品名称 string
  152. engineeringType: string; // 工程类型 string
  153. engineeringVersion: string; // 工程版本 string
  154. creator: string; //创建人 string 开发人员
  155. updated: string; // 修改时间 string(date-time)
  156. created: string; // 创建时间string(date-time)
  157. deleted: string; // 删除标识;0-未删除;1-已删除 integer(int32)
  158. deptId: string; // 部门ID string
  159. orgId: string; // 组织ID string
  160. updator: string; // 上次修改人 string
  161. }
  162. const engineeringList = ref<VersionItem[]>([
  163. {
  164. id: "",
  165. engineeringProductName: "",
  166. engineeringType: "",
  167. engineeringVersion: "",
  168. creator: "",
  169. updated: "",
  170. created: "",
  171. deleted: "",
  172. deptId: "",
  173. orgId: "",
  174. updator: "",
  175. },
  176. {
  177. id: "",
  178. engineeringProductName: "",
  179. engineeringType: "",
  180. engineeringVersion: "",
  181. creator: "",
  182. updated: "",
  183. created: "",
  184. deleted: "",
  185. deptId: "",
  186. orgId: "",
  187. updator: "",
  188. },
  189. {
  190. id: "",
  191. engineeringProductName: "",
  192. engineeringType: "",
  193. engineeringVersion: "",
  194. creator: "",
  195. updated: "",
  196. created: "",
  197. deleted: "",
  198. deptId: "",
  199. orgId: "",
  200. updator: "",
  201. },
  202. {
  203. id: "",
  204. engineeringProductName: "",
  205. engineeringType: "",
  206. engineeringVersion: "",
  207. creator: "",
  208. updated: "",
  209. created: "",
  210. deleted: "",
  211. deptId: "",
  212. orgId: "",
  213. updator: "",
  214. },
  215. ]);
  216. /**
  217. * 分页事件,每页9条
  218. */
  219. const handleChange = (currentPage: number, pageSize: number) => {
  220. // console.log(currentPage);
  221. // console.log(pageSize);
  222. };
  223. /**
  224. * 显示新增弹框
  225. */
  226. let showAdd = ref(false);
  227. const showAddFun = () => {
  228. showAdd.value = true;
  229. };
  230. /**
  231. * 新增弹框返回的数据 请求完成后关闭弹框 showAdd.value = false;
  232. */
  233. const saveFun = (item: VersionItem) => {
  234. console.log(item);
  235. };
  236. /**
  237. * 显示新增弹框
  238. */
  239. let showDetails = ref(false);
  240. const showDetailsFun = (item: any) => {
  241. console.log(item);
  242. showDetails.value = true;
  243. };
  244. </script>
  245. <style scoped lang="scss">
  246. .mainContentBox {
  247. position: absolute;
  248. width: 100%;
  249. .content-head {
  250. color: var(--hj-white-1);
  251. display: flex;
  252. height: 100px;
  253. background: var(--gray-bg-1);
  254. // width: 100%;
  255. // overflow: hidden;
  256. min-width: 0;
  257. .head-box-all {
  258. padding: 6px;
  259. box-sizing: border-box;
  260. border-radius: 4px 0 0 4px;
  261. width: 90px;
  262. height: 100px;
  263. background: linear-gradient(270deg, #3b7cff 0%, #8aa9ec 100%);
  264. color: var(--hj-white-1);
  265. font-size: var(--hj-fs-12);
  266. text-align: center;
  267. .box-all {
  268. color: var(--hj-white-1);
  269. font-size: var(--hj-fs-12);
  270. }
  271. .box-num {
  272. text-align: center;
  273. font-size: var(--hj-fs-24);
  274. }
  275. }
  276. .head-box-group {
  277. flex: 1;
  278. .el-checkbox-group {
  279. height: 100%;
  280. width: 100%;
  281. overflow-x: auto;
  282. overflow-y: hidden;
  283. white-space: nowrap;
  284. display: flex;
  285. align-content: center;
  286. align-items: center;
  287. flex-direction: row;
  288. .head-box-item {
  289. position: relative;
  290. flex: 0 0 182px;
  291. font-size: var(--hj-fs-14);
  292. margin-top: 16px;
  293. padding: 6px;
  294. margin-left: 12px;
  295. height: 67px;
  296. border: 1px solid #afb9d0;
  297. border-radius: 4px 4px 4px 4px;
  298. text-align: center;
  299. .el-checkbox {
  300. position: absolute;
  301. left: 6px;
  302. top: 0;
  303. }
  304. .name {
  305. line-height: 16px;
  306. margin-top: 12px;
  307. font-size: var(--hj-fs-14);
  308. color: var(--fc-color-5);
  309. }
  310. .num {
  311. line-height: 26px;
  312. font-size: var(--hj-fs-20);
  313. font-weight: bold;
  314. color: var(--fc-color-7);
  315. }
  316. &.active {
  317. background: linear-gradient(90deg, #3cbaff 0%, #3b7cff 100%);
  318. .name {
  319. color: var(--hj-white-1);
  320. }
  321. .num {
  322. color: var(--hj-white-1);
  323. }
  324. }
  325. }
  326. }
  327. }
  328. }
  329. .content-body {
  330. .cotent-btns {
  331. display: flex;
  332. justify-content: space-between;
  333. align-items: center;
  334. margin-top: 26px;
  335. margin-bottom: 12px;
  336. .add {
  337. width: 12px;
  338. height: 12px;
  339. line-height: 12px;
  340. border-radius: 12px;
  341. text-align: center;
  342. background-color: #fff;
  343. color: #3b7cff;
  344. margin-right: 10px;
  345. }
  346. .active,
  347. .normal {
  348. i {
  349. width: 14px;
  350. height: 14px;
  351. border-radius: 14px;
  352. vertical-align: middle;
  353. margin-right: 10px;
  354. }
  355. }
  356. .active {
  357. border: 1px solid #1989fa;
  358. color: #1871f8;
  359. i {
  360. border: 4px solid #3b7cff;
  361. }
  362. }
  363. .normal {
  364. i {
  365. border: 1px solid #d5d8de;
  366. }
  367. }
  368. }
  369. }
  370. .content-list {
  371. width: 100%;
  372. display: grid;
  373. grid-template-columns: repeat(3, 1fr);
  374. gap: 20px;
  375. .content-list-item {
  376. border: 1px solid #ccc;
  377. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
  378. border-radius: 4px 4px 4px 4px;
  379. padding-top: 12px;
  380. }
  381. .list-item-flex {
  382. margin-bottom: 12px;
  383. padding: 0 20px;
  384. display: flex;
  385. justify-content: space-between;
  386. align-items: center;
  387. font-size: var(--hj-fs-12);
  388. color: var(--fc-color-5);
  389. .list-itme-tit {
  390. font-size: var(--hj-fs-14);
  391. font-weight: bold;
  392. }
  393. .list-item-switch {
  394. .item-gray {
  395. line-height: 32px;
  396. margin-right: 4px;
  397. }
  398. }
  399. .item-gray {
  400. color: var(--fc-color-3);
  401. }
  402. }
  403. .list-item-btns {
  404. height: 37px;
  405. line-height: 37px;
  406. color: var(--fc-color-6);
  407. display: flex;
  408. justify-content: space-around;
  409. border-top: 1px solid rgba(175, 185, 208, 0.3);
  410. span {
  411. cursor: pointer;
  412. }
  413. }
  414. }
  415. .content-pag {
  416. float: right;
  417. margin-right: 20px;
  418. margin-top: 20px;
  419. padding-bottom: 30px;
  420. }
  421. }
  422. </style>