This commit is contained in:
NiSen
2023-06-22 12:54:06 +08:00
parent eb4085e546
commit a8c1bb47be

View File

@@ -51,10 +51,10 @@
</template>
</a-table>
</div>
<div class="pa" style="display: flex;justify-content: flex-end;padding: 0 38px;">
<a-pagination show-quick-jumper :pageSize="searchData.pageSize" :current="searchData.pageIndex" :total="state.total"
class="pagination" @change="handelChangePage" show-size-changer />
</div>
<div class="pa" style="display: flex; justify-content: flex-end; padding: 0 38px">
<a-pagination show-quick-jumper :pageSize="searchData.pageSize" :current="searchData.pageIndex" :total="state.total"
class="pagination" @change="handelChangePage" show-size-changer />
</div>
<InitiateRecommend v-model:visible="newNext" :title="添加案例"></InitiateRecommend>
</div>
</template>
@@ -62,9 +62,14 @@
import { ref, onMounted, reactive } from "vue";
import { Form, message } from "ant-design-vue";
import { boeRequest } from "@/api/request";
import { RECOMMEND_PAGE, deleteResearch, caseInfoDownload, rePushOrWithdraw } from "@/api/case";
import {
RECOMMEND_PAGE,
deleteResearch,
caseInfoDownload,
rePushOrWithdraw,
} from "@/api/case";
import dialog from "@/utils/dialog";
import InitiateRecommend from '@/components/drawers/InitiateRecommend.vue'
import InitiateRecommend from "@/components/drawers/InitiateRecommend.vue";
const column = [
{
@@ -87,7 +92,6 @@ const column = [
align: "center",
className: "h",
customRender: ({ text }) => {
return text ? text : "-";
},
},
@@ -122,24 +126,18 @@ const column = [
className: "h",
customRender: ({ text }) => {
switch (text) {
case 1: return (
<span>未推送</span>
)
case 2: return (
<span>推送中</span>
)
case 3: return (
<span>推送</span>
)
case 4: return (
<span style={{ color: 'red' }}>推送失败</span>
)
case 5: return (
<span>已撤回</span>
)
default: return (
<span>-</span>
)
case 1:
return <span>未推送</span>;
case 2:
return <span>推送中</span>;
case 3:
return <span>已推送</span>;
case 4:
return <span style={{ color: "red" }}>推送失败</span>;
case 5:
return <span>已撤回</span>;
default:
return <span>-</span>;
}
},
},
@@ -169,40 +167,39 @@ const state = reactive({
data: [],
total: 0,
status: {
1: '撤回',
2: '撤回',
3: '撤回',
4: '重新推送',
5: '重新推送',
}
})
1: "撤回",
2: "撤回",
3: "撤回",
4: "重新推送",
5: "重新推送",
},
});
// 查询数据
const searchData = ref({
pageIndex: 1,
pageSize: 10,
recommendName: "",
recommendTimeList: []
recommendTimeList: [],
});
const newNext = ref(false);
const recommendTimeList = ref([]);
const loading = ref(false)
const loading = ref(false);
const getList = (num) => {
if (num === 1) searchData.value.pageIndex = 1;
boeRequest(
RECOMMEND_PAGE,
searchData.value
).then((res) => {
loading.value = true;
state.data = res?.result?.list || []
state.total = res?.result?.totalPages || 0;
}).catch(() => {
loading.value = false
})
}
boeRequest(RECOMMEND_PAGE, searchData.value)
.then((res) => {
loading.value = true;
state.data = res?.result?.list || [];
state.total = res?.result?.totalPages || 0;
})
.catch(() => {
loading.value = false;
});
};
// 获取列表数据
getList()
getList();
onMounted(() => {
// 是否需要触发新建弹框
@@ -219,7 +216,7 @@ const handle = (record) => ({
withdraw: async () => {
try {
// editReleaseStatus({ assessmentId: record.id, releaseStatus: 1 });
await rePushOrWithdraw({ casesRecommendId: record.id })
await rePushOrWithdraw({ casesRecommendId: record.id });
getList();
} catch (error) {
message.info("推送失败!");
@@ -227,10 +224,12 @@ const handle = (record) => ({
},
del: async () => {
loading.value = true;
await deleteResearch({ id: record.id }).then(() => {
message.info("删除成功!");
getList();
}).catch(() => loading.value = false)
await deleteResearch({ id: record.id })
.then(() => {
message.info("删除成功!");
getList();
})
.catch(() => (loading.value = false));
},
});
@@ -244,23 +243,24 @@ function handleOper(record, type) {
}
// 信息下载
const downloadInfo = (record) => {
caseInfoDownload({ casesRecommendId: record.id }).then((res) => {
console.log(res);
}).catch(() => {
message.info("信息下载失败");
})
}
caseInfoDownload({ casesRecommendId: record.id })
.then((res) => {
console.log(res);
})
.catch(() => {
message.info("信息下载失败");
});
};
const handelChangePage = (page, pageSize) => {
loading.value = false
searchData.value.pageSize = pageSize
loading.value = false;
searchData.value.pageSize = pageSize;
searchData.value.pageIndex = page;
getList();
};
function timeChange(time, timeStr) {
searchData.value.recommendTimeList = timeStr
searchData.value.recommendTimeList = timeStr;
}
const handleRest = () => {
@@ -269,12 +269,9 @@ const handleRest = () => {
getList();
};
const handleNew = () => {
newNext.value = true;
};
</script>
<style lang="scss">
.clearfix:before,