wwf
昨天 737179a0ce34147269cccf288fecd0e7bb4c309b
src/views/main/home/index.vue
@@ -7,16 +7,15 @@
    </el-image>
    <div class="main-content">
      <el-row justify="space-between">
        <el-card
        <div
          v-for="(item,index) in operationList"
          :key="`operation${index}`"
          shadow="hover"
          style="max-width: 270px;"
          class="cursor-p my-4"
          class="cursor-p my-4 p-0"
          @click="goOperationPage(item)"
        >
          <el-image :src="$getImageUrl(`/home/${item.value}.png`)">
          <el-image style="max-width: 270px;" :src="$getImageUrl(`/home/${item.value}.png`)">
          </el-image>
        </el-card>
        </div>
      </el-row>
      <el-row justify="space-between" class="py-2" style="border-bottom: 2px solid var(--el-color-primary);">
@@ -24,7 +23,7 @@
          <span style="color: var(--el-color-primary);">通知</span>
          <span>公告</span>
        </el-text>
        <el-button text type="primary">查看全部>></el-button>
        <el-button text type="primary" @click="goNoticeList()">查看全部>></el-button>
      </el-row>
      
      <el-card 
@@ -42,7 +41,7 @@
            </el-row>
          </div>
          <div>
            <el-button text type="primary">点击查看详情>></el-button>
            <el-button text type="primary" @click="goNoticeDetail(notice.id)">点击查看详情>></el-button>
          </div>
        </el-row>
      </el-card>
@@ -55,7 +54,15 @@
</template>
<script>
import { useLoginStore } from '@/stores/login.js'
import { useSessionStore } from '@/stores/session.js'
import { storeToRefs } from 'pinia';
export default {
  setup() {
    const { userInfo } = storeToRefs(useSessionStore())
    const { loginDialogVisible } = storeToRefs(useLoginStore())
    return { userInfo, loginDialogVisible }
  },
  data() {
    return {
      operationList: [
@@ -64,7 +71,7 @@
        { name: "成绩查询", value: 'score' },
        { name: "证书查询", value: 'certificate' },
      ],
      noticeList: []
      noticeList: [],
    }
  },
  created() {
@@ -76,32 +83,51 @@
        this.noticeList = 
        [
          {
            id: '1',
            title: "关于公布2024年广东省产教评技能生态链链主培育单位入选名单的通知",
            publishTime: '2024-07-12 14:24:33',
            area: '广东省',
          },
          {
            id: '2',
            title: "关于公布2024年广东省产教评技能生态链链主培育单位入选名单的通知",
            publishTime: '2024-07-12 14:24:33',
            area: '广东省',
          },
          {
            id: '3',
            title: "关于公布2024年广东省产教评技能生态链链主培育单位入选名单的通知",
            publishTime: '2024-07-12 14:24:33',
            area: '广东省',
          },
          {
            id: '4',
            title: "关于公布2024年广东省产教评技能生态链链主培育单位入选名单的通知",
            publishTime: '2024-07-12 14:24:33',
            area: '广东省',
          },
          {
            id: '5',
            title: "关于公布2024年广东省产教评技能生态链链主培育单位入选名单的通知",
            publishTime: '2024-07-12 14:24:33',
            area: '广东省',
          },
        ]
      }, 400)
    },
    goNoticeDetail(id) {
      this.$router.push(`/main/noticeDetail/${id}`)
    },
    goNoticeList() {
      this.$router.push('/main/noticeList')
    },
    goOperationPage(item) {
      if (item.value != 'appraisalPlan' && !this.userInfo.id) {
        this.loginDialogVisible = true
        this.$message.primary('请先登录')
        return
      }
      this.$router.push(`/main/${item.value}`)
    }
  }
}