mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 22:06:45 +08:00
部分修改
This commit is contained in:
@@ -55,10 +55,10 @@ http.interceptors.response.use(
|
|||||||
if (code === 0 || code === 200) {
|
if (code === 0 || code === 200) {
|
||||||
return response;
|
return response;
|
||||||
} else {
|
} else {
|
||||||
if (code === 1000) {
|
// if (code === 1000) {
|
||||||
window.open("https://u-pre.boe.com/web/", '_self');
|
// window.open("https://u-pre.boe.com/web/", "_self");
|
||||||
// window.open("http://111.231.196.214:12013/manage/login", '_self');
|
// // window.open("http://111.231.196.214:12013/manage/login", '_self');
|
||||||
}
|
// }
|
||||||
console.log("api %o", msg);
|
console.log("api %o", msg);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ export default {
|
|||||||
let renderArr = [...res.voteStemVoList];
|
let renderArr = [...res.voteStemVoList];
|
||||||
sortBy(renderArr, "orderNumber"); //序号
|
sortBy(renderArr, "orderNumber"); //序号
|
||||||
state.allFormsData = parseData(renderArr);
|
state.allFormsData = parseData(renderArr);
|
||||||
|
console.log(67676767);
|
||||||
|
console.log(state.allFormsData);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -179,7 +181,7 @@ export default {
|
|||||||
|
|
||||||
obj = {
|
obj = {
|
||||||
valueSingle: item.voteStemName,
|
valueSingle: item.voteStemName,
|
||||||
singleList: restList,
|
optionDetailList: restList,
|
||||||
orderNumber: item.orderNumber,
|
orderNumber: item.orderNumber,
|
||||||
};
|
};
|
||||||
resultArr.push(obj);
|
resultArr.push(obj);
|
||||||
@@ -197,7 +199,7 @@ export default {
|
|||||||
arr.forEach((item) => {
|
arr.forEach((item) => {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
console.log("item=======", item);
|
console.log("item=======", item);
|
||||||
let restList = traverseArr(item.singleList, {
|
let restList = traverseArr(item.optionDetailList, {
|
||||||
optionName: "inputVal",
|
optionName: "inputVal",
|
||||||
optionPictureAddress: "imgVal",
|
optionPictureAddress: "imgVal",
|
||||||
optionId: "optionId",
|
optionId: "optionId",
|
||||||
@@ -213,7 +215,7 @@ export default {
|
|||||||
|
|
||||||
obj = {
|
obj = {
|
||||||
voteStemName: item.valueSingle,
|
voteStemName: item.valueSingle,
|
||||||
singleList: restList,
|
optionDetailList: restList,
|
||||||
orderNumber: item.orderNumber,
|
orderNumber: item.orderNumber,
|
||||||
};
|
};
|
||||||
resultArr.push(obj);
|
resultArr.push(obj);
|
||||||
@@ -226,29 +228,11 @@ export default {
|
|||||||
return resultArr;
|
return resultArr;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 解散传值
|
|
||||||
const parseItem = (arrSingle) => {
|
|
||||||
console.log("arrSingle");
|
|
||||||
console.log(arrSingle);
|
|
||||||
let resultObj = {};
|
|
||||||
let arr = [];
|
|
||||||
arrSingle.forEach((item) => {
|
|
||||||
arr.push({
|
|
||||||
voteStemName: item.voteStemName,
|
|
||||||
orderNumber: item.orderNumber,
|
|
||||||
optionDetailList: item.singleList,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
resultObj.voteStemDtoList = arr;
|
|
||||||
console.log("resultObj======", resultObj);
|
|
||||||
return resultObj;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleTypes = () => {
|
const handleTypes = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
id: state.allFormsData.length + 1,
|
id: state.allFormsData.length + 1,
|
||||||
valueSingle: "",
|
valueSingle: "",
|
||||||
singleList: [
|
optionDetailList: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
inputVal: "",
|
inputVal: "",
|
||||||
@@ -268,7 +252,7 @@ export default {
|
|||||||
console.log(888888888);
|
console.log(888888888);
|
||||||
console.log(id);
|
console.log(id);
|
||||||
console.log(curItem);
|
console.log(curItem);
|
||||||
|
// 前端删除
|
||||||
state.allFormsData.forEach((item, index) => {
|
state.allFormsData.forEach((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
state.allFormsData.splice(index, 1);
|
state.allFormsData.splice(index, 1);
|
||||||
@@ -280,17 +264,18 @@ export default {
|
|||||||
item.id = index + 1;
|
item.id = index + 1;
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
// 接口删除
|
||||||
|
if (curItem.voteStemId) {
|
||||||
api.deleteVoteStem(curItem.voteStemId).then((res) => {
|
api.deleteVoteStem(curItem.voteStemId).then((res) => {
|
||||||
console.log(56444);
|
console.log(56444);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
let resultPost = {};
|
let resultPost = {};
|
||||||
let filterData = parseItem(restData(state.allFormsData));
|
let filterData = restData(state.allFormsData);
|
||||||
|
|
||||||
console.log("filterData==111", filterData);
|
console.log("filterData==111", filterData);
|
||||||
|
|
||||||
// 校验
|
// 校验
|
||||||
@@ -301,21 +286,13 @@ export default {
|
|||||||
if (!checkVal(filterData)) {
|
if (!checkVal(filterData)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log(12121212);
|
|
||||||
console.log(filterData);
|
|
||||||
console.log("111111222223333----0000", state.ballotId);
|
|
||||||
|
|
||||||
if (state.ballotId) {
|
if (state.ballotId) {
|
||||||
resultPost = {
|
resultPost = {
|
||||||
ballotId: state.ballotId,
|
ballotId: state.ballotId,
|
||||||
ballotName: state.ballotName,
|
ballotName: state.ballotName,
|
||||||
...filterData,
|
voteStemDtoList: filterData,
|
||||||
};
|
};
|
||||||
/*
|
|
||||||
resultPost = deepCloneFilterString(resultPost, [
|
|
||||||
"assessmentMaxScore",
|
|
||||||
"assessmentMinScore",
|
|
||||||
]);*/
|
|
||||||
console.log(1212334);
|
console.log(1212334);
|
||||||
console.log(resultPost);
|
console.log(resultPost);
|
||||||
api.updateStemMessage(resultPost).then((res) => {
|
api.updateStemMessage(resultPost).then((res) => {
|
||||||
@@ -330,13 +307,8 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
resultPost = {
|
resultPost = {
|
||||||
ballotName: state.ballotName,
|
ballotName: state.ballotName,
|
||||||
...filterData,
|
voteStemDtoList: filterData,
|
||||||
};
|
};
|
||||||
/*
|
|
||||||
resultPost = deepCloneFilterString(resultPost, [
|
|
||||||
"assessmentMaxScore",
|
|
||||||
"assessmentMinScore",
|
|
||||||
]);*/
|
|
||||||
console.log("=========", resultPost);
|
console.log("=========", resultPost);
|
||||||
api.createStemMessage(resultPost).then((res) => {
|
api.createStemMessage(resultPost).then((res) => {
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
@@ -355,14 +327,8 @@ export default {
|
|||||||
|
|
||||||
const checkVal = (filterData) => {
|
const checkVal = (filterData) => {
|
||||||
console.log("filterData.====", filterData);
|
console.log("filterData.====", filterData);
|
||||||
console.log("filterData.voteStemVoList====", filterData.voteStemDtoList);
|
|
||||||
|
|
||||||
if (!filterData.voteStemDtoList) {
|
filterData.forEach((item) => {
|
||||||
message.error("请添加题干");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let arr = filterData.voteStemDtoList;
|
|
||||||
arr.forEach((item) => {
|
|
||||||
console.log("item===", item);
|
console.log("item===", item);
|
||||||
console.log("!item.voteStemName===", !item.voteStemName);
|
console.log("!item.voteStemName===", !item.voteStemName);
|
||||||
if (!item.voteStemName) {
|
if (!item.voteStemName) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<VoteQuestionItem
|
<VoteQuestionItem
|
||||||
v-model:info="info"
|
v-model:info="info"
|
||||||
v-for="(item, index) in curItem.singleList"
|
v-for="(item, index) in curItem.optionDetailList"
|
||||||
:key="index"
|
:key="index"
|
||||||
:item="item"
|
:item="item"
|
||||||
@input="input"
|
@input="input"
|
||||||
@@ -77,40 +77,40 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSingleAdd = () => {
|
const handleSingleAdd = () => {
|
||||||
curItem.value.singleList.push({
|
curItem.value.optionDetailList.push({
|
||||||
id: curItem.value.singleList.length + 1,
|
id: curItem.value.optionDetailList.length + 1,
|
||||||
inputVal: "",
|
inputVal: "",
|
||||||
imgVal: "",
|
imgVal: "",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const input = ({ id, val }) => {
|
const input = ({ id, val }) => {
|
||||||
curItem.value.singleList.forEach((item) => {
|
curItem.value.optionDetailList.forEach((item) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
item.inputVal = val;
|
item.inputVal = val;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const imgSrc = ({ id, src }) => {
|
const imgSrc = ({ id, src }) => {
|
||||||
curItem.value.singleList.forEach((item) => {
|
curItem.value.optionDetailList.forEach((item) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
item.imgVal = src;
|
item.imgVal = src;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const delImg = ({ id }) => {
|
const delImg = ({ id }) => {
|
||||||
curItem.value.singleList.forEach((item) => {
|
curItem.value.optionDetailList.forEach((item) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
item.imgVal = "";
|
item.imgVal = "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const del = ({ id, optionId }) => {
|
const del = ({ id, optionId }) => {
|
||||||
curItem.value.singleList.forEach((item, index) => {
|
curItem.value.optionDetailList.forEach((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
curItem.value.singleList.splice(index, 1);
|
curItem.value.optionDetailList.splice(index, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
curItem.value.singleList.map((item, index) => {
|
curItem.value.optionDetailList.map((item, index) => {
|
||||||
item.id = index + 1;
|
item.id = index + 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="{
|
<div
|
||||||
|
:style="{
|
||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
background: 'url(http://img.gz2c.com/FoTcLY8ww-ISCFlwyCoYuLim1BMt) no-repeat',
|
background:
|
||||||
|
'url(http://img.gz2c.com/FoTcLY8ww-ISCFlwyCoYuLim1BMt) no-repeat',
|
||||||
backgroundSize: '100% 100%',
|
backgroundSize: '100% 100%',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100vh',
|
height: '100vh',
|
||||||
display:'flex'
|
display: 'flex',
|
||||||
}">
|
}"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
:style="{width:'300px', height: '300px', margin:'10% auto',padding:'20px 30px',textAlign:'center', borderRadius:'10px', background:'#e0e0e0',boxShadow:'20px 20px 60px #bebebe,-20px -20px 60px #ffffff'}">
|
:style="{
|
||||||
|
width: '300px',
|
||||||
|
height: '300px',
|
||||||
|
margin: '10% auto',
|
||||||
|
padding: '20px 30px',
|
||||||
|
textAlign: 'center',
|
||||||
|
borderRadius: '10px',
|
||||||
|
background: '#e0e0e0',
|
||||||
|
boxShadow: '20px 20px 60px #bebebe,-20px -20px 60px #ffffff',
|
||||||
|
}"
|
||||||
|
>
|
||||||
<div :style="{ fontSize: '24px', paddingBottom: '30px' }">用户登录</div>
|
<div :style="{ fontSize: '24px', paddingBottom: '30px' }">用户登录</div>
|
||||||
<div>
|
<div>
|
||||||
<a-input placeholder='用户名' v-model:value="form.account"/>
|
<a-input placeholder="用户名" v-model:value="form.account" />
|
||||||
<a-input placeholder='密码' v-model:value="form.password" :style="{marginTop: '30px'}" type='password'/>
|
<a-input
|
||||||
<a-button :style="{marginTop:'30px'}" @click="loginUser">登录</a-button>
|
placeholder="密码"
|
||||||
|
v-model:value="form.password"
|
||||||
|
:style="{ marginTop: '30px' }"
|
||||||
|
type="password"
|
||||||
|
/>
|
||||||
|
<a-button :style="{ marginTop: '30px' }" @click="loginUser">
|
||||||
|
登录
|
||||||
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -27,25 +47,27 @@ import {useRouter} from "vue-router";
|
|||||||
export default {
|
export default {
|
||||||
name: "loginPage",
|
name: "loginPage",
|
||||||
setup() {
|
setup() {
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
form: {
|
form: {
|
||||||
account: '10181457',
|
account: "10181457",
|
||||||
password: '1234567890Aa'
|
password: "1234567890Aa",
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
async function loginUser() {
|
async function loginUser() {
|
||||||
const {data: {data: token}} = await api.login(state.form)
|
const {
|
||||||
setCookie("token", token, 10)
|
data: { data: token },
|
||||||
await router.push({path: '/learningpath'})
|
} = await api.login(state.form);
|
||||||
location.reload()
|
setCookie("token", token, 10);
|
||||||
|
await router.push({ path: "/learningpath" });
|
||||||
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
loginUser
|
loginUser,
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ export default {
|
|||||||
console.log(888888888);
|
console.log(888888888);
|
||||||
console.log(id);
|
console.log(id);
|
||||||
console.log(curItem);
|
console.log(curItem);
|
||||||
|
// 前端删除
|
||||||
state.allFormsData.forEach((item, index) => {
|
state.allFormsData.forEach((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
state.allFormsData.splice(index, 1);
|
state.allFormsData.splice(index, 1);
|
||||||
@@ -433,7 +433,8 @@ export default {
|
|||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
reload();
|
reload();
|
||||||
|
// 接口删除
|
||||||
|
if (state.assessmentId && curItem.orderNumber) {
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
console.log(11111);
|
console.log(11111);
|
||||||
console.log(curItem);
|
console.log(curItem);
|
||||||
@@ -486,6 +487,7 @@ export default {
|
|||||||
reload();
|
reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ export default {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
const del = ({ id, optionId }) => {
|
const del = ({ id, optionId }) => {
|
||||||
|
// 前端删除
|
||||||
curItem.value.singleList.forEach((item, index) => {
|
curItem.value.singleList.forEach((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
curItem.value.singleList.splice(index, 1);
|
curItem.value.singleList.splice(index, 1);
|
||||||
@@ -134,7 +135,8 @@ export default {
|
|||||||
curItem.value.singleList.map((item, index) => {
|
curItem.value.singleList.map((item, index) => {
|
||||||
item.id = index + 1;
|
item.id = index + 1;
|
||||||
});
|
});
|
||||||
|
// 接口删除
|
||||||
|
if (assessmentId.value && optionId) {
|
||||||
deleteChoiceQuestion({
|
deleteChoiceQuestion({
|
||||||
assessmentId: assessmentId.value,
|
assessmentId: assessmentId.value,
|
||||||
questionType: "1",
|
questionType: "1",
|
||||||
@@ -143,6 +145,7 @@ export default {
|
|||||||
console.log(56444);
|
console.log(56444);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user