mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 20:06:47 +08:00
feat:修改复制参数
This commit is contained in:
@@ -66,28 +66,67 @@
|
||||
>
|
||||
<template #operation="{ record }">
|
||||
<a-space style="padding-right: 10px">
|
||||
<a-button v-if="record.releaseStatus === '1' && checkPer(record.permissions)"
|
||||
@click=" handleOper(record,'push')" type="link">发布
|
||||
<a-button
|
||||
v-if="
|
||||
record.releaseStatus === '1' && checkPer(record.permissions)
|
||||
"
|
||||
@click="handleOper(record, 'push')"
|
||||
type="link"
|
||||
>发布
|
||||
</a-button>
|
||||
<a-button v-if="record.releaseStatus === '1' && checkPer(record.permissions)"
|
||||
@click=" editOper(record)" type="link">编辑
|
||||
<a-button
|
||||
v-if="
|
||||
record.releaseStatus === '1' && checkPer(record.permissions)
|
||||
"
|
||||
@click="editOper(record)"
|
||||
type="link"
|
||||
>编辑
|
||||
</a-button>
|
||||
<a-button v-if="record.releaseStatus === '1' && checkPer(record.permissions)"
|
||||
@click=" handleEditPage(record.id)" type="link">基础信息
|
||||
<a-button
|
||||
v-if="
|
||||
record.releaseStatus === '1' && checkPer(record.permissions)
|
||||
"
|
||||
@click="handleEditPage(record.id)"
|
||||
type="link"
|
||||
>基础信息
|
||||
</a-button>
|
||||
<a-button v-if="record.releaseStatus === '2' && checkPer(record.permissions)"
|
||||
@click=" toManage(record.id, record)" type="link">管理
|
||||
<a-button
|
||||
v-if="
|
||||
record.releaseStatus === '2' && checkPer(record.permissions)
|
||||
"
|
||||
@click="toManage(record.id, record)"
|
||||
type="link"
|
||||
>管理
|
||||
</a-button>
|
||||
<a-button v-if="checkPer(record.permissions)" @click=" handleOper(record,'copy')" type="link">复制
|
||||
<a-button
|
||||
v-if="checkPer(record.permissions)"
|
||||
@click="handleOper(record, 'copy')"
|
||||
type="link"
|
||||
>复制
|
||||
</a-button>
|
||||
<a-button v-if="record.releaseStatus === '2' && checkPer(record.permissions)"
|
||||
@click="() => handleOper(record,'withdraw')" type="link">撤回
|
||||
<a-button
|
||||
v-if="
|
||||
record.releaseStatus === '2' && checkPer(record.permissions)
|
||||
"
|
||||
@click="() => handleOper(record, 'withdraw')"
|
||||
type="link"
|
||||
>撤回
|
||||
</a-button>
|
||||
<a-button v-if="record.releaseStatus === '2' && checkPer(record.permissions)"
|
||||
@click=" handleOper(record,'end')" type="link">结束
|
||||
<a-button
|
||||
v-if="
|
||||
record.releaseStatus === '2' && checkPer(record.permissions)
|
||||
"
|
||||
@click="handleOper(record, 'end')"
|
||||
type="link"
|
||||
>结束
|
||||
</a-button>
|
||||
<a-button v-if="record.releaseStatus !== '2' && checkPer(record.permissions)"
|
||||
@click=" handleOper(record,'del')" type="link">删除
|
||||
<a-button
|
||||
v-if="
|
||||
record.releaseStatus !== '2' && checkPer(record.permissions)
|
||||
"
|
||||
@click="handleOper(record, 'del')"
|
||||
type="link"
|
||||
>删除
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -145,19 +184,27 @@
|
||||
</div>
|
||||
<div class="btn">
|
||||
<button class="samtn btn2" @click="handleCancel">取消</button>
|
||||
<a-button class="samtn btn2" @click="handleNext" :loading="formData.validated===1">
|
||||
<a-button
|
||||
class="samtn btn2"
|
||||
@click="handleNext"
|
||||
:loading="formData.validated === 1"
|
||||
>
|
||||
{{ !formData.id ? "下一步" : "确定" }}
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal
|
||||
>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import {createResearch, deleteResearch, editAssessmentName, editReleaseStatus,} from "@/api/indexResearch";
|
||||
import {
|
||||
createResearch,
|
||||
deleteResearch,
|
||||
editAssessmentName,
|
||||
editReleaseStatus,
|
||||
} from "@/api/indexResearch";
|
||||
import { checkPer } from "@/utils/utils";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import NameInput from "@/components/project/NameInput";
|
||||
@@ -297,10 +344,16 @@ const rulesRef = ref({
|
||||
});
|
||||
|
||||
const { resetFields } = Form.useForm(searchData, {});
|
||||
const { resetFields: resetFormFields, validate } = Form.useForm(formData, rulesRef);
|
||||
const { resetFields: resetFormFields, validate } = Form.useForm(
|
||||
formData,
|
||||
rulesRef
|
||||
);
|
||||
|
||||
const { data, total, loading, fetch } = useRowsPage(ASSESSMENT_PAGE, searchData.value);
|
||||
const handle = record => ({
|
||||
const { data, total, loading, fetch } = useRowsPage(
|
||||
ASSESSMENT_PAGE,
|
||||
searchData.value
|
||||
);
|
||||
const handle = (record) => ({
|
||||
push: () => {
|
||||
message.info("发布成功!");
|
||||
record.releaseStatus = "2";
|
||||
@@ -324,10 +377,44 @@ const handle = record => ({
|
||||
},
|
||||
copy: async () => {
|
||||
loading.value = true;
|
||||
message.info("删除成功!");
|
||||
await createResearch({ ...record, assessmentName: record.assessmentName + "(1)" });
|
||||
fetch();
|
||||
message.info("复制成功!");
|
||||
|
||||
record.id = null;
|
||||
if (record.essayQuestionVoList) {
|
||||
record.essayQuestionVoList.forEach((item) => {
|
||||
item.id = null;
|
||||
});
|
||||
}
|
||||
if (record.multipleStemVoList) {
|
||||
record.multipleStemVoList.forEach((item) => {
|
||||
item.multipleChoiceVoList.forEach((a) => {
|
||||
a.id = null;
|
||||
});
|
||||
});
|
||||
}
|
||||
if (record.scoringQuestionVoList) {
|
||||
record.scoringQuestionVoList.forEach((item) => {
|
||||
item.id = null;
|
||||
});
|
||||
}
|
||||
if (record.singleStemVoList) {
|
||||
record.singleStemVoList.forEach((item) => {
|
||||
item.assessmentSingleChoiceVoList.forEach((a) => {
|
||||
a.id = null;
|
||||
});
|
||||
});
|
||||
}
|
||||
console.log("record", record);
|
||||
console.log("复制传参", {
|
||||
...record,
|
||||
assessmentName: record.assessmentName + "(1)",
|
||||
});
|
||||
await createResearch({
|
||||
...record,
|
||||
assessmentName: record.assessmentName + "(1)",
|
||||
});
|
||||
fetch();
|
||||
},
|
||||
});
|
||||
const handleMsg = {
|
||||
push: "您确定要发布此评估吗",
|
||||
@@ -379,7 +466,10 @@ function handleEditPage(id) {
|
||||
}
|
||||
|
||||
function toManage(id, record) {
|
||||
router.push({ path: `/managepage/${id}`, query: { createName:record.createName, createTime:record.createTime } });
|
||||
router.push({
|
||||
path: `/managepage/${id}`,
|
||||
query: { createName: record.createName, createTime: record.createTime },
|
||||
});
|
||||
}
|
||||
|
||||
const handleNext = async () => {
|
||||
@@ -392,12 +482,18 @@ const handleNext = async () => {
|
||||
return;
|
||||
}
|
||||
if (!formData.value.id) {
|
||||
router.push({ path: "/researchadd", query: { name: formData.value.assessmentName } });
|
||||
router.push({
|
||||
path: "/researchadd",
|
||||
query: { name: formData.value.assessmentName },
|
||||
});
|
||||
} else {
|
||||
newNext.value = false
|
||||
newNext.value = false;
|
||||
loading.value = true;
|
||||
message.info("编辑成功!");
|
||||
await editAssessmentName({ assessmentId: formData.value.id, assessmentName: formData.value.assessmentName });
|
||||
await editAssessmentName({
|
||||
assessmentId: formData.value.id,
|
||||
assessmentName: formData.value.assessmentName,
|
||||
});
|
||||
fetch();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user