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