This commit is contained in:
tuxiu21 2024-03-14 19:11:11 +08:00
commit 64e16185bd
3 changed files with 42 additions and 72 deletions

View File

@ -168,7 +168,7 @@ const showDrawer = () => {
function exitLogin(){
requests.logout(token).then((res) => {
if(res.data.code === 200){
router.push("/")
router.push("/login")
console.log(res)
user.isLoggedIn = false; //
message.success("退出成功!")

View File

@ -522,7 +522,7 @@ const projectGetCustom = (data) =>{
return axios({
url:api+ "/project/get/custom",
method: "get",
params: data,
data: data,
headers:{
'Timestamp': getCurrentTimestamp()
}
@ -551,8 +551,7 @@ const messageGet = (token) => {
* 得到tag列表
* @param token
*/
const getTagsProjectList
= (token) =>{
const getTagsProjectList = (token) =>{
return axios({
url:api+ "/tags/project/list",
method: "get",

View File

@ -51,25 +51,26 @@ import router from "@/router/index.js";
const showButton = reactive([]);
const projects = ref([]);
const id =ref(1)
const pageSize = ref(20);
const current1 = ref(3);
// const pageSize = ref(20);
// const current1 = ref(3);
watch(pageSize, () => {
console.log('pageSize', pageSize.value);
});
watch(current1, () => {
console.log('current', current1.value);
});
// watch(pageSize, () => {
// console.log('pageSize', pageSize.value);
// });
// watch(current1, () => {
// console.log('current', current1.value);
// });
onMounted(() =>{
request.getTagsProjectList(token).then(res=>{
console.log(res.data.data)
console.log("tagsData:",res)
tagsData.value=res.data.data
})
getAllProject()
})
function getAllProject(){
request.projectGetCustom(id).then((res)=>{
console.log(res)
request.projectGetCustom(data).then((res)=>{
console.log("project-res:",res)
console.log("data:",data)
// Project.data= res.data.data.data
projects.value = res.data.data;
// console.log(projects.value)
@ -93,16 +94,22 @@ const handleClickAll=(checked)=>{
selectTags.value.forEach((item,index)=>{
selectTags.value[index]=false
})
selectedTags.value = []
// data.tags = []
// getAllProject()
//
request.projectGetCustom(selectedTagNames.value).then(res=>{
projects.value=res.data.data
console.log(res.data.data)
})
// request.projectGetCustom(selectedTagNames.value).then(res=>{
// projects.value=res.data.data
// console.log(res.data.data)
// })
}
console.log("selectedTags",selectedTags.value)
}
const selectedTagNames =ref([])
const selectedTags =ref([])
const selectedTags =ref([])
//
const handleChange = (tag, checked) => {
tag.checked = checked; // checkbox
@ -126,11 +133,13 @@ const handleChange = (tag, checked) => {
tagAll.value = true;
}
}
console.log("selectedTags:", selectedTags.value)
// data.tags = selectedTags.value
// getAllProject()
// selectedTags
request.projectGetCustom(selectedTags).then((res) =>{
projects.value = res.data.data;
})
// request.projectGetCustom(selectedTags).then((res) =>{
// projects.value = res.data.data;
// })
};
@ -146,57 +155,19 @@ console.log(project.id)
// @click="selectedTags.web = !selectedTags.web"
//
const filteredProjects = ref([]);
//
const selectedButtons = ref(['web','ai','大数据']);
const selectionDisabled = ref('');
const selectedStatus = reactive({
weikaishi:true, //1
jinxingzhong:true, //2
yiwancheng:true, //0
stop:true //-1
}); //
const select = reactive({
})
const data = reactive({
tags:[],
id:1,
tags:['web','ai'],
isFinish:[]
})
const clickedButton= ref(null)
//
watch(() => selectedButtons.value, (clickedButton) => {
if (selectedButtons.value === 1){
}
});
watch(selectedStatus, async (newValue, oldValue) => {
if (newValue.stop === true) {
data.isFinish.push(-1)
}
if (newValue.jinxingzhong === true) {
data.isFinish.push(2)
}
if (newValue.weikaishi === true ) {
data.isFinish.push(1)
}
if (newValue.yiwancheng === true) {
data.isFinish.push(0)
}
request.projectGetCustom(data)
data.isFinish = []
watch(() => selectedTags.value.length, async (newValue, oldValue) =>{
data.tags = []
selectedTags.value.forEach((item,index)=>{
data.tags.push(item)
})
getAllProject()
})
</script>