| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422 |
- <template>
- <div class="application-overview">
- <!-- 右侧主内容区 -->
- <div class="main-content">
- <div style="display: flex;justify-content: space-between;">
- <!-- 搜索栏 -->
- <div class="search-bar">
- <el-input
- placeholder="请输入应用名称关键字"
- v-model="searchKeyword"
- class="search-input"
- >
- <!-- <template #append>
- <el-button type="primary" class="search-btn">搜索</el-button>
- </template> -->
-
- </el-input>
- <el-button type="primary" class="search-btn" @click="getDmsDataList">搜索</el-button>
- </div>
-
- <!-- 应用范围过滤 -->
- <div class="filter-tabs">
- <el-radio-group v-model="activeTab" size="medium" @change="handleTabChange" v-for="item in levelOptions" :key="item.value">
- <el-radio-button :label="item.label">{{ item.value }}</el-radio-button>
- <!-- <el-radio-button label="1">区级</el-radio-button>
- <el-radio-button label="2">街镇</el-radio-button> -->
- </el-radio-group>
- </div>
- </div>
- <!-- 应用卡片网格 -->
- <div class="app-content">
- <div class="applications-grid">
- <div class="application-card" v-for="(app, index) in applications" :key="index">
- <div class="card-image">
- <img :src="curUrl + app.c_picture" :alt="app.title" />
- </div>
- <div class="card-content">
- <div class="app-header">
- <h3 class="app-name">{{ app.title }}</h3>
- <span class="app-level">{{ app.levelName }}</span>
- <span class="app-version">{{ app.version }}</span>
- </div>
- <div class="app-tags">
- <!-- <el-tag size="small" type="success">{{ app.status }}</el-tag> -->
- <el-tag size="small" v-for="tag in app.tags" :key="tag">{{ tag }}</el-tag>
- </div>
- <p class="app-description">{{ app.content }}</p>
- <div class="app-footer">
- <span class="app-date">{{ app.createTime }}</span>
- <el-button type="primary" size="small" class="visit-button" @click="handleVisit">访问</el-button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 加载更多按钮 -->
- <!-- <div class="load-more">
- <el-button type="primary" size="medium">查看更多</el-button>
- </div> -->
- </div>
- </div>
- </template>
- <script>
- import appCenter from "@/api/appCenter";
- import moment from 'moment';
- export default {
- name: "ApplicationOverview",
- data() {
- return {
- searchKeyword: '',
- activeTab: 'all',
- curUrl:systemConfig.dmsDataProxy,
- levelOptions: [],
- tagOptions: [],
- applications: [],
- itemApplications: []
- }
- },
- mounted() {
- this.initData()
- },
- methods: {
- handleTabChange() {
- if (this.activeTab == 'all') {
- this.applications = this.itemApplications;
- } else {
- this.applications = this.itemApplications.filter(item => item.level == this.activeTab);
- }
- },
- initData() {
- this.getDmsCNameAType();
- this.getDmsTagSName();
- this.getDmsDataList();
- },
- handleVisit() {
- // http://localhost:2027/fileView?url=/proxy_dms/static/1_青浦大数据中心一张图功能表20240531.xlsx
- // http://localhost:2027/fileView?url=/proxy_dms/static/test.geojson
- window.open('fileView?url='+this.curUrl+'/static/1_青浦大数据中心一张图功能表20240531.xlsx', '_blank');
- },
- getDmsTagSName(){
- let requestParams = {
- sName: 'tag',
- };
- appCenter.getDmsSName(requestParams).then(res => {
- if (res.code === 200) {
- this.tagOptions = res.content.map(item => ({
- label: item.index,
- value: item.name
- }));
- let allOption = {
- label: 'all',
- value: '全部'
- }
- this.tagOptions.unshift(allOption);
-
- }
- })
- },
- getDmsCNameAType() {
- let requestParams = {
- cName: 'applevel',
- type: 0
- };
-
- appCenter.getDmsCNameAType(requestParams).then(res => {
- if (res.code === 200) {
- this.levelOptions = res.content.map(item => ({
- label: item.index,
- value: item.name
- }));
- let allOption = {
- label: 'all',
- value: '全部'
- }
- this.levelOptions.unshift(allOption);
-
- }
- })
- },
- getDmsDataList() {
- let requestParams = {
- columnId: 1658,
- states: 0,
- pageSize: 999,
- page: 0
- };
- if (this.searchKeyword) {
- requestParams.search = JSON.stringify([
- {
- field: "title",
- searchType: 2,
- content: { value: "%" + this.searchKeyword + "%" },
- },
- ]);
- }
- appCenter.getDmsDataList(requestParams).then(res => {
- if (res.code === 200) {
- this.itemApplications = res.content.data.map(item => ({
- ...item,
- status: item.status === 0 ? '待审核' : item.status === 1 ? '待发布' : item.status === 2 ? '未完成' : '已完成',
- // levelName: item.level == 0 ? '区级' : item.level == 1 ? '街镇' : item.level == 2 ? '社区' : '',
- levelName: this.levelOptions.find(info => info.label == item.level.trim())?.value || '',
- tags: item.tag.split(',').map(tag => this.tagOptions.find(info => info.label == tag.trim())?.value || ''),
- createTime: moment(item.create_time).format('YYYY-MM-DD HH:mm:ss')
- }))
- this.applications = this.itemApplications;
- this.handleTabChange();
- }else{
- this.applications = [];
- }
- })
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .application-overview {
- display: flex;
- width: 100%;
- background-color: #08224a;
- color: #ffffff;
- }
- /* 右侧主内容区 */
- .main-content {
- flex: 1;
- padding: 20px 30px;
- overflow-y: auto;
- }
- /* 搜索栏样式 */
- .search-bar {
- margin-bottom: 20px;
-
- .search-input {
- width: 400px;
-
- // ::v-deep .el-input__inner {
- // background-color: rgba(255, 255, 255, 0.1);
- // border: 1px solid rgba(255, 255, 255, 0.2);
- // color: #ffffff;
-
- // &::placeholder {
- // color: rgba(255, 255, 255, 0.6);
- // }
- // }
-
- // ::v-deep .el-input__prepend {
- // background-color: rgba(255, 255, 255, 0.1);
- // border-color: rgba(255, 255, 255, 0.2);
- // color: rgba(255, 255, 255, 0.8);
- // }
- }
- .search-btn {
- margin-left: 10px;
- }
- }
- /* 过滤标签样式 */
- .filter-tabs {
- margin-bottom: 30px;
-
- ::v-deep .el-radio-group {
- .el-radio-button {
- background-color: rgba(255, 255, 255, 0.1);
- border-color: rgba(255, 255, 255, 0.2);
- color: rgba(255, 255, 255, 0.8);
-
- &:first-child .el-radio-button__inner {
- border-left-color: rgba(255, 255, 255, 0.2);
- }
-
- .el-radio-button__inner {
- background-color: transparent;
- border-color: rgba(255, 255, 255, 0.2);
- color: rgba(255, 255, 255, 0.8);
- }
-
- &.is-active {
- background-color: #1890ff;
-
- .el-radio-button__inner {
- background-color: #1890ff;
- border-color: #1890ff;
- color: #ffffff;
- }
- }
- }
- }
- }
- .app-content{
- // height: 640px;
- height: calc(100vh - 266px);
- overflow: auto;
- }
- /* 应用卡片网格样式 */
- .applications-grid {
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
- gap: 25px;
- }
- /* 应用卡片样式 */
- .application-card {
- background-color: rgba(255, 255, 255, 0.05);
- border: 1px solid rgba(255, 255, 255, 0.1);
- border-radius: 8px;
- overflow: hidden;
- transition: all 0.3s ease;
-
- &:hover {
- transform: translateY(-5px);
- box-shadow: 0 10px 30px rgba(24, 144, 255, 0.2);
- border-color: rgba(24, 144, 255, 0.4);
- }
-
- .card-image {
- width: 100%;
- height: 160px;
- overflow: hidden;
-
- img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- transition: transform 0.3s ease;
- }
-
- &:hover img {
- transform: scale(1.05);
- }
- }
-
- .card-content {
- padding: 15px;
- }
-
- .app-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 10px;
-
- .app-name {
- font-size: 16px;
- font-weight: bold;
- margin: 0;
- color: #ffffff;
- }
- .app-level {
- font-size: 12px;
- color: rgba(255, 255, 255, 0.6);
- background-color: rgba(27, 117, 236, 0.8);
- padding: 2px 6px;
- border-radius: 4px;
- }
- .app-version {
- font-size: 12px;
- color: rgba(255, 255, 255, 0.6);
- background-color: rgba(255, 255, 255, 0.1);
- padding: 2px 6px;
- border-radius: 4px;
- }
- }
-
- .app-tags {
- margin-bottom: 10px;
-
- .el-tag {
- margin-right: 5px;
- margin-bottom: 5px;
- }
- }
-
- .app-description {
- font-size: 13px;
- line-height: 1.6;
- color: rgba(255, 255, 255, 0.7);
- margin-bottom: 15px;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
-
- .app-footer {
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .app-date {
- font-size: 12px;
- color: rgba(255, 255, 255, 0.5);
- }
-
- .visit-button {
- padding: 4px 12px;
- font-size: 12px;
- border-radius: 4px;
- }
- }
- }
- /* 加载更多按钮 */
- .load-more {
- text-align: center;
- margin-bottom: 30px;
-
- .el-button {
- padding: 10px 30px;
- background-color: rgba(24, 144, 255, 0.2);
- border-color: rgba(24, 144, 255, 0.4);
- color: #1890ff;
-
- &:hover {
- background-color: rgba(24, 144, 255, 0.3);
- border-color: rgba(24, 144, 255, 0.6);
- }
- }
- }
- /* 响应式设计 */
- @media (max-width: 1200px) {
- .applications-grid {
- grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
- gap: 20px;
- }
- }
- @media (max-width: 992px) {
- .sidebar {
- width: 180px;
-
- .sidebar-menu .menu-item {
- padding: 12px 15px;
-
- i {
- font-size: 16px;
- }
- }
- }
-
- .main-content {
- padding: 15px 20px;
- }
-
- .search-input {
- width: 300px !important;
- }
-
- .applications-grid {
- grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
- gap: 15px;
- }
- }
- </style>
|