--fix 项目草稿

This commit is contained in:
yuping
2023-02-16 19:26:29 +08:00
parent 40dc5f939e
commit e21c4a03ab
3 changed files with 166 additions and 215 deletions

View File

@@ -52,7 +52,6 @@ function beforeunloadHandler() {
function init() { function init() {
getUserInfo(); getUserInfo();
getMemberInfo();
getUserPermission(); getUserPermission();
initDict("content_type"); //内容分类 initDict("content_type"); //内容分类
initDict("project_level"); //项目级别 initDict("project_level"); //项目级别
@@ -70,19 +69,6 @@ function unloadHandler() {
} }
} }
async function getMemberInfo() {
const list = localStorage.getItem("memberInitInfo");
if (list) {
store.commit("SET_MEMBER_INFO", JSON.parse(list));
return;
}
const memberInitInfo = await api1
.getMemberInfo({keyWord: "", pageNo: 1, pageSize: 10})
.then((res) => res.data.data.rows);
store.commit("SET_MEMBER_INFO", memberInitInfo);
localStorage.setItem("memberInitInfo", JSON.stringify(memberInitInfo));
}
async function getUserInfo() { async function getUserInfo() {
const userInfo = await api2.userInfo(); const userInfo = await api2.userInfo();
store.commit("SET_USER", userInfo.data.data); store.commit("SET_USER", userInfo.data.data);

View File

@@ -1,172 +1,172 @@
<template> <!--<template>-->
<a-select <!-- <a-select-->
:getPopupContainer=" <!-- :getPopupContainer="-->
(triggerNode) => { <!-- (triggerNode) => {-->
return triggerNode.parentNode || document.body; <!-- return triggerNode.parentNode || document.body;-->
} <!-- }-->
" <!-- "-->
v-model:value="managerArray" <!-- v-model:value="managerArray"-->
:placeholder="placeholder" <!-- :placeholder="placeholder"-->
:filterOption="false" <!-- :filterOption="false"-->
style="width: 100%" <!-- style="width: 100%"-->
:options="options" <!-- :options="options"-->
allowClear <!-- allowClear-->
showSearch <!-- showSearch-->
:mode="mode" <!-- :mode="mode"-->
:disabled="disabled" <!-- :disabled="disabled"-->
@popupScroll="memberScroll" <!-- @popupScroll="memberScroll"-->
@search="searchMember" <!-- @search="searchMember"-->
@change="change" <!-- @change="change"-->
> <!-- >-->
<template v-if="loading" #notFoundContent> <!-- <template v-if="loading" #notFoundContent>-->
<a-spin size="small" /> <!-- <a-spin size="small" />-->
</template> <!-- </template>-->
</a-select> <!-- </a-select>-->
</template> <!--</template>-->
<script> <!--<script>-->
import { onMounted, reactive, toRefs, watch } from "vue"; <!--import { onMounted, reactive, toRefs, watch } from "vue";-->
import { scrollLoad, throttle } from "@/api/method"; <!--import { scrollLoad, throttle } from "@/api/method";-->
import * as api1 from "@/api/index1"; <!--import * as api1 from "@/api/index1";-->
export default { <!--export default {-->
name: "ProjectClass", <!-- name: "ProjectClass",-->
props: { <!-- props: {-->
value: { <!-- value: {-->
type: String, <!-- type: String,-->
default: "", <!-- default: "",-->
}, <!-- },-->
name: { <!-- name: {-->
type: String, <!-- type: String,-->
default: "", <!-- default: "",-->
}, <!-- },-->
disabled: { <!-- disabled: {-->
type: Boolean, <!-- type: Boolean,-->
default: false, <!-- default: false,-->
}, <!-- },-->
placeholder: { <!-- placeholder: {-->
type: String, <!-- type: String,-->
default: "请选择", <!-- default: "请选择",-->
}, <!-- },-->
// 'multiple' | 'tags' <!-- // 'multiple' | 'tags'-->
mode: { <!-- mode: {-->
type: String, <!-- type: String,-->
default: "select", <!-- default: "select",-->
}, <!-- },-->
}, <!-- },-->
setup(props, ctx) { <!-- setup(props, ctx) {-->
const state = reactive({ <!-- const state = reactive({-->
options: [], <!-- options: [],-->
managerArray: [], <!-- managerArray: [],-->
memberParam: { keyWord: "", pageNo: 1, pageSize: 10 }, <!-- memberParam: { keyWord: "", pageNo: 1, pageSize: 10 },-->
loading: false, <!-- loading: false,-->
init: false, <!-- init: false,-->
}); <!-- });-->
watch(() => state.memberParam.keyWord, throttle(getMember, 500)); <!-- watch(() => state.memberParam.keyWord, throttle(getMember, 500));-->
watch(() => state.memberParam.pageNo, throttle(getPushMember, 500)); <!-- watch(() => state.memberParam.pageNo, throttle(getPushMember, 500));-->
watch(props, init); <!-- watch(props, init);-->
onMounted(() => { <!-- onMounted(() => {-->
console.log("onMounted"); <!-- console.log("onMounted");-->
init(); <!-- init();-->
}); <!-- });-->
function getMember() { <!-- function getMember() {-->
state.loading = true; <!-- state.loading = true;-->
state.options = []; <!-- state.options = [];-->
getMemberData(); <!-- getMemberData();-->
} <!-- }-->
function getPushMember() { <!-- function getPushMember() {-->
state.loading = true; <!-- state.loading = true;-->
getMemberData(); <!-- getMemberData();-->
} <!-- }-->
function getMemberData() { <!-- function getMemberData() {-->
console.log("getMemberData"); <!-- console.log("getMemberData");-->
api1.getMemberInfo(state.memberParam).then((res) => { <!-- api1.getMemberInfo(state.memberParam).then((res) => {-->
const list = res.data.data.rows <!-- const list = res.data.data.rows-->
.filter((e) => !(props.value + "")?.includes(e.id + "")) <!-- .filter((e) => !(props.value + "")?.includes(e.id + ""))-->
.map((e) => ({ <!-- .map((e) => ({-->
label: e.realName, <!-- label: e.realName,-->
value: e.id, <!-- value: e.id,-->
})); <!-- }));-->
if (state.memberParam.pageNo === 1 && props.value) { <!-- if (state.memberParam.pageNo === 1 && props.value) {-->
const arrManagerId = (props.value + "").split(","); <!-- const arrManagerId = (props.value + "").split(",");-->
const arrManager = props.name.split(","); <!-- const arrManager = props.name.split(",");-->
state.options = [ <!-- state.options = [-->
...arrManager.map((e, i) => ({ label: e, value: arrManagerId[i] })), <!-- ...arrManager.map((e, i) => ({ label: e, value: arrManagerId[i] })),-->
...list, <!-- ...list,-->
]; <!-- ];-->
} else state.options.push(...list); <!-- } else state.options.push(...list);-->
state.loading = false; <!-- state.loading = false;-->
}); <!-- });-->
} <!-- }-->
const memberScroll = (e) => { <!-- const memberScroll = (e) => {-->
let num = scrollLoad(e); <!-- let num = scrollLoad(e);-->
if (num === 2) { <!-- if (num === 2) {-->
// 如果滑到底部,则加载下一页 <!-- // 如果滑到底部,则加载下一页-->
state.memberParam.pageNo++; <!-- state.memberParam.pageNo++;-->
} <!-- }-->
}; <!-- };-->
//搜索学员 <!-- //搜索学员-->
const searchMember = (keyWord) => { <!-- const searchMember = (keyWord) => {-->
keyWord && (state.memberParam = { keyWord, pageNo: 1, pageSize: 10 }); <!-- keyWord && (state.memberParam = { keyWord, pageNo: 1, pageSize: 10 });-->
}; <!-- };-->
function init() { <!-- function init() {-->
console.log("init--", props); <!-- console.log("init&#45;&#45;", props);-->
console.log(Array.isArray(state.managerArray)); <!-- console.log(Array.isArray(state.managerArray));-->
if ( <!-- if (-->
props.value + "" !== <!-- props.value + "" !==-->
(Array.isArray(state.managerArray) <!-- (Array.isArray(state.managerArray)-->
? state.managerArray.join(",") <!-- ? state.managerArray.join(",")-->
: state.managerArray + "") <!-- : state.managerArray + "")-->
) { <!-- ) {-->
if (props.value) { <!-- if (props.value) {-->
const arrManager = props.name.split(","); <!-- const arrManager = props.name.split(",");-->
const arrManagerId = (props.value + "").split(","); <!-- const arrManagerId = (props.value + "").split(",");-->
state.managerArray = <!-- state.managerArray =-->
props.mode === "select" ? props.value : arrManagerId; <!-- props.mode === "select" ? props.value : arrManagerId;-->
state.options = arrManager.map((e, i) => ({ <!-- state.options = arrManager.map((e, i) => ({-->
label: e, <!-- label: e,-->
value: arrManagerId[i], <!-- value: arrManagerId[i],-->
})); <!-- }));-->
} else { <!-- } else {-->
state.managerArray = []; <!-- state.managerArray = [];-->
} <!-- }-->
// getMemberData(); <!-- // getMemberData();-->
return; <!-- return;-->
} <!-- }-->
if (!props.value) { <!-- if (!props.value) {-->
if (!(state.options && state.options.length)) { <!-- if (!(state.options && state.options.length)) {-->
state.options = []; <!-- state.options = [];-->
// getMember(); <!-- // getMember();-->
} <!-- }-->
return; <!-- return;-->
} <!-- }-->
} <!-- }-->
function change(e, l) { <!-- function change(e, l) {-->
console.log("change", l); <!-- console.log("change", l);-->
if (Array.isArray(l)) { <!-- if (Array.isArray(l)) {-->
ctx.emit("update:value", l.map((t) => t.value).join(",")); <!-- ctx.emit("update:value", l.map((t) => t.value).join(","));-->
ctx.emit("update:name", l.map((t) => t.label).join(",")); <!-- ctx.emit("update:name", l.map((t) => t.label).join(","));-->
} else { <!-- } else {-->
ctx.emit("update:value", l.value); <!-- ctx.emit("update:value", l.value);-->
ctx.emit("update:name", l.label); <!-- ctx.emit("update:name", l.label);-->
} <!-- }-->
} <!-- }-->
return { <!-- return {-->
...toRefs(state), <!-- ...toRefs(state),-->
searchMember, <!-- searchMember,-->
memberScroll, <!-- memberScroll,-->
change, <!-- change,-->
}; <!-- };-->
}, <!-- },-->
}; <!--};-->
</script> <!--</script>-->

View File

@@ -3974,28 +3974,13 @@ export default {
const getTaskInfo = () => { const getTaskInfo = () => {
getTask({ getTask({
projectId: state.projectId, projectId: state.projectId,
useTask: "N",
}).then((res) => { }).then((res) => {
console.log("get task", res.data.data);
if (res.data.code === 200) {
// 判断当前审核是否通过
if ( if (
res.data.data.projectAuditLogDtoList && res.data.data.projectAuditLogDtoList &&
res.data.data.projectAuditLogDtoList.length res.data.data.projectAuditLogDtoList.length
) { ) {
console.log("审核信息是什么", res.data.data.projectAuditLogDtoList);
let dataset = res.data.data.projectAuditLogDtoList; let dataset = res.data.data.projectAuditLogDtoList;
state.passInfo = dataset[dataset.length - 1].description; state.passInfo = dataset[dataset.length - 1].description;
/**
for (let i = 0; i < dataset.length; i++) {
if (dataset[i].status == -5) {
state.isPass = true;
state.passInfo = dataset[i].description;
}
// isPass passInfo
}
*/
} }
state.stage = res.data.data.stageList.map((e) => ({ state.stage = res.data.data.stageList.map((e) => ({
id: e.stageId, id: e.stageId,
@@ -4003,9 +3988,7 @@ export default {
})); }));
let info = res.data.data.projectInfo; let info = res.data.data.projectInfo;
state.permissions = info.permissions; state.permissions = info.permissions;
// let start = toDate(info.beginTime / 1000, "Y-M-D h:m");
let start = info.beginTime; let start = info.beginTime;
// let end = toDate(info.endTime / 1000, "Y-M-D h:m");
let end = info.endTime; let end = info.endTime;
state.tstartTime = info.beginTime; state.tstartTime = info.beginTime;
state.tendTime = info.endTime; state.tendTime = info.endTime;
@@ -4021,9 +4004,9 @@ export default {
state.tlevel = info.level; state.tlevel = info.level;
state.systemId = info.systemId; state.systemId = info.systemId;
state.tsystemId = info.systemId; state.tsystemId = info.systemId;
state.checkedSty = info.courseSyncFlag == 1 ? true : false; state.checkedSty = info.courseSyncFlag == 1;
state.courseSyncFlag = info.courseSyncFlag; state.courseSyncFlag = info.courseSyncFlag;
state.checkedBOEU = info.boeFlag == 1 ? true : false; state.checkedBOEU = info.boeFlag == 1;
state.boeFlag = info.boeFlag; state.boeFlag = info.boeFlag;
state.picUrl = info.picUrl; state.picUrl = info.picUrl;
state.managerId = info.managerId; state.managerId = info.managerId;
@@ -4032,34 +4015,16 @@ export default {
state.type = info.type; state.type = info.type;
state.category = info.category; state.category = info.category;
state.noticeFlag = info.noticeFlag; state.noticeFlag = info.noticeFlag;
state.switchopen = info.attachSwitch == 1 ? true : false; state.switchopen = info.attachSwitch == 1;
state.docChecked = info.attachSwitch == 1 ? true : false; state.docChecked = info.attachSwitch === 1;
state.hasTask = !!res.data.data?.stageList.some( state.hasTask = !!res.data.data?.stageList.some(
({ taskList }) => taskList.length ({ taskList }) => taskList.length
); );
// state.attach = info.attach; // state.attach = info.attach;
// state.templateId = info.templateId; // state.templateId = info.templateId;
state.sourceBelong = state.sourceBelong = (info.sourceBelongFullName || "") + info.sourceBelongName;
(info.sourceBelongFullName || "") + info.sourceBelongName;
// state.fileList=info.attach.split(",") // state.fileList=info.attach.split(",")
let d = info.attach.indexOf(","); state.fileList = info.attach?JSON.parse(info.attach):[];
// console.log(info.attach, "xgo", info.attach.length);
if (info.attach.length == 0) {
return;
} else if (info.attach.length !== 0 && d == -1) {
return;
} else {
// console.log(info.attach, "xgo");
// let str = JSON.parse(info.attach)
// console.log("赚回来",str)
// let luj = info.attach.split(",")
let luj = info.attach;
// console.log("lulj", luj);
console.log("赚回来", JSON.parse(luj));
state.fileList = JSON.parse(luj);
// state.fileList = luj
}
}
}); });
}; };
//获取小组列表 //获取小组列表