|
@@ -1,49 +1,68 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <div class="tw-bg-white tw-p-5 tw-rounded-xl tw-mb-5">
|
|
|
- <RootOrgSelect v-if="store.isSuperAdmin" v-model:value="rootOrgId" />
|
|
|
-
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <a-input
|
|
|
- v-model:value="code"
|
|
|
- style="width: 178px"
|
|
|
- placeholder="科目代码"
|
|
|
- allowClear
|
|
|
- ></a-input>
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <a-input
|
|
|
- v-model:value="name"
|
|
|
- class="tw-mr-4"
|
|
|
- style="width: 178px"
|
|
|
- placeholder="科目名称"
|
|
|
- allowClear
|
|
|
- ></a-input>
|
|
|
-
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <CourseTypeSelect v-model:value="type" />
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <StateSelect v-model:value="enable" />
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <a-button class="query-btn" @click="clickSearch">查询</a-button>
|
|
|
+ <div class="part-box">
|
|
|
+ <a-space class="filter-line" :size="12">
|
|
|
+ <RootOrgSelect v-if="store.isSuperAdmin" v-model:value="rootOrgId" />
|
|
|
+ <a-input
|
|
|
+ v-model:value="code"
|
|
|
+ placeholder="请输入"
|
|
|
+ allowClear
|
|
|
+ prefix="科目代码"
|
|
|
+ ></a-input>
|
|
|
+ <a-input
|
|
|
+ v-model:value="name"
|
|
|
+ class="tw-mr-4"
|
|
|
+ placeholder="请输入"
|
|
|
+ prefix="科目名称"
|
|
|
+ allowClear
|
|
|
+ ></a-input>
|
|
|
+ <CourseTypeSelect v-model:value="type" />
|
|
|
+ <StateSelect v-model:value="enable" />
|
|
|
+ <a-button type="primary" @click="clickSearch">查询</a-button>
|
|
|
+ </a-space>
|
|
|
</div>
|
|
|
|
|
|
- <div
|
|
|
- v-if="store.isGreaterThanEqualRootOrgAdmin"
|
|
|
- class="tw-flex tw-gap-2 tw-my-4"
|
|
|
- >
|
|
|
- <a-button type="primary" @click="newCourse">新增</a-button>
|
|
|
- <a-button @click="importModalVisible = true">批量导入</a-button>
|
|
|
- <a-button @click="handleExport">批量导出</a-button>
|
|
|
- <a-button @click="handleToggleCourses(true, selectIds)">
|
|
|
- 批量启用
|
|
|
- </a-button>
|
|
|
- <a-button @click="handleToggleCourses(false, selectIds)">
|
|
|
- 批量禁用
|
|
|
- </a-button>
|
|
|
- </div>
|
|
|
+ <div class="part-box">
|
|
|
+ <a-space
|
|
|
+ v-if="store.isGreaterThanEqualRootOrgAdmin"
|
|
|
+ class="part-action"
|
|
|
+ :size="6"
|
|
|
+ >
|
|
|
+ <a-button type="text" @click="newCourse">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="add"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 新增
|
|
|
+ </a-button>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a-button type="text" @click="importModalVisible = true">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="import"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 导入
|
|
|
+ </a-button>
|
|
|
+ <a-button type="text" @click="handleExport">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="export"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 导出
|
|
|
+ </a-button>
|
|
|
+ <a-button type="text" @click="handleToggleCourses(true, selectIds)">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="enable"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 启用
|
|
|
+ </a-button>
|
|
|
+ <a-button type="text" @click="handleToggleCourses(false, selectIds)">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="disable"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 禁用
|
|
|
+ </a-button>
|
|
|
+ </a-space>
|
|
|
|
|
|
- <div class="tw-bg-white tw-p-5 tw-rounded-xl">
|
|
|
<a-table
|
|
|
+ class="page-table"
|
|
|
rowKey="id"
|
|
|
:columns="columns"
|
|
|
:scroll="{ x: 1500 }"
|
|
@@ -56,8 +75,10 @@
|
|
|
pageSize: pageSize,
|
|
|
current: pageNo,
|
|
|
total: totalElements,
|
|
|
- showTotal: () => ``,
|
|
|
- onChange: (pageNoChanged, pageSizeChanged) => {
|
|
|
+ showQuickJumper:true,
|
|
|
+ showSizeChanger:true,
|
|
|
+ showTotal: (total:number) => `共 ${total} 项数据`,
|
|
|
+ onChange: (pageNoChanged:number, pageSizeChanged:number) => {
|
|
|
selectIds = [];
|
|
|
pageNo = pageNoChanged;
|
|
|
pageSize = pageSizeChanged;
|
|
@@ -71,7 +92,6 @@
|
|
|
>
|
|
|
{{ record.rootOrgName }}({{ record.rootOrgCode }})
|
|
|
</a-tooltip>
|
|
|
- <!-- <a>{{ record.rootOrgName }}({{ record.rootOrgCode }})</a> -->
|
|
|
</template>
|
|
|
<template #name="{ record }">
|
|
|
<a-tooltip placement="topLeft">
|
|
@@ -80,18 +100,22 @@
|
|
|
</a-tooltip>
|
|
|
</template>
|
|
|
<template #type="{ text }">
|
|
|
- <a>{{ $filters.courseTypeFilter(text) }}</a>
|
|
|
+ <span>{{ $filters.courseTypeFilter(text) }}</span>
|
|
|
</template>
|
|
|
<template #enable="{ text }">
|
|
|
- <a>{{ $filters.booleanEnableDisableFilter(text) }}</a>
|
|
|
+ <status-tag :value="text" type="enable"></status-tag>
|
|
|
</template>
|
|
|
<template #action="{ record }">
|
|
|
- <span v-if="store.isGreaterThanEqualRootOrgAdmin">
|
|
|
- <a-button @click="showModal(record)">编辑</a-button>
|
|
|
- <a-button @click="handleToggleCourses(!record.enable, [record.id])">
|
|
|
+ <div v-if="store.isGreaterThanEqualRootOrgAdmin" class="action-cell">
|
|
|
+ <a-button type="text" @click="showModal(record)">编辑</a-button>
|
|
|
+ <a-button
|
|
|
+ type="text"
|
|
|
+ :danger="record.enable"
|
|
|
+ @click="handleToggleCourses(!record.enable, [record.id])"
|
|
|
+ >
|
|
|
{{ record.enable ? "禁用" : "启用" }}
|
|
|
</a-button>
|
|
|
- </span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</div>
|
|
@@ -101,6 +125,7 @@
|
|
|
title="科目信息页"
|
|
|
okText="确定"
|
|
|
cancelText="取消"
|
|
|
+ :width="438"
|
|
|
@ok="handleOk"
|
|
|
>
|
|
|
<a-form :labelCol="{ span: 4 }">
|
|
@@ -136,14 +161,12 @@
|
|
|
title="批量科目导入"
|
|
|
okText="确定"
|
|
|
cancelText="取消"
|
|
|
+ :width="438"
|
|
|
@ok="handleImport"
|
|
|
>
|
|
|
<a-form>
|
|
|
- <a-form-item label="学校">
|
|
|
- <RootOrgSelect
|
|
|
- v-show="store.isSuperAdmin"
|
|
|
- v-model:value="courseObj.rootOrgId"
|
|
|
- />
|
|
|
+ <a-form-item v-if="store.isSuperAdmin" label="学校">
|
|
|
+ <RootOrgSelect v-model:value="courseObj.rootOrgId" />
|
|
|
</a-form-item>
|
|
|
<a-form-item label="文件地址">
|
|
|
<input id="file-input" :multiple="false" type="file" />
|
|
@@ -218,20 +241,20 @@ const columns = [
|
|
|
{
|
|
|
title: "学校",
|
|
|
dataIndex: "rootOrgName",
|
|
|
- width: 200,
|
|
|
+ minWidth: 200,
|
|
|
slots: { customRender: "rootOrgName" },
|
|
|
ellipses: true,
|
|
|
},
|
|
|
{
|
|
|
title: "科目代码",
|
|
|
dataIndex: "code",
|
|
|
- width: 100,
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
title: "科目名称",
|
|
|
dataIndex: "name",
|
|
|
slots: { customRender: "name" },
|
|
|
- width: 180,
|
|
|
+ minWidth: 120,
|
|
|
},
|
|
|
{
|
|
|
title: "科目类型",
|
|
@@ -243,7 +266,7 @@ const columns = [
|
|
|
title: "状态",
|
|
|
dataIndex: "enable",
|
|
|
slots: { customRender: "enable" },
|
|
|
- width: 60,
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
title: "创建时间",
|
|
@@ -253,7 +276,7 @@ const columns = [
|
|
|
{
|
|
|
title: "创建人",
|
|
|
dataIndex: "creator",
|
|
|
- width: 90,
|
|
|
+ minWidth: 120,
|
|
|
},
|
|
|
{
|
|
|
title: "更新时间",
|
|
@@ -263,14 +286,14 @@ const columns = [
|
|
|
{
|
|
|
title: "更新人",
|
|
|
dataIndex: "updater",
|
|
|
- width: 90,
|
|
|
+ minWidth: 120,
|
|
|
},
|
|
|
{
|
|
|
title: "操作",
|
|
|
key: "action",
|
|
|
slots: { customRender: "action" },
|
|
|
fixed: "right",
|
|
|
- width: 180,
|
|
|
+ width: 120,
|
|
|
},
|
|
|
];
|
|
|
|