Merge branch 'develop' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage into develop

This commit is contained in:
zhangyc
2022-12-05 07:31:17 +08:00
34 changed files with 4252 additions and 1787 deletions

21
package-lock.json generated
View File

@@ -3591,6 +3591,8 @@
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.11.0.tgz", "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.11.0.tgz",
"integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==",
"dev": true, "dev": true,
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"fast-deep-equal": "^3.1.1", "fast-deep-equal": "^3.1.1",
"json-schema-traverse": "^1.0.0", "json-schema-traverse": "^1.0.0",
@@ -3602,7 +3604,9 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
"dev": true "dev": true,
"optional": true,
"peer": true
}, },
"node_modules/ajv-keywords": { "node_modules/ajv-keywords": {
"version": "3.5.2", "version": "3.5.2",
@@ -13767,7 +13771,6 @@
"integrity": "sha512-yl+5qhpjd8e1G4cMXfORkkBlvtPCIgmRf3IYCWYDKIQ7m+PPa5iTm4feiNmCMD6yGqQWMhhK/7M3oWGL9boKwg==", "integrity": "sha512-yl+5qhpjd8e1G4cMXfORkkBlvtPCIgmRf3IYCWYDKIQ7m+PPa5iTm4feiNmCMD6yGqQWMhhK/7M3oWGL9boKwg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/core": "^7.12.16",
"@babel/helper-compilation-targets": "^7.12.16", "@babel/helper-compilation-targets": "^7.12.16",
"@babel/helper-module-imports": "^7.12.13", "@babel/helper-module-imports": "^7.12.13",
"@babel/plugin-proposal-class-properties": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.12.13",
@@ -13780,7 +13783,6 @@
"@vue/babel-plugin-jsx": "^1.0.3", "@vue/babel-plugin-jsx": "^1.0.3",
"@vue/babel-preset-jsx": "^1.1.2", "@vue/babel-preset-jsx": "^1.1.2",
"babel-plugin-dynamic-import-node": "^2.3.3", "babel-plugin-dynamic-import-node": "^2.3.3",
"core-js": "^3.8.3",
"core-js-compat": "^3.8.3", "core-js-compat": "^3.8.3",
"semver": "^7.3.4" "semver": "^7.3.4"
}, },
@@ -14627,15 +14629,14 @@
"resolved": "https://registry.npmmirror.com/ajv-formats/-/ajv-formats-2.1.1.tgz", "resolved": "https://registry.npmmirror.com/ajv-formats/-/ajv-formats-2.1.1.tgz",
"integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",
"dev": true, "dev": true,
"requires": { "requires": {},
"ajv": "^8.0.0"
},
"dependencies": { "dependencies": {
"ajv": { "ajv": {
"version": "8.11.0", "version": "https://registry.npmmirror.com/ajv/-/ajv-8.11.0.tgz",
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.11.0.tgz",
"integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==",
"dev": true, "dev": true,
"optional": true,
"peer": true,
"requires": { "requires": {
"fast-deep-equal": "^3.1.1", "fast-deep-equal": "^3.1.1",
"json-schema-traverse": "^1.0.0", "json-schema-traverse": "^1.0.0",
@@ -14647,7 +14648,9 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
"dev": true "dev": true,
"optional": true,
"peer": true
} }
} }
}, },

View File

@@ -43,7 +43,7 @@ export default defineComponent({
const store = useStore(); const store = useStore();
const isLogin = ref(false); const isLogin = ref(false);
// console.log("router", router.getRoutes(), route); // console.log("router", router.getRoutes(), route);
console.log("版本0.13------------"); console.log("版本0.17------------");
const routes = computed(() => { const routes = computed(() => {
return router.getRoutes().filter((e) => e.meta?.isLink); return router.getRoutes().filter((e) => e.meta?.isLink);
}); });

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com * @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-21 14:32:52 * @Date: 2022-11-21 14:32:52
* @LastEditors: lixg lixg@dongwu-inc.com * @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-04 13:27:07 * @LastEditTime: 2022-12-05 00:00:40
* @FilePath: /fe-manage/src/api/config.js * @FilePath: /fe-manage/src/api/config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@@ -24,18 +24,19 @@ const http = axios.create({
http.interceptors.request.use( http.interceptors.request.use(
(config) => { (config) => {
// console.log('config', config) console.log("config", config);
// const token = localStorage.getItem("token"); // const token = localStorage.getItem("token");
// // const token = getCookie('token') // // const token = getCookie('token')
// // console.log('token', token) // // console.log('token', token)
// if (token) { // if (token) {
// config.headers.token = token; //测试1111 // config.headers.token = token; //测试1111
// } else { // } else {
// console.log("当前请求页面无token,请执行操作!!!"); // console.log("当前请求页面无token,请执行操作!!!");
// // 此处测试默认配置token // // 此处测试默认配置token
// config.headers.token = "123456"; // config.headers.token =
// } // "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzAxNTMxMDMsImV4cCI6MTY3MDE2MDMwMywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.c937b2d3a59cbab2136fdde55fd38f06bdff041212aab0fa6741bc4be41e28a7";
// // }
return config; return config;
}, },
(err) => { (err) => {
@@ -55,7 +56,7 @@ http.interceptors.response.use(
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);
@@ -64,8 +65,8 @@ http.interceptors.response.use(
}, },
function (error) { function (error) {
if (error.message == "timeout of 1ms exceeded") { if (error.message == "timeout of 1ms exceeded") {
message.destroy() message.destroy();
message.error("请求超时") message.error("请求超时");
} }
console.log("api error %o", error); console.log("api error %o", error);
return Promise.reject(error); return Promise.reject(error);

View File

@@ -115,6 +115,8 @@ export const getMemberInfo = (obj) => http.post('/admin/orgStruct/getMemberInfo'
export const getAudienceInfo = (obj) => http.post('/admin/orgStruct/getAudienceInfo', obj) export const getAudienceInfo = (obj) => http.post('/admin/orgStruct/getAudienceInfo', obj)
//获取、添加授权(修改版) //获取、添加授权(修改版)
export const optionAuthPerm = (obj) => http.post('/admin/AuthPerm/optionAuthPerm', obj) export const optionAuthPerm = (obj) => http.post('/admin/AuthPerm/optionAuthPerm', obj)
//获取学员列表
export const getStuList = (obj) => http.post('/admin/orgStruct/getStudentRef', obj)
//获取用户登录 //获取用户登录
export const getUser = () => http.post('/admin/CheckUser/login', { withCredentials: true }) export const getUser = () => http.post('/admin/CheckUser/login', { withCredentials: true })
//公共信息--------------------------------------------------- //公共信息---------------------------------------------------

View File

@@ -11,4 +11,8 @@ export const RouterEditTask = (obj) => http.post('/admin/router/editTask',obj)
// 删除关卡任务 // 删除关卡任务
export const RouterDeleteTask = (obj) => http.post('/admin/router/deleteTask',obj); export const RouterDeleteTask = (obj) => http.post('/admin/router/deleteTask',obj);
// 删除项目任务 // 删除项目任务
export const ProjectDeleteTask = (obj) => http.delete('/admin/project/deleteTask',obj); export const ProjectDeleteTask = (obj) => http.delete('/admin/project/deleteTask',obj);
// 判断当前在线课是否已经添加到该路径图下
export const IsExistence = (obj) => http.post('/admin/router/queryTaskDoesItExist',obj);
// 判断当前在线课是否已经添加到该项目下
export const IsExistenceProject = (obj) => http.post('/admin/project/queryTaskDoesItExistForProject',obj);

View File

@@ -1,6 +1,5 @@
import http from "./config"; import http from "./config";
import qs from 'qs'; import qs from "qs";
/** /**
* 接口传参数方式get * 接口传参数方式get
@@ -42,42 +41,49 @@ import qs from 'qs';
// 接口-请求 // 接口-请求
//基础票数上传接口 //基础票数上传接口
export const baseVoteupload = (obj) => http.post('/vote/baseVoteupload', obj, { export const baseVoteupload = (obj) =>
headers: { http.post("/vote/baseVoteupload", obj, {
'token': '123', headers: {
'Content-Type': 'multipart/form-data', token: "123",
"Content-Type": "multipart/form-data",
} },
}) });
//创建题干信息接口 //创建题干信息接口
export const createStemMessage = (obj) => http.post('/vote/createOptionMessage', obj) export const createStemMessage = (obj) =>
http.post("/vote/createOptionMessage", obj);
//投票信息创建接口 //投票信息创建接口
export const createVote = (obj) => http.post('/vote/createVote', obj) export const createVote = (obj) => http.post("/vote/createVote", obj);
//删除投票信息 //删除投票信息
export const deleteVoteMessage = (obj) => http.post('/vote/deleteVoteMessage', { params: obj }) export const deleteVoteMessage = (obj) =>
http.post("/vote/deleteVoteMessage", { params: obj });
//删除题干信息接口 //删除题干信息接口
export const deleteVoteStem = (voteStemId) => http.post(`/vote/deleteVoteStem?voteStemId=${voteStemId}`) export const deleteVoteStem = (voteStemId) =>
http.post(`/vote/deleteVoteStem?voteStemId=${voteStemId}`);
//删除题选项息接口 //删除题选项息接口
export const deleteVoteStemOption = (optionId) => http.post(`/vote/deleteVoteStemOption?optionId=${optionId}`) export const deleteVoteStemOption = (optionId) =>
http.post(`/vote/deleteVoteStemOption?optionId=${optionId}`);
//修改投票信息接口 //修改投票信息接口
export const editVote = (obj) => http.post('/vote/editVote', obj) export const editVote = (obj) => http.post("/vote/editVote", obj);
//根据题干ID获取题干信息 //根据题干ID获取题干信息
export const queryStemByStemId = (ballotId) => http.post(`/vote/queryStemByStemId?ballotId=${ballotId}`) export const queryStemByStemId = (ballotId) =>
http.post(`/vote/queryStemByStemId?ballotId=${ballotId}`);
//修改题干信息接口 //修改题干信息接口
export const updateStemMessage = (obj) => http.post('/vote/updateStemMessage', obj); export const updateStemMessage = (obj) =>
http.post("/vote/updateStemMessage", obj);
//上传组件 //上传组件
export const fileUp = (obj) => http.post('/file/upload', obj, qs.stringify({ obj })); export const fileUp = (obj) =>
http.post("/file/upload", obj, qs.stringify({ obj }));
//根据题干ID获取投票任务 //根据题干ID获取投票任务
export const queryVoteDetailById = (voteID) => http.post(`/vote/queryVoteDetailById?voteId=${voteID}`) export const queryVoteDetailById = (voteID) =>
http.post(`/vote/queryVoteDetailById?voteId=${voteID}`);
// 测试方法 // 测试方法
// import * as api from '../../api/index' // import * as api from '../../api/index'

View File

@@ -408,6 +408,7 @@ export default {
ctx.emit("update:addfaceteachVisible", false); ctx.emit("update:addfaceteachVisible", false);
localStorage.setItem("stageId", props.chooseStageId); localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive); localStorage.setItem("chapterId", props.isactive);
state.fileList = []
clear(); clear();
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {

View File

@@ -0,0 +1,637 @@
<template>
<a-drawer
:visible="AGMembers"
class="drawerStyle AddGroupMembers"
placement="right"
width="70%"
@after-visible-change="afterVisibleChange"
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">添加组员</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div class="main">
<div class="search">
<div class="namecon" style="margin-right: 30px">
<div class="name">组员名称</div>
<a-input
v-model:value="name"
style="width: 270px; height: 40px; border-radius: 8px"
placeholder="请输入姓名"
/>
</div>
<div class="btns">
<div class="btn btn1" style="margin-right: 20px" @click="searchStu">
<div class="img1"></div>
<div class="wz">搜索</div>
</div>
<div class="btn btn2" @click="resetSearch">
<div class="img2"></div>
<div class="wz">重置</div>
</div>
</div>
</div>
<div class="line">
<div class="inline">
<div class="left">
<div class="img"></div>
<div class="text" style="margin-left: 10px">已选择</div>
<div class="text2">{{ choosed }}</div>
<div class="text"></div>
<div class="text3">列表选项总计</div>
<div class="text4">{{ total }}</div>
</div>
<div class="right" @click="clearChooseStu">清空</div>
</div>
</div>
<div class="tableBox" style="margin-top: 20px; margin-bottom: 100px">
<a-table
style="border: 1px solid #f2f6fe"
:columns="tablecolumns"
:data-source="tabledata"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
:scroll="{ x: 900 }"
@expand="expandTable"
:pagination="false"
:row-selection="{
columnWidth: 30,
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
/>
<div class="pa">
<a-pagination
v-if="total > 10"
showSizeChanger="true"
showQuickJumper="true"
hideOnSinglePage="true"
:pageSize="pageSize"
:current="currentPage"
:total="total"
class="pagination"
@change="changePaginationStu"
/>
</div>
</div>
</div>
<div class="btnn">
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="addStu">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { toRefs, reactive } from "vue";
import { getProjStu } from "../../api/indexProjStu";
import { toDate } from "../../api/method";
import * as api from "../../api/index1";
import { message } from "ant-design-vue";
// import { message } from "ant-design-vue";
export default {
name: "AddGroupMembers",
props: {
AGMembers: {
type: Boolean,
default: false,
},
chooseGroupId: {
type: Number,
default: null,
},
projectId: {
type: Number,
default: null,
},
},
setup(props, ctx) {
const state = reactive({
AGMembers: false,
name: null,
pageSize: 10,
currentPage: 1,
total: null,
tableDataTotal: -1,
selectedRowKeys: [],
choosed: 0, //勾选的学员总数
selectedRows: [], //选择的学员的id值
selectedRowStu: [], //选择的学员id和名字数组
tabledata: [
// {
// key: 1,
// name: "小李",
// bum: "产品部",
// gangw: "产品经理",
// progress: "20%",
// operations: "删除",
// },
],
tablecolumns: [
{
title: "姓名",
dataIndex: "name",
key: "name",
width: 40,
align: "left",
className: "h head",
},
{
title: "部门",
dataIndex: "bum",
key: "bum",
width: 60,
align: "center",
className: "h",
},
{
title: "岗位",
dataIndex: "gangw",
key: "gangw",
width: 60,
align: "center",
className: "h",
},
// {
// title: "进度",
// dataIndex: "progress",
// key: "progress",
// width: 60,
// align: "center",
// className: "h",
// },
],
});
const closeDrawer = () => {
ctx.emit("update:AGMembers", false);
state.selectedRowKeys = [];
state.choosed = 0; //勾选的学员总数
state.selectedRows = []; //选择的学员的id值
state.selectedRowStu = []; //选择的学员id和名字数组
};
//把数据放到state里
const getTableDataList = (tableData) => {
let data = tableData;
let array = [];
data.map((value) => {
let obj = {
key: value.studentId,
projectId: value.projectId, //项目id
groupId: value.groupId, //小组id
group: value.groupName, //小组名
studentId: value.studentId, //学生id
currentStageId: value.currentStageId, //当前关卡id
name: value.name, //用户名
bum: value.userInfoBo.deptName, //部门
gangw: value.userInfoBo.jobName, //岗位
completeStageCnt: value.completeStageCnt, //当前完成阶段数
totalStageCnt: value.totalStageCnt, //总阶段数
progress: value.completeStageCnt + "/" + value.totalStageCnt,
stutime: toDate(value.beginStudyTime / 1000, "Y-M-D"), //开始学习时间
};
array.push(obj);
});
state.tabledata = array;
};
//获取学员列表
const getStu = (obj) => {
let objf = obj || {
deptIds: [], //部门
groupId: 0,
groupName: "",
name: state.name,
pageNo: state.currentPage,
pageSize: state.pageSize,
projectId: props.projectId,
topFlag: "",
};
getProjStu(objf).then((res) => {
if (res.data.code === 200) {
console.log(res.data.data, "获取学员列表");
// let leng = res.data.data.rows.length;
state.total = res.data.data.total;
state.tableDataTotal = res.data.data.total;
// if (leng > 0) {
// }
let arr = res.data.data.rows;
getTableDataList(arr);
}
});
};
const afterVisibleChange = (bool) => {
if (bool) {
getStu();
}
};
//分页
const changePaginationStu = (page) => {
state.currentPage = page;
getStu();
};
//勾选学员
const onSelectChange = (selectedRowKeys, selectedRows) => {
console.log("selectedRowKeys changed: ", selectedRowKeys, selectedRows);
state.selectedRowKeys = selectedRowKeys;
state.choosed = state.selectedRowKeys.length;
state.selectedRows = [];
let selectedRowStu = [];
selectedRows.map((item) => {
console.log(item.studentId);
state.selectedRows.push(item.studentId);
let obj = {
id: item.studentId,
name: item.name,
};
selectedRowStu.push(obj);
});
state.selectedRowStu = selectedRowStu;
};
//清空所选的学员
const clearChooseStu = () => {
state.selectedRowKeys = [];
state.choosed = 0;
};
//学员搜索
const searchStu = () => {
state.currentPage = 1;
getStu();
};
//重置
const resetSearch = () => {
state.name = null;
let obj = {
deptIds: [], //部门
groupName: "",
name: "",
pageNo: 1,
pageSize: 10,
projectId: props.projectId,
topFlag: "",
};
//重新获取列表
getStu(obj);
};
//向小组添加组员
const addStu = () => {
let obj = {
deptList: [],
groupList: [],
projectGroupId: props.chooseGroupId,
projectId: props.projectId,
studentList: state.selectedRowStu,
};
console.log("添加小组学员obj", obj);
api
.addStudentProject(obj)
.then((res) => {
console.log("添加小组学员成功", res);
message.success("添加成功");
ctx.emit("getStuPro");
closeDrawer();
})
.catch((err) => {
console.log("添加小组学员失败", err);
});
};
// console.log("chooseGroupId", props.chooseGroupId);
return {
...toRefs(state),
closeDrawer,
getStu,
getTableDataList,
afterVisibleChange,
changePaginationStu,
clearChooseStu,
onSelectChange,
searchStu,
resetSearch,
addStu,
};
},
};
</script>
<style lang="scss">
.AddGroupMembers {
.drawerMain {
min-width: 600px;
margin: 0px 32px 0px 32px;
//overflow-x: auto;
display: flex;
flex-direction: column;
.header {
height: 73px;
border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
align-items: center;
// background-color: red;
margin-bottom: 20px;
.headerTitle {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
// margin-left: 24px;
}
}
.main {
width: 100%;
height: 100%;
// background-color: #bfa;
overflow-y: auto;
.endtime {
font-size: 16px;
font-weight: 500;
color: #333333;
}
.search {
width: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 20px;
.namecon {
display: flex;
flex-wrap: nowrap;
margin-bottom: 10px;
.name {
margin-top: 8px;
}
// .name {
// margin-top: 8px;
// color: rgba(0, 0, 0, 0.85);
// font-size: 14px;
// font-weight: 400;
// }
}
.btns {
display: flex;
flex-wrap: nowrap;
.btn {
cursor: pointer;
width: 100px;
height: 40px;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
.img1 {
width: 15px;
height: 17px;
background-image: url(../../assets/images/courseManage/search0.png);
background-size: 100% 100%;
margin-right: 7px;
}
.img2 {
width: 16px;
height: 18px;
background-image: url(../../assets/images/courseManage/reset1.png);
background-size: 100% 100%;
margin-right: 7px;
}
}
.btn1 {
background: #409eff;
color: #ffffff;
}
.btn2 {
background: #ffffff;
color: #409eff;
border: 1px solid #409eff;
}
}
}
.btnss {
display: flex;
flex-wrap: nowrap;
.btn {
cursor: pointer;
width: 130px;
height: 40px;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
.img1 {
width: 15px;
height: 17px;
background-image: url(../../assets/images/courseManage/add0.png);
background-size: 100% 100%;
margin-right: 7px;
}
.img2 {
width: 17px;
height: 16px;
background-image: url(../../assets/images/coursewareManage/export.png);
background-size: 100% 100%;
margin-right: 7px;
}
.img3 {
width: 17px;
height: 16px;
background-image: url(../../assets/images/projectadd/delete.png);
background-size: 100% 100%;
margin-right: 7px;
}
}
.btn1 {
background: #409eff;
color: #ffffff;
}
.btn2 {
background: #ffffff;
margin-right: 20px;
color: #409eff;
border: 1px solid #409eff;
}
}
.line {
width: 100%;
height: 40px;
background-color: #e9f6fe;
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
border: 1px solid #c3e6fc;
.inline {
width: 95%;
height: 100%;
display: flex;
justify-content: space-between;
// background-color: #bfa;
.left {
height: 100%;
display: flex;
align-items: center;
.img {
width: 14px;
height: 15px;
background-image: url(../../assets/images/leveladd/gan.png);
background-size: 100% 100%;
}
.text {
color: #999ba3;
}
.text2 {
color: #4ea6ff;
margin-left: 5px;
margin-right: 5px;
}
.text3 {
color: #999ba3;
margin-left: 20px;
}
}
.right {
font-size: 14px;
font-weight: 400;
color: #387df7;
height: 100%;
display: flex;
align-items: center;
cursor: pointer;
}
}
}
.tableBox {
.ant-table-selection-column {
padding: 0px !important;
// padding-left: 45px !important;
}
.ant-table-thead > tr > th {
background-color: rgba(239, 244, 252, 1) !important;
color: rgba(0, 0, 0, 0.85);
}
.ant-table-cell {
color: rgba(0, 0, 0, 0.65);
}
.ant-table-selection-column {
padding: 0 !important;
}
th.h {
background-color: #eff4fc !important;
}
.head {
padding-left: 0px !important;
}
.operation {
color: rgba(56, 125, 247, 1);
cursor: pointer;
}
.ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td {
background: #f6f9fd;
}
.ant-table-tbody > tr > td {
border-bottom: 1px solid rgba(240, 244, 254, 1);
}
.pa {
// left: 0;
margin-top: 15px;
width: 100%;
// height: 20px;
// background-color: red;
display: flex;
justify-content: center;
// position: absolute;
// bottom: 20px;
}
}
}
.btnn {
height: 72px;
width: 100%;
position: absolute;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
.btn1 {
width: 100px;
height: 40px;
border: 1px solid #4ea6ff;
border-radius: 8px;
color: #4ea6ff;
background-color: #fff;
cursor: pointer;
}
.btn2 {
cursor: pointer;
width: 100px;
height: 40px;
background: #4ea6ff;
border-radius: 8px;
border: 0;
margin-left: 15px;
color: #fff;
}
}
}
}
</style>

View File

@@ -291,6 +291,7 @@ export default {
resetForm(); resetForm();
}; };
const closeDrawer2 = () => { const closeDrawer2 = () => {
ctx.emit("update:edit", false);
ctx.emit("update:addhomeworkVisible", false); ctx.emit("update:addhomeworkVisible", false);
resetForm(); resetForm();
}; };

View File

@@ -134,7 +134,7 @@ import * as api from "../../api/indexOnline.js";
import * as apiTask from "../../api/indexTaskadd"; import * as apiTask from "../../api/indexTaskadd";
// import { setCookie } from "../../api/method" // import { setCookie } from "../../api/method"
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { RouterEditTask } from "@/api/indexTask"; import { RouterEditTask, IsExistence, IsExistenceProject } from "@/api/indexTask";
import { addTempTask } from "../../api/indexTaskadd"; import { addTempTask } from "../../api/indexTaskadd";
export default { export default {
name: "AddOnline", name: "AddOnline",
@@ -272,6 +272,7 @@ export default {
const onSelectChange = (selectedRowKeys,selectedRows) => { const onSelectChange = (selectedRowKeys,selectedRows) => {
state.selectedRowKeys = selectedRowKeys; state.selectedRowKeys = selectedRowKeys;
state.addOnlineList = selectedRows; state.addOnlineList = selectedRows;
console.log(selectedRowKeys,selectedRows)
if( props.edit && selectedRows.length > 0 ){ if( props.edit && selectedRows.length > 0 ){
selectedRows.map((value)=>{ selectedRows.map((value)=>{
if(value.courseId == props.EditOnlineId){ if(value.courseId == props.EditOnlineId){
@@ -311,7 +312,6 @@ export default {
} }
}); });
state.tableData = array; state.tableData = array;
state.tableDataTotal = state.tableData.length
}; };
//获取全部在线信息接口 //获取全部在线信息接口
const getAllOnlineText = () => { const getAllOnlineText = () => {
@@ -330,17 +330,80 @@ export default {
"sysType3": "", "sysType3": "",
}) })
.then((res) => { .then((res) => {
let arr = res.data.data; let arr = res.data.data.list;
state.tableDataTotal = res.data.data.count
if (res.status === 200) { if (res.status === 200) {
console.log('获取在线课列表数据', res)
getTableDate(arr); getTableDate(arr);
} }
}) })
.catch((err) => { .catch((err) => {
console.log(err,'请求失败在线');}); console.log(err,'请求失败在线');});
}; };
// 校验当前在线课是否已经添加进来了
const isExistence = (id) => {
console.log({
"chapterId": Number(props.isactive),
"courseTaskId": Number(id),
"routerId": props.routerId,
"type": 1
})
IsExistence({
"chapterId": Number(props.isactive),
"courseTaskId": Number(id),
"routerId": props.routerId,
"type": 1
}).then(res=>{
console.log('我是不是已经添加了',res)
}).catch(err=>{
console.log(err)
})
}
// 判断项目中是否添加当前在线课
const IsExistenceProjects = () => {
IsExistenceProject({
"courseTaskId": props.projectTaskId || 0,
"projectId": props.projectId,
"stageId": props.chooseStageId || 0,
"type": 1
}).then(res=>{
console.log(res)
}).catch(err=>{
console.log(err)
})
}
const updateTask = () => { const updateTask = () => {
if(props.isLevel == 1){
// isExistence(23)
// return
// let routerarr = []
// console.log('我是要便利的数据1', state.addOnlineList)
// state.addOnlineList.map((value) => {
// routerarr.push(isExistence(value.courseId))
// })
// console.log('当前是否已经添加了',routerarr)
}
if(props.isLevel == 2){
console.log('我是要便利的数据2', state.addOnlineList)
}
if(props.isLevel == 3){
console.log('我是要便利的数据3', state.addOnlineList)
}
if (props.isLevel == 1) { if (props.isLevel == 1) {
state.addOnlineList.map((value) => { state.addOnlineList.map((value) => {
console.log(value)
RouterEditTask({ RouterEditTask({
chapterId: Number(props.isactive), chapterId: Number(props.isactive),
courseId: value.num, courseId: value.num,
@@ -445,6 +508,8 @@ export default {
updateTask, updateTask,
searchList, searchList,
resetOnline, resetOnline,
isExistence,
IsExistenceProjects
}; };
}, },
}; };

View File

@@ -168,8 +168,7 @@ export default {
localStorage.setItem("chapterId", props.isactive); localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = () => { const afterVisibleChange = () => {};
};
const showDrawer = () => { const showDrawer = () => {
state.visible = true; state.visible = true;

View File

@@ -62,7 +62,7 @@
<div class="text3">列表选项总计</div> <div class="text3">列表选项总计</div>
<div class="text4">{{ total }}</div> <div class="text4">{{ total }}</div>
</div> </div>
<div class="right">清空</div> <div class="right" @click="clearChooseStu">清空</div>
</div> </div>
</div> </div>
<div class="tableBox" style="margin-top: 20px; margin-bottom: 100px"> <div class="tableBox" style="margin-top: 20px; margin-bottom: 100px">
@@ -97,8 +97,8 @@
</div> </div>
</div> </div>
<div class="btnn"> <div class="btnn">
<button class="btn1">取消</button> <button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2">确定</button> <button class="btn2" @click="closeDrawer">确定</button>
</div> </div>
<!-- 批量删除的弹窗 --> <!-- 批量删除的弹窗 -->
<a-modal <a-modal
@@ -146,20 +146,30 @@
<button class="btn btn2" @click="yesdele">确定</button> <button class="btn btn2" @click="yesdele">确定</button>
</div> </div>
</a-modal> </a-modal>
<stu-add v-model:Stuvisible="Stuvisible" /> <!-- <stu-add v-model:Stuvisible="Stuvisible" /> -->
<add-group-members
v-model:AGMembers="Stuvisible"
:chooseGroupId="chooseGroupId"
:projectId="projectId"
@getStuPro="getStu"
/>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { toRefs, reactive } from "vue"; import { toRefs, reactive } from "vue";
import StuAdd from "./StuAdd.vue"; // import StuAdd from "./StuAdd.vue";
import { getProjStu, deleteStu } from "../../api/indexProjStu"; import { getProjStu, deleteStu } from "../../api/indexProjStu";
import { toDate } from "../../api/method"; import { toDate } from "../../api/method";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import AddGroupMembers from "./AddGroupMembers.vue";
export default { export default {
name: "MemberList", name: "MemberList",
components: { StuAdd }, components: {
// StuAdd,
AddGroupMembers,
},
props: { props: {
Lvisible: { Lvisible: {
type: Boolean, type: Boolean,
@@ -178,12 +188,15 @@ export default {
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
Stuvisible: false, Stuvisible: false,
// chooseGroupId: props.chooseGroupId,
// projectId: props.projectId,
name: null, name: null,
showmodal: false, showmodal: false,
closable: false, //modal右上角的关闭按钮 closable: false, //modal右上角的关闭按钮
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
total: null, total: null,
tableDataTotal: -1,
selectedRowKeys: [], selectedRowKeys: [],
choosed: 0, //勾选的学员总数 choosed: 0, //勾选的学员总数
selectedRows: [], //选择的学员的id值 selectedRows: [], //选择的学员的id值
@@ -257,6 +270,8 @@ export default {
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:Lvisible", false); ctx.emit("update:Lvisible", false);
state.tabledata = [];
console.log("tabledata", state.tabledata);
}; };
const showModal = () => { const showModal = () => {
if (state.selectedRows.length == 0) { if (state.selectedRows.length == 0) {
@@ -290,6 +305,7 @@ export default {
}; };
const showStuAdd = () => { const showStuAdd = () => {
state.Stuvisible = true; state.Stuvisible = true;
// console.log("单击");
}; };
//把数据放到state里 //把数据放到state里
const getTableDataList = (tableData) => { const getTableDataList = (tableData) => {
@@ -326,21 +342,30 @@ export default {
pageSize: 10, pageSize: 10,
projectId: props.projectId, projectId: props.projectId,
topFlag: "", topFlag: "",
groupId: 10, //暂时写死 groupId: props.chooseGroupId, //暂时写死
}; };
state.tableDataTotal = -1;
getProjStu(objf).then((res) => { getProjStu(objf).then((res) => {
console.log(res.data.data, "获取学员列表"); console.log(res.data.data, "获取学员列表");
let leng = res.data.data.rows.length; if (res.data.code === 200) {
state.total = res.data.data.total; state.total = res.data.data.total;
if (leng > 0) { state.tableDataTotal = res.data.data.total;
let arr = res.data.data.rows; let arr = res.data.data.rows;
getTableDataList(arr); getTableDataList(arr);
} }
// let leng = res.data.data.rows.length;
// state.tableDataTotal = res.data.data.total;
// if (leng > 0) {
// }
}); });
}; };
const afterVisibleChange = () => { const afterVisibleChange = (bool) => {
getStu(); if (bool) {
getStu();
}
}; };
//分页 //分页
const changePaginationStu = (page) => { const changePaginationStu = (page) => {

View File

@@ -583,6 +583,7 @@ import {
// batchLoadList, // batchLoadList,
} from "../../utils/utils"; } from "../../utils/utils";
import * as api from "../../api/index1"; import * as api from "../../api/index1";
import {getStuList} from "../../api/index1";
export default { export default {
name: "ProjCheckShip", name: "ProjCheckShip",
@@ -603,6 +604,11 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
//1 审核 2添加学员
type: {
type: Number,
default: 1,
},
}, },
setup(props, ctx) { setup(props, ctx) {
const store = useStore(); const store = useStore();
@@ -611,7 +617,7 @@ export default {
//快速选人 //快速选人
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
tableDataTotal: 100, tableDataTotal: 0,
nameSearch: "", //搜索名称 nameSearch: "", //搜索名称
loading: false, loading: false,
//受众 //受众
@@ -805,7 +811,7 @@ export default {
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
if (bool) { if (bool) {
optionAuthPerm(); props.type === 1 ? optionAuthPerm() : getStuentList()
} }
}; };
//获取组织树 //获取组织树
@@ -822,7 +828,7 @@ export default {
// }; // };
onMounted(() => { onMounted(() => {
window.addEventListener("resize", getClientHeight, false); window.addEventListener("resize", getClientHeight, false);
state.tabledata = store.state.memberInitInfo; // state.tabledata = store.state.memberInitInfo;
}); });
onUnmounted(() => { onUnmounted(() => {
window.removeEventListener("resize", getClientHeight, false); window.removeEventListener("resize", getClientHeight, false);
@@ -898,10 +904,14 @@ export default {
console.log("choosepeople : ", state.choosepeople); console.log("choosepeople : ", state.choosepeople);
state.selectedRowKeys = selectedRowKeys; state.selectedRowKeys = selectedRowKeys;
const se = state.studentList.map(e => e.id).join(',') || '' const se = state.studentList.map(e => e.id).join(',') || ''
const addItem = item.filter(e => (e && !se.includes(e.id + ','))) const addItem = item.filter(e => (e && !se.includes(e.id + '')))
addItem.forEach(e => { addItem.forEach(e => {
e.name = e.realName e.name = e.realName
}) })
const selectStr = selectedRowKeys.join(',')
console.log(selectStr)
state.studentList = state.studentList.filter(e => selectStr.includes(e.id + ''))
console.log(state.studentList)
state.choosepeople = [...addItem.reverse(), ...state.studentList]; state.choosepeople = [...addItem.reverse(), ...state.studentList];
selectedsHeight(); selectedsHeight();
// if (selectedRowKeys.length > 0 && item.length > 0) { // if (selectedRowKeys.length > 0 && item.length > 0) {
@@ -1331,6 +1341,47 @@ export default {
ctx.emit("update:addAuthList", state.selectAllArr); ctx.emit("update:addAuthList", state.selectAllArr);
closeDrawer(); closeDrawer();
}; };
//获取学员列表
const getStuentList = () => {
getStuList({
refType: {learnPath: 1, project: 2, course: 3, addstudent: 2}[props.classify],
refId: props.selectProjectId,
extId: 0
}).then(res => {
initResp(res)
})
}
function initResp(res) {
let studentArr = res.data.data.studentList;
state.studentList = res.data.data.studentList;
state.choosepeople = res.data.data.studentList;
//快速选人
state.selectedRowKeys = studentArr.map(e => e.id);
let deptArr = res.data.data.deptList;
let selectedKeys1 = [];
let chooseorganization = [];
for (let i = 0; i < deptArr.length; i++) {
selectedKeys1.push(deptArr[i].id);
chooseorganization.push(deptArr[i]);
}
//组织
state.selectedKeys1 = selectedKeys1;
state.chooseorganization = chooseorganization;
state.chooseorganization1 = chooseorganization;
let groupArr = res.data.data.groupList;
let selectedRowKeys2 = [];
let relationpeople = [];
for (let i = 0; i < groupArr.length; i++) {
selectedRowKeys2.push(groupArr[i].id);
relationpeople.push(groupArr[i]);
}
//受众
state.selectedRowKeys2 = selectedRowKeys2;
state.relationpeople = relationpeople;
console.log("获取权限名单成功", res);
}
//获取授权 坐回显 //获取授权 坐回显
const optionAuthPerm = () => { const optionAuthPerm = () => {
let obj = { let obj = {
@@ -1353,43 +1404,10 @@ export default {
studentList: [], studentList: [],
}; };
console.log("获取权限名单obj", obj); console.log("获取权限名单obj", obj);
api api.optionAuthPerm(obj).then((res) => {
.optionAuthPerm(obj) initResp(res)
.then((res) => { })
// console.log("获取权限名单成功", res);
if (res.data.code === 200) {
let studentArr = res.data.data.studentList;
state.studentList = res.data.data.studentList;
state.choosepeople = res.data.data.studentList;
//快速选人
state.selectedRowKeys = studentArr.map(e => e.id);
let deptArr = res.data.data.deptList;
let selectedKeys1 = [];
let chooseorganization = [];
for (let i = 0; i < deptArr.length; i++) {
selectedKeys1.push(deptArr[i].id);
chooseorganization.push(deptArr[i]);
}
//组织
state.selectedKeys1 = selectedKeys1;
state.chooseorganization = chooseorganization;
state.chooseorganization1 = chooseorganization;
let groupArr = res.data.data.groupList;
let selectedRowKeys2 = [];
let relationpeople = [];
for (let i = 0; i < groupArr.length; i++) {
selectedRowKeys2.push(groupArr[i].id);
relationpeople.push(groupArr[i]);
}
//受众
state.selectedRowKeys2 = selectedRowKeys2;
state.relationpeople = relationpeople;
console.log("获取权限名单成功", res);
}
})
.catch((err) => {
console.log("获取权限名单失败", err);
});
}; };
return { return {
...toRefs(state), ...toRefs(state),

View File

@@ -1,49 +1,76 @@
<template> <template>
<a-drawer :visible="addvoteVisible" class="drawerStyle addvoteDrawer" width="80%" title="添加投票" placement="right" <a-drawer
@after-visible-change="afterVisibleChange"> :visible="addvoteVisible"
class="drawerStyle addvoteDrawer"
width="80%"
title="添加投票"
placement="right"
@after-visible-change="afterVisibleChange"
>
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div v-if="edit" class="headerTitle">编辑投票</div> <div v-if="edit" class="headerTitle">编辑投票任务</div>
<div v-else class="headerTitle">添加投票</div> <div v-else class="headerTitle">添加投票任务</div>
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png" <img
@click="closeDrawer" /> style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div> </div>
<div class="contentMain"> <div class="contentMain">
<div class="main_left"> <div class="main_left">
<div class="main_item"> <div class="main_item">
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" /> <img
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
</div> </div>
<span style="margin-right: 3px">任务名称</span> <span style="margin-right: 3px">任务名称</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="inputV1" style="width: 424px; height: 32px" placeholder="请输入投票名称" <a-input
maxlength="20" /> v-model:value="inputV1"
style="width: 424px; height: 32px"
placeholder="请输入投票名称"
maxlength="20"
/>
</div> </div>
</div> </div>
<div class="main_item"> <div class="main_item">
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" /> <img
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
</div> </div>
<span>创建投票</span> <span>创建投票</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<button class="xkbtn" @click="showDrawerCreVote"> <button class="xkbtn" @click="showDrawerCreVote">
{{ ballotId ? "编辑" : "添加" }}投票 {{ ballotId ? "编辑" : "创建" }}投票
</button> </button>
<div v-if="ballotId > 0"> <div v-if="ballotId > 0">
<a-tag closable color="processing" @close="log"> <a-tag closable color="processing" @close="log">
<span style="font-size:14px;line-height: 33px;">删除投票</span> <span style="font-size: 14px; line-height: 33px">
删除投票
</span>
</a-tag> </a-tag>
</div> </div>
<div> <div>
<CreateVote v-model:createVoteVisible="createVoteVisible" v-model:ballotId="ballotId" <CreateVote
v-model:editChild="editChild" /> v-model:createVoteVisible="createVoteVisible"
v-model:ballotId="ballotId"
v-model:editChild="editChild"
/>
</div> </div>
<button class="xkbtn" :style="{ display: creVote ? 'block' : 'none' }" @click="showDrawerCreVote"> <button
class="xkbtn"
:style="{ display: creVote ? 'block' : 'none' }"
@click="showDrawerCreVote"
>
编辑投票 编辑投票
</button> </button>
<div :style="{ display: creVote ? 'block' : 'none' }"> <div :style="{ display: creVote ? 'block' : 'none' }">
@@ -56,7 +83,11 @@
<!-- 创建投票侧弹窗 --> <!-- 创建投票侧弹窗 -->
<div> <div>
<create-vote v-model:crevoteVisible="crevotevisible" @getData="getStemId" v-model:ballotId="ballotId" /> <create-vote
v-model:crevoteVisible="crevotevisible"
@getData="getStemId"
v-model:ballotId="ballotId"
/>
</div> </div>
<!-- 创建投票侧弹窗 --> <!-- 创建投票侧弹窗 -->
</div> </div>
@@ -65,7 +96,11 @@
<span style="margin-right: 3px">起止时间</span> <span style="margin-right: 3px">起止时间</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-range-picker style="width: 424px" v-model:value="time" :placeholder="[' 开始时间', ' 结束时间']" /> <a-range-picker
style="width: 424px"
v-model:value="time"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div> </div>
</div> </div>
<div class="main_item"> <div class="main_item">
@@ -73,12 +108,23 @@
<span style="margin-right: 3px">基础投票数</span> <span style="margin-right: 3px">基础投票数</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-upload @change="handleChange" :before-upload="beforeUpload" :multiple="true" :max-count="1" <a-upload
action="/manageApi/vote/baseVoteupload" v-model:file-list="fileList"> @change="handleChange"
<button class="xkbtn">点击上传</button></a-upload> :before-upload="beforeUpload"
<div v-if="voteCount > 0"><a-tag color="processing"> <span style="font-size:14px;line-height: 33px;">{{ :multiple="true"
voteCount :max-count="1"
}}</span></a-tag></div> action="/manageApi/vote/baseVoteupload"
v-model:file-list="fileList"
>
<button class="xkbtn">点击上传</button></a-upload
>
<div v-if="voteCount > 0">
<a-tag color="processing">
<span style="font-size: 14px; line-height: 33px">
{{ voteCount }}
</span>
</a-tag>
</div>
</div> </div>
</div> </div>
<div class="main_item" style="margin-top: -25px"> <div class="main_item" style="margin-top: -25px">
@@ -92,7 +138,12 @@
<span style="margin-right: 3px">投票说明</span> <span style="margin-right: 3px">投票说明</span>
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea v-model:value="textV1" placeholder="请输入投票说明" allow-clear maxlength="150" /> <a-textarea
v-model:value="textV1"
placeholder="请输入投票说明"
allow-clear
maxlength="150"
/>
</div> </div>
</div> </div>
</div> </div>
@@ -117,8 +168,7 @@ import { addTempTask } from "../../api/indexTaskadd";
export default { export default {
name: "AddVote", name: "AddVote",
components: { components: {
CreateVote CreateVote,
}, },
props: { props: {
addvoteVisible: { addvoteVisible: {
@@ -145,11 +195,13 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLevel: { // 是否是关卡页面触发 isLevel: {
// 是否是关卡页面触发
type: Number, type: Number,
default: null, default: null,
}, },
projectTaskId: { // 要编辑的projectId projectTaskId: {
// 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -164,9 +216,7 @@ export default {
projectTemplateId: { projectTemplateId: {
type: Number, type: Number,
default: null, default: null,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
@@ -182,7 +232,7 @@ export default {
EditVoteId: "", EditVoteId: "",
voteStemName: "", voteStemName: "",
ballotName: "", ballotName: "",
editStem: false, //编辑状态 editStem: false, //编辑状态
ballotId: 0, //题干id ballotId: 0, //题干id
optionId: "", //删除修改选项id optionId: "", //删除修改选项id
addStemVisible: false, // addStemVisible: false, //
@@ -190,14 +240,13 @@ export default {
fileList: [], fileList: [],
voteCount: null, voteCount: null,
projectTemplateId: null, projectTemplateId: null,
}); });
const closeDrawer = () => { const closeDrawer = () => {
state.inputV1 = "", (state.inputV1 = ""),
state.textV1 = "", (state.textV1 = ""),
state.time = undefined, (state.time = undefined),
state.basevote = "", (state.basevote = ""),
state.ballotId = "", (state.ballotId = ""),
ctx.emit("update:addvoteVisible", false); ctx.emit("update:addvoteVisible", false);
ctx.emit("update:edit", false); ctx.emit("update:edit", false);
}; };
@@ -207,38 +256,33 @@ export default {
} }
state.projectTemplateId = props.projectTemplateId; state.projectTemplateId = props.projectTemplateId;
console.log("projectTemplateId visible====", state.projectTemplateId); console.log("projectTemplateId visible====", state.projectTemplateId);
}; };
const showDrawerCreVote = () => { const showDrawerCreVote = () => {
state.createVoteVisible = true; state.createVoteVisible = true;
state.editChild = props.edit; state.editChild = props.edit;
}; };
// 限制文件格式上传 // 限制文件格式上传
const beforeUpload = (obj) => { const beforeUpload = (obj) => {
console.log(obj) console.log(obj);
} };
const handleChange = info => { const handleChange = (info) => {
console.log(info.file.type, info.file.type.indexOf('sheet')) console.log(info.file.type, info.file.type.indexOf("sheet"));
if (info.file.type.indexOf('sheet') == -1) { if (info.file.type.indexOf("sheet") == -1) {
message.destroy() message.destroy();
message.error("请上传正确的文件格式") message.error("请上传正确的文件格式");
console.log(state.fileList) console.log(state.fileList);
state.fileList = [] state.fileList = [];
return return;
} }
let resFileList = [...info.fileList]; let resFileList = [...info.fileList];
resFileList.map((file) => {
resFileList.map(file => {
if (file.response) { if (file.response) {
// Component will show file.url as link // Component will show file.url as link
file.url = file.response.url; file.url = file.response.url;
@@ -246,26 +290,23 @@ export default {
console.log("file========", file.response); console.log("file========", file.response);
state.voteCount = file.response.data; state.voteCount = file.response.data;
} }
}); });
//fileList.value = resFileList; //fileList.value = resFileList;
}; };
//删除题干信息接口 //删除题干信息接口
const dleVoteStem = () => { const dleVoteStem = () => {
api.deleteVoteStem({ voteStemId: state.ballotId }) api.deleteVoteStem({ voteStemId: state.ballotId }).then(() => {
.then(() => { message.success("删除题干信息成功");
message.success('删除题干信息成功') });
};
})
}
//根据投票id获取投票信息 //根据投票id获取投票信息
const queryVoteInfo = () => { const queryVoteInfo = () => {
api
api.queryVoteDetailById(props.EditVoteId) .queryVoteDetailById(props.EditVoteId)
.then((res) => { .then((res) => {
console.log('获取投票信息成功', res); console.log("获取投票信息成功", res);
state.inputV1 = res.data.data.voteName; state.inputV1 = res.data.data.voteName;
state.textV1 = res.data.data.voteExplain; state.textV1 = res.data.data.voteExplain;
state.baseVote = res.data.data.baseVote; state.baseVote = res.data.data.baseVote;
@@ -277,11 +318,9 @@ export default {
]; ];
}) })
.catch((err) => { .catch((err) => {
console.log('获取投票信息失败', err); console.log("获取投票信息失败", err);
}); });
};
}
const updateToTask = (res) => { const updateToTask = (res) => {
console.log("props.isLevel=====", props.isLevel); console.log("props.isLevel=====", props.isLevel);
if (props.isLevel == 1) { if (props.isLevel == 1) {
@@ -319,7 +358,6 @@ export default {
////message.error(`${props.edit ? '编辑' : '新增'}阶段任务失败`) ////message.error(`${props.edit ? '编辑' : '新增'}阶段任务失败`)
}); });
} else if (props.isLevel == 3) { } else if (props.isLevel == 3) {
addTempTask({ addTempTask({
courseId: res.data.data.voteId, courseId: res.data.data.voteId,
name: res.data.data.voteName, name: res.data.data.voteName,
@@ -336,7 +374,7 @@ export default {
//message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`); //message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`);
}); });
} }
} };
//修改投票信息接口 //修改投票信息接口
const updateVoteInfo = () => { const updateVoteInfo = () => {
if (!state.inputV1) { if (!state.inputV1) {
@@ -364,8 +402,7 @@ export default {
ballotId: state.ballotId, ballotId: state.ballotId,
baseVote: state.basevote, baseVote: state.basevote,
voteExplain: state.textV1, voteExplain: state.textV1,
};
}
if (props.edit) { if (props.edit) {
api api
.editVote(obj) .editVote(obj)
@@ -374,12 +411,12 @@ export default {
await updateToTask(res); await updateToTask(res);
closeDrawer(); closeDrawer();
message.destroy(); message.destroy();
message.success("修改投票信息成功") message.success("修改投票信息成功");
}) })
.catch(() => { .catch(() => {
message.destroy(); message.destroy();
message.error("修改投票信息失败") message.error("修改投票信息失败");
}) });
} else { } else {
api api
.createVote(obj) .createVote(obj)
@@ -387,22 +424,21 @@ export default {
await updateToTask(res); await updateToTask(res);
closeDrawer(); closeDrawer();
message.destroy(); message.destroy();
message.success("创建投票信息成功") message.success("创建投票信息成功");
}) })
.catch(() => { .catch(() => {
message.destroy(); message.destroy();
message.error("创建投票信息失败") message.error("创建投票信息失败");
}) });
} }
};
}
const queryStem = () => { const queryStem = () => {
state.addStemVisible = true; state.addStemVisible = true;
}; };
const closeStem = () => { const closeStem = () => {
state.addStemVisible = false; state.addStemVisible = false;
}; };
const log = e => { const log = (e) => {
state.ballotId = null; state.ballotId = null;
console.log(e); console.log(e);
}; };
@@ -450,8 +486,10 @@ export default {
position: absolute; position: absolute;
width: calc(100%); width: calc(100%);
height: 40px; height: 40px;
background: linear-gradient(rgba(78, 166, 255, 0.2) 0%, background: linear-gradient(
rgba(78, 166, 255, 0) 100%); rgba(78, 166, 255, 0.2) 0%,
rgba(78, 166, 255, 0) 100%
);
} }
.del_main { .del_main {

View File

@@ -0,0 +1,626 @@
<!-- 评估管理-创建评估页面 -->
<template>
<a-drawer
:visible="createVoteVisible"
class="drawerStyle createvoteDrawer"
width="100%"
placement="right"
@after-visible-change="afterVisibleChange"
>
<div class="researchadd">
<div class="header">
<div class="headerTitle">创建投票</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div class="main_left">
<div class="main_item">
<div class="signbox">
<div class="sign">
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
</div>
<span style="margin-right: 3px">投票名称</span>
</div>
<div class="btnbox">
<a-input
v-model:value="ballotName"
style="width: 424px; height: 32px"
placeholder="请输入任务名称"
maxlength="20"
/>
</div>
</div>
<div class="main_item">
<div class="signbox">
<div class="sign">
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
</div>
<span>创建题干</span>
</div>
<div class="btnbox">
<button class="xkbtn" @click="handleTypes">添加题干</button>
</div>
</div>
<!-- 创建投票侧弹窗 -->
</div>
<div v-for="(item, index) in allFormsData" :key="index">
<VoteQuestion
v-model:info="information"
:item="item"
:optionId="optionId"
@delOption="delOption"
@del="handleDel"
@edits="edits"
@addOption="addOption"
/>
</div>
<div class="footer">
<div class="btn">
<a-button
type="primary"
style="
width: 100px;
height: 40px;
border-radius: 8px;
background-color: #409eff;
"
@click="handleSave"
>
保存
</a-button>
<a-button
type="primary"
ghost
style="
width: 100px;
height: 40px;
margin-left: 14px;
border-radius: 8px;
"
@click="handleAllCancel"
>
取消
</a-button>
</div>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
// import { createResearch } from "../../api/indexResearch";
import VoteQuestion from "./VoteQuestion.vue";
import {
// sortBy,
traverseArr,
//filterCommon,
// deepCloneFilterString,
} from "../../utils/utils";
//import store from "@/store";
import * as api from "@/api/indexVote";
//import { useRouter } from "vue-router";
import {} from "@/api/indexResearch";
//import { message } from "ant-design-vue";
export default {
name: "CreateVote",
components: {
VoteQuestion,
},
props: {
createVoteVisible: {
type: Boolean,
default: false,
},
ballotId: {
type: Number,
default: null,
},
editChild: {
type: Boolean,
default: false,
},
},
setup(props, ctx) {
const state = reactive({
ballotId: "",
ballotName: "",
allFormsData: [],
allFormsData1: [],
});
// const router = useRouter();
const afterVisibleChange = () => {
if (props.ballotId) {
getInfoDate();
} else {
handleTypes();
}
};
const closeDrawer = () => {
ctx.emit("update:createVoteVisible", false);
ctx.emit("update:ballotId", state.ballotId);
handleAllCancel();
};
// 详情
const getInfoDate = async () => {
console.log("props.editChild=====", props.editChild);
if (props.ballotId) {
console.log("props.editChild2=====", props.editChild);
let res = await api.queryStemByStemId(props.ballotId).then((res) => {
if (res.data.code === 200) {
return res.data.data;
}
});
console.log("res====", res);
state.ballotName = res.ballotId;
// let renderArr = [...res];
// sortBy(renderArr, "orderNumber"); //序号
state.allFormsData = parseData(res); //类型
state.allFormsData1 = parseData(res); //类型
console.log(state.allFormsData);
}
};
// 转换成前端格式
const parseData = (arr) => {
const resultArr = [];
state.ballotId = arr.ballotId;
state.ballotName = arr.ballotName;
console.log("arr.voteStemVoList=====", arr.voteStemVoList);
arr.voteStemVoList.forEach((item) => {
let obj = {};
let restList = traverseArr(item.optionDetailList, {
inputVal: "optionName",
imgVal: "optionPictureAddress",
optionId: "optionId",
voteStemId: "voteStemId",
stem: "stem",
}).map((itm, idx) => {
itm.id = idx + 1;
return itm;
});
obj = {
voteStemId: item.voteStemId,
valueSingle: item.voteStemName,
singleList: restList,
};
resultArr.push(obj);
});
resultArr.map((itm, idx) => {
itm.id = idx + 1;
return itm;
});
return resultArr;
};
// 转换成后端格式
const restData = (arr) => {
const resultArr = [];
arr.forEach((item) => {
let obj = {};
console.log("item=======", item);
// if (item[typeKey] === 1) {
let restList = traverseArr(item.singleList, {
optionName: "inputVal",
optionPictureAddress: "imgVal",
optionId: "optionId",
voteStemId: "voteStemId",
stem: "stem",
}).map((itm, idx) => {
itm.optionOrderNum = idx + 1;
return itm;
});
restList.forEach((item) => {
item.optionId = item.optionId ? item.optionId : "";
});
obj = {
voteStemName: item.valueSingle,
optionDetailList: restList,
voteStemId: item.voteStemId,
};
resultArr.push(obj);
// }
console.log("resultArr=======", resultArr);
});
resultArr.map((itm, idx) => {
itm.orderNumber = idx + 1;
return itm;
});
return resultArr;
};
// 解散传值
const parseItem = (arrr) => {
// const filterComObj = filterCommon(arr, "questionType");
let resultObj = {};
// for (let key in filterComObj) {
// if (key === "1") {
// let arrSingle = arrr
//filterComObj[key];
console.log("arrr======", arrr);
/*
let arr = [];
arrSingle.forEach((item) => {
console.log("item======",item);
if (item.singleList.length) {
item.singleList.forEach((itm) => {
arr.push({
...itm,
optionName: item.optionName,
optionOrderNum: item.optionOrderNum,
});
});
}
});*/
resultObj.voteStemDtoList = arrr;
// }
console.log("resultObj======", resultObj);
// }
return resultObj;
};
const handleTypes = () => {
let obj = {
id: state.allFormsData.length,
valueSingle: "",
singleList: [
{
id: 1,
inputVal: "",
imgVal: "",
},
{
id: 2,
inputVal: "",
imgVal: "",
},
],
};
state.allFormsData.push(obj);
state.allFormsData1.push(obj);
};
const handleDel = ({ id }) => {
console.log("1234523432434234234", id, state.allFormsData);
state.allFormsData.forEach((item, index) => {
if (item.id === id) {
console.log("oooooo", item);
state.allFormsData.splice(index, 1);
}
});
// state.allFormsData.map((item, index) => {
// item.id = index + 1;
// return item;
// });
// orderNumber: curItem.orderNumber,
};
const delOption = (data) => {
console.log("datadatadatadatadata", data, state.allFormsData);
state.allFormsData.forEach((item, index) => {
if (item.voteStemId === data.value.voteStemId) {
state.allFormsData[index].singleList.forEach((ii, nn) => {
if (ii.id == data.value.id) {
console.log(
1212121212,
state.allFormsData[index].singleList[nn],
nn
);
state.allFormsData[index].singleList.splice(nn, 1);
console.log("12", state.allFormsData);
}
});
}
});
state.allFormsData1.forEach((item, index) => {
if (item.voteStemId === data.value.voteStemId) {
state.allFormsData1[index].singleList.forEach((ii, nn) => {
if (ii.id == data.value.id) {
console.log(
1212121212,
state.allFormsData1[index].singleList[nn],
nn
);
state.allFormsData1[index].singleList.splice(nn, 1);
console.log("33", state.allFormsData1);
}
});
}
});
};
const edits = (data) => {
console.log(
"我传递过来了吗---111",
data,
data.value.id,
state.allFormsData1
);
state.allFormsData1.forEach((item, index) => {
if (item.voteStemId === data.value.voteStemId) {
item.singleList.forEach((ii, nn) => {
if (ii.id === data.value.id) {
// ii.optionName = data.value.inputVal
state.allFormsData1[index].singleList[nn].inputVal =
data.value.inputVal;
}
});
}
});
console.log("123-456-789", state.allFormsData1);
};
// 增加选项
const addOption = (data) => {
console.log(data);
state.allFormsData1.forEach((item, index) => {
if (item.voteStemId === data.value.voteStemId) {
state.allFormsData1[index].singleList = data.value.singleList;
}
});
};
const handleSave = () => {
let resultPost = {};
let filterData = parseItem(restData(state.allFormsData1, "type"));
console.log("filterData==111", filterData);
if (!state.ballotName) {
return message.warning("请输入投票名称");
}
// 校验s
// 校验
if (!checkVal(filterData)) {
return false;
}
// checkVal(filterData);
console.log(12121212);
console.log(filterData);
console.log("111111222223333----0000", state.ballotId);
if (state.ballotId) {
resultPost = {
ballotId: state.ballotId,
ballotName: state.ballotName,
...filterData,
};
/*
resultPost = deepCloneFilterString(resultPost, [
"assessmentMaxScore",
"assessmentMinScore",
]);*/
console.log(1212334);
console.log(resultPost);
api.updateStemMessage(resultPost).then((res) => {
if (res.data.code === 200) {
state.ballotId = res.data.data.ballotId;
console.log("res.data.data==============", res.data.data);
console.log("res.state.ballotId==============", state.ballotId);
message.success("编辑成功");
closeDrawer();
}
});
} else {
resultPost = {
ballotName: state.ballotName,
...filterData,
};
/*
resultPost = deepCloneFilterString(resultPost, [
"assessmentMaxScore",
"assessmentMinScore",
]);*/
console.log("=========", resultPost);
api.createStemMessage(resultPost).then((res) => {
if (res.data.code === 200) {
state.ballotId = res.data.data.ballotId;
console.log("res.data.data2==============", res.data.data);
console.log("res.state.ballotId=2s=============", state.ballotId);
message.success("创建成功");
closeDrawer();
}
});
}
};
const handleAllCancel = () => {
state.allFormsData = [];
};
const checkVal = (filterData) => {
console.log("filterData.====", filterData);
console.log("filterData.voteStemVoList====", filterData.voteStemDtoList);
if (!filterData.voteStemDtoList) {
message.error("请添加题干");
return false;
}
let arr = filterData.voteStemDtoList;
arr.forEach((item) => {
console.log("item===", item);
console.log("!item.voteStemName===", !item.voteStemName);
if (!item.voteStemName) {
console.log("item.voteStemName===", item.voteStemName);
message.error("题干为必填 请确认", item.voteStemName);
return false;
}
});
return true;
};
return {
...toRefs(state),
handleTypes,
handleSave,
handleAllCancel,
handleDel,
afterVisibleChange,
closeDrawer,
edits,
delOption,
addOption,
};
},
};
</script>
<style lang="scss">
.researchadd {
.header {
height: 73px;
border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
margin-bottom: 25px;
.headerTitle {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-left: 24px;
}
}
.main_left {
margin-left: 50px;
padding-right: 30px;
flex: 1;
border-right: 1px solid #e8e8e8;
.main_item {
display: flex;
align-items: center;
margin-bottom: 32px;
.signbox {
width: 120px;
display: flex;
justify-content: end;
align-items: center;
.sign {
margin-right: 5px;
}
}
.btnbox {
display: flex;
flex: 1;
align-items: center;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 8px;
color: #fff;
margin-right: 10px;
}
.fileTigan {
display: flex;
align-items: center;
padding: 3px 5px;
background-color: rgba(42, 103, 209, 0.4);
span {
margin-right: 5px;
}
.delBox {
width: 13px;
height: 13px;
background-image: url(@/assets/images/basicinfo/ch.png);
background-size: 100% 100%;
border-radius: 50%;
}
}
}
}
.main_item2 {
display: flex;
align-items: flex-start;
margin-bottom: 32px;
.signbox {
width: 120px;
display: flex;
justify-content: end;
align-items: center;
.sign {
margin-right: 5px;
}
}
.kqszbox {
.qdqtbox {
margin-left: 56px;
}
.setbox {
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-bottom: 24px;
.timerbox {
margin-top: 6px;
margin-right: 32px;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
}
.btnbox2 {
display: flex;
flex-direction: column;
justify-content: flex-start;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 16px 8px 32px 0;
color: #fff;
margin-top: 16px;
margin-bottom: 60px;
}
}
}
}
}
</style>

View File

@@ -1,12 +1,20 @@
<!-- 评估管理-创建评估页面 --> <!-- 评估管理-创建评估页面 -->
<template> <template>
<a-drawer :visible="createVoteVisible" class="drawerStyle createvoteDrawer" width="100%" placement="right" <a-drawer
@after-visible-change="afterVisibleChange"> :visible="createVoteVisible"
class="drawerStyle createvoteDrawer"
width="100%"
placement="right"
@after-visible-change="afterVisibleChange"
>
<div class="researchadd"> <div class="researchadd">
<div class="header"> <div class="header">
<div class="headerTitle">创建投票</div> <div class="headerTitle">{{ ballotId ? "编辑投票" : "创建投票" }}</div>
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png" <img
@click="closeDrawer" /> style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div> </div>
<div class="main_left"> <div class="main_left">
<div class="main_item"> <div class="main_item">
@@ -17,8 +25,12 @@
<span style="margin-right: 3px">投票名称</span> <span style="margin-right: 3px">投票名称</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="ballotName" style="width: 424px; height: 32px" placeholder="请输入任务名称" <a-input
maxlength="20" /> v-model:value="ballotName"
style="width: 424px; height: 32px"
placeholder="请输入任务名称"
maxlength="20"
/>
</div> </div>
</div> </div>
<div class="main_item"> <div class="main_item">
@@ -36,26 +48,34 @@
</div> </div>
<div v-for="(item, index) in allFormsData" :key="index"> <div v-for="(item, index) in allFormsData" :key="index">
<VoteQuestion v-model:info="information" :item="item" :optionId="optionId" @delOption="delOption" <VoteQuestion :item="item" @del="handleDel" />
@del="handleDel" @edits="edits" @addOption="addOption" />
</div> </div>
<div class="footer"> <div class="footer">
<div class="btn"> <div class="btn">
<a-button type="primary" style=" <a-button
type="primary"
style="
width: 100px; width: 100px;
height: 40px; height: 40px;
border-radius: 8px; border-radius: 8px;
background-color: #409eff; background-color: #409eff;
" @click="handleSave"> "
@click="handleSave"
>
保存 保存
</a-button> </a-button>
<a-button type="primary" ghost style=" <a-button
type="primary"
ghost
style="
width: 100px; width: 100px;
height: 40px; height: 40px;
margin-left: 14px; margin-left: 14px;
border-radius: 8px; border-radius: 8px;
" @click="handleAllCancel"> "
@click="handleAllCancel"
>
取消 取消
</a-button> </a-button>
</div> </div>
@@ -70,7 +90,7 @@ import { message } from "ant-design-vue";
import VoteQuestion from "./VoteQuestion.vue"; import VoteQuestion from "./VoteQuestion.vue";
import { import {
// sortBy, sortBy,
traverseArr, traverseArr,
//filterCommon, //filterCommon,
// deepCloneFilterString, // deepCloneFilterString,
@@ -79,7 +99,7 @@ import {
//import store from "@/store"; //import store from "@/store";
import * as api from "@/api/indexVote"; import * as api from "@/api/indexVote";
//import { useRouter } from "vue-router"; //import { useRouter } from "vue-router";
import { } from "@/api/indexResearch"; import {} from "@/api/indexResearch";
//import { message } from "ant-design-vue"; //import { message } from "ant-design-vue";
@@ -107,8 +127,6 @@ export default {
ballotId: "", ballotId: "",
ballotName: "", ballotName: "",
allFormsData: [], allFormsData: [],
allFormsData1: [],
}); });
// const router = useRouter(); // const router = useRouter();
const afterVisibleChange = () => { const afterVisibleChange = () => {
@@ -116,9 +134,7 @@ export default {
getInfoDate(); getInfoDate();
} else { } else {
handleTypes(); handleTypes();
} }
}; };
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:createVoteVisible", false); ctx.emit("update:createVoteVisible", false);
@@ -130,49 +146,39 @@ export default {
console.log("props.editChild=====", props.editChild); console.log("props.editChild=====", props.editChild);
if (props.ballotId) { if (props.ballotId) {
console.log("props.editChild2=====", props.editChild); console.log("props.editChild2=====", props.editChild);
let res = await api let res = await api.queryStemByStemId(props.ballotId).then((res) => {
.queryStemByStemId(props.ballotId) if (res.data.code === 200) {
.then((res) => { return res.data.data;
if (res.data.code === 200) { }
return res.data.data; });
} state.ballotId = res.ballotId;
}); state.ballotName = res.ballotName;
console.log("res====", res); let renderArr = [...res.voteStemVoList];
state.ballotName = res.ballotId; sortBy(renderArr, "orderNumber"); //序号
// let renderArr = [...res]; state.allFormsData = parseData(renderArr);
// sortBy(renderArr, "orderNumber"); //序号
state.allFormsData = parseData(res); //类型
state.allFormsData1 = parseData(res); //类型
console.log(state.allFormsData);
} }
}; };
// 转换成前端格式 // 转换成前端格式
const parseData = (arr) => { const parseData = (arr) => {
const resultArr = []; const resultArr = [];
state.ballotId = arr.ballotId;
state.ballotName = arr.ballotName;
console.log("arr.voteStemVoList=====", arr.voteStemVoList); console.log("arr.voteStemVoList=====", arr);
arr.voteStemVoList.forEach((item) => { arr.forEach((item) => {
let obj = {}; let obj = {};
let restList = traverseArr(item.optionDetailList, { let restList = traverseArr(item.optionDetailList, {
inputVal: "optionName", inputVal: "optionName",
imgVal: "optionPictureAddress", imgVal: "optionPictureAddress",
optionId: "optionId", optionId: "optionId",
voteStemId: "voteStemId",
stem: "stem",
}).map((itm, idx) => { }).map((itm, idx) => {
itm.id = idx + 1; itm.id = idx + 1;
return itm; return itm;
}); });
obj = { obj = {
voteStemId: item.voteStemId,
valueSingle: item.voteStemName, valueSingle: item.voteStemName,
singleList: restList, singleList: restList,
orderNumber: item.orderNumber,
}; };
resultArr.push(obj); resultArr.push(obj);
}); });
@@ -189,34 +195,25 @@ export default {
arr.forEach((item) => { arr.forEach((item) => {
let obj = {}; let obj = {};
console.log("item=======", item); console.log("item=======", item);
// if (item[typeKey] === 1) {
let restList = traverseArr(item.singleList, { let restList = traverseArr(item.singleList, {
optionName: "inputVal", optionName: "inputVal",
optionPictureAddress: "imgVal", optionPictureAddress: "imgVal",
optionId: "optionId", optionId: "optionId",
voteStemId: "voteStemId",
stem: "stem",
}).map((itm, idx) => { }).map((itm, idx) => {
itm.optionOrderNum = idx + 1; itm.optionOrderNum = idx + 1;
return itm; return itm;
}); });
restList.forEach((item) => { restList.forEach((item) => {
item.optionId = item.optionId item.optionId = item.optionId ? item.optionId : "";
? item.optionId
: "";
}); });
obj = { obj = {
voteStemName: item.valueSingle, voteStemName: item.valueSingle,
optionDetailList: restList, singleList: restList,
voteStemId: item.voteStemId, orderNumber: item.orderNumber,
}; };
resultArr.push(obj); resultArr.push(obj);
// }
console.log("resultArr=======", resultArr); console.log("resultArr=======", resultArr);
}); });
resultArr.map((itm, idx) => { resultArr.map((itm, idx) => {
itm.orderNumber = idx + 1; itm.orderNumber = idx + 1;
@@ -226,40 +223,26 @@ export default {
}; };
// 解散传值 // 解散传值
const parseItem = (arrr) => { const parseItem = (arrSingle) => {
// const filterComObj = filterCommon(arr, "questionType"); console.log("arrSingle");
console.log(arrSingle);
let resultObj = {}; let resultObj = {};
// for (let key in filterComObj) {
// if (key === "1") {
// let arrSingle = arrr
//filterComObj[key];
console.log("arrr======", arrr);
/*
let arr = []; let arr = [];
arrSingle.forEach((item) => { arrSingle.forEach((item) => {
console.log("item======",item); arr.push({
if (item.singleList.length) { voteStemName: item.voteStemName,
item.singleList.forEach((itm) => { orderNumber: item.orderNumber,
arr.push({ optionDetailList: item.singleList,
...itm, });
optionName: item.optionName, });
optionOrderNum: item.optionOrderNum, resultObj.voteStemDtoList = arr;
});
});
}
});*/
resultObj.voteStemDtoList = arrr;
// }
console.log("resultObj======", resultObj); console.log("resultObj======", resultObj);
// }
return resultObj; return resultObj;
}; };
const handleTypes = () => { const handleTypes = () => {
let obj = { let obj = {
id: state.allFormsData.length, id: state.allFormsData.length + 1,
valueSingle: "", valueSingle: "",
singleList: [ singleList: [
{ {
@@ -275,107 +258,49 @@ export default {
], ],
}; };
state.allFormsData.push(obj); state.allFormsData.push(obj);
state.allFormsData1.push(obj);
}; };
const handleDel = ({ id }) => { const handleDel = ({ id, curItem }) => {
console.log('1234523432434234234', id, state.allFormsData) console.log(888888888);
console.log(id);
console.log(curItem);
state.allFormsData.forEach((item, index) => { state.allFormsData.forEach((item, index) => {
if (item.id === id) { if (item.id === id) {
console.log('oooooo', item)
state.allFormsData.splice(index, 1); state.allFormsData.splice(index, 1);
} }
}); });
console.log(5656777777777);
console.log(state.allFormsData);
state.allFormsData.map((item, index) => {
item.id = index + 1;
return item;
});
// state.allFormsData.map((item, index) => { api.deleteVoteStem(curItem.voteStemId).then((res) => {
// item.id = index + 1; console.log(56444);
// return item; console.log(res);
// }); });
// orderNumber: curItem.orderNumber,
}; };
const delOption = (data) => {
console.log('datadatadatadatadata', data, state.allFormsData)
state.allFormsData.forEach((item, index) => {
if (item.voteStemId === data.value.voteStemId) {
state.allFormsData[index].singleList.forEach((ii, nn) => {
if (ii.id == data.value.id) {
console.log(1212121212, state.allFormsData[index].singleList[nn], nn)
state.allFormsData[index].singleList.splice(nn, 1)
console.log('12', state.allFormsData)
}
})
}
});
state.allFormsData1.forEach((item, index) => {
if (item.voteStemId === data.value.voteStemId) {
state.allFormsData1[index].singleList.forEach((ii, nn) => {
if (ii.id == data.value.id) {
console.log(1212121212, state.allFormsData1[index].singleList[nn], nn)
state.allFormsData1[index].singleList.splice(nn, 1)
console.log('33', state.allFormsData1)
}
})
}
});
}
const edits = (data) => {
console.log('我传递过来了吗---111', data, data.value.id, state.allFormsData1)
state.allFormsData1.forEach((item, index) => {
if (item.voteStemId === data.value.voteStemId) {
item.singleList.forEach((ii, nn) => {
if (ii.id === data.value.id) {
// ii.optionName = data.value.inputVal
state.allFormsData1[index].singleList[nn].inputVal = data.value.inputVal
}
})
}
});
console.log('123-456-789', state.allFormsData1)
}
// 增加选项
const addOption = (data) => {
console.log(data)
state.allFormsData1.forEach((item, index) => {
if (item.voteStemId === data.value.voteStemId) {
state.allFormsData1[index].singleList = data.value.singleList
}
});
}
const handleSave = () => { const handleSave = () => {
let resultPost = {}; let resultPost = {};
let filterData = parseItem(restData(state.allFormsData));
let filterData = parseItem(restData(state.allFormsData1, "type")); console.log("filterData==111", filterData);
console.log("filterData==111", filterData)
if (!state.ballotName) {
return message.warning("请输入投票名称");
}
// 校验s
// 校验 // 校验
if (!state.ballotName) {
message.warning("请输入投票名称");
return false;
}
if (!checkVal(filterData)) { if (!checkVal(filterData)) {
return false; return false;
} }
// checkVal(filterData);
console.log(12121212); console.log(12121212);
console.log(filterData); console.log(filterData);
console.log('111111222223333----0000', state.ballotId) console.log("111111222223333----0000", state.ballotId);
if (state.ballotId) { if (state.ballotId) {
resultPost = { resultPost = {
ballotId: state.ballotId, ballotId: state.ballotId,
@@ -391,7 +316,7 @@ export default {
console.log(resultPost); console.log(resultPost);
api.updateStemMessage(resultPost).then((res) => { api.updateStemMessage(resultPost).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
state.ballotId = res.data.data.ballotId state.ballotId = res.data.data.ballotId;
console.log("res.data.data==============", res.data.data); console.log("res.data.data==============", res.data.data);
console.log("res.state.ballotId==============", state.ballotId); console.log("res.state.ballotId==============", state.ballotId);
message.success("编辑成功"); message.success("编辑成功");
@@ -408,11 +333,10 @@ export default {
"assessmentMaxScore", "assessmentMaxScore",
"assessmentMinScore", "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) {
state.ballotId = res.data.data.ballotId state.ballotId = res.data.data.ballotId;
console.log("res.data.data2==============", res.data.data); console.log("res.data.data2==============", res.data.data);
console.log("res.state.ballotId=2s=============", state.ballotId); console.log("res.state.ballotId=2s=============", state.ballotId);
message.success("创建成功"); message.success("创建成功");
@@ -420,7 +344,6 @@ export default {
} }
}); });
} }
}; };
const handleAllCancel = () => { const handleAllCancel = () => {
state.allFormsData = []; state.allFormsData = [];
@@ -447,7 +370,6 @@ export default {
return true; return true;
}; };
return { return {
...toRefs(state), ...toRefs(state),
handleTypes, handleTypes,
@@ -456,9 +378,6 @@ export default {
handleDel, handleDel,
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
edits,
delOption,
addOption
}; };
}, },
}; };

View File

@@ -0,0 +1,522 @@
<!-- 评估管理-创建评估页面 -->
<template>
<!-- 单选题 -->
<div class="content">
<div class="tagbox">
<div class="deleteop" @click="handleTypesDel">
<div><img src="../../assets/images/projectadd/delete.png" /></div>
<div class="del_text">删除选项</div>
</div>
</div>
<div class="name">
<div class="namebox">
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
<div class="inname">题干{{ item.id + 1 }}</div>
</div>
<div class="in">
<a-input
v-model:value="curItem.valueSingle"
placeholder="请输入题干名称"
show-count
:maxlength="20"
style="border-radius: 8px"
/>
</div>
</div>
<VoteQuestionItem
v-model:info="info"
v-for="(item, index) in curItem.singleList"
:key="index"
:item="item"
@input="input"
@src="imgSrc"
@delImg="delImg"
@del="del"
@edit="edit"
/>
<div class="name">
<div class="in" style="margin-left: 85px; margin-bottom: 20px">
<a-button
type="primary"
style="
width: 100px;
height: 40px;
border-radius: 8px;
background-color: #409eff;
"
@click="handleSingleAdd"
>
添加选项
</a-button>
</div>
</div>
</div>
</template>
<script>
import VoteQuestionItem from "./VoteQuestionItem.vue";
import { ref } from "vue";
import * as api from "../../api/indexVote";
export default {
name: "CreateVote",
components: {
VoteQuestionItem,
},
props: {
num: {
type: Number,
default: null,
},
item: {
type: Object,
default: () => {
return {};
},
},
},
setup(props, { emit }) {
const curItem = ref(props.item);
const handleTypesDel = () => {
console.log("删除题干======", {
id: curItem.value.id,
curItem: curItem.value,
});
api.deleteVoteStem(curItem.value.voteStemId).then(() => {
// message.success('删除题干信息成功')
emit("del", { id: curItem.value.id, curItem: curItem.value });
});
};
const handleSingleAdd = () => {
curItem.value.singleList.push({
id: curItem.value.singleList.length + 1,
inputVal: "",
imgVal: "",
});
emit("addOption", curItem);
};
const input = ({ id, val }) => {
console.log(id, val);
curItem.value.singleList.forEach((item) => {
if (item.id === id) {
item.inputVal = val;
}
});
};
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, data }) => {
console.log(data);
api.deleteVoteStemOption(data.value.optionId).then(() => {
// message.success('删除题干信息成功')
emit("delOption", data);
});
curItem.value.singleList.forEach((item, index) => {
if (item.id === id) {
curItem.value.singleList.splice(index, 1);
}
});
};
const edit = (data) => {
// console.log('111111-223', data.value)
emit("edits", data);
};
return {
curItem,
handleTypesDel,
handleSingleAdd,
input,
imgSrc,
delImg,
del,
edit,
};
},
};
</script>
<style lang="scss">
.researchadd {
width: 100%;
display: flex;
flex-direction: column;
.header {
width: 100%;
display: flex;
justify-content: space-between;
.title {
color: #000000;
font-size: 18px;
//line-height: 36px;
padding-top: 30px;
padding-left: 37px;
//font-weight: 500;
}
.goback {
padding-right: 70px;
//padding-top: 37px;
position: relative;
.return {
display: inline-block;
width: 42px;
height: 42px;
margin-top: 17px;
margin-right: 10px;
background-image: url("../../assets/images/projectadd/return.png");
}
.returntext {
display: inline-block;
position: absolute;
top: 27px;
color: #4ea6ff;
font-size: 14px;
}
}
}
.addtype {
display: flex;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
margin-right: 20px;
align-items: center;
margin-left: 41px;
.addtypen {
color: #6f6f6f;
font-size: 14px;
}
.types {
cursor: pointer;
width: 80px;
height: 40px;
color: #409eff;
border: 1px solid #409eff;
border-radius: 4px;
display: flex;
justify-content: center;
align-items: center;
margin: 20px 10px;
}
.typesCur {
color: #fff;
background: #409eff;
}
}
.content {
display: flex;
flex-direction: column;
border: 1px solid rgba(0, 0, 0, 0.1);
width: 70%;
min-width: 690px;
margin-left: 38px;
margin-top: 20px;
.tagbox {
display: flex;
justify-content: right;
.tagname {
width: 90px;
height: 32px;
margin-top: 24px;
display: flex;
justify-content: center;
align-items: center;
margin-left: 134px;
background: rgba(78, 166, 255, 0.1);
border-radius: 4px;
color: rgba(64, 158, 255, 1);
font-size: 16px;
}
.deleteop {
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 40px;
margin-top: 20px;
margin-right: 30px;
border: 1px solid #409eff;
border-radius: 8px;
cursor: pointer;
.del_text {
color: #409eff;
font-size: 14px;
margin-left: 5px;
}
}
}
.scorebox {
display: flex;
align-items: center;
margin-top: 20px;
margin-left: 70px;
.scoretext {
font-size: 14px;
color: #56a3f9;
}
.number {
display: flex;
border: 1px solid #d7e5fd;
border-radius: 5px;
margin: 0 10px;
padding: 5px;
.btn {
width: 40px;
height: 40px;
border: 1px solid #56a3f9;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
margin: 5px;
font-size: 14px;
font-weight: 400;
color: #56a3f9;
line-height: 24px;
cursor: pointer;
}
.curBtn {
background: #56a3f9;
color: #fff;
}
}
}
.picture {
width: 100px;
display: flex;
flex-direction: column;
margin-top: 20px;
margin-left: 133px;
.pictureimg {
width: 100px;
height: 100px;
}
.picturename {
color: #6f6f6f;
font-size: 14px;
}
}
.options {
display: flex;
}
.delete {
cursor: pointer;
margin-top: 32px;
margin-left: 107px;
// float: right;
color: #4ea6ff;
font-size: 14px;
}
.name2 {
display: flex;
align-items: flex-start;
}
.name {
width: 60%;
// background-color: lightcoral;
display: flex;
margin-top: 20px;
//align-items: center;
//height: 40px;
// border: 1px solid black;
.namebox {
width: 120px;
display: flex;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
.nameimg {
width: 10px;
height: 10px;
}
}
.inname {
color: #6f6f6f;
font-size: 14px;
margin-left: 7px;
font-weight: 700;
}
.in {
margin-left: 14px;
flex: 1;
.assess {
display: flex;
width: 226px;
height: 40px;
border: 1px solid #56a3f9;
//margin-bottom: 20px;
.assesstype {
width: 50%;
background: #56a3f9;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
}
.assesswhole {
width: 50%;
background: rgba(86, 163, 249, 0.1);
font-size: 14px;
color: #6f6f6f;
display: flex;
justify-content: center;
align-items: center;
}
.ratio {
position: absolute;
right: 10px;
top: 8px;
color: #6f6f6f;
font-size: 14px;
}
}
.addimg {
cursor: pointer;
color: rgba(78, 166, 255, 1);
font-size: 14px;
}
.text {
color: rgba(109, 117, 132, 1);
font-size: 14px;
//line-height: 24px;
}
.ant-radio-wrapper {
}
.ant-input {
border-radius: 5px;
// height: 120%;
width: 100%;
height: 35px;
}
.ant-select-selector {
border-radius: 5px;
// height: 120%;
width: 100%;
height: 40px;
}
}
.numberInp {
width: 200px;
.ant-input-number {
width: 200px;
height: 40px;
border-radius: 8px;
}
// .ant-input-number-input-wrap {
// width: 200px;
// }
}
}
}
.name2 {
display: flex;
align-items: flex-start;
}
.opinion {
display: flex;
margin-top: 30px;
.namebox {
width: 120px;
display: flex;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
}
.in {
margin-left: 14px;
width: 500px;
.ant-input-textarea-show-count {
position: relative;
height: 110px;
}
.ant-input-textarea-show-count::after {
position: absolute;
right: 10px;
bottom: 0px;
}
.ant-input {
border-radius: 8px;
}
}
}
.footer {
width: 100%;
margin-top: 31px;
margin-bottom: 14px;
.btn {
display: flex;
margin-bottom: 20px;
justify-content: center;
cursor: pointer;
}
}
.uploadContent {
display: block !important;
.uploadBtn {
margin-left: 120px !important;
}
}
}
</style>

View File

@@ -14,16 +14,37 @@
<div class="inname">题干{{ item.id }}</div> <div class="inname">题干{{ item.id }}</div>
</div> </div>
<div class="in"> <div class="in">
<a-input v-model:value="curItem.valueSingle" placeholder="请输入题干名称" show-count :maxlength="20" <a-input
style="border-radius: 8px" /> v-model:value="curItem.valueSingle"
placeholder="请输入题干名称"
show-count
:maxlength="20"
style="border-radius: 8px"
/>
</div> </div>
</div> </div>
<VoteQuestionItem v-model:info="info" v-for="(item, index) in curItem.singleList" :key="index" :item="item" <VoteQuestionItem
@input="input" @src="imgSrc" @delImg="delImg" @del="del" @edit="edit" /> v-model:info="info"
v-for="(item, index) in curItem.singleList"
:key="index"
:item="item"
@input="input"
@src="imgSrc"
@delImg="delImg"
@del="del"
/>
<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">
<a-button type="primary" style="width: 100px;height: 40px;border-radius: 8px;background-color: #409eff;" <a-button
@click="handleSingleAdd"> type="primary"
style="
width: 100px;
height: 40px;
border-radius: 8px;
background-color: #409eff;
"
@click="handleSingleAdd"
>
添加选项 添加选项
</a-button> </a-button>
</div> </div>
@@ -31,41 +52,28 @@
</div> </div>
</template> </template>
<script> <script>
import VoteQuestionItem from "./VoteQuestionItem.vue";
import { ref } from "vue"; import { ref } from "vue";
import VoteQuestionItem from "./VoteQuestionItem.vue";
import * as api from "../../api/indexVote"; import * as api from "../../api/indexVote";
export default { export default {
name: "CreateVote", name: "CreateVote",
components: { components: {
VoteQuestionItem, VoteQuestionItem,
}, },
props: { props: {
num: {
type: Number,
default: null,
},
item: { item: {
type: Object, type: Object,
default: () => { default: () => {
return {}; return {};
}, },
}, },
}, },
setup(props, { emit }) { setup(props, { emit }) {
const curItem = ref(props.item); const curItem = ref(props.item);
const handleTypesDel = () => { const handleTypesDel = () => {
emit("del", { id: curItem.value.id, curItem: curItem.value });
console.log("删除题干======", { id: curItem.value.id, curItem: curItem.value });
api.deleteVoteStem(curItem.value.voteStemId)
.then(() => {
// message.success('删除题干信息成功')
emit("del", { id: curItem.value.id, curItem: curItem.value });
})
}; };
const handleSingleAdd = () => { const handleSingleAdd = () => {
@@ -74,10 +82,8 @@ export default {
inputVal: "", inputVal: "",
imgVal: "", imgVal: "",
}); });
emit("addOption", curItem);
}; };
const input = ({ id, val }) => { const input = ({ id, val }) => {
console.log(id, val)
curItem.value.singleList.forEach((item) => { curItem.value.singleList.forEach((item) => {
if (item.id === id) { if (item.id === id) {
item.inputVal = val; item.inputVal = val;
@@ -98,28 +104,22 @@ export default {
} }
}); });
}; };
const del = ({ id, data }) => { const del = ({ id, optionId }) => {
console.log(data)
api.deleteVoteStemOption(data.value.optionId)
.then(() => {
// message.success('删除题干信息成功')
emit("delOption", data);
})
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);
} }
}); });
curItem.value.singleList.map((item, index) => {
item.id = index + 1;
});
api.deleteVoteStemOption(optionId).then((res) => {
console.log(56444);
console.log(res);
});
}; };
const edit = (data) => {
// console.log('111111-223', data.value)
emit("edits", data)
}
return { return {
curItem, curItem,
handleTypesDel, handleTypesDel,
@@ -128,7 +128,6 @@ export default {
imgSrc, imgSrc,
delImg, delImg,
del, del,
edit
}; };
}, },
}; };
@@ -412,7 +411,8 @@ export default {
//line-height: 24px; //line-height: 24px;
} }
.ant-radio-wrapper {} .ant-radio-wrapper {
}
.ant-input { .ant-input {
border-radius: 5px; border-radius: 5px;

View File

@@ -0,0 +1,495 @@
<!-- 评估管理-创建评估页面 -->
<template>
<div class="itemRow">
<div class="options">
<div class="name">
<div class="namebox">
<div class="inname">选项{{ item.id }}</div>
</div>
<div class="in">
<a-input
v-model:value="curItem.inputVal"
show-count
:maxlength="30"
style="border-radius: 8px"
@change="handleInput"
/>
</div>
</div>
<div class="delete" @click="handleDel">删除</div>
</div>
<div class="name uploadContent">
<a-upload
v-show="!item.imgVal"
class="in uploadBtn"
:show-upload-list="false"
:before-upload="beforeUpload"
>
<div class="addimg">+添加图片</div>
</a-upload>
<div v-show="item.imgVal" class="picture" style="position: relative">
<img class="pictureimg" :src="item.imgVal" />
<div class="picturename" v-show="hasImgName">{{ hasImgName }}</div>
<img
style="
cursor: pointer;
width: 20px;
height: 20px;
position: absolute;
right: 0;
top: 0;
"
src="../../assets/images/basicinfo/close.png"
@click="handleCancel"
/>
</div>
</div>
</div>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import { message } from "ant-design-vue";
import { fileUp } from "../../api/indexEval";
export default {
name: "VoteQuestionItem",
props: {
item: {
type: Array,
default: () => {
return [];
},
},
},
setup(props, { emit }) {
const curItem = ref(props.item);
const state = reactive({
hasImgName: "",
});
const handleInput = (value) => {
console.log(value.target.value);
emit("edit", curItem);
emit("input", { id: curItem.value.id, val: value.target.value });
};
const handleDel = () => {
handleCancel();
emit("del", {
id: curItem.value.id,
optionId: curItem.value.optionId,
data: curItem,
});
};
const handleCancel = () => {
state.hasImgName = "";
emit("delImg", { id: curItem.value.id });
};
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,
handleInput,
handleDel,
handleCancel,
beforeUpload,
};
},
};
</script>
<style lang="scss">
.researchadd {
width: 100%;
display: flex;
flex-direction: column;
.header {
width: 100%;
display: flex;
justify-content: space-between;
.title {
color: #000000;
font-size: 18px;
//line-height: 36px;
padding-top: 30px;
padding-left: 37px;
//font-weight: 500;
}
.goback {
padding-right: 70px;
//padding-top: 37px;
position: relative;
.return {
display: inline-block;
width: 42px;
height: 42px;
margin-top: 17px;
margin-right: 10px;
background-image: url("../../assets/images/projectadd/return.png");
}
.returntext {
display: inline-block;
position: absolute;
top: 27px;
color: #4ea6ff;
font-size: 14px;
}
}
}
.addtype {
display: flex;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
margin-right: 20px;
align-items: center;
margin-left: 41px;
.addtypen {
color: #6f6f6f;
font-size: 14px;
}
.types {
cursor: pointer;
width: 80px;
height: 40px;
color: #409eff;
border: 1px solid #409eff;
border-radius: 4px;
display: flex;
justify-content: center;
align-items: center;
margin: 20px 10px;
}
.typesCur {
color: #fff;
background: #409eff;
}
}
.content {
display: flex;
flex-direction: column;
border: 1px solid rgba(0, 0, 0, 0.1);
width: 70%;
min-width: 690px;
margin-left: 38px;
margin-top: 20px;
.tagbox {
display: flex;
justify-content: space-between;
.tagname {
width: 90px;
height: 32px;
margin-top: 24px;
display: flex;
justify-content: center;
align-items: center;
margin-left: 134px;
background: rgba(78, 166, 255, 0.1);
border-radius: 4px;
color: rgba(64, 158, 255, 1);
font-size: 16px;
}
.deleteop {
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 40px;
margin-top: 20px;
margin-right: 30px;
border: 1px solid #409eff;
border-radius: 8px;
cursor: pointer;
.del_text {
color: #409eff;
font-size: 14px;
margin-left: 5px;
}
}
}
.scorebox {
display: flex;
align-items: center;
margin-top: 20px;
margin-left: 70px;
.scoretext {
font-size: 14px;
color: #56a3f9;
}
.number {
display: flex;
border: 1px solid #d7e5fd;
border-radius: 5px;
margin: 0 10px;
padding: 5px;
.btn {
width: 40px;
height: 40px;
border: 1px solid #56a3f9;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
margin: 5px;
font-size: 14px;
font-weight: 400;
color: #56a3f9;
line-height: 24px;
cursor: pointer;
}
}
}
.picture {
width: 100px;
display: flex;
flex-direction: column;
margin-top: 20px;
margin-left: 133px;
.pictureimg {
width: 100px;
height: 100px;
}
.picturename {
color: #6f6f6f;
font-size: 14px;
}
}
.options {
display: flex;
}
.delete {
cursor: pointer;
margin-top: 32px;
margin-left: 107px;
// float: right;
color: #4ea6ff;
font-size: 14px;
}
.name2 {
display: flex;
align-items: flex-start;
}
.name {
width: 60%;
// background-color: lightcoral;
display: flex;
margin-top: 20px;
//align-items: center;
//height: 40px;
// border: 1px solid black;
.namebox {
width: 120px;
display: flex;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
.nameimg {
width: 10px;
height: 10px;
}
}
.inname {
color: #6f6f6f;
font-size: 14px;
margin-left: 7px;
font-weight: 700;
}
.in {
margin-left: 14px;
flex: 1;
.assess {
display: flex;
width: 226px;
height: 40px;
border: 1px solid #56a3f9;
//margin-bottom: 20px;
.assesstype {
width: 50%;
background: #56a3f9;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
}
.assesswhole {
width: 50%;
background: rgba(86, 163, 249, 0.1);
font-size: 14px;
color: #6f6f6f;
display: flex;
justify-content: center;
align-items: center;
}
.ratio {
position: absolute;
right: 10px;
top: 8px;
color: #6f6f6f;
font-size: 14px;
}
}
.addimg {
cursor: pointer;
color: rgba(78, 166, 255, 1);
font-size: 14px;
}
.text {
color: rgba(109, 117, 132, 1);
font-size: 14px;
//line-height: 24px;
}
.ant-radio-wrapper {
}
.ant-input {
border-radius: 5px;
// height: 120%;
width: 100%;
height: 35px;
}
.ant-select-selector {
border-radius: 5px;
// height: 120%;
width: 100%;
height: 40px;
}
}
.numberInp {
width: 200px;
.ant-input-number {
width: 200px;
height: 40px;
border-radius: 8px;
}
// .ant-input-number-input-wrap {
// width: 200px;
// }
}
}
}
.name2 {
display: flex;
align-items: flex-start;
}
.opinion {
display: flex;
margin-top: 30px;
.namebox {
width: 120px;
display: flex;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
}
.in {
margin-left: 14px;
width: 500px;
.ant-input-textarea-show-count {
position: relative;
height: 110px;
}
.ant-input-textarea-show-count::after {
position: absolute;
right: 10px;
bottom: 0px;
}
.ant-input {
border-radius: 8px;
}
}
}
.footer {
width: 100%;
margin-top: 31px;
margin-bottom: 14px;
.btn {
display: flex;
margin-bottom: 20px;
justify-content: center;
cursor: pointer;
}
}
.uploadContent {
display: block !important;
.uploadBtn {
margin-left: 120px !important;
}
}
}
</style>

View File

@@ -7,27 +7,41 @@
<div class="inname">选项{{ item.id }}</div> <div class="inname">选项{{ item.id }}</div>
</div> </div>
<div class="in"> <div class="in">
<a-input v-model:value="curItem.inputVal" show-count :maxlength="30" style="border-radius: 8px" <a-input
@change="handleInput" /> v-model:value="curItem.inputVal"
show-count
:maxlength="30"
style="border-radius: 8px"
@change="handleInput"
/>
</div> </div>
</div> </div>
<div class="delete" @click="handleDel">删除</div> <div class="delete" @click="handleDel">删除</div>
</div> </div>
<div class="name uploadContent"> <div class="name uploadContent">
<a-upload v-show="!item.imgVal" class="in uploadBtn" :show-upload-list="false" :before-upload="beforeUpload"> <a-upload
v-show="!item.imgVal"
class="in uploadBtn"
:show-upload-list="false"
:before-upload="beforeUpload"
>
<div class="addimg">+添加图片</div> <div class="addimg">+添加图片</div>
</a-upload> </a-upload>
<div v-show="item.imgVal" class="picture" style="position: relative"> <div v-show="item.imgVal" class="picture" style="position: relative">
<img class="pictureimg" :src="item.imgVal" /> <img class="pictureimg" :src="item.imgVal" />
<div class="picturename" v-show="hasImgName">{{ hasImgName }}</div> <div class="picturename" v-show="hasImgName">{{ hasImgName }}</div>
<img style=" <img
style="
cursor: pointer; cursor: pointer;
width: 20px; width: 20px;
height: 20px; height: 20px;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
" src="../../assets/images/basicinfo/close.png" @click="handleCancel" /> "
src="../../assets/images/basicinfo/close.png"
@click="handleCancel"
/>
</div> </div>
</div> </div>
</div> </div>
@@ -53,14 +67,12 @@ export default {
hasImgName: "", hasImgName: "",
}); });
const handleInput = (value) => { const handleInput = () => {
console.log(value.target.value) emit("input", { id: curItem.value.id, val: curItem.value.inputVal });
emit("edit", curItem)
emit("input", { id: curItem.value.id, val: value.target.value });
}; };
const handleDel = () => { const handleDel = () => {
handleCancel(); handleCancel();
emit("del", { id: curItem.value.id, optionId: curItem.value.optionId, data: curItem }); emit("del", { id: curItem.value.id, optionId: curItem.value.optionId });
}; };
const handleCancel = () => { const handleCancel = () => {
state.hasImgName = ""; state.hasImgName = "";
@@ -87,6 +99,7 @@ export default {
const formData = new FormData(); const formData = new FormData();
formData.append("file", file); formData.append("file", file);
console.log(file);
fileUp(formData).then((res) => { fileUp(formData).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
state.hasImgName = file.name; state.hasImgName = file.name;
@@ -381,7 +394,8 @@ export default {
//line-height: 24px; //line-height: 24px;
} }
.ant-radio-wrapper {} .ant-radio-wrapper {
}
.ant-input { .ant-input {
border-radius: 5px; border-radius: 5px;

View File

@@ -1,86 +1,92 @@
<template> <template>
<a-drawer :visible="addStemVisible" <a-drawer
placement="right" class="custom-class" :visible="addStemVisible"
@after-visible-change="afterVisibleChange" placement="right"
@close="closeDrawer" width="60%"> class="custom-class"
<div> @after-visible-change="afterVisibleChange"
<h2 style="text-align:center;">投票查看</h2> @close="closeDrawer"
<div v-for="(item,index) in form" :key="item.voteStemId"> width="60%"
<div class="title">{{index+1}}. {{item.voteStemName}}</div> >
<a-radio-group v-model:value="item.voteStemId"> <div>
<a-radio :value="3" :style="radioStyle"> <h2 style="text-align: center">投票查看</h2>
{{item.optionDetailList[0].optionName}}</a-radio> <div v-for="(item, index) in form" :key="item.voteStemId">
<br /> <div class="title">{{ index + 1 }}. {{ item.voteStemName }}</div>
<a-radio :value="2" :style="radioStyle"> <a-radio-group v-model:value="item.voteStemId">
{{item.optionDetailList[1].optionName}}</a-radio> <a-radio :value="3" :style="radioStyle">
</a-radio-group> {{ item.optionDetailList[0].optionName }}</a-radio
</div> >
<br />
</div> <a-radio :value="2" :style="radioStyle">
</a-drawer> {{ item.optionDetailList[1].optionName }}</a-radio
>
</a-radio-group>
</div>
</div>
</a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs,ref } from "vue"; import { reactive, toRefs, ref } from "vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import * as api from "@/api/indexVote" import * as api from "@/api/indexVote";
export default { export default {
name: "queryStem", name: "queryStem",
props: { props: {
addStemVisible:{ addStemVisible: {
type: Boolean, type: Boolean,
default: false, default: false,
}
}, },
setup(props,ctx) { },
const value = ref(1); setup(props, ctx) {
const state = reactive({ const value = ref(1);
form:[], const state = reactive({
form: [],
});
const radioStyle = reactive({
display: 'flex',
height: '30px',
lineHeight: '30px',
}); });
const afterVisibleChange = (bool) => { const radioStyle = reactive({
if(bool === true) { display: "flex",
getStem() height: "30px",
} lineHeight: "30px",
} });
const getStem = () => { const afterVisibleChange = (bool) => {
let obj = { if (bool === true) {
stemId:0, getStem();
ballotId:2, }
} };
api.queryStemByStemId(obj).then((res) => { const getStem = () => {
state.form = res.data.data let obj = {
console.log(JSON.stringify(res.data)+'***'); stemId: 0,
message.success("投票获取成功"); ballotId: 2,
console.log(res); };
}).catch((err) => { api
message.error("投票获取失败"+err); .queryStemByStemId(obj)
console.log(err); .then((res) => {
}) state.form = res.data.data;
} console.log(JSON.stringify(res.data) + "***");
const closeDrawer = () => { message.success("投票获取成功");
ctx.emit("closeDrawer") console.log(res);
} })
return { .catch((err) => {
...toRefs(state), message.error("投票获取失败" + err);
afterVisibleChange, console.log(err);
closeDrawer, });
radioStyle, };
value const closeDrawer = () => {
} ctx.emit("closeDrawer");
} };
} return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
radioStyle,
value,
};
},
};
</script> </script>
<style> <style>
.title { .title {
font-size: 17px; font-size: 17px;
} }
</style> </style>

View File

@@ -57,19 +57,16 @@ export function deepCloneFilterString(obj, fillterKeys) {
return obj; return obj;
} }
export function sortBy(arr, ...keys) { export function sortBy(arr, key) {
return arr.sort((x, y) => { return arr.sort((x, y) => {
for (const key of keys) { const valueX = parseInt(x[key]);
const valueX = typeof key === "function" ? key(x) : x[key]; const valueY = parseInt(y[key]);
const valueY = typeof key === "function" ? key(y) : y[key]; if (valueX > valueY) {
if (valueX > valueY) { return 1;
return 1; }
} if (valueX < valueY) {
if (valueX < valueY) { return -1;
return -1;
}
} }
return 0;
}); });
} }

View File

@@ -2439,7 +2439,7 @@
</div> </div>
<div class="i5_right"> <div class="i5_right">
<div class="stmm_btn btn3"> <div class="stmm_btn btn3">
<span style="color: #ffffff" @click="showStuAdd"> <span style="color: #ffffff" @click="showStuAdd(currentPlanItem)">
添加学员 添加学员
</span> </span>
</div> </div>
@@ -2970,6 +2970,7 @@
v-model:addAuthList="addAuthList" v-model:addAuthList="addAuthList"
:authClassify="authClassify" :authClassify="authClassify"
classify="course" classify="course"
:type="shipType"
/> />
</div> </div>
@@ -3160,7 +3161,7 @@ const columns1 = [
key: "9", key: "9",
align: "center", align: "center",
customRender: ({ text }) => { customRender: ({ text }) => {
return text ? getdateToTime(text * 1000) : "-"; return text ? text : "-";
}, },
}, },
{ {
@@ -3501,6 +3502,7 @@ export default defineComponent({
}, },
setup() { setup() {
const state = reactive({ const state = reactive({
shipType: 1,
addLoading: false, addLoading: false,
currentPlanItem: {}, currentPlanItem: {},
teacherId: null, teacherId: null,
@@ -3750,9 +3752,11 @@ export default defineComponent({
newCourseName: null, //新建开课名称 newCourseName: null, //新建开课名称
}); });
const showStuAdd = () => { const showStuAdd = (record) => {
state.viewpowervisible = true; state.selectCourseId = record.offcoursePlanId;
state.shipType = 2;
state.authClassify = 3; state.authClassify = 3;
state.viewpowervisible = true;
}; };
// 富文本 sssssssssssssss // 富文本 sssssssssssssss
@@ -3913,6 +3917,7 @@ export default defineComponent({
beginTime: startTime, beginTime: startTime,
}); });
const { rows, total } = res.data.data; const { rows, total } = res.data.data;
console.log(res.data.data);
state.tableDataTotal1 = total; state.tableDataTotal1 = total;
const datas = traverseArr( const datas = traverseArr(
rows, rows,
@@ -4429,8 +4434,8 @@ export default defineComponent({
}; };
// 关闭查看 // 关闭查看
const handlelookMs = () => { const handlelookMs = () => {
state.lookMs = false state.lookMs = false;
} };
//保存面授课 //保存面授课
const handlePush = (param) => { const handlePush = (param) => {
//state.isEdit = 1; //state.isEdit = 1;
@@ -5030,7 +5035,6 @@ export default defineComponent({
state.ft_eidt = true; state.ft_eidt = true;
}; };
const handleLook = async (itm, type) => { const handleLook = async (itm, type) => {
state.isEdit = 0; state.isEdit = 0;
console.log(45555); console.log(45555);
@@ -5306,28 +5310,31 @@ export default defineComponent({
//权限名单 //权限名单
const showPrower = (record) => { const showPrower = (record) => {
// console.log("record", record); // console.log("record", record);
state.corpowerlistvisible = true;
state.selectCourseId = record.offcourseId; state.selectCourseId = record.offcourseId;
state.corpowerlistvisible = true;
}; };
//归属权 //归属权
const showOwnPrower = (record) => { const showOwnPrower = (record) => {
// console.log("record", record); // console.log("record", record);
state.ownpowervisible = true;
state.selectCourseId = record.offcourseId; state.selectCourseId = record.offcourseId;
state.ownpowervisible = true;
}; };
//查看权 //查看权
const showViewPrower = (record) => { const showViewPrower = (record) => {
// console.log("record", record); // console.log("record", record);
state.viewpowervisible = true;
state.selectCourseId = record.offcourseId; state.selectCourseId = record.offcourseId;
state.authClassify = 1; state.authClassify = 1;
state.viewpowervisible = true;
}; };
//管理权 //管理权
const showManagePrower = (record) => { const showManagePrower = (record) => {
// console.log("record", record); // console.log("record", record);
state.viewpowervisible = true; console.log(22222222)
console.log(record)
state.selectCourseId = record.offcourseId; state.selectCourseId = record.offcourseId;
state.shipType = 1;
state.authClassify = 2; state.authClassify = 2;
state.viewpowervisible = true;
}; };
//添加权限 //添加权限
watch( watch(
@@ -5508,7 +5515,7 @@ export default defineComponent({
closeOnlineCoursevisible, closeOnlineCoursevisible,
handlelookMs, handlelookMs,
handleLook handleLook,
}; };
}, },
}); });

View File

@@ -65,7 +65,6 @@
import { reactive, toRefs, onMounted } from "vue"; import { reactive, toRefs, onMounted } from "vue";
import { courseListView } from "../../api/indexAudit"; import { courseListView } from "../../api/indexAudit";
import * as api1 from "@/api/index1"; import * as api1 from "@/api/index1";
import { toDate } from "../../api/method";
export default { export default {
name: "CoursereViewed", name: "CoursereViewed",
@@ -123,7 +122,7 @@ export default {
key: "time", key: "time",
align: "center", align: "center",
customRender: (time) => { customRender: (time) => {
return <div style="color:#387DF7">{toDate(time.record.time, "Y-M-D h:m")}</div>; return <div style="color:#387DF7">{time.record.time}</div>;
}, },
}, },

View File

@@ -318,7 +318,6 @@
<script> <script>
import { reactive, toRefs, onMounted, ref } from "vue"; import { reactive, toRefs, onMounted, ref } from "vue";
import { list, courseAuditView, courseDetail } from "../../api/indexAudit"; import { list, courseAuditView, courseDetail } from "../../api/indexAudit";
import { toDate } from "../../api/method";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { Editor } from "@wangeditor/editor-for-vue"; import { Editor } from "@wangeditor/editor-for-vue";
import { iframeUrl } from "../../api/method"; import { iframeUrl } from "../../api/method";
@@ -585,7 +584,7 @@ export default {
: "-", : "-",
change: "-", change: "-",
creater: item.createName, creater: item.createName,
time: toDate(item.createTime, "Y-M-D h:m"), time: item.createTime,
createrId: item.createId, createrId: item.createId,
offId: item.offcourseId, offId: item.offcourseId,
}; };

View File

@@ -1027,7 +1027,8 @@
:selectProjectId="routerId" :selectProjectId="routerId"
v-model:addAuthList="addAuthList" v-model:addAuthList="addAuthList"
:authClassify="authClassify" :authClassify="authClassify"
classify="addstudent" classify="learnPath"
:type="2"
/> />
<!-- 导入学员抽屉 --> <!-- 导入学员抽屉 -->
<imp-stu v-model:AddImpStuvisible="AddImpStuvisible" /> <imp-stu v-model:AddImpStuvisible="AddImpStuvisible" />

View File

@@ -1471,7 +1471,7 @@ export default {
path: "/projectadd", path: "/projectadd",
query: { query: {
parentId: value.record.projectId, parentId: value.record.projectId,
parentName: value.record.name, parentName: value.record.parentName + '——' + value.record.name,
}, },
}); });
}} }}
@@ -1573,7 +1573,7 @@ export default {
data.forEach((e) => { data.forEach((e) => {
e.parentName = parentName; e.parentName = parentName;
e.key = e.projectId; e.key = e.projectId;
initDataSublist(e.name, e.subList); initDataSublist((parentName ? (parentName + '——') : '') + e.name, e.subList);
e.subList && e.subList.length && (e.children = e.subList); e.subList && e.subList.length && (e.children = e.subList);
}); });
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -88,7 +88,7 @@
</div> </div>
</template> </template>
<script> <script>
import { reactive, toRefs, computed } from "vue"; import { reactive, toRefs, computed, getCurrentInstance } from "vue";
// import { message } from "ant-design-vue"; // import { message } from "ant-design-vue";
// import { createResearch } from "../../api/indexResearch"; // import { createResearch } from "../../api/indexResearch";
import ResearchAddSingle from "./components/ResearchAddSingle.vue"; import ResearchAddSingle from "./components/ResearchAddSingle.vue";
@@ -121,6 +121,11 @@ export default {
ResearchAddPin, ResearchAddPin,
}, },
setup() { setup() {
let { ctx: that } = getCurrentInstance();
const reload = () => {
that.$forceUpdate();
};
const router = useRouter(); const router = useRouter();
const state = reactive({ const state = reactive({
assessmentId: "", //编辑时候传 assessmentId: "", //编辑时候传
@@ -153,8 +158,8 @@ export default {
]; ];
sortBy(renderArr, "orderNumber"); //序号 sortBy(renderArr, "orderNumber"); //序号
state.allFormsData = parseData(renderArr, "questionType"); //类型 state.allFormsData = parseData(renderArr, "questionType"); //类型
// console.log("state.allFormsData"); console.log("state.allFormsData11111111111");
// console.log(state.allFormsData); console.log(state.allFormsData);
} }
}; };
getInfoDate(); getInfoDate();
@@ -360,7 +365,7 @@ export default {
case 1: case 1:
obj = { obj = {
type, type,
id: state.allFormsData.length, id: state.allFormsData.length + 1,
valueSingle: "", valueSingle: "",
singleList: [ singleList: [
{ {
@@ -374,7 +379,7 @@ export default {
case 2: case 2:
obj = { obj = {
type, type,
id: state.allFormsData.length, id: state.allFormsData.length + 1,
valueMutil: "", valueMutil: "",
mutilList: [ mutilList: [
{ {
@@ -388,7 +393,7 @@ export default {
case 3: case 3:
obj = { obj = {
type, type,
id: state.allFormsData.length, id: state.allFormsData.length + 1,
valueAsk: "", valueAsk: "",
valueAskDesc: "", valueAskDesc: "",
}; };
@@ -396,7 +401,7 @@ export default {
case 4: case 4:
obj = { obj = {
type, type,
id: state.allFormsData.length, id: state.allFormsData.length + 1,
valuePin: "", valuePin: "",
minScore: 1, minScore: 1,
maxScore: 10, maxScore: 10,
@@ -412,15 +417,22 @@ export default {
}; };
const handleDel = ({ id, type, curItem }) => { const handleDel = ({ id, type, curItem }) => {
console.log(888888888);
console.log(id);
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);
} }
}); });
console.log(5656777777777);
console.log(state.allFormsData);
state.allFormsData.map((item, index) => { state.allFormsData.map((item, index) => {
item.id = index + 1; item.id = index + 1;
return item; return item;
}); });
reload();
if (type === 1) { if (type === 1) {
console.log(11111); console.log(11111);
@@ -432,6 +444,7 @@ export default {
}).then((res) => { }).then((res) => {
console.log(56444); console.log(56444);
console.log(res); console.log(res);
reload();
}); });
} }
if (type === 2) { if (type === 2) {
@@ -444,6 +457,7 @@ export default {
}).then((res) => { }).then((res) => {
console.log(56444); console.log(56444);
console.log(res); console.log(res);
reload();
}); });
} }
if (type === 3) { if (type === 3) {
@@ -456,6 +470,7 @@ export default {
}).then((res) => { }).then((res) => {
console.log(56444); console.log(56444);
console.log(res); console.log(res);
reload();
}); });
} }
if (type === 4) { if (type === 4) {
@@ -468,6 +483,7 @@ export default {
}).then((res) => { }).then((res) => {
console.log(56444); console.log(56444);
console.log(res); console.log(res);
reload();
}); });
} }
}; };

View File

@@ -15,7 +15,7 @@
class="nameimg" class="nameimg"
src="../../../assets/images/basicinfo/asterisk.png" src="../../../assets/images/basicinfo/asterisk.png"
/> />
<div class="inname">标题</div> <div class="inname">标题{{ curItem.id }}</div>
</div> </div>
<div class="in"> <div class="in">
<a-input <a-input

View File

@@ -15,7 +15,7 @@
class="nameimg" class="nameimg"
src="../../../assets/images/basicinfo/asterisk.png" src="../../../assets/images/basicinfo/asterisk.png"
/> />
<div class="inname">标题</div> <div class="inname">标题{{ curItem.id }}</div>
</div> </div>
<div class="in"> <div class="in">
<a-input <a-input

View File

@@ -15,7 +15,7 @@
class="nameimg" class="nameimg"
src="../../../assets/images/basicinfo/asterisk.png" src="../../../assets/images/basicinfo/asterisk.png"
/> />
<div class="inname">标题</div> <div class="inname">标题{{ curItem.id }}</div>
</div> </div>
<div class="in"> <div class="in">
<a-input <a-input

View File

@@ -15,7 +15,7 @@
class="nameimg" class="nameimg"
src="../../../assets/images/basicinfo/asterisk.png" src="../../../assets/images/basicinfo/asterisk.png"
/> />
<div class="inname">标题</div> <div class="inname">标题{{ curItem.id }}</div>
</div> </div>
<div class="in"> <div class="in">
<a-input <a-input
@@ -80,6 +80,15 @@ export default {
const curItem = ref(props.item); const curItem = ref(props.item);
const assessmentId = ref(props.assessmentId); const assessmentId = ref(props.assessmentId);
// watch(
// () => curItem,
// (newVal) => {
// console.log("6765555curItemcurItem");
// console.log(newVal);
// },
// { deep: true }
// );
const handleTypesDel = (type) => { const handleTypesDel = (type) => {
emit("del", { id: curItem.value.id, type, curItem: curItem.value }); emit("del", { id: curItem.value.id, type, curItem: curItem.value });
// if (state.typesCur.includes(types)) { // if (state.typesCur.includes(types)) {