index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <div class="application-overview">
  3. <!-- 右侧主内容区 -->
  4. <div class="main-content">
  5. <div style="display: flex;justify-content: space-between;padding-right: 30px;">
  6. <!-- 搜索栏 -->
  7. <div class="search-bar">
  8. <el-input
  9. placeholder="请输入应用名称关键字"
  10. v-model="searchKeyword"
  11. class="search-input"
  12. >
  13. <!-- <template #append>
  14. <el-button type="primary" class="search-btn">搜索</el-button>
  15. </template> -->
  16. </el-input>
  17. <el-button type="primary" class="search-btn" @click="getDmsDataList">搜索</el-button>
  18. </div>
  19. <!-- 应用范围过滤 -->
  20. <div class="filter-tabs">
  21. <el-radio-group v-model="activeTab" size="medium" @change="handleTabChange" v-for="item in buffOptions" :key="item.value">
  22. <el-radio-button :label="item.label">{{ item.value }}</el-radio-button>
  23. <!-- <el-radio-button label="1">区级</el-radio-button>
  24. <el-radio-button label="2">街镇</el-radio-button> -->
  25. </el-radio-group>
  26. </div>
  27. </div>
  28. <!-- 应用卡片网格 -->
  29. <div class="app-content">
  30. <div class="applications-grid">
  31. <div class="application-card" v-for="(app, index) in applications" :key="index">
  32. <div class="card-image">
  33. <img :src="curUrl + app.c_picture" :alt="app.title" />
  34. </div>
  35. <div class="card-content">
  36. <div class="app-header">
  37. <h3 class="app-name">{{ app.title }}</h3>
  38. <!-- <span class="app-level">{{ app.buffName }}</span> -->
  39. <span class="app-version">{{ app.version }}</span>
  40. </div>
  41. <div class="app-tags">
  42. <el-tag size="small" type="success">{{ app.buffName }}</el-tag>
  43. <!-- <el-tag size="small" type="success">{{ app.status }}</el-tag> -->
  44. <el-tag size="small" v-for="tag in app.tags" :key="tag">{{ tag }}</el-tag>
  45. </div>
  46. <p class="app-description">{{ app.content }}</p>
  47. <div class="app-footer">
  48. <span class="app-date">{{ app.createTime }}</span>
  49. <el-button
  50. type="primary"
  51. size="small"
  52. class="visit-button"
  53. @click="handleVisit"
  54. >访问</el-button
  55. >
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <!-- 加载更多按钮 -->
  62. <!-- <div class="load-more">
  63. <el-button type="primary" size="medium">查看更多</el-button>
  64. </div> -->
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import appCenter from "@/api/appCenter";
  70. import moment from "moment";
  71. export default {
  72. name: "ApplicationOverview",
  73. data() {
  74. return {
  75. searchKeyword: '',
  76. activeTab: 'all',
  77. curUrl:systemConfig.dmsDataProxy,
  78. buffOptions: [],
  79. tagOptions: [],
  80. applications: [],
  81. itemApplications: [],
  82. };
  83. },
  84. mounted() {
  85. this.initData();
  86. },
  87. methods: {
  88. handleTabChange() {
  89. console.log(this.activeTab);
  90. if (this.activeTab == 'all') {
  91. this.applications = this.itemApplications;
  92. } else {
  93. this.applications = this.itemApplications.filter(item => item.appbuff == this.activeTab);
  94. }
  95. },
  96. initData() {
  97. this.getDmsCNameAType();
  98. this.getDmsTagSName();
  99. this.getDmsDataList();
  100. },
  101. handleVisit() {
  102. // http://localhost:2027/fileView?url=/proxy_dms/static/1_青浦大数据中心一张图功能表20240531.xlsx
  103. // http://localhost:2027/fileView?url=/proxy_dms/static/test.geojson
  104. // window.open(
  105. // "fileView?url=" +
  106. // this.curUrl +
  107. // "/static/1_青浦大数据中心一张图功能表20240531.xlsx",
  108. // "_blank"
  109. // );
  110. },
  111. getDmsTagSName() {
  112. let requestParams = {
  113. sName: "tag",
  114. };
  115. appCenter.getDmsSName(requestParams).then((res) => {
  116. if (res.code === 200) {
  117. this.tagOptions = res.content.map((item) => ({
  118. label: item.index,
  119. value: item.name,
  120. }));
  121. let allOption = {
  122. label: "all",
  123. value: "全部",
  124. };
  125. this.tagOptions.unshift(allOption);
  126. }
  127. });
  128. },
  129. getDmsCNameAType() {
  130. let requestParams = {
  131. cName: "applevel",
  132. type: 0,
  133. };
  134. appCenter.getDmsCNameAType(requestParams).then((res) => {
  135. if (res.code === 200) {
  136. this.buffOptions = res.content.map(item => ({
  137. label: item.index,
  138. value: item.name
  139. }));
  140. let allOption = {
  141. label: 'all',
  142. value: '全部'
  143. }
  144. this.buffOptions.unshift(allOption);
  145. }
  146. });
  147. },
  148. getDmsDataList() {
  149. let requestParams = {
  150. columnId: systemConfig.columnIds[1], // 应用中心栏目id
  151. states: 0,
  152. orderBy: JSON.stringify([{"field":"frame_time","orderByType":2}]),
  153. pageSize: 9999,
  154. page: 0
  155. };
  156. if (this.searchKeyword) {
  157. requestParams.search = JSON.stringify([
  158. {
  159. field: "title",
  160. searchType: 2,
  161. content: { value: "%" + this.searchKeyword + "%" },
  162. },
  163. ]);
  164. }
  165. appCenter.getDmsDataList(requestParams).then((res) => {
  166. if (res.code === 200) {
  167. this.itemApplications = res.content.data.map((item) => ({
  168. ...item,
  169. status: item.status === 0 ? '待审核' : item.status === 1 ? '待发布' : item.status === 2 ? '未完成' : '已完成',
  170. buffName: this.buffOptions.find(info => info.label == item.appbuff.trim())?.value || '',
  171. tags: item.apptags.split(',').map(tag => this.tagOptions.find(info => info.label == tag.trim())?.value || ''),
  172. createTime: moment(item.create_time).format('YYYY-MM-DD HH:mm:ss')
  173. }))
  174. this.applications = this.itemApplications;
  175. this.handleTabChange();
  176. } else {
  177. this.applications = [];
  178. }
  179. });
  180. },
  181. },
  182. };
  183. </script>
  184. <style lang="less" scoped>
  185. .application-overview {
  186. display: flex;
  187. width: 100%;
  188. background-color: #08224a;
  189. color: #ffffff;
  190. }
  191. /* 右侧主内容区 */
  192. .main-content {
  193. flex: 1;
  194. padding: 5px 30px;
  195. overflow-y: auto;
  196. }
  197. /* 搜索栏样式 */
  198. .search-bar {
  199. margin-bottom: 20px;
  200. .search-input {
  201. width: 400px;
  202. // ::v-deep .el-input__inner {
  203. // background-color: rgba(255, 255, 255, 0.1);
  204. // border: 1px solid rgba(255, 255, 255, 0.2);
  205. // color: #ffffff;
  206. // &::placeholder {
  207. // color: rgba(255, 255, 255, 0.6);
  208. // }
  209. // }
  210. // ::v-deep .el-input__prepend {
  211. // background-color: rgba(255, 255, 255, 0.1);
  212. // border-color: rgba(255, 255, 255, 0.2);
  213. // color: rgba(255, 255, 255, 0.8);
  214. // }
  215. }
  216. .search-btn {
  217. margin-left: 10px;
  218. }
  219. }
  220. /* 过滤标签样式 */
  221. .filter-tabs {
  222. margin-bottom: 30px;
  223. :deep(.el-radio-group) {
  224. .el-radio-button {
  225. background-color: rgba(255, 255, 255, 0.1);
  226. border-color: rgba(255, 255, 255, 0.2);
  227. color: rgba(255, 255, 255, 0.8);
  228. &:first-child .el-radio-button__inner {
  229. border-left-color: rgba(255, 255, 255, 0.2);
  230. }
  231. .el-radio-button__inner {
  232. background-color: transparent;
  233. border-color: rgba(255, 255, 255, 0.2);
  234. color: rgba(255, 255, 255, 0.8);
  235. }
  236. &.is-active {
  237. background-color: #1890ff;
  238. .el-radio-button__inner {
  239. background-color: #1890ff;
  240. border-color: #1890ff;
  241. color: #ffffff;
  242. }
  243. }
  244. }
  245. }
  246. }
  247. .app-content{
  248. // height: 640px;
  249. height: calc(100vh - 266px);
  250. overflow: auto;
  251. padding-right: 20px;
  252. }
  253. /* 应用卡片网格样式 */
  254. .applications-grid {
  255. display: grid;
  256. grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  257. gap: 25px;
  258. }
  259. /* 应用卡片样式 */
  260. .application-card {
  261. background-color: rgba(255, 255, 255, 0.05);
  262. border: 1px solid rgba(255, 255, 255, 0.1);
  263. border-radius: 8px;
  264. overflow: hidden;
  265. transition: all 0.3s ease;
  266. &:hover {
  267. transform: translateY(-5px);
  268. box-shadow: 0 10px 30px rgba(24, 144, 255, 0.2);
  269. border-color: rgba(24, 144, 255, 0.4);
  270. }
  271. .card-image {
  272. width: 100%;
  273. height: 160px;
  274. overflow: hidden;
  275. img {
  276. width: 100%;
  277. height: 100%;
  278. object-fit: cover;
  279. transition: transform 0.3s ease;
  280. }
  281. &:hover img {
  282. transform: scale(1.05);
  283. }
  284. }
  285. .card-content {
  286. padding: 15px;
  287. }
  288. .app-header {
  289. display: flex;
  290. justify-content: space-between;
  291. align-items: center;
  292. margin-bottom: 10px;
  293. .app-name {
  294. font-size: 16px;
  295. font-weight: bold;
  296. margin: 0;
  297. color: #ffffff;
  298. }
  299. .app-level {
  300. font-size: 12px;
  301. color: rgba(255, 255, 255, 0.6);
  302. background-color: rgba(27, 117, 236, 0.8);
  303. padding: 2px 6px;
  304. border-radius: 4px;
  305. }
  306. .app-version {
  307. font-size: 12px;
  308. color: rgba(255, 255, 255, 0.6);
  309. background-color: rgba(255, 255, 255, 0.1);
  310. padding: 2px 6px;
  311. border-radius: 4px;
  312. }
  313. }
  314. .app-tags {
  315. margin-bottom: 10px;
  316. .el-tag {
  317. margin-right: 5px;
  318. margin-bottom: 5px;
  319. }
  320. }
  321. .app-description {
  322. font-size: 13px;
  323. line-height: 1.6;
  324. color: rgba(255, 255, 255, 0.7);
  325. margin-bottom: 15px;
  326. overflow: hidden;
  327. text-overflow: ellipsis;
  328. display: -webkit-box;
  329. -webkit-line-clamp: 2;
  330. -webkit-box-orient: vertical;
  331. }
  332. .app-footer {
  333. display: flex;
  334. justify-content: space-between;
  335. align-items: center;
  336. .app-date {
  337. font-size: 12px;
  338. color: rgba(255, 255, 255, 0.5);
  339. }
  340. .visit-button {
  341. padding: 4px 12px;
  342. font-size: 12px;
  343. border-radius: 4px;
  344. }
  345. }
  346. }
  347. /* 加载更多按钮 */
  348. .load-more {
  349. text-align: center;
  350. margin-bottom: 30px;
  351. .el-button {
  352. padding: 10px 30px;
  353. background-color: rgba(24, 144, 255, 0.2);
  354. border-color: rgba(24, 144, 255, 0.4);
  355. color: #1890ff;
  356. &:hover {
  357. background-color: rgba(24, 144, 255, 0.3);
  358. border-color: rgba(24, 144, 255, 0.6);
  359. }
  360. }
  361. }
  362. /* 响应式设计 */
  363. @media (max-width: 1200px) {
  364. .applications-grid {
  365. grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  366. gap: 20px;
  367. }
  368. }
  369. @media (max-width: 992px) {
  370. .sidebar {
  371. width: 180px;
  372. .sidebar-menu .menu-item {
  373. padding: 12px 15px;
  374. i {
  375. font-size: 16px;
  376. }
  377. }
  378. }
  379. .main-content {
  380. padding: 15px 20px;
  381. }
  382. .search-input {
  383. width: 300px !important;
  384. }
  385. .applications-grid {
  386. grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  387. gap: 15px;
  388. }
  389. }
  390. </style>