--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": { "eslintConfig": {
"root": true, "root": true,
"env": { "env": {
"node": true "node": true,
"vue/setup-compiler-macros": true
}, },
"extends": [ "extends": [
"plugin:vue/vue3-essential", "plugin:vue/vue3-essential",

View File

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

View File

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

View File

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

View File

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

View File

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