--fix 添加归属权

This commit is contained in:
yuping
2023-01-31 17:27:58 +08:00
parent a4542cf798
commit 9e972b2ae4
6 changed files with 28 additions and 21 deletions

View File

@@ -49,7 +49,8 @@
"eslintConfig": {
"root": true,
"env": {
"node": true
"node": true,
"vue/setup-compiler-macros": true
},
"extends": [
"plugin:vue/vue3-essential",

View File

@@ -121,11 +121,17 @@ export function usePage(_url, params, init = true) {
})
if (isRef(params)) {
watch(params, () => {
watch(params.value, () => {
fetch()
})
}
if (isRef(_url)) {
watchEffect(fetch)
} else {
init && fetch()
}
function reset(){
state.data = []
state.loading = false
@@ -142,12 +148,6 @@ export function usePage(_url, params, init = true) {
})
}
if (isRef(_url)) {
watchEffect(fetch)
} else {
init && fetch()
}
return {
...toRefs(state),
fetch,

View File

@@ -13,7 +13,7 @@ import {defineProps, ref} from "vue";
import TableModelStudent from "@/components/student/TableModelStudent";
import CommonStudent from "@/components/student/CommonStudent";
const props = defineProps({
defineProps({
id: String,
type: Number,
types: {

View File

@@ -27,7 +27,7 @@
<a-form-item title="姓名:">
<a-input
class="cus-input"
v-model:value="searchParams.studentName"
v-model:value="searchName"
placeholder="请输入姓名"
/>
</a-form-item>
@@ -36,7 +36,7 @@
<a-button
class="cus-btn"
style="background: #4ea6ff; color: #fff; width: 100px"
@click="searchStu"
@click="search"
>
<template #icon><img style="margin-right: 10px" src="../../assets/images/courseManage/search0.png"/>
</template>
@@ -104,7 +104,7 @@ const visiable = ref(false);
const initParams = {
studentName: "",
page: 1,
pageNo: 1,
pageSize: 10,
type: props.type || '',
types: props.types,
@@ -112,6 +112,7 @@ const initParams = {
}
const searchParams = ref(initParams)
const searchName = ref('')
const columns = ref([
{
@@ -144,7 +145,7 @@ const columns = ref([
key: "type",
width: 30,
align: "center",
customRender: ({record: {type}}) => ({4: "查看权", 5: "管理权", 6: "归属权"}[type]),
customRender: ({record: {type}}) => ({4: "查看权", 5: "管理权", 6: "归属权",7: "查看权", 8: "管理权", 9: "归属权",10: "查看权", 11: "管理权", 12: "归属权"}[type])
},
{
title: "操作",
@@ -156,24 +157,28 @@ const columns = ref([
},
])
const {data: studentList, fetch: searchStu, total, loading} = usePage(STUDENT_LIST, searchParams.value)
const {data: studentList, fetch: searchStu, total, loading} = usePage(STUDENT_LIST, searchParams)
const stuPagination = computed(() => ({
total: total,
total:total.value,
showSizeChanger: false,
current: searchParams.value.page,
current: searchParams.value.pageNo,
pageSize: searchParams.value.pageSize,
onChange: changePagination,
onChange: changePagination
}));
const openDrawer = () => {
visiable.value = true;
};
const changePagination = (page) => {
searchParams.value.page = page;
searchStu();
searchParams.value.pageNo = page;
};
function search(){
searchParams.value.studentName = searchName.value
searchParams.value.pageNo = 1
}
function del(id) {
Modal.confirm({
title: () => '确定删除?',
@@ -194,7 +199,7 @@ const closeDrawer = () => {
function reset(){
searchParams.value = initParams
searchStu()
searchName.value=''
}
watch(visiable, () => {

View File

@@ -305,6 +305,7 @@ import {storage} from "../../api/storage";
import * as api2 from "../../api/indexAudit";
import {validateName} from "@/api/index1";
import dayjs from "dayjs";
import {scrollLoad} from "@/api/method";
export default {
name: "projectAdd",

View File

@@ -991,7 +991,7 @@ export default {
message.destroy();
return message.warning("项目名称重复,请重新填写");
}
api.createProject(state.projectInfo).then((res) => {
api.createProject(state.projectInfo).then(() => {
state.doublepro = false;
message.destroy();
message.success("创建成功");