index.vue 11 KB

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