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:
@@ -65,29 +65,68 @@
|
|||||||
:pagination="false"
|
:pagination="false"
|
||||||
>
|
>
|
||||||
<template #operation="{ record }">
|
<template #operation="{ record }">
|
||||||
<a-space style="padding-right:10px">
|
<a-space style="padding-right: 10px">
|
||||||
<a-button v-if="record.releaseStatus === '1' && checkPer(record.permissions)"
|
<a-button
|
||||||
@click=" handleOper(record,'push')" type="link">发布
|
v-if="
|
||||||
|
record.releaseStatus === '1' && checkPer(record.permissions)
|
||||||
|
"
|
||||||
|
@click="handleOper(record, 'push')"
|
||||||
|
type="link"
|
||||||
|
>发布
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-if="record.releaseStatus === '1' && checkPer(record.permissions)"
|
<a-button
|
||||||
@click=" editOper(record)" type="link">编辑
|
v-if="
|
||||||
|
record.releaseStatus === '1' && checkPer(record.permissions)
|
||||||
|
"
|
||||||
|
@click="editOper(record)"
|
||||||
|
type="link"
|
||||||
|
>编辑
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-if="record.releaseStatus === '1' && checkPer(record.permissions)"
|
<a-button
|
||||||
@click=" handleEditPage(record.id)" type="link">基础信息
|
v-if="
|
||||||
|
record.releaseStatus === '1' && checkPer(record.permissions)
|
||||||
|
"
|
||||||
|
@click="handleEditPage(record.id)"
|
||||||
|
type="link"
|
||||||
|
>基础信息
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-if="record.releaseStatus === '2' && checkPer(record.permissions)"
|
<a-button
|
||||||
@click=" toManage(record.id, record)" type="link">管理
|
v-if="
|
||||||
|
record.releaseStatus === '2' && checkPer(record.permissions)
|
||||||
|
"
|
||||||
|
@click="toManage(record.id, record)"
|
||||||
|
type="link"
|
||||||
|
>管理
|
||||||
</a-button>
|
</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>
|
||||||
<a-button v-if="record.releaseStatus === '2' && checkPer(record.permissions)"
|
<a-button
|
||||||
@click="() => handleOper(record,'withdraw')" type="link">撤回
|
v-if="
|
||||||
|
record.releaseStatus === '2' && checkPer(record.permissions)
|
||||||
|
"
|
||||||
|
@click="() => handleOper(record, 'withdraw')"
|
||||||
|
type="link"
|
||||||
|
>撤回
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-if="record.releaseStatus === '2' && checkPer(record.permissions)"
|
<a-button
|
||||||
@click=" handleOper(record,'end')" type="link">结束
|
v-if="
|
||||||
|
record.releaseStatus === '2' && checkPer(record.permissions)
|
||||||
|
"
|
||||||
|
@click="handleOper(record, 'end')"
|
||||||
|
type="link"
|
||||||
|
>结束
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-if="record.releaseStatus !== '2' && checkPer(record.permissions)"
|
<a-button
|
||||||
@click=" handleOper(record,'del')" type="link">删除
|
v-if="
|
||||||
|
record.releaseStatus !== '2' && checkPer(record.permissions)
|
||||||
|
"
|
||||||
|
@click="handleOper(record, 'del')"
|
||||||
|
type="link"
|
||||||
|
>删除
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -115,7 +154,7 @@
|
|||||||
>
|
>
|
||||||
<div class="out">
|
<div class="out">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<img class="topimg" src="../../assets/images/courseManage/add1.png"/>
|
<img class="topimg" src="../../assets/images/courseManage/add1.png" />
|
||||||
<div class="topc">{{ !formData.id ? "创建" : "编辑" }}评估</div>
|
<div class="topc">{{ !formData.id ? "创建" : "编辑" }}评估</div>
|
||||||
<div
|
<div
|
||||||
style="margin-left: 500px; cursor: pointer"
|
style="margin-left: 500px; cursor: pointer"
|
||||||
@@ -145,25 +184,33 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<button class="samtn btn2" @click="handleCancel">取消</button>
|
<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 ? "下一步" : "确定" }}
|
{{ !formData.id ? "下一步" : "确定" }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-modal
|
</a-modal>
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref,onMounted} from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import {createResearch, deleteResearch, editAssessmentName, editReleaseStatus,} from "@/api/indexResearch";
|
import {
|
||||||
import {checkPer} from "@/utils/utils";
|
createResearch,
|
||||||
import {Form, message} from "ant-design-vue";
|
deleteResearch,
|
||||||
|
editAssessmentName,
|
||||||
|
editReleaseStatus,
|
||||||
|
} from "@/api/indexResearch";
|
||||||
|
import { checkPer } from "@/utils/utils";
|
||||||
|
import { Form, message } from "ant-design-vue";
|
||||||
import NameInput from "@/components/project/NameInput";
|
import NameInput from "@/components/project/NameInput";
|
||||||
import {useRowsPage} from "@/api/request";
|
import { useRowsPage } from "@/api/request";
|
||||||
import {ASSESSMENT_PAGE} from "@/api/apis";
|
import { ASSESSMENT_PAGE } from "@/api/apis";
|
||||||
import {useRouter} from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import dialog from "@/utils/dialog";
|
import dialog from "@/utils/dialog";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -279,7 +326,7 @@ onMounted(() => {
|
|||||||
// 是否需要触发新建弹框
|
// 是否需要触发新建弹框
|
||||||
let str = location.href;
|
let str = location.href;
|
||||||
let isOpen = str.includes("openCreate=true");
|
let isOpen = str.includes("openCreate=true");
|
||||||
if(isOpen){
|
if (isOpen) {
|
||||||
newNext.value = true;
|
newNext.value = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -297,10 +344,16 @@ const rulesRef = ref({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { resetFields } = Form.useForm(searchData, {});
|
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 { data, total, loading, fetch } = useRowsPage(
|
||||||
const handle = record => ({
|
ASSESSMENT_PAGE,
|
||||||
|
searchData.value
|
||||||
|
);
|
||||||
|
const handle = (record) => ({
|
||||||
push: () => {
|
push: () => {
|
||||||
message.info("发布成功!");
|
message.info("发布成功!");
|
||||||
record.releaseStatus = "2";
|
record.releaseStatus = "2";
|
||||||
@@ -324,10 +377,44 @@ const handle = record => ({
|
|||||||
},
|
},
|
||||||
copy: async () => {
|
copy: async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
message.info("删除成功!");
|
message.info("复制成功!");
|
||||||
await createResearch({ ...record, assessmentName: record.assessmentName + "(1)" });
|
|
||||||
|
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();
|
fetch();
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const handleMsg = {
|
const handleMsg = {
|
||||||
push: "您确定要发布此评估吗",
|
push: "您确定要发布此评估吗",
|
||||||
@@ -379,7 +466,10 @@ function handleEditPage(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toManage(id, record) {
|
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 () => {
|
const handleNext = async () => {
|
||||||
@@ -392,12 +482,18 @@ const handleNext = async () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!formData.value.id) {
|
if (!formData.value.id) {
|
||||||
router.push({ path: "/researchadd", query: { name: formData.value.assessmentName } });
|
router.push({
|
||||||
|
path: "/researchadd",
|
||||||
|
query: { name: formData.value.assessmentName },
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
newNext.value = false
|
newNext.value = false;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
message.info("编辑成功!");
|
message.info("编辑成功!");
|
||||||
await editAssessmentName({ assessmentId: formData.value.id, assessmentName: formData.value.assessmentName });
|
await editAssessmentName({
|
||||||
|
assessmentId: formData.value.id,
|
||||||
|
assessmentName: formData.value.assessmentName,
|
||||||
|
});
|
||||||
fetch();
|
fetch();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -448,8 +544,8 @@ const handleNext = async () => {
|
|||||||
height: 68px;
|
height: 68px;
|
||||||
|
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
rgba(78, 166, 255, 0.2) 0%,
|
rgba(78, 166, 255, 0.2) 0%,
|
||||||
rgba(78, 166, 255, 0) 100%
|
rgba(78, 166, 255, 0) 100%
|
||||||
);
|
);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -736,8 +832,8 @@ const handleNext = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -805,8 +901,8 @@ const handleNext = async () => {
|
|||||||
width: calc(100%);
|
width: calc(100%);
|
||||||
height: 40px;
|
height: 40px;
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
rgba(78, 166, 255, 0.2) 0%,
|
rgba(78, 166, 255, 0.2) 0%,
|
||||||
rgba(78, 166, 255, 0) 100%
|
rgba(78, 166, 255, 0) 100%
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user