mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 03:46:45 +08:00
--fix 评估重写
This commit is contained in:
@@ -22,4 +22,4 @@ export const WORK_DETAIL = workId => `/work/queryWorkDetailById?workId=${workId}
|
|||||||
//考试
|
//考试
|
||||||
export const EXAM_DETAIL = examinationId => `/examination/queryExaminationDetailById?examinationId=${examinationId} post`;
|
export const EXAM_DETAIL = examinationId => `/examination/queryExaminationDetailById?examinationId=${examinationId} post`;
|
||||||
//评估
|
//评估
|
||||||
export const ASSESSMENT_DETAIL = "/assessment/queryAssessmentDetailById post";
|
export const ASSESSMENT_DETAIL = (assessmentId)=>`/assessment/queryAssessmentDetailById?assessmentId=${assessmentId} post`;
|
||||||
|
|||||||
@@ -5,60 +5,24 @@
|
|||||||
<span class="title">创建评估</span>
|
<span class="title">创建评估</span>
|
||||||
<router-link to="/researchmanage" class="goback">
|
<router-link to="/researchmanage" class="goback">
|
||||||
<span class="return"></span>
|
<span class="return"></span>
|
||||||
<router-link class="returntext" to="/researchmanage">
|
<router-link class="returntext" to="/researchmanage">返回</router-link>
|
||||||
返回
|
|
||||||
</router-link>
|
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="addtype">
|
<div class="addtype">
|
||||||
<div class="addtypen">创建评估类型</div>
|
<div class="addtypen">创建评估类型</div>
|
||||||
<div class="types" @click="handleTypes(1)">单选题</div>
|
<div class="types" @click="addSingleItem">单选题</div>
|
||||||
<div class="types" @click="handleTypes(2)">多选题</div>
|
<div class="types" @click="addMultipleItem">多选题</div>
|
||||||
<div class="types" @click="handleTypes(3)">问答题</div>
|
<div class="types" @click="addEssayQuestionItem">问答题</div>
|
||||||
<div class="types" @click="handleTypes(4)">评分题</div>
|
<div class="types" @click="addScoringQuestionItem">评分题</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="orderList.length">
|
||||||
v-for="(item, index) in allFormsData"
|
<div v-for="(item, index) in orderList" :key="index + new Date().getTime()">
|
||||||
:key="index + new Date().getTime()"
|
<ResearchAddSingle v-if="item.questionType == 1" :index="item.orderNumber-1" :item="item" :list="data.singleStemVoList"/>
|
||||||
>
|
<ResearchAddMulti v-else-if="item.questionType == 2" :index="item.orderNumber-1" :item="item" :list="data.multipleStemVoList"/>
|
||||||
<ResearchAddSingle
|
<ResearchAddAsk v-else-if="item.questionType == 3" :index="item.orderNumber-1" :item="item" :list="data.essayQuestionVoList"/>
|
||||||
v-if="item.type === 1 && item.deleted!==true"
|
<ResearchAddPin v-else-if="item.questionType == 4" :index="item.orderNumber-1" :item="item" :list="data.scoringQuestionVoList"/>
|
||||||
:item="item"
|
</div>
|
||||||
:assessmentId="assessmentId"
|
|
||||||
@del="handleDel"
|
|
||||||
/>
|
|
||||||
<ResearchAddMulti
|
|
||||||
v-if="item.type === 2 && item.deleted!==true"
|
|
||||||
:item="item"
|
|
||||||
:assessmentId="assessmentId"
|
|
||||||
@del="handleDel"
|
|
||||||
/>
|
|
||||||
<ResearchAddAsk
|
|
||||||
v-if="item.type === 3 && item.deleted!==true"
|
|
||||||
:item="item"
|
|
||||||
:assessmentId="assessmentId"
|
|
||||||
@del="handleDel"
|
|
||||||
/>
|
|
||||||
<ResearchAddPin
|
|
||||||
v-if="item.type === 4 && item.deleted!==true"
|
|
||||||
:item="item"
|
|
||||||
:assessmentId="assessmentId"
|
|
||||||
@del="handleDel"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="opinion name2">
|
|
||||||
<div class="namebox">
|
|
||||||
<div class="inname" style="margin-top: 13px">您的其他意见</div>
|
|
||||||
</div>
|
|
||||||
<div class="in">
|
|
||||||
<a-textarea
|
|
||||||
v-model:value="valueMore"
|
|
||||||
style="height: 110px"
|
|
||||||
show-count
|
|
||||||
:maxlength="200"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<a-button
|
<a-button
|
||||||
@@ -70,9 +34,9 @@
|
|||||||
background-color: #4ea6ff;
|
background-color: #4ea6ff;
|
||||||
"
|
"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
:disabled="!canSubmit"
|
||||||
@click="handleSave"
|
@click="handleSave"
|
||||||
>
|
>保存
|
||||||
保存
|
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -86,639 +50,172 @@
|
|||||||
background-color: #4ea6ff;
|
background-color: #4ea6ff;
|
||||||
"
|
"
|
||||||
@click="handleAllCancel"
|
@click="handleAllCancel"
|
||||||
>
|
>取消
|
||||||
取消
|
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script setup>
|
||||||
import {reactive, toRefs} from "vue";
|
import {computed, ref, watch, watchEffect} from "vue";
|
||||||
import ResearchAddSingle from "./components/ResearchAddSingle.vue";
|
import ResearchAddSingle from "./components/ResearchAddSingle.vue";
|
||||||
import ResearchAddMulti from "./components/ResearchAddMulti.vue";
|
import ResearchAddMulti from "./components/ResearchAddMulti.vue";
|
||||||
import ResearchAddAsk from "./components/ResearchAddAsk.vue";
|
import ResearchAddAsk from "./components/ResearchAddAsk.vue";
|
||||||
import ResearchAddPin from "./components/ResearchAddPin.vue";
|
import ResearchAddPin from "./components/ResearchAddPin.vue";
|
||||||
import {
|
import {editResearchMessage,} from "@/api/indexResearch";
|
||||||
sortBy,
|
|
||||||
traverseArr,
|
|
||||||
filterCommon,
|
|
||||||
deepCloneFilterString,
|
|
||||||
} from "@/utils/utils";
|
|
||||||
import {
|
|
||||||
queryResearchDetailById,
|
|
||||||
editResearchMessage,
|
|
||||||
createResearch,
|
|
||||||
// deleteChoiceQuestion,
|
|
||||||
// deleteQuestionScAndQa,
|
|
||||||
} from "@/api/indexResearch";
|
|
||||||
import {useRoute, useRouter} from "vue-router";
|
import {useRoute, useRouter} from "vue-router";
|
||||||
import {message} from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
|
import {ASSESSMENT_DETAIL} from "@/api/apis";
|
||||||
|
import {request} from "@/api/request";
|
||||||
|
|
||||||
export default {
|
const router = useRouter();
|
||||||
name: "ResearchAdd",
|
const loading = ref(false);
|
||||||
components: {
|
const { params: { id }, query: { name:assessmentName } } = useRoute();
|
||||||
ResearchAddSingle,
|
const data = ref({
|
||||||
ResearchAddMulti,
|
assessmentName,
|
||||||
ResearchAddAsk,
|
singleStemVoList: [],
|
||||||
ResearchAddPin,
|
multipleStemVoList: [],
|
||||||
},
|
essayQuestionVoList: [],
|
||||||
setup() {
|
scoringQuestionVoList: []
|
||||||
const router = useRouter();
|
});
|
||||||
const route = useRoute();
|
const canSubmit = computed(()=>data.value.singleStemVoList.length || data.value.multipleStemVoList.length || data.value.essayQuestionVoList.length || data.value.scoringQuestionVoList.length)
|
||||||
const state = reactive({
|
const orderList = computed(()=>[...data.value.singleStemVoList.filter(t=>!t.deleted),...data.value.multipleStemVoList.filter(t=>!t.deleted),...data.value.essayQuestionVoList.filter(t=>!t.deleted),...data.value.scoringQuestionVoList.filter(t=>!t.deleted)].sort((a,b)=>a.orderNumber-b.orderNumber))
|
||||||
assessmentId: "", //编辑时候传
|
watch(()=>orderList.value.length,()=> orderList.value.forEach((t,i)=>t.orderNumber = i + 1))
|
||||||
assessmentName: "",
|
watchEffect(() => id && request(ASSESSMENT_DETAIL(id), {}).then((res) => data.value = res.data));
|
||||||
assessmentNameNew: route.query.name,
|
const handleSave = () => {
|
||||||
|
console.log(data);
|
||||||
allFormsData: [],
|
loading.value = true;
|
||||||
valueMore: "",
|
// 校验
|
||||||
loading: false,
|
if (!checkVal()) {
|
||||||
});
|
loading.value = false;
|
||||||
|
return false;
|
||||||
// 详情
|
}
|
||||||
const getInfoDate = async () => {
|
editResearchMessage({
|
||||||
let id = router.currentRoute.value.params.id;
|
id,
|
||||||
if (id) {
|
assessmentName: data.value.assessmentName,
|
||||||
state.assessmentId = id;
|
assessmentSingleChoiceDtoList: data.value.singleStemVoList.flatMap(t=>t.assessmentSingleChoiceVoList.map(s=>({...s,deleted:(t.deleted || s.deleted),singleStemName:t.singleStemName}))),
|
||||||
let res = await queryResearchDetailById({
|
assessmentMultipleChoiceDtoList: data.value.multipleStemVoList.flatMap(t=>t.multipleChoiceVoList.map(s=>({...s,deleted:(t.deleted || s.deleted),multipleStemName:t.multipleStemName}))),
|
||||||
assessmentId: state.assessmentId,
|
assessmentEssayQuestionDtoList: data.value.essayQuestionVoList,
|
||||||
}).then((res) => {
|
assessmentScoringQuestionDtoList: data.value.scoringQuestionVoList
|
||||||
if (res.data.code === 200) {
|
}).then(() => {
|
||||||
return res.data.data;
|
loading.value = false;
|
||||||
}
|
message.success("编辑成功");
|
||||||
});
|
router.push({ path: "/researchmanage"});
|
||||||
state.assessmentName = res.assessmentName;
|
});
|
||||||
state.valueMore = res.assessmentMark;
|
|
||||||
let renderArr = [
|
|
||||||
...res.singleStemVoList,
|
|
||||||
...res.multipleStemVoList,
|
|
||||||
...res.essayQuestionVoList,
|
|
||||||
...res.scoringQuestionVoList,
|
|
||||||
];
|
|
||||||
sortBy(renderArr, "orderNumber"); //序号
|
|
||||||
console.log(renderArr)
|
|
||||||
state.allFormsData = parseData(renderArr, "questionType"); //类型
|
|
||||||
}
|
|
||||||
};
|
|
||||||
getInfoDate();
|
|
||||||
|
|
||||||
// 转换成前端格式
|
|
||||||
const parseData = (arr, typeKey) => {
|
|
||||||
const resultArr = [];
|
|
||||||
arr.forEach((item) => {
|
|
||||||
let key = Number(item[typeKey]);
|
|
||||||
let obj = {};
|
|
||||||
if (key === 1) {
|
|
||||||
let restList = traverseArr(item.assessmentSingleChoiceVoList, {
|
|
||||||
ids:"id",
|
|
||||||
deleted:"deleted",
|
|
||||||
inputVal: "singleOptionName",
|
|
||||||
imgVal: "singleOptionPictureAddress",
|
|
||||||
optionId: "singleOptionId",
|
|
||||||
}).map((itm, idx) => {
|
|
||||||
itm.id = idx + 1;
|
|
||||||
return itm;
|
|
||||||
});
|
|
||||||
|
|
||||||
obj = {
|
|
||||||
type: key,
|
|
||||||
valueSingle: item.singleStemName,
|
|
||||||
singleList: restList,
|
|
||||||
orderNumber: item.orderNumber,
|
|
||||||
};
|
|
||||||
resultArr.push(obj);
|
|
||||||
}
|
|
||||||
if (key === 2) {
|
|
||||||
let restList = traverseArr(item.multipleChoiceVoList, {
|
|
||||||
ids:"id",
|
|
||||||
deleted:"deleted",
|
|
||||||
inputVal: "multipleOptionName",
|
|
||||||
imgVal: "multipleOptionPictureAddress",
|
|
||||||
optionId: "multipleOptionId",
|
|
||||||
}).map((itm, idx) => {
|
|
||||||
itm.id = idx + 1;
|
|
||||||
return itm;
|
|
||||||
});
|
|
||||||
|
|
||||||
obj = {
|
|
||||||
type: key,
|
|
||||||
valueMutil: item.multipleStemName,
|
|
||||||
mutilList: restList,
|
|
||||||
orderNumber: item.orderNumber,
|
|
||||||
};
|
|
||||||
resultArr.push(obj);
|
|
||||||
}
|
|
||||||
if (key === 3) {
|
|
||||||
obj = {
|
|
||||||
ids: item.id,
|
|
||||||
deleted:item.deleted,
|
|
||||||
type: key,
|
|
||||||
valueAsk: item.assessmentQaTitle,
|
|
||||||
valueAskDesc: item.assessmentQaDescribe,
|
|
||||||
optionId: item.assessmentQaId,
|
|
||||||
};
|
|
||||||
resultArr.push(obj);
|
|
||||||
}
|
|
||||||
if (key === 4) {
|
|
||||||
obj = {
|
|
||||||
ids: item.id,
|
|
||||||
deleted:item.deleted,
|
|
||||||
type: key,
|
|
||||||
valuePin: item.assessmentScTitle,
|
|
||||||
minScore: item.assessmentMinScore,
|
|
||||||
maxScore: item.assessmentMaxScore,
|
|
||||||
pinQuan: item.weightScale,
|
|
||||||
optionId: item.assessmentScId,
|
|
||||||
};
|
|
||||||
resultArr.push(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
resultArr.map((itm, idx) => {
|
|
||||||
itm.id = idx + 1;
|
|
||||||
return itm;
|
|
||||||
});
|
|
||||||
console.log(resultArr)
|
|
||||||
return resultArr;
|
|
||||||
};
|
|
||||||
// 转换成后端格式
|
|
||||||
const restData = (arr, typeKey) => {
|
|
||||||
const resultArr = [];
|
|
||||||
arr.forEach((item) => {
|
|
||||||
let obj = {};
|
|
||||||
if (item[typeKey] === 1) {
|
|
||||||
let restList = traverseArr(item.singleList, {
|
|
||||||
id:"ids",
|
|
||||||
deleted:"deleted",
|
|
||||||
singleOptionName: "inputVal",
|
|
||||||
singleOptionPictureAddress: "imgVal",
|
|
||||||
singleOptionId: "optionId",
|
|
||||||
}).map((itm, idx) => {
|
|
||||||
itm.optionOrderNum = idx + 1;
|
|
||||||
return itm;
|
|
||||||
});
|
|
||||||
restList.forEach((item) => {
|
|
||||||
item.singleOptionId = item.singleOptionId
|
|
||||||
? item.singleOptionId
|
|
||||||
: "";
|
|
||||||
});
|
|
||||||
|
|
||||||
obj = {
|
|
||||||
questionType: item[typeKey],
|
|
||||||
singleStemName: item.valueSingle,
|
|
||||||
singleList: restList,
|
|
||||||
orderNumber: item.orderNumber,
|
|
||||||
};
|
|
||||||
resultArr.push(obj);
|
|
||||||
}
|
|
||||||
if (item[typeKey] === 2) {
|
|
||||||
let restList = traverseArr(item.mutilList, {
|
|
||||||
id:"ids",
|
|
||||||
deleted:"deleted",
|
|
||||||
multipleOptionName: "inputVal",
|
|
||||||
multipleOptionPictureAddress: "imgVal",
|
|
||||||
multipleOptionId: "optionId",
|
|
||||||
}).map((itm, idx) => {
|
|
||||||
itm.optionOrderNum = idx + 1;
|
|
||||||
return itm;
|
|
||||||
});
|
|
||||||
restList.forEach((item) => {
|
|
||||||
item.multipleOptionId = item.multipleOptionId
|
|
||||||
? item.multipleOptionId
|
|
||||||
: "";
|
|
||||||
});
|
|
||||||
|
|
||||||
obj = {
|
|
||||||
questionType: item[typeKey],
|
|
||||||
multipleStemName: item.valueMutil,
|
|
||||||
mutilList: restList,
|
|
||||||
orderNumber: item.orderNumber,
|
|
||||||
};
|
|
||||||
resultArr.push(obj);
|
|
||||||
}
|
|
||||||
if (item[typeKey] === 3) {
|
|
||||||
obj = {
|
|
||||||
id:item.ids,
|
|
||||||
deleted:item.deleted,
|
|
||||||
questionType: item[typeKey],
|
|
||||||
assessmentQaTitle: item.valueAsk,
|
|
||||||
assessmentQaDescribe: item.valueAskDesc,
|
|
||||||
assessmentQaId: item.optionId ? item.optionId : "",
|
|
||||||
};
|
|
||||||
resultArr.push(obj);
|
|
||||||
}
|
|
||||||
if (item[typeKey] === 4) {
|
|
||||||
obj = {
|
|
||||||
id:item.ids,
|
|
||||||
deleted:item.deleted,
|
|
||||||
questionType: item[typeKey],
|
|
||||||
assessmentScTitle: item.valuePin,
|
|
||||||
assessmentMinScore: item.minScore,
|
|
||||||
assessmentMaxScore: item.maxScore,
|
|
||||||
weightScale: item.pinQuan,
|
|
||||||
assessmentScId: item.optionId ? item.optionId : "",
|
|
||||||
};
|
|
||||||
resultArr.push(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
resultArr.map((itm, idx) => {
|
|
||||||
itm.orderNumber = idx + 1;
|
|
||||||
return itm;
|
|
||||||
});
|
|
||||||
console.log(222);
|
|
||||||
console.log(resultArr);
|
|
||||||
return resultArr;
|
|
||||||
};
|
|
||||||
// 解散传值
|
|
||||||
const parseItem = (arr) => {
|
|
||||||
const filterComObj = filterCommon(arr, "questionType");
|
|
||||||
console.log('filterComObj')
|
|
||||||
console.log(filterComObj)
|
|
||||||
let resultObj = {};
|
|
||||||
for (let key in filterComObj) {
|
|
||||||
if (key === "1") {
|
|
||||||
let arrSingle = filterComObj[key];
|
|
||||||
let arr = [];
|
|
||||||
arrSingle.forEach((item) => {
|
|
||||||
if (item.singleList.length) {
|
|
||||||
item.singleList.forEach((itm) => {
|
|
||||||
arr.push({
|
|
||||||
...itm,
|
|
||||||
singleStemName: item.singleStemName,
|
|
||||||
orderNumber: item.orderNumber,
|
|
||||||
questionType: item.questionType,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
resultObj.assessmentSingleChoiceDtoList = arr;
|
|
||||||
}
|
|
||||||
if (key === "2") {
|
|
||||||
let arrMulti = filterComObj[key];
|
|
||||||
let arr = [];
|
|
||||||
arrMulti.forEach((item) => {
|
|
||||||
if (item.mutilList.length) {
|
|
||||||
item.mutilList.forEach((itm) => {
|
|
||||||
arr.push({
|
|
||||||
...itm,
|
|
||||||
multipleStemName: item.multipleStemName,
|
|
||||||
orderNumber: item.orderNumber,
|
|
||||||
questionType: item.questionType,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
resultObj.assessmentMultipleChoiceDtoList = arr;
|
|
||||||
}
|
|
||||||
if (key === "3") {
|
|
||||||
resultObj.assessmentEssayQuestionDtoList = filterComObj[key];
|
|
||||||
}
|
|
||||||
if (key === "4") {
|
|
||||||
resultObj.assessmentScoringQuestionDtoList = filterComObj[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return resultObj;
|
|
||||||
};
|
|
||||||
const creatFromData = (type) => {
|
|
||||||
let obj = {};
|
|
||||||
switch (type) {
|
|
||||||
case 1:
|
|
||||||
obj = {
|
|
||||||
type,
|
|
||||||
id: state.allFormsData.length + 1,
|
|
||||||
valueSingle: "",
|
|
||||||
deleted: false,
|
|
||||||
singleList: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
inputVal: "",
|
|
||||||
imgVal: "",
|
|
||||||
deleted: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
obj = {
|
|
||||||
type,
|
|
||||||
id: state.allFormsData.length + 1,
|
|
||||||
valueMutil: "",
|
|
||||||
deleted: false,
|
|
||||||
mutilList: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
inputVal: "",
|
|
||||||
imgVal: "",
|
|
||||||
deleted: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
obj = {
|
|
||||||
type,
|
|
||||||
id: state.allFormsData.length + 1,
|
|
||||||
valueAsk: "",
|
|
||||||
valueAskDesc: "",
|
|
||||||
deleted: false,
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
obj = {
|
|
||||||
type,
|
|
||||||
id: state.allFormsData.length + 1,
|
|
||||||
valuePin: "",
|
|
||||||
minScore: 1,
|
|
||||||
maxScore: 10,
|
|
||||||
pinQuan: 100,
|
|
||||||
deleted: false,
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleTypes = (type) => {
|
|
||||||
state.allFormsData.push(creatFromData(type));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDel = ({ id, type, curItem }) => {
|
|
||||||
|
|
||||||
// 接口删除
|
|
||||||
// if (state.assessmentId && (curItem.orderNumber || curItem.optionId)) {
|
|
||||||
// if (type === 1) {
|
|
||||||
// deleteChoiceQuestion({
|
|
||||||
// assessmentId: state.assessmentId,
|
|
||||||
// questionType: "1",
|
|
||||||
// orderNumber: curItem.orderNumber,
|
|
||||||
// }).then((res) => {
|
|
||||||
// if (res.data.code === 200) {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// if (type === 2) {
|
|
||||||
// deleteChoiceQuestion({
|
|
||||||
// assessmentId: state.assessmentId,
|
|
||||||
// questionType: "2",
|
|
||||||
// orderNumber: curItem.orderNumber,
|
|
||||||
// }).then((res) => {
|
|
||||||
// if (res.data.code === 200) {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// if (type === 3) {
|
|
||||||
// deleteQuestionScAndQa({
|
|
||||||
// assessmentId: state.assessmentId,
|
|
||||||
// questionType: "3",
|
|
||||||
// optionId: curItem.optionId,
|
|
||||||
// }).then((res) => {
|
|
||||||
// if (res.data.code === 200) {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// if (type === 4) {
|
|
||||||
// deleteQuestionScAndQa({
|
|
||||||
// assessmentId: state.assessmentId,
|
|
||||||
// questionType: "4",
|
|
||||||
// optionId: curItem.optionId,
|
|
||||||
// }).then((res) => {
|
|
||||||
// if (res.data.code === 200) {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
if (state.assessmentId && (curItem.orderNumber || curItem.optionId)) {
|
|
||||||
if (type === 1) {
|
|
||||||
virtualDel(id);
|
|
||||||
}
|
|
||||||
if (type === 2) {
|
|
||||||
virtualDel(id);
|
|
||||||
}
|
|
||||||
if (type === 3) {
|
|
||||||
virtualDel(id);
|
|
||||||
}
|
|
||||||
if (type === 4) {
|
|
||||||
virtualDel(id);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
virtualDel(id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const virtualDel = (id) => {
|
|
||||||
// 前端删除
|
|
||||||
// state.allFormsData.forEach((item, index) => {
|
|
||||||
// if (item.id === id) {
|
|
||||||
// state.allFormsData.splice(index, 1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// state.allFormsData.map((item, index) => {
|
|
||||||
// item.id = index + 1;
|
|
||||||
// return item;
|
|
||||||
// });
|
|
||||||
// 前端删除
|
|
||||||
state.allFormsData.forEach((item, index) => {
|
|
||||||
if (item.id === id) {
|
|
||||||
state.allFormsData[index].deleted = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 处理id为空的字段
|
|
||||||
const formatID = (data) => {
|
|
||||||
let obj = {}
|
|
||||||
for(let i in data){
|
|
||||||
if(i=="assessmentSingleChoiceDtoList"){
|
|
||||||
let arr1 = []
|
|
||||||
for(let k=0;k<data[i].length;k++){
|
|
||||||
if(data[i][k].id!==undefined){
|
|
||||||
arr1.push(data[i][k])
|
|
||||||
}else{
|
|
||||||
let obj1 = {...data[i][k]}
|
|
||||||
delete obj1.id
|
|
||||||
delete obj1.deleted
|
|
||||||
arr1.push(obj1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
obj.assessmentSingleChoiceDtoList = arr1;
|
|
||||||
}
|
|
||||||
if(i=="assessmentMultipleChoiceDtoList"){
|
|
||||||
let arr1 = []
|
|
||||||
for(let k=0;k<data[i].length;k++){
|
|
||||||
if(data[i][k].id!==undefined){
|
|
||||||
arr1.push(data[i][k])
|
|
||||||
}else{
|
|
||||||
let obj1 = {...data[i][k]}
|
|
||||||
delete obj1.id
|
|
||||||
arr1.push(obj1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
obj.assessmentMultipleChoiceDtoList = arr1;
|
|
||||||
}
|
|
||||||
if(i=="assessmentEssayQuestionDtoList"){
|
|
||||||
let arr1 = []
|
|
||||||
for(let k=0;k<data[i].length;k++){
|
|
||||||
if(data[i][k].id!==undefined){
|
|
||||||
arr1.push(data[i][k])
|
|
||||||
}else{
|
|
||||||
let obj1 = {...data[i][k]}
|
|
||||||
delete obj1.id
|
|
||||||
arr1.push(obj1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
obj.assessmentEssayQuestionDtoList = arr1;
|
|
||||||
}
|
|
||||||
if(i=="assessmentScoringQuestionDtoList"){
|
|
||||||
let arr1 = []
|
|
||||||
for(let k=0;k<data[i].length;k++){
|
|
||||||
if(data[i][k].id!==undefined){
|
|
||||||
arr1.push(data[i][k])
|
|
||||||
}else{
|
|
||||||
let obj1 = {...data[i][k]}
|
|
||||||
delete obj1.id
|
|
||||||
delete obj1.deleted
|
|
||||||
arr1.push(obj1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
obj.assessmentScoringQuestionDtoList = arr1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log(obj)
|
|
||||||
return obj
|
|
||||||
}
|
|
||||||
const handleSave = () => {
|
|
||||||
let resultPost = {};
|
|
||||||
let filterData = formatID(parseItem(restData(state.allFormsData, "type")));
|
|
||||||
// 处理id为undefined得字段
|
|
||||||
console.log('mmmmmmmmm------->',filterData)
|
|
||||||
// 校验
|
|
||||||
if (!checkVal(filterData)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
state.loading = true;
|
|
||||||
|
|
||||||
if (state.assessmentId) {
|
|
||||||
resultPost = {
|
|
||||||
id: state.assessmentId,
|
|
||||||
assessmentName: state.assessmentName,
|
|
||||||
assessmentMark: state.valueMore,
|
|
||||||
...filterData,
|
|
||||||
};
|
|
||||||
resultPost = deepCloneFilterString(resultPost, [
|
|
||||||
"assessmentMaxScore",
|
|
||||||
"assessmentMinScore",
|
|
||||||
]);
|
|
||||||
|
|
||||||
editResearchMessage(resultPost).then((res) => {
|
|
||||||
state.loading = false;
|
|
||||||
if (res.data.code === 200) {
|
|
||||||
message.success("编辑成功");
|
|
||||||
router.push({
|
|
||||||
path: "/researchmanage",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
resultPost = {
|
|
||||||
assessmentName: state.assessmentNameNew,
|
|
||||||
assessmentMark: state.valueMore,
|
|
||||||
...filterData,
|
|
||||||
};
|
|
||||||
resultPost = deepCloneFilterString(resultPost, [
|
|
||||||
"assessmentMaxScore",
|
|
||||||
"assessmentMinScore",
|
|
||||||
]);
|
|
||||||
createResearch(resultPost).then((res) => {
|
|
||||||
if (res.data.code === 200) {
|
|
||||||
message.success("创建成功");
|
|
||||||
router.push({
|
|
||||||
path: "/researchmanage",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const handleAllCancel = () => {
|
|
||||||
state.allFormsData = [];
|
|
||||||
router.push({
|
|
||||||
path: "/researchmanage",
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const checkVal = (filterData) => {
|
|
||||||
// 问答
|
|
||||||
if (
|
|
||||||
filterData.assessmentEssayQuestionDtoList &&
|
|
||||||
filterData.assessmentEssayQuestionDtoList.length
|
|
||||||
) {
|
|
||||||
let arr = filterData.assessmentEssayQuestionDtoList;
|
|
||||||
for (let item of arr) {
|
|
||||||
if (!item.assessmentQaTitle) {
|
|
||||||
message.error("问答题干为必填 请确认");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 多选
|
|
||||||
console.log(filterData.assessmentMultipleChoiceDtoList);
|
|
||||||
if(filterData.assessmentMultipleChoiceDtoList && !filterData.assessmentMultipleChoiceDtoList.some(t=>!t.deleted)){
|
|
||||||
message.error("多选题最少添加一个选项!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(filterData.assessmentMultipleChoiceDtoList?.some((item) => !item.deleted && (!item.multipleStemName || !item.multipleOptionName))){
|
|
||||||
message.error("多选题干或选项为必填 请确认!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// 评分
|
|
||||||
if (
|
|
||||||
filterData.assessmentScoringQuestionDtoList &&
|
|
||||||
filterData.assessmentScoringQuestionDtoList.length
|
|
||||||
) {
|
|
||||||
let CountNum = 0;
|
|
||||||
let CountArr = filterData.assessmentScoringQuestionDtoList;
|
|
||||||
for (let item of CountArr) {
|
|
||||||
if (!item.assessmentScTitle) {
|
|
||||||
message.error("评分题干为必填 请确认");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
CountNum += Number(item["weightScale"]);
|
|
||||||
}
|
|
||||||
// console.log("CountNum");
|
|
||||||
// console.log(CountNum);
|
|
||||||
// if(CountNum>100){
|
|
||||||
// CountNum = 100;
|
|
||||||
// }
|
|
||||||
if (CountNum !== 100) {
|
|
||||||
message.error("当前权重设置是百分制 请重新配置");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 单选
|
|
||||||
if(filterData.assessmentSingleChoiceDtoList && !filterData.assessmentSingleChoiceDtoList.length){
|
|
||||||
message.error("单选题最少添加一个选项!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(filterData.assessmentSingleChoiceDtoList?.some((item) => !item.deleted && (!item.singleStemName || !item.singleOptionName))){
|
|
||||||
message.error("单选题干或选项为必填 请确认!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
...toRefs(state),
|
|
||||||
handleTypes,
|
|
||||||
handleSave,
|
|
||||||
handleAllCancel,
|
|
||||||
handleDel,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
const handleAllCancel = () => router.push({ path: "/researchmanage" });
|
||||||
|
function addSingleItem() {
|
||||||
|
data.value.singleStemVoList.push({
|
||||||
|
questionType: 1,
|
||||||
|
singleStemName: "",
|
||||||
|
orderNumber: orderList.value?.length + 1,
|
||||||
|
assessmentSingleChoiceVoList: [
|
||||||
|
{
|
||||||
|
questionType: 1,
|
||||||
|
singleOptionName: "",
|
||||||
|
singleOptionPictureAddress: "",
|
||||||
|
singleStemName: "",
|
||||||
|
deleted: false,
|
||||||
|
orderNumber: (data.value?.singleStemVoList?.length || 0) + 1,
|
||||||
|
optionOrderNum: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
questionType: 1,
|
||||||
|
singleOptionName: "",
|
||||||
|
singleOptionPictureAddress: "",
|
||||||
|
singleStemName: "",
|
||||||
|
deleted: false,
|
||||||
|
orderNumber: (data.value?.singleStemVoList?.length || 0) + 1,
|
||||||
|
optionOrderNum: 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
deleted: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function addMultipleItem() {
|
||||||
|
data.value.multipleStemVoList.push({
|
||||||
|
questionType: 2,
|
||||||
|
multipleStemName: "",
|
||||||
|
orderNumber: orderList.value?.length + 1,
|
||||||
|
multipleChoiceVoList: [
|
||||||
|
{
|
||||||
|
questionType: 2,
|
||||||
|
multipleOptionName: "",
|
||||||
|
multipleOptionPictureAddress: "",
|
||||||
|
multipleStemName: "",
|
||||||
|
deleted: false,
|
||||||
|
orderNumber: (data.value?.multipleStemVoList?.length || 0) + 1,
|
||||||
|
optionOrderNum: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
questionType: 2,
|
||||||
|
multipleOptionName: "",
|
||||||
|
multipleOptionPictureAddress: "",
|
||||||
|
multipleStemName: "",
|
||||||
|
deleted: false,
|
||||||
|
orderNumber: (data.value?.multipleStemVoList?.length || 0) + 1,
|
||||||
|
optionOrderNum: 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
deleted: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addEssayQuestionItem() {
|
||||||
|
data.value.essayQuestionVoList.push({
|
||||||
|
questionType: 3,
|
||||||
|
assessmentQaTitle: "",
|
||||||
|
orderNumber: orderList.value?.length + 1,
|
||||||
|
deleted: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function addScoringQuestionItem() {
|
||||||
|
data.value.scoringQuestionVoList.push({
|
||||||
|
questionType: 4,
|
||||||
|
assessmentScTitle: "",
|
||||||
|
assessmentMaxScore: 10,
|
||||||
|
assessmentMinScore: 1,
|
||||||
|
weightScale: 100,
|
||||||
|
orderNumber: orderList.value?.length + 1,
|
||||||
|
deleted: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const checkVal = () => {
|
||||||
|
// 问答
|
||||||
|
if (data.value.essayQuestionVoList.length && data.value.essayQuestionVoList?.some((item) => !item.deleted && (!item.assessmentQaTitle))) {
|
||||||
|
message.error("问答题干为必填 请确认!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 多选
|
||||||
|
if (data.value.multipleStemVoList.length && data.value.multipleStemVoList.some(t => !t.deleted && t.multipleChoiceVoList.filter(s=>!s.deleted)?.length < 2)) {
|
||||||
|
message.error("多选题最少添加两个选项!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (data.value.multipleStemVoList.length && data.value.multipleStemVoList?.some((item) => !item.deleted && (!item.multipleStemName || item.multipleChoiceVoList?.some((t) => !t.deleted && !t.multipleOptionName)))) {
|
||||||
|
message.error("多选题干或选项为必填 请确认!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 评分
|
||||||
|
if (data.value.scoringQuestionVoList.length && data.value.scoringQuestionVoList?.some((item) => !item.deleted && (!item.assessmentScTitle))) {
|
||||||
|
message.error("评分题干为必填 请确认!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (data.value.scoringQuestionVoList.length && data.value.scoringQuestionVoList.reduce((pre, cur) => pre + parseInt(cur.weightScale), 0) !== 100) {
|
||||||
|
message.error("当前权重设置是百分制 请重新配置");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 单选
|
||||||
|
if (data.value.singleStemVoList.length && data.value.singleStemVoList.some(t => !t.deleted && t.assessmentSingleChoiceVoList.filter(s=>!s.deleted)?.length < 2)) {
|
||||||
|
message.error("单选题最少添加两个选项!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (data.value.singleStemVoList.length && data.value.singleStemVoList?.some((item) => !item.deleted && (!item.singleStemName || item.assessmentSingleChoiceVoList.some(option=>!option.deleted && !option.singleOptionName)))) {
|
||||||
|
message.error("单选题干或选项为必填 请确认!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.researchadd {
|
.researchadd {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<!-- 评估管理-创建评估页面 -->
|
<!-- 评估管理-创建评估页面 -->
|
||||||
<template>
|
<template>
|
||||||
<!-- 问答题 -->
|
<!-- 问答题 -->
|
||||||
<div class="content">
|
<div class="content" v-if="!item.deleted">
|
||||||
<div class="tagbox">
|
<div class="tagbox">
|
||||||
<div class="tagname">问答题</div>
|
<div class="tagname">问答题</div>
|
||||||
<div class="deleteop" @click="handleTypesDel(3)">
|
<div class="deleteop" @click="del">
|
||||||
<div><img src="../../../assets/images/projectadd/delete1.png" /></div>
|
<div><img src="../../../assets/images/projectadd/delete1.png" /></div>
|
||||||
<div class="del_text">删除题目</div>
|
<div class="del_text">删除题目</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../../assets/images/basicinfo/asterisk.png"
|
src="../../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">标题{{ curItem.id }}</div>
|
<div class="inname">标题{{ index + 1 }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="curItem.valueAsk"
|
v-model:value="item.assessmentQaTitle"
|
||||||
placeholder="请输入标题名称"
|
placeholder="请输入标题名称"
|
||||||
show-count
|
show-count
|
||||||
:maxlength="100"
|
:maxlength="100"
|
||||||
@@ -34,48 +34,16 @@
|
|||||||
<div class="in">
|
<div class="in">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
:maxlength="100"
|
:maxlength="100"
|
||||||
v-model:value="curItem.valueAskDesc"
|
v-model:value="item.assessmentQaDescribe"
|
||||||
style="height: 148px"
|
style="height: 148px"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script setup>
|
||||||
import { ref } from "vue";
|
const props = defineProps({ index: Number, list: Array, item: Object});
|
||||||
|
const del = () => props.item.id?(props.item.deleted = true):(props.list.splice(props.index, 1));
|
||||||
export default {
|
|
||||||
name: "ResearchAddAsk",
|
|
||||||
props: {
|
|
||||||
item: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
assessmentId: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup(props, { emit }) {
|
|
||||||
const curItem = ref(props.item);
|
|
||||||
// const assessmentId = ref(props.assessmentId);
|
|
||||||
|
|
||||||
const handleTypesDel = (type) => {
|
|
||||||
emit("del", { id: curItem.value.id, type, curItem: curItem.value });
|
|
||||||
// if (state.typesCur.includes(types)) {
|
|
||||||
// const arr = state.typesCur.filter((item) => item !== types);
|
|
||||||
// state.typesCur = arr;
|
|
||||||
// }
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
curItem,
|
|
||||||
handleTypesDel,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.researchadd {
|
.researchadd {
|
||||||
|
|||||||
@@ -8,32 +8,32 @@
|
|||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../../assets/images/basicinfo/asterisk.png"
|
src="../../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">选项{{ curItem.id }}</div>
|
<div class="inname">选项{{ index+1 }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="curItem.inputVal"
|
v-model:value="item[nameKey]"
|
||||||
show-count
|
show-count
|
||||||
|
placeholder="请输入选项名称"
|
||||||
:maxlength="100"
|
:maxlength="100"
|
||||||
style="border-radius: 8px"
|
style="border-radius: 8px"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="delete" @click="handleDel">删除</div>
|
<div class="delete" @click="handleDel" v-if="list?.filter(t=>!t.deleted)?.length>2">删除</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="name uploadContent">
|
<div class="name uploadContent">
|
||||||
<a-upload
|
<a-upload
|
||||||
v-show="!curItem.imgVal"
|
v-show="!item[imgKey]"
|
||||||
class="in uploadBtn"
|
class="in uploadBtn"
|
||||||
:show-upload-list="false"
|
:show-upload-list="false"
|
||||||
:before-upload="beforeUpload"
|
:before-upload="beforeUpload"
|
||||||
>
|
>
|
||||||
<div class="addimg">+添加图片</div>
|
<div class="addimg">+添加图片</div>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
<div v-show="curItem.imgVal" class="picture" style="position: relative">
|
<div v-show="item[imgKey]" class="picture" style="position: relative">
|
||||||
<img class="pictureimg" :src="VUE_APP_FILE_PATH + curItem.imgVal" />
|
<img class="pictureimg" :src="VUE_APP_FILE_PATH + item[imgKey]"/>
|
||||||
<div class="picturename" v-show="hasImgName">{{ hasImgName }}</div>
|
|
||||||
<img
|
<img
|
||||||
style="
|
style="
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -50,103 +50,49 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script setup>
|
||||||
import { reactive, toRefs, ref } from "vue";
|
import {message} from "ant-design-vue";
|
||||||
import { message } from "ant-design-vue";
|
import {fileUp} from "@/api/indexEval";
|
||||||
import { fileUp } from "../../../api/indexEval";
|
|
||||||
|
|
||||||
export default {
|
const props = defineProps({ index: Number, list: Array, item: Object ,nameKey:String,imgKey:String});
|
||||||
name: "ResearchAddItem",
|
const VUE_APP_FILE_PATH = process.env.VUE_APP_FILE_PATH;
|
||||||
props: {
|
const handleCancel = () => props.item[props.imgKey] = "";
|
||||||
item: {
|
const handleDel = () => props.item.id?(props.item.deleted = true):(props.list.splice(props.index, 1))
|
||||||
type: Array,
|
const beforeUpload = (file) => {
|
||||||
default: () => {
|
const isJpgOrPng =
|
||||||
return [];
|
file.type === "image/jpg" ||
|
||||||
},
|
file.type === "image/jpeg" ||
|
||||||
},
|
file.type === "image/png" ||
|
||||||
},
|
file.type === "image/svg" ||
|
||||||
setup(props, { emit }) {
|
file.type === "image/bmp" ||
|
||||||
const curItem = ref(props.item);
|
file.type === "image/gif";
|
||||||
const VUE_APP_FILE_PATH = ref(process.env.VUE_APP_FILE_PATH);
|
if (!isJpgOrPng) {
|
||||||
// console.log(
|
message.error("仅支持jpg、gif、png、jpeg、svg、bmp格式!");
|
||||||
// "选项信息",
|
return false;
|
||||||
// curItem.value,
|
}
|
||||||
// curItem.value.imgVal.indexOf(process.env.VUE_APP_FILE_PATH)
|
let isLt1M = file.size / 10240 / 10240 <= 1;
|
||||||
// );
|
if (!isLt1M) {
|
||||||
// if (
|
this.$message.error("图片大小超过10MB!");
|
||||||
// curItem.value.imgVal &&
|
return false;
|
||||||
// curItem.value.imgVal.indexOf(process.env.VUE_APP_FILE_PATH) == -1
|
}
|
||||||
// ) {
|
const formData = new FormData();
|
||||||
// curItem.value.imgVal =
|
formData.append("file", file);
|
||||||
// process.env.VUE_APP_FILE_PATH + curItem.value.imgVal;
|
fileUp(formData).then((res) => props.item[props.imgKey] = res.data.data);
|
||||||
// }
|
return false;
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
hasImgName: "",
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleCancel = () => {
|
|
||||||
state.hasImgName = "";
|
|
||||||
emit("delImg", { id: curItem.value.id });
|
|
||||||
};
|
|
||||||
const handleDel = () => {
|
|
||||||
handleCancel();
|
|
||||||
emit("del", {
|
|
||||||
id: curItem.value.id,
|
|
||||||
optionId: curItem.value.optionId,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const beforeUpload = (file) => {
|
|
||||||
const isJpgOrPng =
|
|
||||||
file.type === "image/jpg" ||
|
|
||||||
file.type === "image/jpeg" ||
|
|
||||||
file.type === "image/png" ||
|
|
||||||
file.type === "image/svg" ||
|
|
||||||
file.type === "image/bmp" ||
|
|
||||||
file.type === "image/gif";
|
|
||||||
if (!isJpgOrPng) {
|
|
||||||
message.error("仅支持jpg、gif、png、jpeg、svg、bmp格式!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
let isLt1M = file.size / 10240 / 10240 <= 1;
|
|
||||||
if (!isLt1M) {
|
|
||||||
this.$message.error("图片大小超过10MB!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("file", file);
|
|
||||||
fileUp(formData).then((res) => {
|
|
||||||
if (res.data.code === 200) {
|
|
||||||
state.hasImgName = file.name;
|
|
||||||
emit("src", { id: curItem.value.id, src: res.data.data });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
...toRefs(state),
|
|
||||||
curItem,
|
|
||||||
handleDel,
|
|
||||||
handleCancel,
|
|
||||||
beforeUpload,
|
|
||||||
VUE_APP_FILE_PATH,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.researchadd {
|
.researchadd {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -155,10 +101,12 @@ export default {
|
|||||||
padding-left: 37px;
|
padding-left: 37px;
|
||||||
//font-weight: 500;
|
//font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goback {
|
.goback {
|
||||||
padding-right: 70px;
|
padding-right: 70px;
|
||||||
//padding-top: 37px;
|
//padding-top: 37px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.return {
|
.return {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 42px;
|
width: 42px;
|
||||||
@@ -167,6 +115,7 @@ export default {
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
background-image: url("../../../assets/images/projectadd/return.png");
|
background-image: url("../../../assets/images/projectadd/return.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
.returntext {
|
.returntext {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -176,16 +125,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.addtype {
|
.addtype {
|
||||||
display: flex;
|
display: flex;
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: 41px;
|
margin-left: 41px;
|
||||||
|
|
||||||
.addtypen {
|
.addtypen {
|
||||||
color: #6f6f6f;
|
color: #6f6f6f;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.types {
|
.types {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
@@ -198,11 +150,13 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 20px 10px;
|
margin: 20px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.typesCur {
|
.typesCur {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #4ea6ff;
|
background: #4ea6ff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -211,9 +165,11 @@ export default {
|
|||||||
min-width: 690px;
|
min-width: 690px;
|
||||||
margin-left: 38px;
|
margin-left: 38px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|
||||||
.tagbox {
|
.tagbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.tagname {
|
.tagname {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
@@ -227,6 +183,7 @@ export default {
|
|||||||
color: rgba(64, 158, 255, 1);
|
color: rgba(64, 158, 255, 1);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deleteop {
|
.deleteop {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -238,6 +195,7 @@ export default {
|
|||||||
border: 1px solid #4ea6ff;
|
border: 1px solid #4ea6ff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.del_text {
|
.del_text {
|
||||||
color: #4ea6ff;
|
color: #4ea6ff;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -245,21 +203,25 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.scorebox {
|
.scorebox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-left: 70px;
|
margin-left: 70px;
|
||||||
|
|
||||||
.scoretext {
|
.scoretext {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #56a3f9;
|
color: #56a3f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.number {
|
.number {
|
||||||
display: flex;
|
display: flex;
|
||||||
border: 1px solid #d7e5fd;
|
border: 1px solid #d7e5fd;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -277,24 +239,29 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.picture {
|
.picture {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-left: 133px;
|
margin-left: 133px;
|
||||||
|
|
||||||
.pictureimg {
|
.pictureimg {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.picturename {
|
.picturename {
|
||||||
color: #6f6f6f;
|
color: #6f6f6f;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.options {
|
.options {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delete {
|
.delete {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-top: 32px;
|
margin-top: 32px;
|
||||||
@@ -303,10 +270,12 @@ export default {
|
|||||||
color: #4ea6ff;
|
color: #4ea6ff;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name2 {
|
.name2 {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
// background-color: lightcoral;
|
// background-color: lightcoral;
|
||||||
@@ -321,20 +290,24 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
.nameimg {
|
.nameimg {
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.inname {
|
.inname {
|
||||||
color: #6f6f6f;
|
color: #6f6f6f;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-left: 7px;
|
margin-left: 7px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.in {
|
.in {
|
||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
.assess {
|
.assess {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 226px;
|
width: 226px;
|
||||||
@@ -349,6 +322,7 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.assesswhole {
|
.assesswhole {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
background: rgba(86, 163, 249, 0.1);
|
background: rgba(86, 163, 249, 0.1);
|
||||||
@@ -358,6 +332,7 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ratio {
|
.ratio {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
@@ -366,24 +341,29 @@ export default {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.addimg {
|
.addimg {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: rgba(78, 166, 255, 1);
|
color: rgba(78, 166, 255, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
color: rgba(109, 117, 132, 1);
|
color: rgba(109, 117, 132, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
//line-height: 24px;
|
//line-height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-radio-wrapper {
|
.ant-radio-wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-input {
|
.ant-input {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
// height: 120%;
|
// height: 120%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-select-selector {
|
.ant-select-selector {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
// height: 120%;
|
// height: 120%;
|
||||||
@@ -391,26 +371,32 @@ export default {
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.numberInp {
|
.numberInp {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
|
|
||||||
.ant-input-number {
|
.ant-input-number {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .ant-input-number-input-wrap {
|
// .ant-input-number-input-wrap {
|
||||||
// width: 200px;
|
// width: 200px;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.name2 {
|
.name2 {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.opinion {
|
.opinion {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
|
|
||||||
.namebox {
|
.namebox {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -418,27 +404,33 @@ export default {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.in {
|
.in {
|
||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
width: 500px;
|
width: 500px;
|
||||||
|
|
||||||
.ant-input-textarea-show-count {
|
.ant-input-textarea-show-count {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 110px;
|
height: 110px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-input-textarea-show-count::after {
|
.ant-input-textarea-show-count::after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-input {
|
.ant-input {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 31px;
|
margin-top: 31px;
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
@@ -449,6 +441,7 @@ export default {
|
|||||||
|
|
||||||
.uploadContent {
|
.uploadContent {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
|
|
||||||
.uploadBtn {
|
.uploadBtn {
|
||||||
margin-left: 120px !important;
|
margin-left: 120px !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<!-- 评估管理-创建评估页面 -->
|
<!-- 评估管理-创建评估页面 -->
|
||||||
<template>
|
<template>
|
||||||
<!-- 多选题 -->
|
<!-- 多选题 -->
|
||||||
<div class="content">
|
<div class="content" v-if="!item.deleted">
|
||||||
<div class="tagbox">
|
<div class="tagbox">
|
||||||
<div class="tagname">多选题</div>
|
<div class="tagname">多选题</div>
|
||||||
<div class="deleteop" @click="handleTypesDel(2)">
|
<div class="deleteop" @click="del">
|
||||||
<div><img src="../../../assets/images/projectadd/delete1.png" /></div>
|
<div><img src="../../../assets/images/projectadd/delete1.png" /></div>
|
||||||
<div class="del_text">删除题目</div>
|
<div class="del_text">删除题目</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../../assets/images/basicinfo/asterisk.png"
|
src="../../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">标题{{ curItem.id }}</div>
|
<div class="inname">标题{{ index + 1 }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="curItem.valueMutil"
|
v-model:value="item.multipleStemName"
|
||||||
placeholder="请输入题干名称"
|
placeholder="请输入题干名称"
|
||||||
show-count
|
show-count
|
||||||
:maxlength="100"
|
:maxlength="100"
|
||||||
@@ -28,12 +28,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ResearchAddItem
|
<ResearchAddItem
|
||||||
v-for="(item, index) in curItem.mutilList"
|
v-for="(child, index) in item.multipleChoiceVoList"
|
||||||
:key="index"
|
:key="index + new Date().getTime()"
|
||||||
:item="item"
|
:item="child"
|
||||||
@src="imgSrcMutil"
|
:index="index"
|
||||||
@delImg="delImgMutil"
|
:list="item.multipleChoiceVoList"
|
||||||
@del="delMutil"
|
name-key="multipleOptionName"
|
||||||
|
img-key="multipleOptionPictureAddress"
|
||||||
/>
|
/>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="in" style="margin-left: 85px; margin-bottom: 20px">
|
<div class="in" style="margin-left: 85px; margin-bottom: 20px">
|
||||||
@@ -46,116 +47,28 @@
|
|||||||
background-color: #4ea6ff;
|
background-color: #4ea6ff;
|
||||||
"
|
"
|
||||||
@click="handleMutilAdd"
|
@click="handleMutilAdd"
|
||||||
>
|
>添加选项
|
||||||
添加选项
|
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script setup>
|
||||||
import { ref } from "vue";
|
|
||||||
import ResearchAddItem from "./ResearchAddItem.vue";
|
import ResearchAddItem from "./ResearchAddItem.vue";
|
||||||
// import { deleteChoiceQuestion } from "@/api/indexResearch";
|
const props = defineProps({index: Number, list: Array,item:Object});
|
||||||
|
const del = () => {
|
||||||
export default {
|
props.item.deleted = true;
|
||||||
name: "ResearchAddMulti",
|
props.item.multipleChoiceVoList.forEach((t,i)=>t.id?(t.deleted=true):(props.item.multipleChoiceVoList.splice(i,1)));
|
||||||
components: {
|
};
|
||||||
ResearchAddItem,
|
const handleMutilAdd = () => {
|
||||||
},
|
props.item.multipleChoiceVoList.push({
|
||||||
props: {
|
questionType: 2,
|
||||||
item: {
|
multipleOptionName: "",
|
||||||
type: Object,
|
multipleOptionPictureAddress: "",
|
||||||
default: () => {
|
deleted: false,
|
||||||
return {};
|
orderNumber: props.index + 1,
|
||||||
},
|
optionOrderNum: (props.item?.multipleChoiceVoList?.length || 0) + 1,
|
||||||
},
|
});
|
||||||
assessmentId: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup(props, { emit }) {
|
|
||||||
const curItem = ref(props.item);
|
|
||||||
const assessmentId = ref(props.assessmentId);
|
|
||||||
|
|
||||||
const handleTypesDel = (type) => {
|
|
||||||
emit("del", { id: curItem.value.id, type, curItem: curItem.value });
|
|
||||||
// if (state.typesCur.includes(types)) {
|
|
||||||
// const arr = state.typesCur.filter((item) => item !== types);
|
|
||||||
// state.typesCur = arr;
|
|
||||||
// }
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMutilAdd = () => {
|
|
||||||
curItem.value.mutilList.push({
|
|
||||||
id: curItem.value.mutilList.length + 1,
|
|
||||||
inputVal: "",
|
|
||||||
imgVal: "",
|
|
||||||
deleted: false
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const imgSrcMutil = ({ id, src }) => {
|
|
||||||
curItem.value.mutilList.forEach((item) => {
|
|
||||||
if (item.id === id) {
|
|
||||||
item.imgVal = src;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const delImgMutil = ({ id }) => {
|
|
||||||
curItem.value.mutilList.forEach((item) => {
|
|
||||||
if (item.id === id) {
|
|
||||||
item.imgVal = "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const delMutil = ({ id, optionId }) => {
|
|
||||||
// 接口删除
|
|
||||||
// if (assessmentId.value && optionId) {
|
|
||||||
// deleteChoiceQuestion({
|
|
||||||
// assessmentId: assessmentId.value,
|
|
||||||
// questionType: "2",
|
|
||||||
// optionId,
|
|
||||||
// }).then((res) => {
|
|
||||||
// if (res.data.code === 200) {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
if (assessmentId.value && optionId) {
|
|
||||||
virtualDel(id);
|
|
||||||
} else {
|
|
||||||
virtualDel(id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const virtualDel = (id) => {
|
|
||||||
// 前端删除
|
|
||||||
// curItem.value.mutilList.forEach((item, index) => {
|
|
||||||
// if (item.id === id) {
|
|
||||||
// curItem.value.mutilList.splice(index, 1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// curItem.value.mutilList.map((item, index) => {
|
|
||||||
// item.id = index + 1;
|
|
||||||
// });
|
|
||||||
curItem.value.mutilList.forEach((item, index) => {
|
|
||||||
if (item.id === id) {
|
|
||||||
curItem.value.mutilList[index].deleted = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
curItem,
|
|
||||||
handleTypesDel,
|
|
||||||
handleMutilAdd,
|
|
||||||
imgSrcMutil,
|
|
||||||
delImgMutil,
|
|
||||||
delMutil,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<!-- 评估管理-创建评估页面 -->
|
<!-- 评估管理-创建评估页面 -->
|
||||||
<template>
|
<template>
|
||||||
<!-- 评分题 -->
|
<!-- 评分题 -->
|
||||||
<div class="content">
|
<div class="content" v-if="!item.deleted">
|
||||||
<div class="tagbox">
|
<div class="tagbox">
|
||||||
<div class="tagname">评分题</div>
|
<div class="tagname">评分题</div>
|
||||||
<div class="deleteop" @click="handleTypesDel(4)">
|
<div class="deleteop" @click="del">
|
||||||
<div><img src="../../../assets/images/projectadd/delete1.png" /></div>
|
<div><img src="../../../assets/images/projectadd/delete1.png"/></div>
|
||||||
<div class="del_text">删除题目</div>
|
<div class="del_text">删除题目</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../../assets/images/basicinfo/asterisk.png"
|
src="../../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">标题{{ curItem.id }}</div>
|
<div class="inname">标题{{ index }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="curItem.valuePin"
|
v-model:value="item.assessmentScTitle"
|
||||||
placeholder="请输入标题名称"
|
placeholder="请输入标题名称"
|
||||||
show-count
|
show-count
|
||||||
:maxlength="100"
|
:maxlength="100"
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="in numberInp">
|
<div class="in numberInp">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
:value="curItem.minScore"
|
:value="item.assessmentMinScore"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="10"
|
:max="10"
|
||||||
@change="minChange"
|
@change="minChange"
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="in numberInp">
|
<div class="in numberInp">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
:value="curItem.maxScore"
|
:value="item.assessmentMaxScore"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="10"
|
:max="10"
|
||||||
@change="maxChange"
|
@change="maxChange"
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
<div class="number">
|
<div class="number">
|
||||||
<div
|
<div
|
||||||
style="margin-left: 10px"
|
style="margin-left: 10px"
|
||||||
v-for="(value, index) in scoreList"
|
v-for="(value, i) in scoreList"
|
||||||
:key="index"
|
:key="i"
|
||||||
class="btn"
|
class="btn"
|
||||||
>
|
>
|
||||||
{{ value.text }}
|
{{ value.text }}
|
||||||
@@ -74,15 +74,11 @@
|
|||||||
<div class="inname">配置权重</div>
|
<div class="inname">配置权重</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in" style="display: flex">
|
<div class="in" style="display: flex">
|
||||||
<!-- <div class="assess">
|
|
||||||
<div class="assesstype">评估类型</div>
|
|
||||||
<div class="assesswhole">整体评估</div>
|
|
||||||
</div> -->
|
|
||||||
<div class="assess" style="position: relative">
|
<div class="assess" style="position: relative">
|
||||||
<div class="assesstype">权重比例</div>
|
<div class="assesstype">权重比例</div>
|
||||||
<div class="assesswhole" style="background: #ffffff">
|
<div class="assesswhole" style="background: #ffffff">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
v-model:value="curItem.pinQuan"
|
v-model:value="item.weightScale"
|
||||||
:min="0"
|
:min="0"
|
||||||
:max="100"
|
:max="100"
|
||||||
/>
|
/>
|
||||||
@@ -93,156 +89,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script setup>
|
||||||
import { reactive, toRefs, ref } from "vue";
|
import {computed} from "vue";
|
||||||
import { message } from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
|
|
||||||
export default {
|
const props = defineProps({ index: Number, list: Array, item: Object });
|
||||||
name: "ResearchAddPin",
|
const del = () => props.item.id ? (props.item.deleted = true) : (props.list.splice(props.index, 1));
|
||||||
props: {
|
const scoreList = computed(() => new Array(props.item.assessmentMaxScore - props.item.assessmentMinScore + 1).fill(0).map((value, index) => ({ id: index + 1, text: props.item.assessmentMinScore + index })));
|
||||||
item: {
|
const minChange = (e) => {
|
||||||
type: Object,
|
if (e > props.item.assessmentMaxScore) return message.warning("最低分不能超过最高分");
|
||||||
default: () => {
|
props.item.assessmentMinScore = e;
|
||||||
return {};
|
};
|
||||||
},
|
const maxChange = (e) => {
|
||||||
},
|
if (e < props.item.assessmentMinScore) return message.warning("最高分不能低于最低分");
|
||||||
assessmentId: {
|
props.item.assessmentMaxScore = e;
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup(props, { emit }) {
|
|
||||||
const curItem = ref(props.item);
|
|
||||||
// const assessmentId = ref(props.assessmentId);
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
scoreList: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
text: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
text: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
text: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
text: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
text: 5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
text: 6,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 7,
|
|
||||||
text: 7,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 8,
|
|
||||||
text: 8,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 9,
|
|
||||||
text: 9,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 10,
|
|
||||||
text: 10,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
scoreListClone: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
text: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
text: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
text: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
text: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
text: 5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
text: 6,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 7,
|
|
||||||
text: 7,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 8,
|
|
||||||
text: 8,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 9,
|
|
||||||
text: 9,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 10,
|
|
||||||
text: 10,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleTypesDel = (type) => {
|
|
||||||
emit("del", { id: curItem.value.id, type, curItem: curItem.value });
|
|
||||||
// if (state.typesCur.includes(types)) {
|
|
||||||
// const arr = state.typesCur.filter((item) => item !== types);
|
|
||||||
// state.typesCur = arr;
|
|
||||||
// }
|
|
||||||
};
|
|
||||||
|
|
||||||
const minChange = (e) => {
|
|
||||||
if (e > curItem.value.maxScore)
|
|
||||||
return message.warning("最低分不能超过最高分");
|
|
||||||
curItem.value.minScore = e;
|
|
||||||
let arr = state.scoreListClone.concat([]);
|
|
||||||
arr.map((value, index) => {
|
|
||||||
if (value.id === e) {
|
|
||||||
arr = arr.slice(index, curItem.value.maxScore);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
state.scoreList = arr;
|
|
||||||
};
|
|
||||||
const maxChange = (e) => {
|
|
||||||
if (e < curItem.value.minScore)
|
|
||||||
return message.warning("最高分不能低于最低分");
|
|
||||||
curItem.value.maxScore = e;
|
|
||||||
let arr = state.scoreListClone.concat([]);
|
|
||||||
arr.map((value, index) => {
|
|
||||||
if (value.id === e) {
|
|
||||||
arr = arr.slice(curItem.value.minScore - 1, index + 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
state.scoreList = arr;
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
...toRefs(state),
|
|
||||||
curItem,
|
|
||||||
handleTypesDel,
|
|
||||||
minChange,
|
|
||||||
maxChange,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -250,10 +110,12 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -262,10 +124,12 @@ export default {
|
|||||||
padding-left: 37px;
|
padding-left: 37px;
|
||||||
//font-weight: 500;
|
//font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goback {
|
.goback {
|
||||||
padding-right: 70px;
|
padding-right: 70px;
|
||||||
//padding-top: 37px;
|
//padding-top: 37px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.return {
|
.return {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 42px;
|
width: 42px;
|
||||||
@@ -274,6 +138,7 @@ export default {
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
background-image: url("../../../assets/images/projectadd/return.png");
|
background-image: url("../../../assets/images/projectadd/return.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
.returntext {
|
.returntext {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -283,16 +148,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.addtype {
|
.addtype {
|
||||||
display: flex;
|
display: flex;
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: 41px;
|
margin-left: 41px;
|
||||||
|
|
||||||
.addtypen {
|
.addtypen {
|
||||||
color: #6f6f6f;
|
color: #6f6f6f;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.types {
|
.types {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
@@ -305,11 +173,13 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 20px 10px;
|
margin: 20px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.typesCur {
|
.typesCur {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #4ea6ff;
|
background: #4ea6ff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -318,9 +188,11 @@ export default {
|
|||||||
min-width: 690px;
|
min-width: 690px;
|
||||||
margin-left: 38px;
|
margin-left: 38px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|
||||||
.tagbox {
|
.tagbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.tagname {
|
.tagname {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
@@ -334,6 +206,7 @@ export default {
|
|||||||
color: rgba(64, 158, 255, 1);
|
color: rgba(64, 158, 255, 1);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deleteop {
|
.deleteop {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -345,6 +218,7 @@ export default {
|
|||||||
border: 1px solid #4ea6ff;
|
border: 1px solid #4ea6ff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.del_text {
|
.del_text {
|
||||||
color: #4ea6ff;
|
color: #4ea6ff;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -352,21 +226,25 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.scorebox {
|
.scorebox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-left: 70px;
|
margin-left: 70px;
|
||||||
|
|
||||||
.scoretext {
|
.scoretext {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #56a3f9;
|
color: #56a3f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.number {
|
.number {
|
||||||
display: flex;
|
display: flex;
|
||||||
border: 1px solid #d7e5fd;
|
border: 1px solid #d7e5fd;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -382,30 +260,36 @@ export default {
|
|||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.curBtn {
|
.curBtn {
|
||||||
background: #56a3f9;
|
background: #56a3f9;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.picture {
|
.picture {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-left: 133px;
|
margin-left: 133px;
|
||||||
|
|
||||||
.pictureimg {
|
.pictureimg {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.picturename {
|
.picturename {
|
||||||
color: #6f6f6f;
|
color: #6f6f6f;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.options {
|
.options {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delete {
|
.delete {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-top: 32px;
|
margin-top: 32px;
|
||||||
@@ -414,10 +298,12 @@ export default {
|
|||||||
color: #4ea6ff;
|
color: #4ea6ff;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name2 {
|
.name2 {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
// background-color: lightcoral;
|
// background-color: lightcoral;
|
||||||
@@ -432,20 +318,24 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
.nameimg {
|
.nameimg {
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.inname {
|
.inname {
|
||||||
color: #6f6f6f;
|
color: #6f6f6f;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-left: 7px;
|
margin-left: 7px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.in {
|
.in {
|
||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
.assess {
|
.assess {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 226px;
|
width: 226px;
|
||||||
@@ -460,6 +350,7 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.assesswhole {
|
.assesswhole {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
background: rgba(86, 163, 249, 0.1);
|
background: rgba(86, 163, 249, 0.1);
|
||||||
@@ -469,6 +360,7 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ratio {
|
.ratio {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: -1px;
|
right: -1px;
|
||||||
@@ -477,24 +369,29 @@ export default {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.addimg {
|
.addimg {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: rgba(78, 166, 255, 1);
|
color: rgba(78, 166, 255, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
color: rgba(109, 117, 132, 1);
|
color: rgba(109, 117, 132, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
//line-height: 24px;
|
//line-height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-radio-wrapper {
|
.ant-radio-wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-input {
|
.ant-input {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
// height: 120%;
|
// height: 120%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-select-selector {
|
.ant-select-selector {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
// height: 120%;
|
// height: 120%;
|
||||||
@@ -502,26 +399,32 @@ export default {
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.numberInp {
|
.numberInp {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
|
|
||||||
.ant-input-number {
|
.ant-input-number {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .ant-input-number-input-wrap {
|
// .ant-input-number-input-wrap {
|
||||||
// width: 200px;
|
// width: 200px;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.name2 {
|
.name2 {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.opinion {
|
.opinion {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
|
|
||||||
.namebox {
|
.namebox {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -529,27 +432,33 @@ export default {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.in {
|
.in {
|
||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
width: 500px;
|
width: 500px;
|
||||||
|
|
||||||
.ant-input-textarea-show-count {
|
.ant-input-textarea-show-count {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 110px;
|
height: 110px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-input-textarea-show-count::after {
|
.ant-input-textarea-show-count::after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-input {
|
.ant-input {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 31px;
|
margin-top: 31px;
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
@@ -560,6 +469,7 @@ export default {
|
|||||||
|
|
||||||
.uploadContent {
|
.uploadContent {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
|
|
||||||
.uploadBtn {
|
.uploadBtn {
|
||||||
margin-left: 120px !important;
|
margin-left: 120px !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<!-- 评估管理-创建评估页面 -->
|
<!-- 评估管理-创建评估页面 -->
|
||||||
<template>
|
<template>
|
||||||
<!-- 单选题 -->
|
<!-- 单选题 -->
|
||||||
<div class="content">
|
<div class="content" v-if="!item.deleted">
|
||||||
<div class="tagbox">
|
<div class="tagbox">
|
||||||
<div class="tagname">单选题</div>
|
<div class="tagname">单选题</div>
|
||||||
<div class="deleteop" @click="handleTypesDel(1)">
|
<div class="deleteop" @click="del">
|
||||||
<div><img src="../../../assets/images/projectadd/delete1.png" /></div>
|
<div><img src="../../../assets/images/projectadd/delete1.png" /></div>
|
||||||
<div class="del_text">删除题目</div>
|
<div class="del_text">删除题目</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../../assets/images/basicinfo/asterisk.png"
|
src="../../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">标题{{ curItem.id }}</div>
|
<div class="inname">标题{{ index+1 }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="curItem.valueSingle"
|
v-model:value="item.singleStemName"
|
||||||
placeholder="请输入题干名称"
|
placeholder="请输入题干名称"
|
||||||
show-count
|
show-count
|
||||||
:maxlength="100"
|
:maxlength="100"
|
||||||
@@ -28,12 +28,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ResearchAddItem
|
<ResearchAddItem
|
||||||
v-for="(item, index) in curItem.singleList"
|
v-for="(child, index) in item.assessmentSingleChoiceVoList"
|
||||||
:key="index + new Date().getTime()"
|
:key="index + new Date().getTime()"
|
||||||
:item="item"
|
:item="child"
|
||||||
@src="imgSrc"
|
:list="item.assessmentSingleChoiceVoList"
|
||||||
@delImg="delImg"
|
:index="index"
|
||||||
@del="del"
|
name-key="singleOptionName"
|
||||||
|
img-key="singleOptionPictureAddress"
|
||||||
/>
|
/>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="in" style="margin-left: 85px; margin-bottom: 20px">
|
<div class="in" style="margin-left: 85px; margin-bottom: 20px">
|
||||||
@@ -53,108 +54,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script setup>
|
||||||
import { ref } from "vue";
|
|
||||||
import ResearchAddItem from "./ResearchAddItem.vue";
|
import ResearchAddItem from "./ResearchAddItem.vue";
|
||||||
// import { deleteChoiceQuestion } from "@/api/indexResearch";
|
const props = defineProps({index: Number, list: Array,item:Object});
|
||||||
|
const handleSingleAdd = () => props.item.assessmentSingleChoiceVoList.push({
|
||||||
export default {
|
questionType: 1,
|
||||||
name: "ResearchAddSingle",
|
singleOptionName: "",
|
||||||
components: {
|
singleOptionPictureAddress: "",
|
||||||
ResearchAddItem,
|
singleStemName: "",
|
||||||
},
|
deleted: false,
|
||||||
props: {
|
orderNumber: props.index + 1,
|
||||||
item: {
|
optionOrderNum: props.item.assessmentSingleChoiceVoList.length + 1,
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
assessmentId: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup(props, { emit }) {
|
|
||||||
const curItem = ref(props.item);
|
|
||||||
const assessmentId = ref(props.assessmentId);
|
|
||||||
|
|
||||||
const handleTypesDel = (type) => {
|
|
||||||
emit("del", { id: curItem.value.id, type, curItem: curItem.value });
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSingleAdd = () => {
|
|
||||||
curItem.value.singleList.push({
|
|
||||||
id: curItem.value.singleList.length + 1,
|
|
||||||
inputVal: "",
|
|
||||||
imgVal: "",
|
|
||||||
deleted: false
|
|
||||||
});
|
});
|
||||||
|
const del = () => {
|
||||||
|
props.item.deleted = true;
|
||||||
|
props.item.assessmentSingleChoiceVoList.forEach((t,i)=>t.id?(t.deleted=true):(props.item.assessmentSingleChoiceVoList.splice(i,1)))
|
||||||
};
|
};
|
||||||
const imgSrc = ({ id, src }) => {
|
|
||||||
curItem.value.singleList.forEach((item) => {
|
|
||||||
if (item.id === id) {
|
|
||||||
item.imgVal = src;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const delImg = ({ id }) => {
|
|
||||||
curItem.value.singleList.forEach((item) => {
|
|
||||||
if (item.id === id) {
|
|
||||||
item.imgVal = "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const del = ({ id, optionId}) => {
|
|
||||||
// 接口删除
|
|
||||||
// if (assessmentId.value && optionId) {
|
|
||||||
// deleteChoiceQuestion({
|
|
||||||
// assessmentId: assessmentId.value,
|
|
||||||
// questionType: "1",
|
|
||||||
// optionId,
|
|
||||||
// }).then((res) => {
|
|
||||||
// if (res.data.code === 200) {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// virtualDel(id);
|
|
||||||
// }
|
|
||||||
if (assessmentId.value && optionId) {
|
|
||||||
virtualDel(id);
|
|
||||||
} else {
|
|
||||||
virtualDel(id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const virtualDel = (id) => {
|
|
||||||
// 前端删除
|
|
||||||
// curItem.value.singleList.forEach((item, index) => {
|
|
||||||
// if (item.id === id) {
|
|
||||||
// curItem.value.singleList.splice(index, 1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// curItem.value.singleList.map((item, index) => {
|
|
||||||
// item.id = index + 1;
|
|
||||||
// });
|
|
||||||
|
|
||||||
// 前端删除
|
|
||||||
curItem.value.singleList.forEach((item, index) => {
|
|
||||||
if (item.id === id) {
|
|
||||||
curItem.value.singleList[index].deleted = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
curItem,
|
|
||||||
handleTypesDel,
|
|
||||||
handleSingleAdd,
|
|
||||||
imgSrc,
|
|
||||||
delImg,
|
|
||||||
del,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.researchadd {
|
.researchadd {
|
||||||
|
|||||||
Reference in New Issue
Block a user