Merge branch 'develop' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage into develop

This commit is contained in:
wyx
2023-01-31 18:42:48 +08:00
5 changed files with 88 additions and 122 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

@@ -29,7 +29,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: {
@@ -37,7 +37,6 @@ const props = defineProps({
default: () => [], default: () => [],
}, },
}); });
console.log("props", props.types);
const tableModelRef = ref(); const tableModelRef = ref();
function submitCall(flag) { function submitCall(flag) {

View File

@@ -8,7 +8,9 @@
> >
<div class="drawerMain" id="ProjCheckship" style=""> <div class="drawerMain" id="ProjCheckship" style="">
<div class="header"> <div class="header">
<div class="headerTitle">权限名单</div> <div class="headerTitle">
权限名单
</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@@ -25,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>
@@ -34,28 +36,16 @@
<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 <template #icon><img style="margin-right: 10px" src="../../assets/images/courseManage/search0.png"/>
><img
style="margin-right: 10px"
src="../../assets/images/courseManage/search0.png"
/>
</template> </template>
搜索 搜索
</a-button> </a-button>
</a-col> </a-col>
<a-col :span="2"> <a-col :span="2">
<a-button <a-button class="cus-btn white" style="width: 100px" @click="reset">
class="cus-btn white" <template #icon><img style="margin-right: 10px" src="../../assets/images/leveladd/reset.png"/>
style="width: 100px"
@click="reset"
>
<template #icon
><img
style="margin-right: 10px"
src="../../assets/images/leveladd/reset.png"
/>
</template> </template>
重置 重置
</a-button> </a-button>
@@ -72,9 +62,7 @@
<template #action="{ record }"> <template #action="{ record }">
<a-space :size="2"> <a-space :size="2">
<slot name="extension" v-bind:data="{ record }"></slot> <slot name="extension" v-bind:data="{ record }"></slot>
<a-button @click="del(record.id)" type="link" danger <a-button v-if="record.type!==6 && record.type!==9 && record.type!==12" @click="del(record.id)" type="link" danger>删除</a-button>
>删除</a-button
>
</a-space> </a-space>
</template> </template>
</a-table> </a-table>
@@ -92,14 +80,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { import {computed, createVNode, defineProps, ref, watch} from "vue";
computed,
createVNode,
defineProps,
defineExpose,
ref,
watch,
} from "vue";
import {usePage} from "@/api/request"; import {usePage} from "@/api/request";
import {STUDENT_LIST} from "@/api/apis"; import {STUDENT_LIST} from "@/api/apis";
import {delStudentList} from "@/api/index1"; import {delStudentList} from "@/api/index1";
@@ -123,14 +104,15 @@ 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,
pid: props.id || "", pid: props.id || '',
}; }
const searchParams = ref(initParams); const searchParams = ref(initParams)
const searchName = ref('')
const columns = ref([ const columns = ref([
{ {
@@ -163,8 +145,7 @@ const columns = ref([
key: "type", key: "type",
width: 30, width: 30,
align: "center", align: "center",
customRender: ({ record: { type } }) => customRender: ({record: {type}}) => ({4: "查看权", 5: "管理权", 6: "归属权",7: "查看权", 8: "管理权", 9: "归属权",10: "查看权", 11: "管理权", 12: "归属权"}[type])
({ 4: "查看权", 5: "管理权", 6: "归属权" }[type]),
}, },
{ {
title: "操作", title: "操作",
@@ -174,41 +155,40 @@ const columns = ref([
align: "center", align: "center",
slots: {customRender: "action"}, slots: {customRender: "action"},
}, },
]); ])
const { const {data: studentList, fetch: searchStu, total, loading} = usePage(STUDENT_LIST, searchParams)
data: studentList,
fetch: searchStu,
total,
loading,
} = usePage(STUDENT_LIST, searchParams.value);
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: () => '确定删除?',
icon: () => createVNode(ExclamationCircleOutlined), icon: () => createVNode(ExclamationCircleOutlined),
content: () => "数据删除后不可恢复!", content: () => '数据删除后不可恢复!',
okText: () => "确定", okText: () => '确定',
okType: "danger", okType: 'danger',
cancelText: () => "取消", cancelText: () => '取消',
onOk() { onOk() {
id && delStudentList({ ids: [id] }).then(() => searchStu()); id && delStudentList({ids: [id]}).then(() => searchStu())
}, },
}); });
} }
@@ -218,19 +198,19 @@ const closeDrawer = () => {
}; };
function reset(){ function reset(){
searchParams.value = initParams; searchParams.value = initParams
searchStu(); searchName.value=''
} }
watch(visiable, () => { watch(visiable, () => {
visiable.value && searchStu(); visiable.value && searchStu()
searchParams.value = initParams; searchParams.value = initParams
}); });
defineExpose({ defineExpose({
searchStu, searchStu,
loading, loading
}); })
</script> </script>
<style lang="scss"> <style lang="scss">
.cus-btn { .cus-btn {

View File

@@ -991,8 +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(() => {
console.log("res", res);
state.doublepro = false; state.doublepro = false;
message.destroy(); message.destroy();
message.success("创建成功"); message.success("创建成功");
@@ -1508,28 +1507,15 @@ export default {
)} )}
{ {
<div className="tableSelect"> <div className="tableSelect">
<a-select <a-select style="width: 50px;" value="授权" dropdownClassName="tabledropdown">
style="width: 50px;"
value="授权"
dropdownClassName="tabledropdown"
>
<a-select-option value="权限名单" label="权限名单"> <a-select-option value="权限名单" label="权限名单">
<TableModelStudent <TableModelStudent types={[4,5,6]} id={value.record.projectId}>权限名单</TableModelStudent>
types={[4, 5, 6]}
id={value.record.projectId}
>
权限名单
</TableModelStudent>
</a-select-option> </a-select-option>
<a-select-option value="查看权" label="查看权"> <a-select-option value="查看权" label="查看权">
<CommonStudent type={4} id={value.record.projectId}> <CommonStudent type={4} id={value.record.projectId}>查看权</CommonStudent>
查看权
</CommonStudent>
</a-select-option> </a-select-option>
<a-select-option value="管理权" label="管理权"> <a-select-option value="管理权" label="管理权">
<CommonStudent type={5} id={value.record.projectId}> <CommonStudent type={5} id={value.record.projectId}>管理权</CommonStudent>
管理权
</CommonStudent>
</a-select-option> </a-select-option>
</a-select> </a-select>
</div> </div>