|
@@ -17,16 +17,6 @@
|
|
class="!w-240px"
|
|
class="!w-240px"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="出生日期" prop="birthday">
|
|
|
|
- <el-date-picker
|
|
|
|
- v-model="queryParams.birthday"
|
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
|
- type="date"
|
|
|
|
- placeholder="选择出生日期"
|
|
|
|
- clearable
|
|
|
|
- class="!w-240px"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="性别" prop="sex">
|
|
<el-form-item label="性别" prop="sex">
|
|
<el-select
|
|
<el-select
|
|
v-model="queryParams.sex"
|
|
v-model="queryParams.sex"
|
|
@@ -42,21 +32,6 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="是否有效" prop="enabled">
|
|
|
|
- <el-select
|
|
|
|
- v-model="queryParams.enabled"
|
|
|
|
- placeholder="请选择是否有效"
|
|
|
|
- clearable
|
|
|
|
- class="!w-240px"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
|
|
|
- :key="dict.value"
|
|
|
|
- :label="dict.label"
|
|
|
|
- :value="dict.value"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="创建时间" prop="createTime">
|
|
<el-form-item label="创建时间" prop="createTime">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="queryParams.createTime"
|
|
v-model="queryParams.createTime"
|
|
@@ -75,7 +50,7 @@
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
@click="openForm('create')"
|
|
@click="openForm('create')"
|
|
- v-hasPermi="['infra:demo01-student:create']"
|
|
|
|
|
|
+ v-hasPermi="['infra:demo01-contact:create']"
|
|
>
|
|
>
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
</el-button>
|
|
</el-button>
|
|
@@ -84,7 +59,7 @@
|
|
plain
|
|
plain
|
|
@click="handleExport"
|
|
@click="handleExport"
|
|
:loading="exportLoading"
|
|
:loading="exportLoading"
|
|
- v-hasPermi="['infra:demo01-student:export']"
|
|
|
|
|
|
+ v-hasPermi="['infra:demo01-contact:export']"
|
|
>
|
|
>
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
|
</el-button>
|
|
</el-button>
|
|
@@ -97,26 +72,20 @@
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
<el-table-column label="编号" align="center" prop="id" />
|
|
<el-table-column label="编号" align="center" prop="id" />
|
|
<el-table-column label="名字" align="center" prop="name" />
|
|
<el-table-column label="名字" align="center" prop="name" />
|
|
|
|
+ <el-table-column label="性别" align="center" prop="sex">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.sex" />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
- label="出生日期"
|
|
|
|
|
|
+ label="出生年"
|
|
align="center"
|
|
align="center"
|
|
prop="birthday"
|
|
prop="birthday"
|
|
:formatter="dateFormatter"
|
|
:formatter="dateFormatter"
|
|
width="180px"
|
|
width="180px"
|
|
/>
|
|
/>
|
|
- <el-table-column label="性别" align="center" prop="sex">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.sex" />
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="是否有效" align="center" prop="enabled">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.enabled" />
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
+ <el-table-column label="简介" align="center" prop="description" />
|
|
<el-table-column label="头像" align="center" prop="avatar" />
|
|
<el-table-column label="头像" align="center" prop="avatar" />
|
|
- <el-table-column label="附件" align="center" prop="video" />
|
|
|
|
- <el-table-column label="备注" align="center" prop="memo" />
|
|
|
|
<el-table-column
|
|
<el-table-column
|
|
label="创建时间"
|
|
label="创建时间"
|
|
align="center"
|
|
align="center"
|
|
@@ -130,7 +99,7 @@
|
|
link
|
|
link
|
|
type="primary"
|
|
type="primary"
|
|
@click="openForm('update', scope.row.id)"
|
|
@click="openForm('update', scope.row.id)"
|
|
- v-hasPermi="['infra:demo01-student:update']"
|
|
|
|
|
|
+ v-hasPermi="['infra:demo01-contact:update']"
|
|
>
|
|
>
|
|
编辑
|
|
编辑
|
|
</el-button>
|
|
</el-button>
|
|
@@ -138,7 +107,7 @@
|
|
link
|
|
link
|
|
type="danger"
|
|
type="danger"
|
|
@click="handleDelete(scope.row.id)"
|
|
@click="handleDelete(scope.row.id)"
|
|
- v-hasPermi="['infra:demo01-student:delete']"
|
|
|
|
|
|
+ v-hasPermi="['infra:demo01-contact:delete']"
|
|
>
|
|
>
|
|
删除
|
|
删除
|
|
</el-button>
|
|
</el-button>
|
|
@@ -155,32 +124,29 @@
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
- <Demo01StudentForm ref="formRef" @success="getList" />
|
|
|
|
|
|
+ <Demo01ContactForm ref="formRef" @success="getList" />
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { getIntDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
|
+import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
-import * as Demo01StudentApi from '@/api/infra/demo01'
|
|
|
|
-import Demo01StudentForm from './Demo01StudentForm.vue'
|
|
|
|
|
|
+import * as Demo01ContactApi from '@/api/infra/demo/demo01'
|
|
|
|
+import Demo01ContactForm from './Demo01ContactForm.vue'
|
|
|
|
|
|
-defineOptions({ name: 'InfraDemo01Student' })
|
|
|
|
|
|
+defineOptions({ name: 'Demo01Contact' })
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
const message = useMessage() // 消息弹窗
|
|
const { t } = useI18n() // 国际化
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
const loading = ref(true) // 列表的加载中
|
|
-const total = ref(0) // 列表的总页数
|
|
|
|
const list = ref([]) // 列表的数据
|
|
const list = ref([]) // 列表的数据
|
|
|
|
+const total = ref(0) // 列表的总页数
|
|
const queryParams = reactive({
|
|
const queryParams = reactive({
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
name: null,
|
|
name: null,
|
|
- birthday: null,
|
|
|
|
- birthday: [],
|
|
|
|
sex: null,
|
|
sex: null,
|
|
- enabled: null,
|
|
|
|
createTime: []
|
|
createTime: []
|
|
})
|
|
})
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const queryFormRef = ref() // 搜索的表单
|
|
@@ -190,7 +156,7 @@ const exportLoading = ref(false) // 导出的加载中
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
loading.value = true
|
|
loading.value = true
|
|
try {
|
|
try {
|
|
- const data = await Demo01StudentApi.getDemo01StudentPage(queryParams)
|
|
|
|
|
|
+ const data = await Demo01ContactApi.getDemo01ContactPage(queryParams)
|
|
list.value = data.list
|
|
list.value = data.list
|
|
total.value = data.total
|
|
total.value = data.total
|
|
} finally {
|
|
} finally {
|
|
@@ -222,7 +188,7 @@ const handleDelete = async (id: number) => {
|
|
// 删除的二次确认
|
|
// 删除的二次确认
|
|
await message.delConfirm()
|
|
await message.delConfirm()
|
|
// 发起删除
|
|
// 发起删除
|
|
- await Demo01StudentApi.deleteDemo01Student(id)
|
|
|
|
|
|
+ await Demo01ContactApi.deleteDemo01Contact(id)
|
|
message.success(t('common.delSuccess'))
|
|
message.success(t('common.delSuccess'))
|
|
// 刷新列表
|
|
// 刷新列表
|
|
await getList()
|
|
await getList()
|
|
@@ -236,8 +202,8 @@ const handleExport = async () => {
|
|
await message.exportConfirm()
|
|
await message.exportConfirm()
|
|
// 发起导出
|
|
// 发起导出
|
|
exportLoading.value = true
|
|
exportLoading.value = true
|
|
- const data = await Demo01StudentApi.exportDemo01Student(queryParams)
|
|
|
|
- download.excel(data, '学生.xls')
|
|
|
|
|
|
+ const data = await Demo01ContactApi.exportDemo01Contact(queryParams)
|
|
|
|
+ download.excel(data, '示例联系人.xls')
|
|
} catch {
|
|
} catch {
|
|
} finally {
|
|
} finally {
|
|
exportLoading.value = false
|
|
exportLoading.value = false
|