9.18 lpt修改
Showing
4 changed files
with
39 additions
and
23 deletions
| ... | @@ -15,9 +15,9 @@ | ... | @@ -15,9 +15,9 @@ |
| 15 | </el-col> | 15 | </el-col> |
| 16 | <el-col :lg="12"> | 16 | <el-col :lg="12"> |
| 17 | <div style="display: flex;align-items: center;height: 100%"> | 17 | <div style="display: flex;align-items: center;height: 100%"> |
| 18 | <el-input class="search-input" clearable :placeholder="languageLibrary[language].e" v-model="searchParam.text"> | 18 | <el-input v-model="searchParam.name" class="search-input" clearable :placeholder="languageLibrary[language].e"> |
| 19 | <template #append> | 19 | <template #append> |
| 20 | <el-button class="search-btn" > | 20 | <el-button @click="getList" class="search-btn" > |
| 21 | <el-icon> | 21 | <el-icon> |
| 22 | <Search/> | 22 | <Search/> |
| 23 | </el-icon> | 23 | </el-icon> |
| ... | @@ -27,7 +27,7 @@ | ... | @@ -27,7 +27,7 @@ |
| 27 | </div> | 27 | </div> |
| 28 | </el-col> | 28 | </el-col> |
| 29 | </el-row> | 29 | </el-row> |
| 30 | <el-card class="machCard" v-for="(n,index) in newest2"> | 30 | <el-card v-loading="tableLoading" class="machCard" v-for="(n,index) in newest2"> |
| 31 | <el-row> | 31 | <el-row> |
| 32 | <el-col :lg="8" :xs="24"> | 32 | <el-col :lg="8" :xs="24"> |
| 33 | <div class="imgbox"> | 33 | <div class="imgbox"> |
| ... | @@ -116,8 +116,10 @@ const searchParam = ref({ | ... | @@ -116,8 +116,10 @@ const searchParam = ref({ |
| 116 | pageSize:9999, | 116 | pageSize:9999, |
| 117 | enrollStatus:'', | 117 | enrollStatus:'', |
| 118 | releaseStatus: 1, | 118 | releaseStatus: 1, |
| 119 | name:'', | ||
| 119 | }) | 120 | }) |
| 120 | const newest2 = ref([]) | 121 | const newest2 = ref([]) |
| 122 | const tableLoading = ref(false) | ||
| 121 | 123 | ||
| 122 | onMounted(() => { | 124 | onMounted(() => { |
| 123 | getList() | 125 | getList() |
| ... | @@ -129,10 +131,12 @@ const searchByType = (type) => { | ... | @@ -129,10 +131,12 @@ const searchByType = (type) => { |
| 129 | } | 131 | } |
| 130 | 132 | ||
| 131 | const getList = () => { | 133 | const getList = () => { |
| 134 | tableLoading.value = true | ||
| 132 | getCompetitionList(searchParam.value).then(res => { | 135 | getCompetitionList(searchParam.value).then(res => { |
| 133 | if (res.code == 200) { | 136 | if (res.code == 200) { |
| 134 | newest2.value = res.rows | 137 | newest2.value = res.rows |
| 135 | } | 138 | } |
| 139 | tableLoading.value = false | ||
| 136 | console.log(res) | 140 | console.log(res) |
| 137 | }) | 141 | }) |
| 138 | } | 142 | } | ... | ... |
| ... | @@ -16,18 +16,18 @@ | ... | @@ -16,18 +16,18 @@ |
| 16 | </div> | 16 | </div> |
| 17 | </div> | 17 | </div> |
| 18 | <el-row style="margin: 20px 0"> | 18 | <el-row style="margin: 20px 0"> |
| 19 | <el-select | 19 | <!-- <el-select--> |
| 20 | class="list-select" | 20 | <!-- class="list-select"--> |
| 21 | v-model="query.type" | 21 | <!-- v-model="query.type"--> |
| 22 | @change="getList" | 22 | <!-- @change="getList"--> |
| 23 | > | 23 | <!-- >--> |
| 24 | <el-option | 24 | <!-- <el-option--> |
| 25 | v-for="item in optionList" | 25 | <!-- v-for="item in optionList"--> |
| 26 | :key="item.value" | 26 | <!-- :key="item.value"--> |
| 27 | :label="item.label" | 27 | <!-- :label="item.label"--> |
| 28 | :value="item.value" | 28 | <!-- :value="item.value"--> |
| 29 | /> | 29 | <!-- />--> |
| 30 | </el-select> | 30 | <!-- </el-select>--> |
| 31 | </el-row> | 31 | </el-row> |
| 32 | <el-row> | 32 | <el-row> |
| 33 | <el-col v-for="item in competitionList" :lg="8"> | 33 | <el-col v-for="item in competitionList" :lg="8"> |
| ... | @@ -129,7 +129,7 @@ const query = ref({ | ... | @@ -129,7 +129,7 @@ const query = ref({ |
| 129 | pageNum:1, | 129 | pageNum:1, |
| 130 | pageSize:9999, | 130 | pageSize:9999, |
| 131 | cptId:'', | 131 | cptId:'', |
| 132 | type:'1' | 132 | type:'' |
| 133 | }) | 133 | }) |
| 134 | const competitionList = ref([]) | 134 | const competitionList = ref([]) |
| 135 | 135 | ||
| ... | @@ -143,6 +143,7 @@ const getMainInfo = () => { | ... | @@ -143,6 +143,7 @@ const getMainInfo = () => { |
| 143 | getMain(tId.value).then(res => { | 143 | getMain(tId.value).then(res => { |
| 144 | if (res.code === 200) { | 144 | if (res.code === 200) { |
| 145 | mainInfo.value = res.data | 145 | mainInfo.value = res.data |
| 146 | mainInfo.value.beginTime = getTimeFormate(mainInfo.value.beginTime) | ||
| 146 | query.value.cptId = mainInfo.value.id | 147 | query.value.cptId = mainInfo.value.id |
| 147 | getList() | 148 | getList() |
| 148 | } | 149 | } |
| ... | @@ -176,6 +177,15 @@ const getList = () => { | ... | @@ -176,6 +177,15 @@ const getList = () => { |
| 176 | }) | 177 | }) |
| 177 | } | 178 | } |
| 178 | 179 | ||
| 180 | const getTimeFormate = (time) => { | ||
| 181 | const showDay = new Date(time) | ||
| 182 | const year = showDay.getFullYear(); | ||
| 183 | const month = showDay.getMonth() + 1; // 月份是从0开始的,所以需要加1 | ||
| 184 | const date = showDay.getDate(); | ||
| 185 | |||
| 186 | return `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`; | ||
| 187 | } | ||
| 188 | |||
| 179 | const goDetail = (n) => { | 189 | const goDetail = (n) => { |
| 180 | router.push({ | 190 | router.push({ |
| 181 | path:`/contest/detail/${n}` | 191 | path:`/contest/detail/${n}` | ... | ... |
| ... | @@ -7,10 +7,10 @@ | ... | @@ -7,10 +7,10 @@ |
| 7 | </el-col> | 7 | </el-col> |
| 8 | </el-row> | 8 | </el-row> |
| 9 | <el-row> | 9 | <el-row> |
| 10 | <el-col class="photo-space" :lg="24" v-for="item in itemList.slice(0,1)"> | 10 | <el-col class="photo-space" :lg="8" v-for="item in itemList"> |
| 11 | <div class="photo-img-group"> | 11 | <div class="photo-img-group"> |
| 12 | <img class="photo-img" :src="fillImgUrl(item.picUrl)"> | 12 | <img class="photo-img" :src="fillImgUrl(item.picUrl)"> |
| 13 | <!-- <span style="display: block;font-size: 16px;margin:5px 0;color:#fff">{{item.name}}</span>--> | 13 | <span style="display: block;font-size: 16px;margin:5px 0;color:#fff">{{item.name}}</span> |
| 14 | </div> | 14 | </div> |
| 15 | </el-col> | 15 | </el-col> |
| 16 | </el-row> | 16 | </el-row> | ... | ... |
| ... | @@ -7,7 +7,7 @@ | ... | @@ -7,7 +7,7 @@ |
| 7 | </el-col> | 7 | </el-col> |
| 8 | <el-col :lg="12"> | 8 | <el-col :lg="12"> |
| 9 | <div style="display: flex;align-items: center;height: 100%"> | 9 | <div style="display: flex;align-items: center;height: 100%"> |
| 10 | <el-input class="search-input" clearable :placeholder="languageLibrary[language].c" v-model="searchParam.text"> | 10 | <el-input class="search-input" clearable :placeholder="languageLibrary[language].c" v-model="searchParam.name"> |
| 11 | <template #append> | 11 | <template #append> |
| 12 | <el-button @click="getList" class="search-btn" > | 12 | <el-button @click="getList" class="search-btn" > |
| 13 | <el-icon> | 13 | <el-icon> |
| ... | @@ -20,7 +20,7 @@ | ... | @@ -20,7 +20,7 @@ |
| 20 | </el-col> | 20 | </el-col> |
| 21 | </el-row> | 21 | </el-row> |
| 22 | 22 | ||
| 23 | <div style="background: #1f2644;border-radius: 15px;box-shadow: 0 0 15px 5px rgba(0,0,0,0.36)"> | 23 | <div v-loading="tableLoading" style="background: #1f2644;border-radius: 15px;box-shadow: 0 0 15px 5px rgba(0,0,0,0.36)"> |
| 24 | <div class="newsLine" v-for="(n,index) in newsList" :key="index"> | 24 | <div class="newsLine" v-for="(n,index) in newsList" :key="index"> |
| 25 | <div class="item" @click="goDetail(n.noteId)"> | 25 | <div class="item" @click="goDetail(n.noteId)"> |
| 26 | <div class="date"> | 26 | <div class="date"> |
| ... | @@ -42,7 +42,7 @@ | ... | @@ -42,7 +42,7 @@ |
| 42 | <a class="go" /> | 42 | <a class="go" /> |
| 43 | </div> | 43 | </div> |
| 44 | </div> | 44 | </div> |
| 45 | <div style="display: flex;align-items: center"> | 45 | <div v-if="newsList.length > 10" style="display: flex;align-items: center"> |
| 46 | <el-button class="news-more-btn" @click="getMoreInfo">{{ languageLibrary[language].b }}<div class="arrow_towDown"></div></el-button> | 46 | <el-button class="news-more-btn" @click="getMoreInfo">{{ languageLibrary[language].b }}<div class="arrow_towDown"></div></el-button> |
| 47 | </div> | 47 | </div> |
| 48 | </div> | 48 | </div> |
| ... | @@ -82,13 +82,13 @@ const languageLibrary = ref([{ | ... | @@ -82,13 +82,13 @@ const languageLibrary = ref([{ |
| 82 | b:'Xem thêm', | 82 | b:'Xem thêm', |
| 83 | c:'Nhập nội dung tìm kiếm', | 83 | c:'Nhập nội dung tìm kiếm', |
| 84 | }]) | 84 | }]) |
| 85 | 85 | const tableLoading = ref(false) | |
| 86 | const router = useRouter() | 86 | const router = useRouter() |
| 87 | const totalTable = ref(0) | 87 | const totalTable = ref(0) |
| 88 | const searchParam = ref({ | 88 | const searchParam = ref({ |
| 89 | pageNum:1, | 89 | pageNum:1, |
| 90 | pageSize:10, | 90 | pageSize:10, |
| 91 | text:'', | 91 | name:'', |
| 92 | status: 1, | 92 | status: 1, |
| 93 | sortId: 1000, | 93 | sortId: 1000, |
| 94 | }) | 94 | }) |
| ... | @@ -100,6 +100,7 @@ onMounted(() => { | ... | @@ -100,6 +100,7 @@ onMounted(() => { |
| 100 | }) | 100 | }) |
| 101 | 101 | ||
| 102 | const getList = () => { | 102 | const getList = () => { |
| 103 | tableLoading.value = true | ||
| 103 | searchParam.value.pageNum = 1 | 104 | searchParam.value.pageNum = 1 |
| 104 | searchParam.value.pageSize = 10 | 105 | searchParam.value.pageSize = 10 |
| 105 | match.getNoteList(searchParam.value).then(res => { | 106 | match.getNoteList(searchParam.value).then(res => { |
| ... | @@ -107,6 +108,7 @@ const getList = () => { | ... | @@ -107,6 +108,7 @@ const getList = () => { |
| 107 | newsList.value = res.rows | 108 | newsList.value = res.rows |
| 108 | totalTable.value = res.total | 109 | totalTable.value = res.total |
| 109 | } | 110 | } |
| 111 | tableLoading.value = false | ||
| 110 | }) | 112 | }) |
| 111 | } | 113 | } |
| 112 | 114 | ... | ... |
-
Please register or sign in to post a comment