feat:增加项目授权以及修改新建项目

This commit is contained in:
lixg
2022-11-28 22:47:30 +08:00
parent 032df5bb71
commit 33e9e1bb93
16 changed files with 1135 additions and 665 deletions

View File

@@ -167,6 +167,7 @@
allowClear
showSearch
:disabled="viewDetail ? true : false"
@popupScroll="memberScroll"
>
</a-select>
</div>
@@ -192,7 +193,6 @@
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
placeholder="自动带出 可修改"
allow-clear
tree-default-expand-all
:tree-data="classifyList2"
:fieldNames="{
children: 'treeChildList',
@@ -416,7 +416,7 @@ import dayjs from "dayjs";
import * as api from "../../api/index";
import * as api1 from "../../api/index1";
import { storage } from "../../api/storage";
import { toDate } from "../../api/method";
import { toDate, scrollLoad } from "../../api/method";
import { useStore } from "vuex";
export default {
name: "projectAdd",
@@ -441,6 +441,9 @@ export default {
pageSize: 10, //每页10条数据
totalPages: 0, //总页数
viewDetail: routers.query.viewDetail ? routers.query.viewDetail : null,
currentPage1: 1, //项目经理
pageSize1: 10, //项目经理
});
//分类列表
const classifyList = ref([]);
@@ -764,12 +767,47 @@ export default {
endTime = new Date(dateString[1]).getTime() / 1000;
};
// 项目经理 后续接口调用
const classifyList1 = ref([
{ value: 1, label: "李俊国" },
{ value: 2, label: "将小米" },
{ value: 3, label: "刘孟君" },
]);
//获取
const classifyList1 = ref([]);
//获取学员
const getMember = () => {
api1
.getMemberInfo({
pageNo: state.currentPage1,
pageSize: state.pageSize1,
keyWord: "",
})
.then((res) => {
if (res.data.code === 200) {
let arr = res.data.data.rows;
let array = classifyList1.value;
arr.map((value) => {
let obj = {
value: value.id,
label: value.realName,
};
array.push(obj);
});
classifyList1.value = array;
console.log("获取学员", res.data);
// classifyList1.value = res.data.data.rows;
// state.tableDataTotal = res.data.data.total;
// return res.data.data.rows;
}
});
};
getMember();
//学员滚动加载信息
const memberScroll = (e) => {
// console.log("滚动", e, b);
let num = scrollLoad(e);
if (num === 1) {
state.currentPage1 = 1;
} else if (num === 2) {
// 如果滑到底部,则加载下一页
state.currentPage1++;
getMember();
}
};
//选择处理项目经理
let manager = "";
@@ -929,19 +967,13 @@ export default {
//模版滚动加载模板信息
const templateScroll = (e) => {
// console.log("滚动", e, b);
const { target } = e;
const scrllHeight = target.scrollHeight - target.scrollTop;
const clientHeight = target.clientHeight;
// console.log("scrllHeight", scrllHeight, clientHeight);
if (scrllHeight === 0 && clientHeight === 0) {
let num = scrollLoad(e);
if (num === 1) {
state.currentPage = 1;
} else if (scrllHeight - clientHeight == 0) {
// 下拉到底部时
if (state.currentPage < state.totalPages) {
// 如果滑到底部,则加载下一页
state.currentPage++;
getTemplate();
}
} else if (num === 2) {
// 如果滑到底部,则加载下一页
state.currentPage++;
getTemplate();
}
};
@@ -1159,6 +1191,7 @@ export default {
dateFormatList,
templateScroll,
memberScroll,
};
},
};