mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-25 02:32:54 +08:00
Merge branch 'develop' of http://gitlab.dongwu-inc.com:10080/BOE/fe-manage into develop
This commit is contained in:
@@ -358,7 +358,6 @@ export default {
|
||||
};
|
||||
//把数据放到state里
|
||||
const getTableDataList = (tableData) => {
|
||||
debugger
|
||||
let data = tableData;
|
||||
let array = [];
|
||||
data.map((value) => {
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
<template>
|
||||
<a-input
|
||||
v-model:value="modelV"
|
||||
:placeholder="placeholder"
|
||||
:show-count="showCount"
|
||||
:maxlength="maxlength"
|
||||
:validate="validate"
|
||||
@change="validateProName"
|
||||
v-model:value="modelV.value"
|
||||
:placeholder="placeholder"
|
||||
:show-count="showCount"
|
||||
:maxlength="maxlength"
|
||||
/>
|
||||
<div style="color: red; font-size: 10px" v-if="modelV && !validated">
|
||||
<div style="color: red; font-size: 10px" v-if="modelV.value && validated===0">
|
||||
名称重复,请重新输入
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {defineProps, defineEmits, watch, ref, onMounted} from "vue";
|
||||
import {defineProps, defineEmits, watch, ref} from "vue";
|
||||
import {validateName} from "@/api/index1";
|
||||
import {throttle} from "@/api/method";
|
||||
import {Form} from "ant-design-vue";
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
@@ -38,70 +36,70 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
validated: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits({});
|
||||
const emit = defineEmits(["update:value",'update:validated']);
|
||||
|
||||
const modelV = ref();
|
||||
|
||||
const validating = ref(false)
|
||||
const validated = ref(true)
|
||||
|
||||
onMounted(() => {
|
||||
modelV.value = props.value;
|
||||
const modelV = ref({
|
||||
value: props.value
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
() => {
|
||||
if (props.value !== modelV.value) {
|
||||
modelV.value = props.value;
|
||||
const rulesRef = ref({
|
||||
value: [{
|
||||
required: true,
|
||||
validator: validateValue,
|
||||
trigger: "change",
|
||||
message: "请输入名称",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Form.useForm(modelV, rulesRef, { debounce: { wait: 800 } });
|
||||
|
||||
watch(props, () => {
|
||||
modelV.value.value = props.value;
|
||||
});
|
||||
|
||||
watch(() => modelV.value.value, () => {
|
||||
emit("update:validated", 1);
|
||||
emit("update:value", modelV.value.value);
|
||||
});
|
||||
|
||||
async function validateValue() {
|
||||
if (!modelV.value.value) {
|
||||
return Promise.reject("请输入名称");
|
||||
}
|
||||
return validateName({ name: modelV.value.value, type: props.type, id: props.id }).then(res => {
|
||||
if (res.data.data === 1) {
|
||||
emit("update:validated", 0);
|
||||
return Promise.reject("名称重复");
|
||||
}
|
||||
emit("update:validated", 2);
|
||||
return Promise.resolve();
|
||||
}
|
||||
);
|
||||
|
||||
watch(modelV, () => {
|
||||
emit("update:value", modelV.value);
|
||||
});
|
||||
|
||||
function validate() {
|
||||
console.log('validate')
|
||||
;
|
||||
}
|
||||
|
||||
function validateNameFun() {
|
||||
validateName({name: props.value, type: props.type, id: props.id}).then(res => {
|
||||
validating.value = false
|
||||
validated.value = res.data.data !== 1
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const throttleValidateName = throttle(validateNameFun, 500)
|
||||
|
||||
function validateProName() {
|
||||
validating.value = true
|
||||
validated.value = true
|
||||
props.value && throttleValidateName()
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
.pro {
|
||||
.ant-input-affix-wrapper {
|
||||
padding: 4px 8px;
|
||||
border-radius: 8px;
|
||||
|
||||
}
|
||||
.pro {
|
||||
.ant-input-affix-wrapper {
|
||||
padding: 4px 8px;
|
||||
border-radius: 8px;
|
||||
|
||||
}
|
||||
.road {
|
||||
}
|
||||
|
||||
.road {
|
||||
.ant-input-affix-wrapper {
|
||||
padding: 0px 8px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.b_input,
|
||||
|
||||
@@ -401,8 +401,9 @@ const getStu = () => {
|
||||
arr.map((value) => {
|
||||
let obj = {
|
||||
id: value.id,
|
||||
studentId: value.studentId,
|
||||
realName: value.studentName,
|
||||
userNo: value.studentId,
|
||||
userNo: value.studentUserNo,
|
||||
isLeader: value.isLeader,
|
||||
groupId: value.groupId,
|
||||
orgName: value.studentOrgName ? value.studentOrgName : "-",
|
||||
@@ -792,7 +793,6 @@ function handleDialogOk() {
|
||||
}
|
||||
|
||||
function handleStageOk() {
|
||||
// debugger
|
||||
// 判断添加人数是否已超过限制人数 限制 = 本次添加的人 + 原有的人
|
||||
if (props.type === 1) {
|
||||
if (props.groupMemberCount !== null) { // 只有添加组员的时候判断
|
||||
@@ -804,21 +804,26 @@ function handleStageOk() {
|
||||
if (haveGroupNum.length > 0) {
|
||||
message.warning("部分学员已经有小组,再次添加会被添加到当前小组.");
|
||||
}
|
||||
// 判断是否是组长,组长不能添加
|
||||
const leaderArray = selectsData.value.projectMemberList.filter(item => item.isLeader === "1");
|
||||
if (leaderArray.length > 0) {
|
||||
return message.warning("当前选中学员" + leaderArray[0].realName + "已是小组长,请勿重复选择。");
|
||||
}
|
||||
} else if (activeKey.value === 1) {
|
||||
selectMember = selectsData.value.studentList.length;
|
||||
|
||||
|
||||
} else if (activeKey.value === 2) {
|
||||
selectMember = selectsData.value.groupList.length;
|
||||
} else if (activeKey.value === 3) {
|
||||
selectMember = selectsData.value.deptList.length;
|
||||
}
|
||||
|
||||
|
||||
if (props.groupMemberCount < selectMember + Number(props.groupMemberNumber)) {
|
||||
return message.warning("添加小组学员超过最大值");
|
||||
}
|
||||
// 判断是否是组长,组长不能添加
|
||||
const leaderArray = selectsData.value.projectMemberList.filter(item => item.isLeader === "1");
|
||||
if (leaderArray.length > 0) {
|
||||
return message.warning("当前选中学员" + leaderArray[0].realName + "已是小组长,请勿重复选择。");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,10 +135,11 @@
|
||||
<NameInput
|
||||
placeholder="请输入课程名称"
|
||||
v-model:value="xzinputV1"
|
||||
v-model:validate="validate"
|
||||
v-model:validated="validated"
|
||||
:id="offcourseId"
|
||||
:maxlength="20"
|
||||
show-count
|
||||
:type="3"
|
||||
:type="2"
|
||||
></NameInput>
|
||||
<!-- <a-input-->
|
||||
<!-- v-model:value="xzinputV1"-->
|
||||
@@ -286,9 +287,9 @@
|
||||
<div class="btn btn5" @click="of_exit1">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="btn btn6" @click="createft">
|
||||
<div class="btnText">确定</div>
|
||||
</div>
|
||||
<a-button class="btn btn6" @click="createft" :loading="validated===1">
|
||||
确定
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -918,10 +919,10 @@
|
||||
<NameInput
|
||||
maxlength="30"
|
||||
v-model:value="xjkkinputV1"
|
||||
v-model:validate="validate"
|
||||
v-model:validated="validated"
|
||||
show-count
|
||||
:id="offcourseId"
|
||||
:type="2"
|
||||
:id="offcoursePlanId"
|
||||
:type="5"
|
||||
style="width: 440px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入开课名称"
|
||||
></NameInput>
|
||||
@@ -1168,9 +1169,9 @@
|
||||
<div class="cstm_btn btn5" @click="handleCancelStu">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="cstm_btn btn6" @click="handleSureStu">
|
||||
<div class="btnText">确定</div>
|
||||
</div>
|
||||
<a-button class="cstm_btn btn6" @click="handleSureStu" :loading="validated===1">
|
||||
确定
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2575,7 +2576,7 @@ export default defineComponent({
|
||||
|
||||
imageUrl: "",
|
||||
imgList: [],
|
||||
validate: true,
|
||||
validated: 0,
|
||||
attach: "",
|
||||
pageSize2: 10,
|
||||
currentPage2: 0,
|
||||
@@ -3501,9 +3502,7 @@ export default defineComponent({
|
||||
return message.warning("请输入必填项");
|
||||
}
|
||||
|
||||
console.log("state.validate", state.validate);
|
||||
|
||||
if (!state.validate) {
|
||||
if (!state.validated == 2) {
|
||||
message.destroy();
|
||||
return message.warning("该课程名称已存在");
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
ref="inputRef"
|
||||
placeholder="请输入课程名称"
|
||||
v-model:value="qdms_inputV1"
|
||||
v-model:validate="validate"
|
||||
v-model:validated="validated"
|
||||
:maxlength="20"
|
||||
show-count
|
||||
:type="2"
|
||||
@@ -457,9 +457,9 @@
|
||||
<div class="btn btn5" @click="noEditClose">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="btn btn6" @click="handlePush">
|
||||
<a-button class="btn btn6" @click="handlePush" :loading="validated===1">
|
||||
<div class="btnText">保存</div>
|
||||
</div>
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -507,7 +507,7 @@
|
||||
</div>
|
||||
<div class="btn">
|
||||
<button class="samtn btn1" @click="closeLearnBgMore">取消</button>
|
||||
<button class="samtn btn2" @click="closeLearnBgMore">确定</button>
|
||||
<a-button class="samtn btn2" @click="closeLearnBgMore">确定</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
@@ -556,7 +556,7 @@ export default defineComponent({
|
||||
hideshow: true,
|
||||
ft_eidt: false,
|
||||
attach: "",
|
||||
validate: true,
|
||||
validated: 0,
|
||||
ft_hs: false,
|
||||
addLoading: false,
|
||||
statusJuJue: 0,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<iframe
|
||||
id="iframe"
|
||||
style="width: 100%; height: 100%"
|
||||
:src="iframeUrl + '/iframe/course/reviewed'"
|
||||
:src="iframeUrl + '/pc/iframe/course/reviewed'"
|
||||
frameborder="0"
|
||||
name="myframe"
|
||||
security="restricted"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<iframe
|
||||
id="iframe"
|
||||
style="width: 100%; height: 100%"
|
||||
:src="iframeUrl + '/iframe/course/noapproved'"
|
||||
:src="iframeUrl + '/pc/iframe/course/noapproved'"
|
||||
frameborder="0"
|
||||
name="myframe"
|
||||
security="restricted"
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
<NameInput
|
||||
placeholder="请输入路径名称"
|
||||
v-model:value="pathName"
|
||||
v-model:validate="validate"
|
||||
v-model:validated="validated"
|
||||
:maxlength="20"
|
||||
show-count
|
||||
:type="3"
|
||||
@@ -285,7 +285,7 @@
|
||||
<a-button
|
||||
class="samtn btn2"
|
||||
@click="createLearnPath"
|
||||
:loading="confirmLoading"
|
||||
:loading="confirmLoading || validated === 1"
|
||||
>确定</a-button
|
||||
>
|
||||
</div>
|
||||
@@ -780,6 +780,7 @@ export default {
|
||||
selectTime: null,
|
||||
sh: false,
|
||||
validate: true,
|
||||
validated: 0,
|
||||
tableData: [
|
||||
// {
|
||||
// key: 1,
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
<template xmlns:display="http://www.w3.org/1999/xhtml">
|
||||
<div class="projectAdd">
|
||||
<div class="header">
|
||||
<span class="title">{{ projectInfo.id ? "编辑" : "创建"
|
||||
}}{{ ptojectType == "3" ? "班级" : "项目" }}</span>
|
||||
<span class="title">{{
|
||||
projectInfo.id ? "编辑" : "创建"
|
||||
}}{{ ptojectType == "3" ? "班级" : "项目" }}</span>
|
||||
<div @click="backPage" style="cursor: pointer" to="/projectmanage" class="goback">
|
||||
<span class="return"></span><span class="returntext">返回</span>
|
||||
</div>
|
||||
@@ -12,7 +13,7 @@
|
||||
<div class="main">
|
||||
<div class="name" v-if="projectInfo.parentName">
|
||||
<div class="namebox">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">项目归属</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
@@ -23,19 +24,20 @@
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">
|
||||
{{ ptojectType == 3 ? "班级名称" : "项目名称" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<NameInput placeholder="请输入项目名称" v-model:value="projectInfo.name" v-model:validate="projectInfo.validate"
|
||||
:maxlength="30" show-count :id="projectInfo.id"></NameInput>
|
||||
<NameInput placeholder="请输入项目名称" v-model:value="projectInfo.name"
|
||||
v-model:validated="projectInfo.validated" :type="1"
|
||||
:maxlength="30" show-count :id="projectInfo.id"></NameInput>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name flex-top">
|
||||
<div class="namebox" style="margin-top: 10px">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">封面图</div>
|
||||
</div>
|
||||
<div class="in select" style="flex: 1; display: flex">
|
||||
@@ -54,7 +56,7 @@
|
||||
height: 100px;
|
||||
margin-bottom: 4px;
|
||||
margin-right: 4px;
|
||||
" :src="src.value" alt="avatar" />
|
||||
" :src="src.value" alt="avatar"/>
|
||||
</div>
|
||||
<div @click="showLearnBgMore" v-if="projectPic.length > 3" style="
|
||||
width: 100px;
|
||||
@@ -74,47 +76,49 @@
|
||||
line-height: 36px;
|
||||
">
|
||||
查看更多
|
||||
<img src="../../assets/images/projectadd/go.png" alt="" />
|
||||
<img src="../../assets/images/projectadd/go.png" alt=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">项目时间</div>
|
||||
</div>
|
||||
|
||||
<div class="in">
|
||||
<a-range-picker separator="至" :show-time="{ format: 'HH:mm' }" :placeholder="[' 开始时间', ' 结束时间']"
|
||||
:disabledDate="disabledDate" v-model:value="timeRange" @calendarChange="calendarChange"
|
||||
style="width: 100%; height: 40px; border-radius: 5px" :allowClear="false" format="YYYY-MM-DD HH:mm"
|
||||
valueFormat="YYYY-MM-DD HH:mm" @change="timeChange" :disabled="!!viewDetail" />
|
||||
<a-range-picker separator="至" :show-time="{ format: 'HH:mm' }"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
:disabledDate="disabledDate" v-model:value="timeRange" @calendarChange="calendarChange"
|
||||
style="width: 100%; height: 40px; border-radius: 5px" :allowClear="false"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
valueFormat="YYYY-MM-DD HH:mm" @change="timeChange" :disabled="!!viewDetail"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">项目经理</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<ProjectManager v-model:value="projectInfo.managerId" v-model:name="projectInfo.manager"
|
||||
@onChange="managerChange" mode="multiple"></ProjectManager>
|
||||
@onChange="managerChange" mode="multiple"></ProjectManager>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">资源归属</div>
|
||||
</div>
|
||||
|
||||
<div class="in select">
|
||||
<OrgClass v-model:value="projectInfo.sourceBelongId" v-model:name="projectInfo.sourceBelongName"
|
||||
v-model:fullName="projectInfo.sourceBelongFullName"></OrgClass>
|
||||
v-model:fullName="projectInfo.sourceBelongFullName"></OrgClass>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">项目级别</div>
|
||||
</div>
|
||||
<div class="in select">
|
||||
@@ -123,7 +127,7 @@
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">培训分类</div>
|
||||
</div>
|
||||
<div class="in select">
|
||||
@@ -132,7 +136,7 @@
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
|
||||
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png"/>
|
||||
<div class="inname">是否BOEU实施</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
@@ -177,7 +181,7 @@
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-textarea v-model:value="projectInfo.remark" style="height: 80px" placeholder="请输入说明" show-count
|
||||
:maxlength="200" :disabled="viewDetail ? true : false" />
|
||||
:maxlength="200" :disabled="viewDetail ? true : false"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -197,7 +201,7 @@
|
||||
<a-select :getPopupContainer="
|
||||
(triggerNode) => triggerNode.parentNode || document.body
|
||||
" placeholder="请选择模版" style="width: 100%" :options="classifyList5" @change="classificationChange5"
|
||||
@popupScroll="templateScroll" :fieldNames="{
|
||||
@popupScroll="templateScroll" :fieldNames="{
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
}">
|
||||
@@ -215,18 +219,18 @@
|
||||
</div>
|
||||
<!-- 更多背景图 v-model:visible="learnBgMore" -->
|
||||
<a-modal :closable="sh" centered="true" v-model:visible="learnBgMore" :footer="null" :width="650"
|
||||
wrapClassName="learnBgMoreModal" :z-index="9999">
|
||||
wrapClassName="learnBgMoreModal" :z-index="9999">
|
||||
<div class="main">
|
||||
<div class="top">
|
||||
<div class="topc">封面图</div>
|
||||
</div>
|
||||
<div class="imagesBox">
|
||||
<!-- <div
|
||||
@click="() => (projectInfo.picUrl = src.value)"
|
||||
v-for="item in projectPic"
|
||||
:key="item.code"
|
||||
class="learnBgItem"
|
||||
> -->
|
||||
<!-- <div
|
||||
@click="() => (projectInfo.picUrl = src.value)"
|
||||
v-for="item in projectPic"
|
||||
:key="item.code"
|
||||
class="learnBgItem"
|
||||
> -->
|
||||
<div @click="chooseImg2(item)" v-for="item in projectPic" :key="item.code" class="learnBgItem" :style="{
|
||||
border:
|
||||
projectInfo.picUrl === item.value
|
||||
@@ -239,27 +243,27 @@
|
||||
</div>
|
||||
<div class="btn">
|
||||
<button class="samtn btn1" @click="closeLearnBgMore">取消</button>
|
||||
<button class="samtn btn2" @click="closeLearnBgMore">确定</button>
|
||||
<a-button class="samtn btn2" @click="closeLearnBgMore" :loading="projectInfo.validated===1">确定</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { onMounted, reactive, toRefs, watch } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import {onMounted, reactive, toRefs, watch} from "vue";
|
||||
import {message} from "ant-design-vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import * as api from "../../api/index";
|
||||
import { useStore } from "vuex";
|
||||
import {useStore} from "vuex";
|
||||
import TrainClass from "@/components/project/TrainClass";
|
||||
import OrgClass from "@/components/project/OrgClass";
|
||||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
||||
import NameInput from "@/components/project/NameInput";
|
||||
import ProjectLevel from "@/components/project/ProjectLevel";
|
||||
import * as api2 from "../../api/indexAudit";
|
||||
import { validateName } from "@/api/index1";
|
||||
import {validateName} from "@/api/index1";
|
||||
import dayjs from "dayjs";
|
||||
import { scrollLoad } from "@/api/method";
|
||||
import {scrollLoad} from "@/api/method";
|
||||
|
||||
export default {
|
||||
name: "projectAdd",
|
||||
@@ -283,7 +287,7 @@ export default {
|
||||
pageSize: 10, //每页10条数据
|
||||
totalPages: 0, //总页数
|
||||
viewDetail: null,
|
||||
projectInfo: { id: "" },
|
||||
projectInfo: { id: "", validated: 0 },
|
||||
projectPic: [],
|
||||
memberParam: {
|
||||
pageNo: 1,
|
||||
@@ -330,43 +334,43 @@ export default {
|
||||
state.projectInfo.parentId = routers.query.parentId;
|
||||
state.projectInfo.id = routers.query.projectId;
|
||||
(state.projectInfo.id || state.projectInfo.parentId) &&
|
||||
api
|
||||
.getProjectDetail({
|
||||
projectId: state.projectInfo.id || state.projectInfo.parentId,
|
||||
})
|
||||
.then((res) => {
|
||||
state.projectInfo = {
|
||||
...res.data.data.projectInfo,
|
||||
...state.projectInfo,
|
||||
api
|
||||
.getProjectDetail({
|
||||
projectId: state.projectInfo.id || state.projectInfo.parentId,
|
||||
})
|
||||
.then((res) => {
|
||||
state.projectInfo = {
|
||||
...res.data.data.projectInfo,
|
||||
...state.projectInfo,
|
||||
};
|
||||
!routers.query.projectId &&
|
||||
!!routers.query.parentId &&
|
||||
(state.projectInfo.name = "");
|
||||
state.timeRange = [
|
||||
state.projectInfo.beginTime,
|
||||
state.projectInfo.endTime,
|
||||
];
|
||||
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
|
||||
if (Number(state.projectInfo.status) === -5) {
|
||||
let obj = {
|
||||
project_id: state.projectInfo.id,
|
||||
type: 1,
|
||||
pageNo: 1,
|
||||
pageSize: 1,
|
||||
};
|
||||
!routers.query.projectId &&
|
||||
!!routers.query.parentId &&
|
||||
(state.projectInfo.name = "");
|
||||
state.timeRange = [
|
||||
state.projectInfo.beginTime,
|
||||
state.projectInfo.endTime,
|
||||
];
|
||||
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
|
||||
if (Number(state.projectInfo.status) === -5) {
|
||||
let obj = {
|
||||
project_id: state.projectInfo.id,
|
||||
type: 1,
|
||||
pageNo: 1,
|
||||
pageSize: 1,
|
||||
};
|
||||
api2.auditList(obj).then((d) => {
|
||||
if (d.data.code === 200) {
|
||||
let res = d.data.data;
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
let i = res.rows.length;
|
||||
state.auditDescription = res.rows[i - 1].description
|
||||
? res.rows[i - 1].description
|
||||
: "-";
|
||||
}
|
||||
api2.auditList(obj).then((d) => {
|
||||
if (d.data.code === 200) {
|
||||
let res = d.data.data;
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
let i = res.rows.length;
|
||||
state.auditDescription = res.rows[i - 1].description
|
||||
? res.rows[i - 1].description
|
||||
: "-";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const backPage = () => {
|
||||
@@ -453,7 +457,7 @@ export default {
|
||||
/**
|
||||
if (!state.projectInfo.validate) {
|
||||
message.destroy();
|
||||
message.warning('项目名称重复,请修改名称!');
|
||||
message.warning("项目名称重复,请修改名称!");
|
||||
return;
|
||||
}*/
|
||||
const offName = await validateName({
|
||||
@@ -508,9 +512,11 @@ export default {
|
||||
const closeLearnBgMore = () => {
|
||||
state.learnBgMore = false;
|
||||
};
|
||||
|
||||
function calendarChange(date, dateStr, partial) {
|
||||
state.datePartial = partial;
|
||||
}
|
||||
|
||||
const chooseImg2 = (item) => {
|
||||
// console.log(item);
|
||||
state.projectInfo.picUrl = item.value;
|
||||
|
||||
@@ -304,7 +304,8 @@
|
||||
<NameInput
|
||||
placeholder="请输入项目名称"
|
||||
v-model:value="projectInfo.name"
|
||||
v-model:validate="projectInfo.validate"
|
||||
v-model:validated="projectInfo.validated"
|
||||
:type="1"
|
||||
:maxlength="30"
|
||||
show-count
|
||||
:id="projectInfo.projectId"
|
||||
@@ -358,7 +359,7 @@
|
||||
</div>
|
||||
<div class="pubtn">
|
||||
<a-button class="pubtn1" @click="closeModal2">取消</a-button>
|
||||
<a-button class="pubtn2" @click="createStoreyProject"
|
||||
<a-button class="pubtn2" @click="createStoreyProject" :loading="buttonLoading || projectInfo.validated===1"
|
||||
>确定
|
||||
</a-button>
|
||||
</div>
|
||||
@@ -973,6 +974,7 @@ export default {
|
||||
setup() {
|
||||
const state = reactive({
|
||||
tableLoading: false,
|
||||
buttonLoading: false,
|
||||
projectName: null,
|
||||
selectTime: null,
|
||||
sonproject: false,
|
||||
@@ -1082,6 +1084,7 @@ export default {
|
||||
|
||||
// 创建多层项目
|
||||
const createStoreyProject = async () => {
|
||||
state.buttonLoading = true
|
||||
// 接口需要传递的参数信息
|
||||
const errorMsgs = {
|
||||
name: "请输入项目名称",
|
||||
@@ -1090,6 +1093,7 @@ export default {
|
||||
sourceBelongId: "请选择资源归属",
|
||||
};
|
||||
if (!validate(state.projectInfo, errorMsgs)) {
|
||||
state.buttonLoading = false
|
||||
return;
|
||||
}
|
||||
/**
|
||||
@@ -1106,6 +1110,7 @@ export default {
|
||||
return res.data.data == 1;
|
||||
});
|
||||
if (offName) {
|
||||
state.buttonLoading = false
|
||||
message.destroy();
|
||||
return message.warning("项目名称重复,请重新填写");
|
||||
}
|
||||
@@ -1114,6 +1119,7 @@ export default {
|
||||
message.destroy();
|
||||
message.success("创建成功");
|
||||
state.currentPage = 1;
|
||||
state.buttonLoading = false
|
||||
getTableDate();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -92,9 +92,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, computed } from "vue";
|
||||
// import { message } from "ant-design-vue";
|
||||
// import { createResearch } from "../../api/indexResearch";
|
||||
import {reactive, toRefs} from "vue";
|
||||
import ResearchAddSingle from "./components/ResearchAddSingle.vue";
|
||||
import ResearchAddMulti from "./components/ResearchAddMulti.vue";
|
||||
import ResearchAddAsk from "./components/ResearchAddAsk.vue";
|
||||
@@ -104,7 +102,7 @@ import {
|
||||
traverseArr,
|
||||
filterCommon,
|
||||
deepCloneFilterString,
|
||||
} from "../../utils/utils";
|
||||
} from "@/utils/utils";
|
||||
import {
|
||||
queryResearchDetailById,
|
||||
editResearchMessage,
|
||||
@@ -112,9 +110,8 @@ import {
|
||||
deleteChoiceQuestion,
|
||||
deleteQuestionScAndQa,
|
||||
} from "@/api/indexResearch";
|
||||
import { useRouter } from "vue-router";
|
||||
import store from "@/store";
|
||||
import { message } from "ant-design-vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {message} from "ant-design-vue";
|
||||
|
||||
export default {
|
||||
name: "ResearchAdd",
|
||||
@@ -126,10 +123,11 @@ export default {
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const state = reactive({
|
||||
assessmentId: "", //编辑时候传
|
||||
assessmentName: "",
|
||||
assessmentNameNew: computed(() => store.state.assessmentName),
|
||||
assessmentNameNew: route.query.name,
|
||||
|
||||
allFormsData: [],
|
||||
valueMore: "",
|
||||
@@ -612,10 +610,12 @@ export default {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.header {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
color: #000000;
|
||||
font-size: 18px;
|
||||
@@ -624,10 +624,12 @@ export default {
|
||||
padding-left: 37px;
|
||||
//font-weight: 500;
|
||||
}
|
||||
|
||||
.goback {
|
||||
padding-right: 70px;
|
||||
//padding-top: 37px;
|
||||
position: relative;
|
||||
|
||||
.return {
|
||||
display: inline-block;
|
||||
width: 42px;
|
||||
@@ -636,6 +638,7 @@ export default {
|
||||
margin-right: 10px;
|
||||
background-image: url("../../assets/images/projectadd/return.png");
|
||||
}
|
||||
|
||||
.returntext {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
@@ -645,16 +648,19 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
@@ -667,11 +673,13 @@ export default {
|
||||
align-items: center;
|
||||
margin: 20px 10px;
|
||||
}
|
||||
|
||||
.typesCur {
|
||||
color: #fff;
|
||||
background: #4ea6ff;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -680,9 +688,11 @@ export default {
|
||||
min-width: 690px;
|
||||
margin-left: 38px;
|
||||
margin-top: 20px;
|
||||
|
||||
.tagbox {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.tagname {
|
||||
width: 90px;
|
||||
height: 32px;
|
||||
@@ -696,6 +706,7 @@ export default {
|
||||
color: rgba(64, 158, 255, 1);
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.deleteop {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -707,6 +718,7 @@ export default {
|
||||
border: 1px solid #4ea6ff;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
|
||||
.del_text {
|
||||
color: #4ea6ff;
|
||||
font-size: 14px;
|
||||
@@ -714,21 +726,25 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
@@ -744,30 +760,36 @@ export default {
|
||||
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;
|
||||
@@ -776,10 +798,12 @@ export default {
|
||||
color: #4ea6ff;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.name2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 60%;
|
||||
// background-color: lightcoral;
|
||||
@@ -794,20 +818,24 @@ export default {
|
||||
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;
|
||||
@@ -822,6 +850,7 @@ export default {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.assesswhole {
|
||||
width: 50%;
|
||||
background: rgba(86, 163, 249, 0.1);
|
||||
@@ -831,6 +860,7 @@ export default {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ratio {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
@@ -839,24 +869,29 @@ export default {
|
||||
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%;
|
||||
@@ -864,26 +899,32 @@ export default {
|
||||
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;
|
||||
@@ -891,27 +932,33 @@ export default {
|
||||
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;
|
||||
@@ -922,6 +969,7 @@ export default {
|
||||
|
||||
.uploadContent {
|
||||
display: block !important;
|
||||
|
||||
.uploadBtn {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user