mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 03:16:44 +08:00
Merge branch 'develop' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage into develop
This commit is contained in:
@@ -49,7 +49,8 @@
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
"node": true,
|
||||
"vue/setup-compiler-macros": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/vue3-essential",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -29,7 +29,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: {
|
||||
@@ -37,7 +37,6 @@ const props = defineProps({
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
console.log("props", props.types);
|
||||
const tableModelRef = ref();
|
||||
|
||||
function submitCall(flag) {
|
||||
|
||||
@@ -1,61 +1,51 @@
|
||||
<template>
|
||||
<div class="CommonStudent">
|
||||
<a-drawer
|
||||
:visible="visiable"
|
||||
class="drawerStyle ProjCheckship"
|
||||
placement="right"
|
||||
width="40%"
|
||||
:visible="visiable"
|
||||
class="drawerStyle ProjCheckship"
|
||||
placement="right"
|
||||
width="40%"
|
||||
>
|
||||
<div class="drawerMain" id="ProjCheckship" style="">
|
||||
<div class="header">
|
||||
<div class="headerTitle">权限名单</div>
|
||||
<div class="headerTitle">
|
||||
权限名单
|
||||
</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="TableStudent">
|
||||
<a-row
|
||||
type="flex"
|
||||
gutter="12"
|
||||
style="padding-left: 20px; margin-right: 0px"
|
||||
type="flex"
|
||||
gutter="12"
|
||||
style="padding-left: 20px; margin-right: 0px"
|
||||
>
|
||||
<a-col>
|
||||
<a-form-item title="姓名:">
|
||||
<a-input
|
||||
class="cus-input"
|
||||
v-model:value="searchParams.studentName"
|
||||
placeholder="请输入姓名"
|
||||
class="cus-input"
|
||||
v-model:value="searchName"
|
||||
placeholder="请输入姓名"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col>
|
||||
<a-button
|
||||
class="cus-btn"
|
||||
style="background: #4ea6ff; color: #fff; width: 100px"
|
||||
@click="searchStu"
|
||||
class="cus-btn"
|
||||
style="background: #4ea6ff; color: #fff; width: 100px"
|
||||
@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>
|
||||
搜索
|
||||
</a-button>
|
||||
</a-col>
|
||||
<a-col :span="2">
|
||||
<a-button
|
||||
class="cus-btn white"
|
||||
style="width: 100px"
|
||||
@click="reset"
|
||||
>
|
||||
<template #icon
|
||||
><img
|
||||
style="margin-right: 10px"
|
||||
src="../../assets/images/leveladd/reset.png"
|
||||
/>
|
||||
<a-button class="cus-btn white" style="width: 100px" @click="reset">
|
||||
<template #icon><img style="margin-right: 10px" src="../../assets/images/leveladd/reset.png"/>
|
||||
</template>
|
||||
重置
|
||||
</a-button>
|
||||
@@ -63,18 +53,16 @@
|
||||
</a-row>
|
||||
<div style="margin-top: 20px">
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="studentList"
|
||||
:pagination="stuPagination"
|
||||
:loading="loading"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:data-source="studentList"
|
||||
:pagination="stuPagination"
|
||||
:loading="loading"
|
||||
row-key="id"
|
||||
>
|
||||
<template #action="{ record }">
|
||||
<a-space :size="2">
|
||||
<slot name="extension" v-bind:data="{ record }"></slot>
|
||||
<a-button @click="del(record.id)" type="link" danger
|
||||
>删除</a-button
|
||||
>
|
||||
<a-button v-if="record.type!==6 && record.type!==9 && record.type!==12" @click="del(record.id)" type="link" danger>删除</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-table>
|
||||
@@ -92,19 +80,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
createVNode,
|
||||
defineProps,
|
||||
defineExpose,
|
||||
ref,
|
||||
watch,
|
||||
} from "vue";
|
||||
import { usePage } from "@/api/request";
|
||||
import { STUDENT_LIST } from "@/api/apis";
|
||||
import { delStudentList } from "@/api/index1";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import {computed, createVNode, defineProps, ref, watch} from "vue";
|
||||
import {usePage} from "@/api/request";
|
||||
import {STUDENT_LIST} from "@/api/apis";
|
||||
import {delStudentList} from "@/api/index1";
|
||||
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
|
||||
import {Modal} from "ant-design-vue";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
@@ -123,14 +104,15 @@ const visiable = ref(false);
|
||||
|
||||
const initParams = {
|
||||
studentName: "",
|
||||
page: 1,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
type: props.type || "",
|
||||
type: props.type || '',
|
||||
types: props.types,
|
||||
pid: props.id || "",
|
||||
};
|
||||
pid: props.id || '',
|
||||
}
|
||||
|
||||
const searchParams = ref(initParams);
|
||||
const searchParams = ref(initParams)
|
||||
const searchName = ref('')
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
@@ -163,8 +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: "操作",
|
||||
@@ -172,43 +153,42 @@ const columns = ref([
|
||||
key: "operation",
|
||||
width: 50,
|
||||
align: "center",
|
||||
slots: { customRender: "action" },
|
||||
slots: {customRender: "action"},
|
||||
},
|
||||
]);
|
||||
])
|
||||
|
||||
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: () => "确定删除?",
|
||||
title: () => '确定删除?',
|
||||
icon: () => createVNode(ExclamationCircleOutlined),
|
||||
content: () => "数据删除后不可恢复!",
|
||||
okText: () => "确定",
|
||||
okType: "danger",
|
||||
cancelText: () => "取消",
|
||||
content: () => '数据删除后不可恢复!',
|
||||
okText: () => '确定',
|
||||
okType: 'danger',
|
||||
cancelText: () => '取消',
|
||||
onOk() {
|
||||
id && delStudentList({ ids: [id] }).then(() => searchStu());
|
||||
id && delStudentList({ids: [id]}).then(() => searchStu())
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -217,20 +197,20 @@ const closeDrawer = () => {
|
||||
visiable.value = false;
|
||||
};
|
||||
|
||||
function reset() {
|
||||
searchParams.value = initParams;
|
||||
searchStu();
|
||||
function reset(){
|
||||
searchParams.value = initParams
|
||||
searchName.value=''
|
||||
}
|
||||
|
||||
watch(visiable, () => {
|
||||
visiable.value && searchStu();
|
||||
searchParams.value = initParams;
|
||||
visiable.value && searchStu()
|
||||
searchParams.value = initParams
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
searchStu,
|
||||
loading,
|
||||
});
|
||||
loading
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.cus-btn {
|
||||
|
||||
@@ -991,8 +991,7 @@ export default {
|
||||
message.destroy();
|
||||
return message.warning("项目名称重复,请重新填写");
|
||||
}
|
||||
api.createProject(state.projectInfo).then((res) => {
|
||||
console.log("res", res);
|
||||
api.createProject(state.projectInfo).then(() => {
|
||||
state.doublepro = false;
|
||||
message.destroy();
|
||||
message.success("创建成功");
|
||||
@@ -1508,30 +1507,17 @@ export default {
|
||||
)}
|
||||
{
|
||||
<div className="tableSelect">
|
||||
<a-select
|
||||
style="width: 50px;"
|
||||
value="授权"
|
||||
dropdownClassName="tabledropdown"
|
||||
>
|
||||
<a-select-option value="权限名单" label="权限名单">
|
||||
<TableModelStudent
|
||||
types={[4, 5, 6]}
|
||||
id={value.record.projectId}
|
||||
>
|
||||
权限名单
|
||||
</TableModelStudent>
|
||||
</a-select-option>
|
||||
<a-select-option value="查看权" label="查看权">
|
||||
<CommonStudent type={4} id={value.record.projectId}>
|
||||
查看权
|
||||
</CommonStudent>
|
||||
</a-select-option>
|
||||
<a-select-option value="管理权" label="管理权">
|
||||
<CommonStudent type={5} id={value.record.projectId}>
|
||||
管理权
|
||||
</CommonStudent>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-select style="width: 50px;" value="授权" dropdownClassName="tabledropdown">
|
||||
<a-select-option value="权限名单" label="权限名单">
|
||||
<TableModelStudent types={[4,5,6]} id={value.record.projectId}>权限名单</TableModelStudent>
|
||||
</a-select-option>
|
||||
<a-select-option value="查看权" label="查看权">
|
||||
<CommonStudent type={4} id={value.record.projectId}>查看权</CommonStudent>
|
||||
</a-select-option>
|
||||
<a-select-option value="管理权" label="管理权">
|
||||
<CommonStudent type={5} id={value.record.projectId}>管理权</CommonStudent>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
}
|
||||
{value.record.type === 1 ? (
|
||||
|
||||
Reference in New Issue
Block a user