a
This commit is contained in:
103
docs/hooks-table使用检查.md
Normal file
103
docs/hooks-table使用检查.md
Normal file
@@ -0,0 +1,103 @@
|
||||
# hooks/table 使用方法检查
|
||||
|
||||
## 一、useTable 源码要点(`src/hooks/table.ts`)
|
||||
|
||||
### 1. 入参 `BasicTableProps`
|
||||
|
||||
| 属性 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `createdIsNeed` | `boolean` | **true** | 是否在 `onMounted` 时自动请求列表 |
|
||||
| `isPage` | `boolean` | true | 是否分页 |
|
||||
| `queryForm` | `any` | `{}` | 查询条件,会合并到请求参数 |
|
||||
| `pageList` | `(...arg: any) => Promise<any>` | - | **必填**,分页接口方法 |
|
||||
| `props` | `object` | `{ item: 'records', totalCount: 'total' }` | 列表/总数的数据路径 |
|
||||
| `validate` | `Function` | - | 请求前校验,不通过则不请求 |
|
||||
| `onLoaded` | `Function` | - | 请求成功、写入 `dataList` 后的回调 |
|
||||
| `onCascaded` | `Function` | - | 级联回调 |
|
||||
| `pagination` | `Pagination` | 见源码 | 分页配置 |
|
||||
|
||||
### 2. 内部逻辑
|
||||
|
||||
- **请求参数**:`query()` 调用 `state.pageList({ ...state.queryForm, current, size, descs, ascs })`。
|
||||
- **响应处理**:用 `state.props.item`、`state.props.totalCount` 从 `res.data` 取列表和总数,写入 `state.dataList`、`state.pagination.total`。
|
||||
- **首次加载**:在 **hooks 内部的 `onMounted`** 里,若 `state.createdIsNeed === true` 则执行一次 `query()`。
|
||||
- **注意**:`useTable` **不 return state**,调用方需要自己持有一份 `state`(通常用 `reactive`)并传给 `useTable(state)`,表格数据、分页、loading 都写在这份 `state` 上。
|
||||
|
||||
### 3. 返回值
|
||||
|
||||
```ts
|
||||
{
|
||||
getDataList, // (refresh?: any) => void,默认重置到第 1 页再请求;getDataList(false) 不重置页码
|
||||
currentChangeHandle, // 页码变化时调用
|
||||
sizeChangeHandle, // 每页条数变化时调用
|
||||
sortChangeHandle, // 排序变化时调用(若表格支持 sortable="custom")
|
||||
tableStyle, // { cellStyle, headerCellStyle }
|
||||
downBlobFile // 下载文件
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 二、推荐用法(与 search-form 配合)
|
||||
|
||||
### 1. 定义 state 并传入 useTable
|
||||
|
||||
```ts
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
|
||||
const search = reactive({ deptCode: '', realName: '', teacherNo: '' })
|
||||
|
||||
const state = reactive<BasicTableProps>({
|
||||
queryForm: search, // 与 search-form 的 :model 同一对象
|
||||
pageList: fetchList, // 或自定义方法合并额外参数
|
||||
// createdIsNeed 不写则默认为 true,首屏自动请求
|
||||
})
|
||||
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
|
||||
```
|
||||
|
||||
- **state 由调用方定义并传入**,不要在解构时期望 `useTable` 返回 `state`(源码未返回)。
|
||||
|
||||
### 2. 模板绑定
|
||||
|
||||
- 表格:`:data="state.dataList"`、`v-loading="state.loading"`,`tableStyle` 用于 `cell-style` / `header-cell-style`。
|
||||
- 分页:`v-bind="state.pagination"` 或分别绑定 `current`/`size`/`total`,事件用 `@current-change="currentChangeHandle"`、`@size-change="sizeChangeHandle"`。
|
||||
|
||||
### 3. 查询 / 重置 / 刷新
|
||||
|
||||
- 点击「查询」:先更新 `search`(或额外参数),再 `getDataList()`(会回到第 1 页)。
|
||||
- 重置:清空 `search`(及 ref 里的额外参数),可选 `searchFormRef?.resetFields()`,再 `getDataList()`。
|
||||
- 只刷新当前页:`getDataList(false)`。
|
||||
|
||||
### 4. 与 createdIsNeed 的关系
|
||||
|
||||
- **createdIsNeed: true(默认)**:hooks 内部 onMounted 会自动调一次 `query()`,**页面里不需要再在 onMounted 里调 getDataList()**,否则会重复请求。
|
||||
- **createdIsNeed: false**:不在挂载时请求,需要自己在合适时机(例如 onMounted 或某个条件满足后)调用 `getDataList()`。
|
||||
|
||||
---
|
||||
|
||||
## 三、professionaltitlerelation/index.vue 检查结果
|
||||
|
||||
| 检查项 | 状态 | 说明 |
|
||||
|--------|------|------|
|
||||
| queryForm 使用 search | ✅ | 与 search-form 的 model 一致 |
|
||||
| pageList 返回结构 | ✅ | 返回 `{ data: { records, total } }`,与默认 props 一致 |
|
||||
| createdIsNeed | ✅ | 未配置即默认 true,首屏由 useTable 自动请求 |
|
||||
| onMounted 不重复请求 | ✅ | 仅 `loadDictData()`,未再调 getDataList |
|
||||
| 表格绑定 state.dataList / state.loading | ✅ | 正确 |
|
||||
| 分页绑定 state.pagination + currentChangeHandle/sizeChangeHandle | ✅ | 正确 |
|
||||
| 查询 handleFilter → getDataList() | ✅ | 正确 |
|
||||
| 重置 resetQuery → 清空 search + getDataList() | ✅ | 正确 |
|
||||
| 删除/审核后 getDataList() | ✅ | 正确 |
|
||||
| tableStyle 用于 el-table | ✅ | 正确 |
|
||||
|
||||
**结论**:当前 `professionaltitlerelation/index.vue` 对 hooks/table 的使用符合上述规范,无需修改。
|
||||
|
||||
---
|
||||
|
||||
## 四、常见注意点
|
||||
|
||||
1. **不要从 useTable 解构 state**:源码未返回 state,应自己在页面里 `const state = reactive<BasicTableProps>({...})` 并传给 `useTable(state)`。
|
||||
2. **文档中若写 `const { state } = useTable(state)`**:属于文档笔误,实际应使用调用方定义的 `state`。
|
||||
3. **自定义 pageList 时**:返回结构需与 `props` 一致,默认即 `res.data.records`、`res.data.total`;若后端字段不同,可同时配置 `props: { item: 'xxx', totalCount: 'yyy' }`。
|
||||
4. **需要额外请求参数时**:在 `pageList` 里对入参做合并,例如 `return await fetchList({ ...queryParams, ...params.value })`。
|
||||
@@ -82,7 +82,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { fetchList } from '/@/api/professional/professionaluser/professionalpartychange'
|
||||
@@ -130,10 +130,7 @@ const resetQuery = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
// 表格数据由 useTable(createdIsNeed 默认 true)在挂载时自动请求
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -402,10 +402,9 @@ const loadDictData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
// 初始化:仅加载下拉字典,表格数据由 useTable(createdIsNeed 默认 true)自动请求
|
||||
onMounted(async () => {
|
||||
await loadDictData()
|
||||
getDataList()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -456,10 +456,9 @@ const loadDictData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
// 初始化:仅加载下拉字典,表格数据由 useTable(createdIsNeed 默认 true)自动请求
|
||||
onMounted(async () => {
|
||||
await loadDictData()
|
||||
getDataList()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -56,16 +56,16 @@
|
||||
<el-row>
|
||||
<div class="mb15" style="width: 100%;">
|
||||
<el-button
|
||||
v-auth="'professional_professionalteachercertificaterelation_add'"
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionalteachercertificaterelation_add">新 增
|
||||
@click="handleAdd">新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_teacherbase_export'"
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
v-if="permissions.professional_teacherbase_export"
|
||||
@click="handleDownLoadWord"
|
||||
:loading="exportLoading">导出信息
|
||||
</el-button>
|
||||
@@ -123,31 +123,34 @@
|
||||
<el-table-column label="操作" width="280" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-auth="'professional_professionalteachercertificaterelation_edit'"
|
||||
v-if="scope.row.state === '0' || scope.row.state === '-2'"
|
||||
type="primary"
|
||||
link
|
||||
icon="edit-pen"
|
||||
v-if="permissions.professional_professionalteachercertificaterelation_edit && (scope.row.state === '0' || scope.row.state === '-2')"
|
||||
@click="handleEdit(scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionalteachercertificaterelation_exam'"
|
||||
v-if="scope.row.state === '0'"
|
||||
type="success"
|
||||
link
|
||||
icon="CircleCheck"
|
||||
v-if="permissions.professional_professionalteachercertificaterelation_exam && scope.row.state === '0'"
|
||||
@click="changeState(scope.row, 1)">通过
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionalteachercertificaterelation_exam'"
|
||||
v-if="scope.row.state === '0' || scope.row.state === '1'"
|
||||
type="danger"
|
||||
link
|
||||
icon="CircleClose"
|
||||
v-if="permissions.professional_professionalteachercertificaterelation_exam && (scope.row.state === '0' || scope.row.state === '1')"
|
||||
@click="changeState(scope.row, -2)">驳回
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionalteachercertificaterelation_del'"
|
||||
type="danger"
|
||||
link
|
||||
icon="delete"
|
||||
v-if="permissions.professional_professionalteachercertificaterelation_del"
|
||||
style="margin-left: 12px"
|
||||
@click="handleDel(scope.row)">删除
|
||||
</el-button>
|
||||
@@ -178,9 +181,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
@@ -207,19 +208,6 @@ const auditStateOptions: StateOption[] = [
|
||||
{ value: '0', label: '待审核', type: 'warning', icon: 'fa-regular fa-clock', effect: 'light' }
|
||||
]
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -397,10 +385,9 @@ const loadDictData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
// 初始化:仅加载下拉字典,表格数据由 useTable(createdIsNeed 默认 true)自动请求
|
||||
onMounted(async () => {
|
||||
await loadDictData()
|
||||
getDataList()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@
|
||||
<el-row>
|
||||
<div class="mb15" style="width: 100%;">
|
||||
<el-button
|
||||
v-auth="'professional_professionalteacherhonor_add'"
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionalteacherhonor_add">新 增
|
||||
@click="handleAdd">新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
@@ -118,31 +118,34 @@
|
||||
<el-table-column label="操作" width="280" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-auth="'professional_professionalteacherhonor_edit'"
|
||||
v-if="scope.row.state === '0' || scope.row.state === '-2'"
|
||||
type="primary"
|
||||
link
|
||||
icon="edit-pen"
|
||||
v-if="permissions.professional_professionalteacherhonor_edit && (scope.row.state === '0' || scope.row.state === '-2')"
|
||||
@click="handleEdit(scope.row)">编辑
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionalteacherhonor_exam'"
|
||||
v-if="scope.row.state === '0'"
|
||||
type="success"
|
||||
link
|
||||
icon="CircleCheck"
|
||||
v-if="permissions.professional_professionalteacherhonor_exam && scope.row.state === '0'"
|
||||
@click="changeState(scope.row, 1)">通过
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionalteacherhonor_exam'"
|
||||
v-if="scope.row.state === '0' || scope.row.state === '1'"
|
||||
type="danger"
|
||||
link
|
||||
icon="CircleClose"
|
||||
v-if="permissions.professional_professionalteacherhonor_exam && (scope.row.state === '0' || scope.row.state === '1')"
|
||||
@click="changeState(scope.row, -2)">驳回
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionalteacherhonor_del'"
|
||||
type="danger"
|
||||
link
|
||||
icon="delete"
|
||||
v-if="permissions.professional_professionalteacherhonor_del"
|
||||
style="margin-left: 12px"
|
||||
@click="handleDel(scope.row)">删除
|
||||
</el-button>
|
||||
@@ -173,9 +176,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
@@ -185,6 +186,7 @@ import {
|
||||
examObj,
|
||||
delObj
|
||||
} from '/@/api/professional/professionaluser/professionalteacherhonor'
|
||||
import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
|
||||
const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue'))
|
||||
@@ -192,19 +194,6 @@ const ProfessionalBackResaon = defineAsyncComponent(() => import('/@/views/profe
|
||||
const DataForm = defineAsyncComponent(() => import('./form.vue'))
|
||||
const previewFile = defineAsyncComponent(() => import('/@/components/tools/preview-file.vue'))
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -212,13 +201,8 @@ const messageBox = useMessageBox()
|
||||
// 字典数据
|
||||
const { professional_state: professionalState } = useDict('professional_state')
|
||||
|
||||
// 审核状态选项(独立定义,防止其他页面修改时被波及)
|
||||
import type { StateOption } from '/@/components/AuditState/index.vue'
|
||||
const auditStateOptions: StateOption[] = [
|
||||
{ value: '1', label: '已通过', type: 'success', icon: 'fa-solid fa-circle-check', effect: 'dark' },
|
||||
{ value: '-2', label: '已驳回', type: 'danger', icon: 'fa-solid fa-circle-xmark', effect: 'dark' },
|
||||
{ value: '0', label: '待审核', type: 'warning', icon: 'fa-regular fa-clock', effect: 'light' }
|
||||
]
|
||||
// 审核状态选项
|
||||
const auditStateOptions = PROFESSIONAL_AUDIT_STATE_OPTIONS
|
||||
|
||||
// 表格引用
|
||||
const tableRef = ref()
|
||||
@@ -365,10 +349,7 @@ const handleDownLoadWord = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
// 表格数据由 useTable(createdIsNeed 默认 true)在挂载时自动请求
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { fetchList } from '/@/api/professional/professionaluser/professionalteacherstationchange'
|
||||
@@ -136,10 +136,7 @@ const doPrint = (row: any) => {
|
||||
window.open(`/professional/professionalteacherstationchange/print/${row.id}`)
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
// 表格数据由 useTable(createdIsNeed 默认 true)在挂载时自动请求
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionalteachertype_add">新 增
|
||||
v-auth="'professional_professionalteachertype_add'">新 增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -35,14 +35,14 @@
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_professionalteachertype_edit"
|
||||
v-auth="'professional_professionalteachertype_edit'"
|
||||
icon="edit-pen"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.professional_professionalteachertype_del"
|
||||
v-auth="'professional_professionalteachertype_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="danger"
|
||||
@@ -63,7 +63,7 @@
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="form.id ? '编辑' : '新增'"
|
||||
:title="form.id ? '修改' : '新增'"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@@ -114,27 +114,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, addObj, putObj, delObj } from '/@/api/professional/rsbase/professionalteachertype'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -235,7 +220,7 @@ const handleSubmit = async () => {
|
||||
getDataList()
|
||||
} catch (error: any) {
|
||||
// 处理业务错误
|
||||
message.error(error.msg)
|
||||
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionalteachingmaterialconfig_add">新 增
|
||||
v-auth="'professional_professionalteachingmaterialconfig_add'">新 增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -35,14 +35,14 @@
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_professionalteachingmaterialconfig_edit"
|
||||
v-auth="'professional_professionalteachingmaterialconfig_edit'"
|
||||
icon="edit-pen"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.professional_professionalteachingmaterialconfig_del"
|
||||
v-auth="'professional_professionalteachingmaterialconfig_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="danger"
|
||||
@@ -114,27 +114,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, addObj, putObj, delObj } from '/@/api/professional/rsbase/professionalteachingmaterialconfig'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -235,7 +220,7 @@ const handleSubmit = async () => {
|
||||
getDataList()
|
||||
} catch (error: any) {
|
||||
// 处理业务错误
|
||||
message.error(error.msg)
|
||||
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionaltitlelevelconfig_add">新 增
|
||||
v-auth="'professional_professionaltitlelevelconfig_add'">新 增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -35,14 +35,14 @@
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_professionaltitlelevelconfig_edit"
|
||||
v-auth="'professional_professionaltitlelevelconfig_edit'"
|
||||
icon="edit-pen"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.professional_professionaltitlelevelconfig_del"
|
||||
v-auth="'professional_professionaltitlelevelconfig_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="danger"
|
||||
@@ -114,27 +114,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, addObj, putObj, delObj } from '/@/api/professional/rsbase/professionaltitlelevelconfig'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -235,7 +220,6 @@ const handleSubmit = async () => {
|
||||
getDataList()
|
||||
} catch (error: any) {
|
||||
// 处理业务错误
|
||||
message.error(error.msg)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="编辑职称" width="600px" append-to-body :close-on-click-modal="false" destroy-on-close>
|
||||
<el-dialog v-model="dialogVisible" title="修改职称" width="600px" append-to-body :close-on-click-modal="false" destroy-on-close>
|
||||
<div v-if="showForm">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
|
||||
@@ -88,17 +88,17 @@
|
||||
<el-row>
|
||||
<div class="mb15" style="width: 100%;">
|
||||
<el-button
|
||||
v-auth="'professional_professionaltitlerelation_add'"
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionaltitlerelation_add">新 增
|
||||
@click="handleAdd">新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_teacherbase_export'"
|
||||
class="ml10"
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
v-if="permissions.professional_teacherbase_export"
|
||||
@click="handleDownLoadWord"
|
||||
:loading="exportLoading">导出信息
|
||||
</el-button>
|
||||
@@ -162,31 +162,34 @@
|
||||
<el-table-column label="操作" width="280" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-auth="'professional_professionaltitlerelation_edit'"
|
||||
v-if="scope.row.state === '0' || scope.row.state === '-2'"
|
||||
type="primary"
|
||||
link
|
||||
icon="edit-pen"
|
||||
v-if="permissions.professional_professionaltitlerelation_edit && (scope.row.state === '0' || scope.row.state === '-2')"
|
||||
@click="handleEdit(scope.row)">编辑
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionaltitlerelation_exam'"
|
||||
v-if="scope.row.state === '0'"
|
||||
type="success"
|
||||
link
|
||||
icon="CircleCheck"
|
||||
v-if="permissions.professional_professionaltitlerelation_exam && scope.row.state === '0'"
|
||||
@click="changeState(scope.row, 1)">通过
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionaltitlerelation_exam'"
|
||||
v-if="scope.row.state === '0' || scope.row.state === '1'"
|
||||
type="danger"
|
||||
link
|
||||
icon="CircleClose"
|
||||
v-if="permissions.professional_professionaltitlerelation_exam && (scope.row.state === '0' || scope.row.state === '1')"
|
||||
@click="changeState(scope.row, -2)">驳回
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'professional_professionaltitlerelation_del'"
|
||||
type="danger"
|
||||
link
|
||||
icon="delete"
|
||||
v-if="permissions.professional_professionaltitlerelation_del"
|
||||
style="margin-left: 12px"
|
||||
@click="handleDel(scope.row)">删除
|
||||
</el-button>
|
||||
@@ -218,9 +221,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
@@ -244,18 +245,6 @@ const ProfessionalBackResaon = defineAsyncComponent(() => import('/@/views/profe
|
||||
const previewFile = defineAsyncComponent(() => import('/@/components/tools/preview-file.vue'))
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -452,11 +441,9 @@ const loadDictData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
// 初始化:仅加载下拉字典,表格数据由 useTable 在 createdIsNeed: true 时自动请求
|
||||
onMounted(async () => {
|
||||
await loadDictData()
|
||||
dataFormRef.value?.init()
|
||||
getDataList()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionaltopiclevelconfig_add">新 增
|
||||
v-auth="'professional_professionaltopiclevelconfig_add'">新 增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -35,14 +35,14 @@
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_professionaltopiclevelconfig_edit"
|
||||
v-auth="'professional_professionaltopiclevelconfig_edit'"
|
||||
icon="edit-pen"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.professional_professionaltopiclevelconfig_del"
|
||||
v-auth="'professional_professionaltopiclevelconfig_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="danger"
|
||||
@@ -63,7 +63,7 @@
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="form.id ? '编辑' : '新增'"
|
||||
:title="form.id ? '修改' : '新增'"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@@ -114,27 +114,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, addObj, putObj, delObj } from '/@/api/professional/rsbase/professionaltopiclevelconfig'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -235,7 +220,6 @@ const handleSubmit = async () => {
|
||||
getDataList()
|
||||
} catch (error: any) {
|
||||
// 处理业务错误
|
||||
message.error(error.msg)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionaltopicsourceconfig_add">新 增
|
||||
v-auth="'professional_professionaltopicsourceconfig_add'">新 增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -35,14 +35,14 @@
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_professionaltopicsourceconfig_edit"
|
||||
v-auth="'professional_professionaltopicsourceconfig_edit'"
|
||||
icon="edit-pen"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.professional_professionaltopicsourceconfig_del"
|
||||
v-auth="'professional_professionaltopicsourceconfig_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="danger"
|
||||
@@ -63,7 +63,7 @@
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="form.id ? '编辑' : '新增'"
|
||||
:title="form.id ? '修改' : '新增'"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@@ -114,27 +114,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, addObj, putObj, delObj } from '/@/api/professional/rsbase/professionaltopicsourceconfig'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -235,7 +220,6 @@ const handleSubmit = async () => {
|
||||
getDataList()
|
||||
} catch (error: any) {
|
||||
// 处理业务错误
|
||||
message.error(error.msg)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_worktype_add">新 增
|
||||
v-auth="'professional_worktype_add'">新 增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -31,14 +31,14 @@
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_worktype_edit"
|
||||
v-auth="'professional_worktype_edit'"
|
||||
icon="edit-pen"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.professional_worktype_del"
|
||||
v-auth="'professional_worktype_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="danger"
|
||||
@@ -59,7 +59,7 @@
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="form.id ? '编辑' : '新增'"
|
||||
:title="form.id ? '修改' : '新增'"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@@ -91,27 +91,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, addObj, putObj, delObj } from '/@/api/professional/rsbase/professionalworktype'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -203,7 +188,6 @@ const handleSubmit = async () => {
|
||||
getDataList()
|
||||
} catch (error: any) {
|
||||
// 处理业务错误
|
||||
message.error(error.msg)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_professionalyearbounds_add">新 增
|
||||
v-auth="'professional_professionalyearbounds_add'">新 增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -46,14 +46,14 @@
|
||||
<el-table-column label="操作" min-width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_professionalyearbounds_edit"
|
||||
v-auth="'professional_professionalyearbounds_edit'"
|
||||
icon="edit-pen"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.professional_professionalyearbounds_del"
|
||||
v-auth="'professional_professionalyearbounds_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="danger"
|
||||
@@ -74,7 +74,7 @@
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="form.id ? '编辑' : '新增'"
|
||||
:title="form.id ? '修改' : '新增'"
|
||||
width="800px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@@ -175,29 +175,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, addObj, putObj, delObj } from '/@/api/professional/salaries/professionalyearbounds'
|
||||
|
||||
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -317,7 +302,7 @@ const handleSubmit = async () => {
|
||||
dialogVisible.value = false
|
||||
getDataList(false) // 提交后保持当前页
|
||||
} catch (error: any) {
|
||||
message.error(error.msg)
|
||||
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<el-table-column label="操作" min-width="80" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_salaryexportrecord_del"
|
||||
v-auth="'professional_salaryexportrecord_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="primary"
|
||||
@@ -93,26 +93,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, delObj } from '/@/api/professional/salaries/salaryexportrecord'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -169,7 +154,7 @@ const handleDel = (row: any) => {
|
||||
message.success('删除成功')
|
||||
getDataList(false) // 删除后保持当前页
|
||||
} catch (error: any) {
|
||||
message.error(error.msg)
|
||||
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||
}
|
||||
}).catch(() => {
|
||||
// 用户取消
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</template>
|
||||
<el-button
|
||||
size="small"
|
||||
v-if="permissions.professional_salary_import"
|
||||
v-auth="'teacher_award_import'"
|
||||
type="primary">选择文件
|
||||
</el-button>
|
||||
</el-upload>
|
||||
@@ -45,8 +45,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { Session } from '/@/utils/storage'
|
||||
import request from '/@/utils/request'
|
||||
@@ -56,19 +54,6 @@ const emit = defineEmits<{
|
||||
(e: 'refreshData'): void
|
||||
}>()
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示
|
||||
const message = useMessage()
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
type="primary"
|
||||
plain
|
||||
icon="UploadFilled"
|
||||
v-if="permissions.teacher_award_import"
|
||||
v-auth="'teacher_award_import'"
|
||||
@click="handleImportBaseSalary">绩效导入
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -107,25 +107,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { fetchList } from '/@/api/professional/salaries/teacherawardtax'
|
||||
import ImportAwardTax from './importAwardTax.vue'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
const ImportAwardTax = defineAsyncComponent(() => import('./importAwardTax.vue'))
|
||||
|
||||
// 表格引用
|
||||
const tableRef = ref()
|
||||
|
||||
@@ -1492,7 +1492,7 @@
|
||||
import {updateStatus} from '/@/api/professional/professionalstatuslock'
|
||||
import {resetPassWord} from "/@/api/professional/professionaluser/teacherbase"
|
||||
// 组件配置已不再需要(已从 avue-crud 迁移到 el-table)
|
||||
import authImg from "/@/components/tools/auth-img.vue"
|
||||
const authImg = defineAsyncComponent(() => import("/@/components/tools/auth-img.vue"))
|
||||
|
||||
// 导入工具
|
||||
import { Session } from '/@/utils/storage'
|
||||
|
||||
@@ -90,19 +90,19 @@
|
||||
type="primary"
|
||||
plain
|
||||
icon="UploadFilled"
|
||||
v-if="permissions.professional_salary_import"
|
||||
v-auth="'professional_salary_import'"
|
||||
@click="handleImportBaseSalary">工资条导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="View"
|
||||
class="ml10"
|
||||
v-if="permissions.professional_seach_auth"
|
||||
v-auth="'professional_seach_auth'"
|
||||
@click="canSearch(1)">设置可查询
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Hide"
|
||||
class="ml10"
|
||||
v-if="permissions.professional_seach_auth"
|
||||
v-auth="'professional_seach_auth'"
|
||||
@click="canSearch(0)">设置不可查询
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -110,7 +110,7 @@
|
||||
plain
|
||||
icon="Delete"
|
||||
class="ml10"
|
||||
v-if="permissions.professional_professionalsalaries_del"
|
||||
v-auth="'professional_professionalsalaries_del'"
|
||||
@click="delbatch">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -186,33 +186,19 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, delBatch, setCanSearch } from '/@/api/professional/salaries/teacherpayslip'
|
||||
import { checkAuth } from '/@/api/professional/salaries/teachersalary'
|
||||
import { getStationLevelList } from '/@/api/professional/professionalstationlevelconfig'
|
||||
import SalaryInfo from './salaryInfo.vue'
|
||||
import ImportBaseSalary from './importBaseSalary.vue'
|
||||
import ExportBaseSalary from './exportBaseSalary.vue'
|
||||
const SalaryInfo = defineAsyncComponent(() => import('./salaryInfo.vue'))
|
||||
const ImportBaseSalary = defineAsyncComponent(() => import('./importBaseSalary.vue'))
|
||||
const ExportBaseSalary = defineAsyncComponent(() => import('./exportBaseSalary.vue'))
|
||||
|
||||
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
@@ -339,7 +325,7 @@ const delbatch = () => {
|
||||
getDataList(false) // 删除后保持当前页
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error(error?.msg || '删除失败')
|
||||
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||
}
|
||||
}).catch(() => {
|
||||
// 用户取消
|
||||
@@ -359,7 +345,7 @@ const canSearch = (val: number) => {
|
||||
message.success("设置成功")
|
||||
getDataList(false) // 设置后保持当前页
|
||||
} catch (error: any) {
|
||||
message.error(error?.msg || '设置失败')
|
||||
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||
}
|
||||
}).catch(() => {
|
||||
// 用户取消
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
type="primary"
|
||||
plain
|
||||
icon="UploadFilled"
|
||||
v-if="permissions.professional_salary_import"
|
||||
v-auth="'professional_salary_import'"
|
||||
@click="handleImportBaseSalary">人事薪资导入
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -104,7 +104,7 @@
|
||||
plain
|
||||
icon="Download"
|
||||
class="ml10"
|
||||
v-if="permissions.professional_salary_finance_import"
|
||||
v-auth="'professional_salary_finance_import'"
|
||||
@click="handleExportSalart">薪资导出
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -112,19 +112,19 @@
|
||||
plain
|
||||
icon="UploadFilled"
|
||||
class="ml10"
|
||||
v-if="permissions.professional_salary_finance_import"
|
||||
v-auth="'professional_salary_finance_import'"
|
||||
@click="handleImportTaxSalary">税金导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="View"
|
||||
class="ml10"
|
||||
v-if="permissions.professional_seach_auth"
|
||||
v-auth="'professional_seach_auth'"
|
||||
@click="canSearch(1)">设置可查询
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Hide"
|
||||
class="ml10"
|
||||
v-if="permissions.professional_seach_auth"
|
||||
v-auth="'professional_seach_auth'"
|
||||
@click="canSearch(0)">设置不可查询
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -132,7 +132,7 @@
|
||||
plain
|
||||
icon="Delete"
|
||||
class="ml10"
|
||||
v-if="permissions.professional_professionalsalaries_del"
|
||||
v-auth="'professional_professionalsalaries_del'"
|
||||
@click="delbatch">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -208,33 +208,18 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, delBatch, setCanSearch, checkAuth } from '/@/api/professional/salaries/teachersalary'
|
||||
import { getStationLevelList } from '/@/api/professional/professionalstationlevelconfig'
|
||||
import SalaryInfo from './salaryInfo.vue'
|
||||
import ImportBaseSalary from './importBaseSalary.vue'
|
||||
const SalaryInfo = defineAsyncComponent(() => import('./salaryInfo.vue'))
|
||||
const ImportBaseSalary = defineAsyncComponent(() => import('./importBaseSalary.vue'))
|
||||
const ExportBaseSalary = defineAsyncComponent(() => import('./exportBaseSalary.vue'))
|
||||
const ImportTaxSalary = defineAsyncComponent(() => import('./importTaxSalary.vue'))
|
||||
|
||||
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
|
||||
import ExportBaseSalary from './exportBaseSalary.vue'
|
||||
import ImportTaxSalary from './importTaxSalary.vue'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
@@ -396,7 +381,7 @@ const canSearch = (val: number) => {
|
||||
message.success("设置成功")
|
||||
getDataList(false) // 设置后保持当前页
|
||||
} catch (error: any) {
|
||||
message.error(error?.msg || '设置失败')
|
||||
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||
}
|
||||
}).catch(() => {
|
||||
// 用户取消
|
||||
|
||||
@@ -341,7 +341,7 @@ const searchUserInfo = async () => {
|
||||
message.success('查询成功')
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error(error?.msg || '查询失败')
|
||||
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||
} finally {
|
||||
baseLoading.value = false
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
type="primary"
|
||||
icon="FolderAdd"
|
||||
@click="handleAdd"
|
||||
v-if="permissions.professional_typeofworkconfig_add">新 增
|
||||
v-auth="'professional_typeofworkconfig_add'">新 增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -35,14 +35,14 @@
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="permissions.professional_typeofworkconfig_edit"
|
||||
v-auth="'professional_typeofworkconfig_edit'"
|
||||
icon="edit-pen"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="permissions.professional_typeofworkconfig_del"
|
||||
v-auth="'professional_typeofworkconfig_del'"
|
||||
icon="delete"
|
||||
link
|
||||
type="danger"
|
||||
@@ -63,7 +63,7 @@
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="form.id ? '编辑' : '新增'"
|
||||
:title="form.id ? '修改' : '新增'"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@@ -114,27 +114,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { useMessageBox } from '/@/hooks/message'
|
||||
import { fetchList, addObj, putObj, delObj } from '/@/api/professional/rsbase/typeofworkconfig'
|
||||
|
||||
// 使用 Pinia store
|
||||
const userInfoStore = useUserInfo()
|
||||
const { userInfos } = storeToRefs(userInfoStore)
|
||||
|
||||
// 创建权限对象
|
||||
const permissions = computed(() => {
|
||||
const perms: Record<string, boolean> = {}
|
||||
userInfos.value.authBtnList.forEach((perm: string) => {
|
||||
perms[perm] = true
|
||||
})
|
||||
return perms
|
||||
})
|
||||
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
const messageBox = useMessageBox()
|
||||
@@ -235,7 +220,7 @@ const handleSubmit = async () => {
|
||||
getDataList()
|
||||
} catch (error: any) {
|
||||
// 处理业务错误
|
||||
message.error(error.msg)
|
||||
// 错误处理已在数据请求层统一处理,此处不需要提示
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="recruitstudentplan">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
@@ -312,9 +312,7 @@ const handleSubmit = async () => {
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
// 表格数据由 useTable(createdIsNeed 默认 true)在挂载时自动请求
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="recruitstudentplandegreeofeducation">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
@@ -242,9 +242,7 @@ const handleSubmit = async () => {
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
// 表格数据由 useTable(createdIsNeed 默认 true)在挂载时自动请求
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -307,9 +307,9 @@ const resetQuery = () => {
|
||||
getDataList();
|
||||
};
|
||||
|
||||
// 表格数据由 useTable(createdIsNeed 默认 true)自动请求,onMounted 仅执行 init
|
||||
onMounted(() => {
|
||||
init();
|
||||
getDataList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="recruitstudentsignupturnovermoneychange">
|
||||
import { ref, reactive, computed, onMounted, defineAsyncComponent, nextTick } from 'vue'
|
||||
import { ref, reactive, computed, defineAsyncComponent, nextTick } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserInfo } from '/@/stores/userInfo'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
@@ -182,9 +182,7 @@ const handleDel = async (row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
// 表格数据由 useTable(createdIsNeed 默认 true)在挂载时自动请求
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user