index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div class="project-box" style="display: none;">
  3. <el-row style="padding-bottom: 16px">
  4. <el-input placeholder="请输入关键字" style="width: 240px" clearable @keyup.enter.native="ChangeKeyWord(keyWord)" v-model="keyWord">
  5. <i slot="prefix" class="el-input__icon el-icon-search" style="cursor: pointer" @click="ChangeKeyWord(keyWord)"></i>
  6. </el-input>
  7. <el-button style="float: right" @click="addProject">添加项目</el-button>
  8. </el-row>
  9. <div class="saga-brand-group">
  10. <el-row :gutter="16">
  11. <el-col :span="6" v-for="item in projectList" :key="item.id">
  12. <el-card shadow="always" class="project-card" :body-style="{ padding: '0px' }">
  13. <el-image style="width: 100%; height: 187px" :src="item.url">
  14. <div slot="error" class="image-slot">
  15. <i class="iconfont icon-wandajituan"></i>
  16. </div>
  17. </el-image>
  18. <div style="padding: 16px">
  19. <span class="project-name" :title="item.name">{{ item.name }}</span>
  20. <span class="iconfont icon-shanchu"></span>
  21. <span class="iconfont icon-bianji"></span>
  22. </div>
  23. </el-card>
  24. </el-col>
  25. </el-row>
  26. </div>
  27. </div>
  28. </template>
  29. <script lang="ts">
  30. import { Component, Vue } from "vue-property-decorator";
  31. import { UserModule } from "../../store/modules/user";
  32. @Component({
  33. name: "index",
  34. })
  35. export default class extends Vue {
  36. private keyWord = "";
  37. private projectList: any = [
  38. {
  39. id: "1",
  40. name: "龙岗万达龙岗万达龙岗万达龙岗万达龙岗万达龙岗万达龙岗万达龙岗万达龙岗万达龙岗万达龙岗万达龙岗万达",
  41. logo: "",
  42. },
  43. {
  44. id: "2",
  45. name: "龙岗万达",
  46. logo: "",
  47. },
  48. {
  49. id: "3",
  50. name: "龙岗万达",
  51. logo: "",
  52. },
  53. {
  54. id: "4",
  55. name: "龙岗万达",
  56. logo: "",
  57. },
  58. {
  59. id: "5",
  60. name: "龙岗万达",
  61. logo: "",
  62. },
  63. {
  64. id: "6",
  65. name: "龙岗万达",
  66. logo: "",
  67. },
  68. ];
  69. get projectId() {
  70. return UserModule.projectId;
  71. }
  72. /**
  73. * 检索项目
  74. * @param 检索关键字
  75. */
  76. private ChangeKeyWord(keyWord: string) {
  77. console.log(keyWord);
  78. }
  79. /**
  80. * 添加项目
  81. */
  82. private addProject() {
  83. console.log("添加项目");
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .project-box {
  89. height: 100%;
  90. padding: 0 16px;
  91. .saga-brand-group {
  92. height: calc(100% - 48px);
  93. overflow-y: auto;
  94. overflow-x: hidden;
  95. ::v-deep .el-col {
  96. margin-bottom: 16px;
  97. }
  98. .project-card {
  99. ::v-deep .image-slot {
  100. display: flex;
  101. width: 100%;
  102. height: 100%;
  103. background-color: #075fa9;
  104. }
  105. .project-name {
  106. display: inline-block;
  107. width: calc(100% - 50px);
  108. cursor: text;
  109. overflow: hidden;
  110. text-overflow: ellipsis;
  111. white-space: nowrap;
  112. }
  113. .icon-bianji {
  114. display: none;
  115. float: right;
  116. cursor: pointer;
  117. margin-right: 12px;
  118. }
  119. .icon-shanchu {
  120. display: none;
  121. float: right;
  122. cursor: pointer;
  123. }
  124. }
  125. .project-card:hover {
  126. .icon-bianji {
  127. display: block;
  128. }
  129. .icon-shanchu {
  130. display: block;
  131. }
  132. }
  133. .saga-brand-list {
  134. display: flex;
  135. flex-direction: row;
  136. flex-wrap: wrap;
  137. justify-content: space-between;
  138. .saga-brand-item {
  139. width: 380px;
  140. height: 247px;
  141. // margin-right: 17px;
  142. margin-bottom: 16px;
  143. cursor: pointer;
  144. box-sizing: border-box;
  145. background-color: #fff;
  146. border-radius: 4px;
  147. border: 1px solid #e4e5e7;
  148. transition: all 0.1s linear 0.01s;
  149. .saga-brand-name {
  150. display: inline-block;
  151. width: 133px;
  152. height: 100%;
  153. margin-right: 5px;
  154. font-size: 14px;
  155. line-height: 22px;
  156. .saga-brand-zhName {
  157. height: 44px;
  158. display: -webkit-box;
  159. -webkit-box-orient: vertical;
  160. -webkit-line-clamp: 2;
  161. overflow: hidden;
  162. }
  163. .saga-brand-enName {
  164. color: #8d9399;
  165. margin-top: 4px;
  166. height: 22px;
  167. overflow: hidden;
  168. white-space: nowrap;
  169. text-overflow: ellipsis;
  170. }
  171. }
  172. .saga-brand-logo {
  173. width: 52px;
  174. height: 52px;
  175. display: inline-block;
  176. vertical-align: top;
  177. ::v-deep .image-slot {
  178. font-size: 30px;
  179. display: flex;
  180. justify-content: center;
  181. align-items: center;
  182. width: 100%;
  183. height: 100%;
  184. background: #f5f7fa;
  185. color: #909399;
  186. }
  187. }
  188. }
  189. .pick {
  190. width: 380px;
  191. height: 1px;
  192. }
  193. .saga-brand-item.brand-new {
  194. border: 1px solid rgba(58, 141, 222, 0.6);
  195. }
  196. .saga-brand-item:hover {
  197. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  198. transform: translate(0, -5px);
  199. }
  200. .saga-brand-item:nth-child(4n) {
  201. margin-right: 0;
  202. }
  203. }
  204. }
  205. }
  206. ::v-deep .icon-wandajituan {
  207. font-size: 60px;
  208. margin: auto;
  209. color: #ffffff;
  210. }
  211. @media screen and (max-width: 1000px) {
  212. ::v-deep .icon-wandajituan {
  213. font-size: 30px;
  214. }
  215. }
  216. </style>