mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-19 15:56:47 +08:00
feat:过滤未发布的评估
This commit is contained in:
@@ -3,10 +3,10 @@
|
|||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="fi_input">
|
<div class="fi_input">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="params.assessmentName"
|
v-model:value="params.assessmentName"
|
||||||
style="width: 424px; height: 40px; border-radius: 8px"
|
style="width: 424px; height: 40px; border-radius: 8px"
|
||||||
placeholder="请输入评估名称"
|
placeholder="请输入评估名称"
|
||||||
maxlength="20"
|
maxlength="20"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="btns" @click="search">
|
<div class="btns" @click="search">
|
||||||
@@ -20,41 +20,39 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<button class="xkbtn" @click="goResearchmanage">
|
<button class="xkbtn" @click="goResearchmanage">新建评估</button>
|
||||||
新建评估
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main_notice" style="display:none;">
|
<div class="main_notice" style="display: none">
|
||||||
<div class="mntc_left">
|
<div class="mntc_left">
|
||||||
<div class="notice_icon"></div>
|
<div class="notice_icon"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main_table">
|
<div class="main_table">
|
||||||
<a-table
|
<a-table
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
class="ant-table-striped"
|
class="ant-table-striped"
|
||||||
:row-class-name="(_, index) => (index % 2 === 1 ? 'table-striped' : null)"
|
:row-class-name="(_, index) => (index % 2 === 1 ? 'table-striped' : null)"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:row-selection="rowSelection"
|
:row-selection="rowSelection"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {computed, defineEmits, defineProps, ref, watch} from "vue";
|
import { computed, defineEmits, defineProps, ref, watch } from "vue";
|
||||||
import {useRouter} from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import {useRowsPage} from "@/api/request";
|
import { useRowsPage } from "@/api/request";
|
||||||
import {ASSESSMENT_PAGE} from "@/api/apis";
|
import { ASSESSMENT_PAGE } from "@/api/apis";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: String,
|
id: String,
|
||||||
name: String
|
name: String,
|
||||||
})
|
});
|
||||||
const emit = defineEmits([])
|
const emit = defineEmits([]);
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{
|
{
|
||||||
title: "名称",
|
title: "名称",
|
||||||
@@ -71,11 +69,17 @@ const columns = ref([
|
|||||||
align: "center",
|
align: "center",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
customRender: (text) => {
|
customRender: (text) => {
|
||||||
return (
|
return (
|
||||||
<div class="racona">
|
<div class="racona">
|
||||||
<span> {text.record.essayQuestionVoList.length + text.record.multipleStemVoList.length + text.record.scoringQuestionVoList.length + text.record.singleStemVoList.length}</span>
|
<span>
|
||||||
</div>
|
{" "}
|
||||||
);
|
{text.record.essayQuestionVoList.length +
|
||||||
|
text.record.multipleStemVoList.length +
|
||||||
|
text.record.scoringQuestionVoList.length +
|
||||||
|
text.record.singleStemVoList.length}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -94,38 +98,45 @@ const columns = ref([
|
|||||||
align: "center",
|
align: "center",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
},
|
},
|
||||||
])
|
]);
|
||||||
const initParams = {
|
const initParams = {
|
||||||
assessmentName: '',
|
assessmentName: "",
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
}
|
releaseStatus: 2,
|
||||||
const router = useRouter()
|
};
|
||||||
const params = ref(initParams)
|
const router = useRouter();
|
||||||
|
const params = ref(initParams);
|
||||||
|
|
||||||
const rowSelectKeys = ref([]);
|
const rowSelectKeys = ref([]);
|
||||||
const selectsData = ref([]);
|
const selectsData = ref([]);
|
||||||
|
|
||||||
const {data, loading, total, fetch} = useRowsPage(ASSESSMENT_PAGE, params.value)
|
const { data, loading, total, fetch } = useRowsPage(
|
||||||
console.log(data)
|
ASSESSMENT_PAGE,
|
||||||
watch(()=>props.id, () => {
|
params.value
|
||||||
if (props.id) {
|
);
|
||||||
rowSelectKeys.value = [props.id]
|
console.log(data);
|
||||||
selectsData.value = [{id: props.id, assessmentName: props.name}]
|
watch(
|
||||||
} else {
|
() => props.id,
|
||||||
rowSelectKeys.value = []
|
() => {
|
||||||
selectsData.value = []
|
if (props.id) {
|
||||||
|
rowSelectKeys.value = [props.id];
|
||||||
|
selectsData.value = [{ id: props.id, assessmentName: props.name }];
|
||||||
|
} else {
|
||||||
|
rowSelectKeys.value = [];
|
||||||
|
selectsData.value = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
|
|
||||||
const customRow = (record) => ({
|
const customRow = (record) => ({
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
rowSelectKeys.value = [record.id]
|
rowSelectKeys.value = [record.id];
|
||||||
selectsData.value = [record]
|
selectsData.value = [record];
|
||||||
emit('update:id', selectsData.value[0].id)
|
emit("update:id", selectsData.value[0].id);
|
||||||
emit('update:name', selectsData.value[0].assessmentName)
|
emit("update:name", selectsData.value[0].assessmentName);
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
const pagination = computed(() => ({
|
const pagination = computed(() => ({
|
||||||
total: total.value,
|
total: total.value,
|
||||||
@@ -137,10 +148,10 @@ const pagination = computed(() => ({
|
|||||||
|
|
||||||
const changePagination = (e) => {
|
const changePagination = (e) => {
|
||||||
params.value.pageIndex = e;
|
params.value.pageIndex = e;
|
||||||
fetch()
|
fetch();
|
||||||
};
|
};
|
||||||
const rowSelection = computed(() => ({
|
const rowSelection = computed(() => ({
|
||||||
type: 'radio',
|
type: "radio",
|
||||||
columnWidth: 20,
|
columnWidth: 20,
|
||||||
selectedRowKeys: rowSelectKeys.value,
|
selectedRowKeys: rowSelectKeys.value,
|
||||||
onChange: onSelectChange,
|
onChange: onSelectChange,
|
||||||
@@ -150,27 +161,26 @@ const rowSelection = computed(() => ({
|
|||||||
function onSelectChange(e, l) {
|
function onSelectChange(e, l) {
|
||||||
rowSelectKeys.value = e;
|
rowSelectKeys.value = e;
|
||||||
selectsData.value = l;
|
selectsData.value = l;
|
||||||
emit('update:id', selectsData.value[0].id)
|
emit("update:id", selectsData.value[0].id);
|
||||||
emit('update:name', selectsData.value[0].assessmentName)
|
emit("update:name", selectsData.value[0].assessmentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
function search() {
|
function search() {
|
||||||
params.value.pageIndex = 1
|
params.value.pageIndex = 1;
|
||||||
fetch()
|
fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
rowSelectKeys.value = [];
|
rowSelectKeys.value = [];
|
||||||
selectsData.value = [];
|
selectsData.value = [];
|
||||||
params.value.pageIndex = 1
|
params.value.pageIndex = 1;
|
||||||
params.value.keyWord = ''
|
params.value.keyWord = "";
|
||||||
fetch()
|
fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
const goResearchmanage = () => {
|
const goResearchmanage = () => {
|
||||||
router.push({path: "/researchmanage"});
|
router.push({ path: "/researchmanage" });
|
||||||
}
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.xkbtn {
|
.xkbtn {
|
||||||
@@ -315,8 +325,8 @@ const goResearchmanage = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ant-table-tbody
|
.ant-table-tbody
|
||||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||||
> td {
|
> td {
|
||||||
background: #f6f9fd;
|
background: #f6f9fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user