feat:合并

This commit is contained in:
lixg
2022-12-20 18:37:17 +08:00
7 changed files with 169 additions and 6 deletions

View File

@@ -242,6 +242,10 @@ const setCookie = (name, value, perpetual) => {
} }
//获取cookie数据 //获取cookie数据
//先写一个方法 //先写一个方法
export function getCookieForName(name) {
return document.cookie?.split(";").find(e => e.includes(name))?.replace(`${name}=`, '') || ''
}
function getCookie(name) { function getCookie(name) {
//1.获取cookie字符串 //1.获取cookie字符串
var cookies = document.cookie; var cookies = document.cookie;

View File

@@ -1,5 +1,5 @@
import {reactive, ref, toRefs, watch} from "vue"; import {reactive, ref, toRefs, watch} from "vue";
import {getCookie} from "@/api/method"; import {getCookieForName} from "@/api/method";
import JSONBigInt from 'json-bigint'; import JSONBigInt from 'json-bigint';
const JSONBigIntStr = JSONBigInt({storeAsString: true}); const JSONBigIntStr = JSONBigInt({storeAsString: true});
@@ -143,7 +143,7 @@ export async function request(_url, params) {
return fetch(url, { return fetch(url, {
method, method,
headers: { headers: {
token: getCookie('token'), token: getCookieForName('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {} ...method !== 'get' ? {'Content-Type': 'application/json'} : {}
}, },
...method !== 'get' ? {body: JSON.stringify(body)} : {} ...method !== 'get' ? {body: JSON.stringify(body)} : {}

View File

@@ -92,6 +92,8 @@ function getMemberData() {
isOpen.value = false isOpen.value = false
return; return;
} }
console.log(1111111111111)
console.log(props.value)
const list = res.data.data.rows.filter(e => !(props.value + '').includes(e.id)).map(e => ({ const list = res.data.data.rows.filter(e => !(props.value + '').includes(e.id)).map(e => ({
label: e.realName + e.userNo, label: e.realName + e.userNo,
value: e.id, value: e.id,
@@ -131,7 +133,7 @@ function change(e, l) {
Array.isArray(selectOptions.value) && emit('onChange', e, l, selectOptions.value.find(e => e.deptId)?.deptId, selectOptions.value.find(e => e.deptId)?.departName) Array.isArray(selectOptions.value) && emit('onChange', e, l, selectOptions.value.find(e => e.deptId)?.deptId, selectOptions.value.find(e => e.deptId)?.departName)
if (Array.isArray(l)) { if (Array.isArray(l)) {
emit('update:name', l.map(t => t.label).join(',')) emit('update:name', l.map(t => t.label).join(','))
emit('update:value', l.map(t => t.label).join(',')) emit('update:value', l.map(t => t.value).join(','))
} else { } else {
emit('update:name', l?.label) emit('update:name', l?.label)
emit('update:value', l?.value) emit('update:value', l?.value)

View File

@@ -96,6 +96,7 @@
</div> </div>
</div> </div>
</a-tab-pane> </a-tab-pane>
<<<<<<< HEAD
<a-tab-pane :key="2" tab="添加组织"> <a-tab-pane :key="2" tab="添加组织">
<div :style="{ height: screenHeight - 235 + 'px' }"> <div :style="{ height: screenHeight - 235 + 'px' }">
<div class="tab2"> <div class="tab2">
@@ -140,6 +141,46 @@
</div> </div>
</div> </div>
</a-tab-pane> </a-tab-pane>
=======
<!-- <a-tab-pane :key="2" tab="添加组织">-->
<!-- <div-->
<!-- :style="{ height: screenHeight - 235 + 'px' }"-->
<!-- >-->
<!-- <div class="tab2">-->
<!-- <a-form-item label="组织:">-->
<!-- <a-input-->
<!-- v-model:value="searchOrgName.keyword"-->
<!-- style="width: 230px; height: 40px; border-radius: 8px"-->
<!-- placeholder="请输入组织"-->
<!-- />-->
<!-- <a-button type="primary" @click="searchOrg" style="margin-left: 20px;border-radius: 4px">-->
<!-- <template #icon>-->
<!-- <SearchOutlined/>-->
<!-- </template>-->
<!-- 搜索-->
<!-- </a-button>-->
<!-- <a-button @click="resetOrg" style="margin-left: 20px;border-radius: 4px">重置</a-button>-->
<!-- </a-form-item>-->
<!-- </div>-->
<!-- <div class="boeTree">-->
<!-- <a-tree-->
<!-- :tree-data="searchOrgName.keyword ? orgData : treeData"-->
<!-- @select="onOrgSelectChange"-->
<!-- :fieldNames="{-->
<!-- children: 'treeChildList',-->
<!-- key: 'id',-->
<!-- title: 'name',-->
<!-- value: 'name',-->
<!-- }"-->
<!-- row-key="id"-->
<!-- :row-selection="orgRowSelection"-->
<!-- multiple-->
<!-- >-->
<!-- </a-tree>-->
<!-- </div>-->
<!-- </div>-->
<!-- </a-tab-pane>-->
>>>>>>> 0bbb4403e7650fcaf87f158833a10c02c3e51841
<a-tab-pane :key="3" tab="受众关联"> <a-tab-pane :key="3" tab="受众关联">
<div :style="{ height: screenHeight - 235 + 'px' }"> <div :style="{ height: screenHeight - 235 + 'px' }">
<div> <div>
@@ -208,6 +249,7 @@
</div> </div>
</div> </div>
</div> </div>
<<<<<<< HEAD
</div> </div>
<div <div
v-if="!person && selectsData.studentList.length > 10" v-if="!person && selectsData.studentList.length > 10"
@@ -256,6 +298,52 @@
<div v-if="i < 11"> <div v-if="i < 11">
<div class="chose2"> <div class="chose2">
<div class="span">{{ item.audienceName }}</div> <div class="span">{{ item.audienceName }}</div>
=======
</div>
</div>
<div v-if="!person && selectsData.studentList.length >10" class="ifsw"><div @click="person = !person" class=sw>查看更多></div></div>
<div v-if="person && selectsData.studentList.length >10" class="ifsw" ><div @click="person = !person" class="sw"> 收起&lt; </div></div>
<!--组织-->
<!-- <div class="dept">添加组织</div>-->
<!-- <div v-for="(item,i) in selectsData.deptList" >-->
<!-- <div v-if="i<11">-->
<!-- <div class="chose1">-->
<!-- <div class="span"> {{ item.name }}</div>-->
<!-- <div class="ch1" @click="orgDel(i)"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div v-else> -->
<!-- <div v-if ="dept">-->
<!-- <div class="chose1">-->
<!-- <div class="span"> {{ item.name }}</div>-->
<!-- <div class="ch1" @click="orgDel(i)"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- -->
<!-- </div>-->
<!-- -->
<!-- </div>-->
<!-- <div v-if="!dept && selectsData.deptList.length >10" class="ifsw"><div @click="dept = !dept" class=sw>查看更多></div></div>-->
<!-- <div v-if="dept && selectsData.deptList.length >10" class="ifsw" ><div @click="dept = !dept" class="sw"> 收起&lt; </div></div>-->
<!--受众-->
<div class="group">受众关联</div>
<div v-for="(item,i) in selectsData.groupList" >
<div v-if="i<11">
<div class="chose2">
<div class="span"> {{ item.audienceName }}</div>
<div class="ch2" @click="AuditDel(i)"></div>
</div>
</div>
<div v-else>
<div v-if ="group">
<div class="chose2">
<div class="span"> {{ item.audienceName }}</div>
>>>>>>> 0bbb4403e7650fcaf87f158833a10c02c3e51841
<div class="ch2" @click="AuditDel(i)"></div> <div class="ch2" @click="AuditDel(i)"></div>
</div> </div>
</div> </div>
@@ -346,11 +434,19 @@
</a-modal> </a-modal>
</template> </template>
<script setup> <script setup>
<<<<<<< HEAD
import { computed, defineEmits, defineProps, ref, watch } from "vue"; import { computed, defineEmits, defineProps, ref, watch } from "vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useBoeApi, useBoeApiPage } from "@/api/request"; import { useBoeApi, useBoeApiPage } from "@/api/request";
import { AUDIENCE_LIST, ORG_LIST, USER_LIST } from "@/api/ThirdApi"; import { AUDIENCE_LIST, ORG_LIST, USER_LIST } from "@/api/ThirdApi";
import { saveStu } from "@/api/index1"; import { saveStu } from "@/api/index1";
=======
import {computed, defineEmits, defineProps, ref, watch} from "vue";
import {useStore} from "vuex";
import {useBoeApiPage} from "@/api/request";
import {AUDIENCE_LIST, USER_LIST} from "@/api/ThirdApi";
import {saveStu} from "@/api/index1";
>>>>>>> 0bbb4403e7650fcaf87f158833a10c02c3e51841
const store = useStore(); const store = useStore();
const emit = defineEmits({}); const emit = defineEmits({});
@@ -359,6 +455,7 @@ const props = defineProps({
id: String, id: String,
stage: { stage: {
type: Array, type: Array,
<<<<<<< HEAD
default: () => [], default: () => [],
}, },
}); });
@@ -368,6 +465,17 @@ const group = ref(false);
const visiable = ref(false); const visiable = ref(false);
const activeKey = ref(1); const activeKey = ref(1);
const stageVisible = ref(false); const stageVisible = ref(false);
=======
default: () => []
}
})
const person =ref(false)
// const dept =ref(false)
const group =ref(false)
const visiable = ref(false)
const activeKey = ref(1)
const stageVisible = ref(false)
>>>>>>> 0bbb4403e7650fcaf87f158833a10c02c3e51841
const selectsData = ref({ const selectsData = ref({
stageId: "", stageId: "",
studentList: [], studentList: [],
@@ -383,6 +491,7 @@ const nameSearch = ref({
const audienceName = ref({ const audienceName = ref({
keyword: "", keyword: "",
page: 1, page: 1,
<<<<<<< HEAD
pageSize: 10, pageSize: 10,
}); });
const searchOrgName = ref({ const searchOrgName = ref({
@@ -390,6 +499,15 @@ const searchOrgName = ref({
page: 1, page: 1,
pageSize: 10, pageSize: 10,
}); });
=======
pageSize: 10
})
// const searchOrgName = ref({
// keyword: '',
// page: 1,
// pageSize: 10
// })
>>>>>>> 0bbb4403e7650fcaf87f158833a10c02c3e51841
const stageIds = computed(() => props.stage); const stageIds = computed(() => props.stage);
@@ -407,10 +525,17 @@ const {
total: (res) => res.result.totalElement, total: (res) => res.result.totalElement,
}); });
<<<<<<< HEAD
const { data: orgData, fetch: searchOrg } = useBoeApi( const { data: orgData, fetch: searchOrg } = useBoeApi(
ORG_LIST, ORG_LIST,
searchOrgName.value searchOrgName.value
); );
=======
// const {
// data: orgData,
// fetch: searchOrg,
// } = useBoeApi(ORG_LIST, searchOrgName.value)
>>>>>>> 0bbb4403e7650fcaf87f158833a10c02c3e51841
const { const {
data: audiData, data: audiData,
@@ -568,12 +693,19 @@ function stuDel(i) {
selectsData.value.studentList.splice(i, 1); selectsData.value.studentList.splice(i, 1);
} }
<<<<<<< HEAD
function orgDel(i) { function orgDel(i) {
orgSelectKeys.value = orgSelectKeys.value.filter( orgSelectKeys.value = orgSelectKeys.value.filter(
(e) => e !== selectsData.value.deptList[i].id (e) => e !== selectsData.value.deptList[i].id
); );
selectsData.value.deptList.splice(i, 1); selectsData.value.deptList.splice(i, 1);
} }
=======
// function orgDel(i) {
// orgSelectKeys.value = orgSelectKeys.value.filter(e => e !== selectsData.value.deptList[i].id)
// selectsData.value.deptList.splice(i, 1)
// }
>>>>>>> 0bbb4403e7650fcaf87f158833a10c02c3e51841
function AuditDel(i) { function AuditDel(i) {
auditSelectKeys.value = auditSelectKeys.value.filter( auditSelectKeys.value = auditSelectKeys.value.filter(
@@ -631,9 +763,15 @@ const deleteDepSelect = () => {
}; };
//重置组织 //重置组织
<<<<<<< HEAD
const resetOrg = () => { const resetOrg = () => {
searchOrgName.value = { keyword: "", page: 1, pageSize: 10 }; searchOrgName.value = { keyword: "", page: 1, pageSize: 10 };
}; };
=======
// const resetOrg = () => {
// searchOrgName.value = {keyword: '', page: 1, pageSize: 10}
// };
>>>>>>> 0bbb4403e7650fcaf87f158833a10c02c3e51841
//重置受众 //重置受众
const resetAudienceInfo = () => { const resetAudienceInfo = () => {

View File

@@ -259,6 +259,7 @@
<div class="btn"> <div class="btn">
<a-button @click="backPage" class="btn2">取消</a-button> <a-button @click="backPage" class="btn2">取消</a-button>
<a-button <a-button
:loading="loading"
v-on:click="createProject" v-on:click="createProject"
type="primary" type="primary"
class="btn1" class="btn1"
@@ -301,6 +302,7 @@ export default {
const routers = useRoute(); const routers = useRoute();
const router = useRouter(); const router = useRouter();
const state = reactive({ const state = reactive({
loading:false,
currentPage: 1, //当前页 currentPage: 1, //当前页
tableDataTotal: -1, //模版列表总数 tableDataTotal: -1, //模版列表总数
pageSize: 10, //每页10条数据 pageSize: 10, //每页10条数据
@@ -459,6 +461,7 @@ export default {
} }
const createProject = async () => { const createProject = async () => {
state.loading = true
console.log("保存", state.projectInfo); console.log("保存", state.projectInfo);
if (!validate(state.projectInfo, errorMsgs)) { if (!validate(state.projectInfo, errorMsgs)) {
return; return;
@@ -483,6 +486,7 @@ export default {
state.projectInfo.type = 3; state.projectInfo.type = 3;
state.projectInfo.courseSyncFlag = state.courseSyncFlag ? 1 : 0; state.projectInfo.courseSyncFlag = state.courseSyncFlag ? 1 : 0;
api.createProject(state.projectInfo).then((res) => { api.createProject(state.projectInfo).then((res) => {
state.loading = false
state.projectInfo.projectId || state.projectInfo.projectId ||
changeOwnership("project", res.data.data.projectId, [ changeOwnership("project", res.data.data.projectId, [
{ id: res.data.data.createId, name: res.data.data.createName }, { id: res.data.data.createId, name: res.data.data.createName },
@@ -499,6 +503,9 @@ export default {
}; };
function managerChange(e, l, d, t) { function managerChange(e, l, d, t) {
if (routers.query.parentId) {
return;
}
!state.projectInfo.sourceBelongId && !state.projectInfo.sourceBelongId &&
(state.projectInfo.sourceBelongId = d); (state.projectInfo.sourceBelongId = d);
!state.projectInfo.sourceBelongName && !state.projectInfo.sourceBelongName &&

View File

@@ -1804,6 +1804,10 @@ export default {
); );
function managerChange(e, l, d, t) { function managerChange(e, l, d, t) {
if (state.projectInfo.parentId) {
return;
}
!state.projectInfo.sourceBelongId && !state.projectInfo.sourceBelongId &&
(state.projectInfo.sourceBelongId = d); (state.projectInfo.sourceBelongId = d);
!state.projectInfo.sourceBelongName && !state.projectInfo.sourceBelongName &&

View File

@@ -386,8 +386,16 @@ export default {
}); });
}; };
function managerChange(e, l, d, t) {
!state.projectInfo.sourceBelongId &&
(state.projectInfo.sourceBelongId = d);
!state.projectInfo.sourceBelongName &&
(state.projectInfo.sourceBelongName = t);
}
return { return {
...toRefs(state), ...toRefs(state),
managerChange,
timeChange, timeChange,
projectPic, projectPic,
createProject, createProject,