index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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: 1658,
  151. // states: 0,
  152. // pageSize: 999,
  153. // page: 0
  154. // };
  155. // if (this.searchKeyword) {
  156. // requestParams.search = JSON.stringify([
  157. // {
  158. // field: "title",
  159. // searchType: 2,
  160. // content: { value: "%" + this.searchKeyword + "%" },
  161. // },
  162. // ]);
  163. // }
  164. let requestParams = {
  165. columnId: 1659,
  166. states: 0,
  167. orderBy: JSON.stringify([{"field":"frame_time","orderByType":2}]),
  168. pageSize: 9999,
  169. page: 0
  170. };
  171. if (this.searchKeyword) {
  172. requestParams.search = JSON.stringify([
  173. {
  174. field: "title",
  175. searchType: 2,
  176. content: { value: "%" + this.searchKeyword + "%" },
  177. },
  178. ]);
  179. }
  180. appCenter.getDmsDataList(requestParams).then((res) => {
  181. if (res.code === 200) {
  182. this.itemApplications = res.content.data.map((item) => ({
  183. ...item,
  184. status: item.status === 0 ? '待审核' : item.status === 1 ? '待发布' : item.status === 2 ? '未完成' : '已完成',
  185. buffName: this.buffOptions.find(info => info.label == item.appbuff.trim())?.value || '',
  186. tags: item.apptags.split(',').map(tag => this.tagOptions.find(info => info.label == tag.trim())?.value || ''),
  187. createTime: moment(item.create_time).format('YYYY-MM-DD HH:mm:ss')
  188. }))
  189. this.applications = this.itemApplications;
  190. this.handleTabChange();
  191. } else {
  192. this.applications = [];
  193. }
  194. });
  195. },
  196. },
  197. };
  198. </script>
  199. <style lang="less" scoped>
  200. .application-overview {
  201. display: flex;
  202. width: 100%;
  203. background-color: #08224a;
  204. color: #ffffff;
  205. }
  206. /* 右侧主内容区 */
  207. .main-content {
  208. flex: 1;
  209. padding: 5px 30px;
  210. overflow-y: auto;
  211. }
  212. /* 搜索栏样式 */
  213. .search-bar {
  214. margin-bottom: 20px;
  215. .search-input {
  216. width: 400px;
  217. // ::v-deep .el-input__inner {
  218. // background-color: rgba(255, 255, 255, 0.1);
  219. // border: 1px solid rgba(255, 255, 255, 0.2);
  220. // color: #ffffff;
  221. // &::placeholder {
  222. // color: rgba(255, 255, 255, 0.6);
  223. // }
  224. // }
  225. // ::v-deep .el-input__prepend {
  226. // background-color: rgba(255, 255, 255, 0.1);
  227. // border-color: rgba(255, 255, 255, 0.2);
  228. // color: rgba(255, 255, 255, 0.8);
  229. // }
  230. }
  231. .search-btn {
  232. margin-left: 10px;
  233. }
  234. }
  235. /* 过滤标签样式 */
  236. .filter-tabs {
  237. margin-bottom: 30px;
  238. :deep(.el-radio-group) {
  239. .el-radio-button {
  240. background-color: rgba(255, 255, 255, 0.1);
  241. border-color: rgba(255, 255, 255, 0.2);
  242. color: rgba(255, 255, 255, 0.8);
  243. &:first-child .el-radio-button__inner {
  244. border-left-color: rgba(255, 255, 255, 0.2);
  245. }
  246. .el-radio-button__inner {
  247. background-color: transparent;
  248. border-color: rgba(255, 255, 255, 0.2);
  249. color: rgba(255, 255, 255, 0.8);
  250. }
  251. &.is-active {
  252. background-color: #1890ff;
  253. .el-radio-button__inner {
  254. background-color: #1890ff;
  255. border-color: #1890ff;
  256. color: #ffffff;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. .app-content{
  263. // height: 640px;
  264. height: calc(100vh - 266px);
  265. overflow: auto;
  266. padding-right: 20px;
  267. }
  268. /* 应用卡片网格样式 */
  269. .applications-grid {
  270. display: grid;
  271. grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  272. gap: 25px;
  273. }
  274. /* 应用卡片样式 */
  275. .application-card {
  276. background-color: rgba(255, 255, 255, 0.05);
  277. border: 1px solid rgba(255, 255, 255, 0.1);
  278. border-radius: 8px;
  279. overflow: hidden;
  280. transition: all 0.3s ease;
  281. &:hover {
  282. transform: translateY(-5px);
  283. box-shadow: 0 10px 30px rgba(24, 144, 255, 0.2);
  284. border-color: rgba(24, 144, 255, 0.4);
  285. }
  286. .card-image {
  287. width: 100%;
  288. height: 160px;
  289. overflow: hidden;
  290. img {
  291. width: 100%;
  292. height: 100%;
  293. object-fit: cover;
  294. transition: transform 0.3s ease;
  295. }
  296. &:hover img {
  297. transform: scale(1.05);
  298. }
  299. }
  300. .card-content {
  301. padding: 15px;
  302. }
  303. .app-header {
  304. display: flex;
  305. justify-content: space-between;
  306. align-items: center;
  307. margin-bottom: 10px;
  308. .app-name {
  309. font-size: 16px;
  310. font-weight: bold;
  311. margin: 0;
  312. color: #ffffff;
  313. }
  314. .app-level {
  315. font-size: 12px;
  316. color: rgba(255, 255, 255, 0.6);
  317. background-color: rgba(27, 117, 236, 0.8);
  318. padding: 2px 6px;
  319. border-radius: 4px;
  320. }
  321. .app-version {
  322. font-size: 12px;
  323. color: rgba(255, 255, 255, 0.6);
  324. background-color: rgba(255, 255, 255, 0.1);
  325. padding: 2px 6px;
  326. border-radius: 4px;
  327. }
  328. }
  329. .app-tags {
  330. margin-bottom: 10px;
  331. .el-tag {
  332. margin-right: 5px;
  333. margin-bottom: 5px;
  334. }
  335. }
  336. .app-description {
  337. font-size: 13px;
  338. line-height: 1.6;
  339. color: rgba(255, 255, 255, 0.7);
  340. margin-bottom: 15px;
  341. overflow: hidden;
  342. text-overflow: ellipsis;
  343. display: -webkit-box;
  344. -webkit-line-clamp: 2;
  345. -webkit-box-orient: vertical;
  346. }
  347. .app-footer {
  348. display: flex;
  349. justify-content: space-between;
  350. align-items: center;
  351. .app-date {
  352. font-size: 12px;
  353. color: rgba(255, 255, 255, 0.5);
  354. }
  355. .visit-button {
  356. padding: 4px 12px;
  357. font-size: 12px;
  358. border-radius: 4px;
  359. }
  360. }
  361. }
  362. /* 加载更多按钮 */
  363. .load-more {
  364. text-align: center;
  365. margin-bottom: 30px;
  366. .el-button {
  367. padding: 10px 30px;
  368. background-color: rgba(24, 144, 255, 0.2);
  369. border-color: rgba(24, 144, 255, 0.4);
  370. color: #1890ff;
  371. &:hover {
  372. background-color: rgba(24, 144, 255, 0.3);
  373. border-color: rgba(24, 144, 255, 0.6);
  374. }
  375. }
  376. }
  377. /* 响应式设计 */
  378. @media (max-width: 1200px) {
  379. .applications-grid {
  380. grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  381. gap: 20px;
  382. }
  383. }
  384. @media (max-width: 992px) {
  385. .sidebar {
  386. width: 180px;
  387. .sidebar-menu .menu-item {
  388. padding: 12px 15px;
  389. i {
  390. font-size: 16px;
  391. }
  392. }
  393. }
  394. .main-content {
  395. padding: 15px 20px;
  396. }
  397. .search-input {
  398. width: 300px !important;
  399. }
  400. .applications-grid {
  401. grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  402. gap: 15px;
  403. }
  404. }
  405. </style>