ktianc 7fbdcb3b0f 版本升级
1. 新增:微信小程序端新增微信手机号登录功能(必须为企业认证小程序)
2. 新增:加入动态更新常见问题
3. 新增:新增小程序分享功能
4. 新增:小程序新增第一次登录需要修改密码
5. 新增:新增接口权限控制
6. 新增:用户新增is_staff用来判断是否为工作人员
7. 新增:软删除新增is_delete字段来判断,delete_datetime当前主要来记录时间
8. 更新:部分接口删除功能已更新,需要试用软删除的才会试用软删除
9. 更新:更新系统配置缓存功能
10. 更新:接口认证依赖项更新
11. 更新:获取系统基础配置信息与用户协议与隐私协议更新
12. 优化:优化接口与数据库操作
2023-02-27 17:28:27 +08:00

144 lines
3.5 KiB
Vue

<script setup lang="ts">
import { ContentWrap } from '@/components/ContentWrap'
import { Table } from '@/components/Table'
import {
getIssueListApi,
delIssueListApi,
getIssueCategoryOptionsApi
} from '@/api/vadmin/help/issue'
import { useTable } from '@/hooks/web/useTable'
import { columns, searchSchema } from './components/issue.data'
import { ref, watch, nextTick } from 'vue'
import { ElRow, ElCol, ElButton, ElSwitch } from 'element-plus'
import { RightToolbar } from '@/components/RightToolbar'
import { FormSetPropsType } from '@/types/form'
import { Search } from '@/components/Search'
import { useI18n } from '@/hooks/web/useI18n'
import { useCache } from '@/hooks/web/useCache'
import { useRouter } from 'vue-router'
const { wsCache } = useCache()
const { t } = useI18n()
const { register, elTableRef, tableObject, methods } = useTable({
getListApi: getIssueListApi,
delListApi: delIssueListApi,
response: {
data: 'data',
count: 'count'
}
})
const { getList, setSearchParams } = methods
const tableSize = ref('default')
watch(tableSize, (val) => {
tableSize.value = val
})
const { currentRoute, push } = useRouter()
const cacheTableHeadersKey = currentRoute.value.fullPath
watch(
columns,
async (val) => {
wsCache.set(cacheTableHeadersKey, JSON.stringify(val))
await nextTick()
elTableRef.value?.doLayout()
},
{
deep: true
}
)
const loading = ref(false)
const searchSetSchemaList = ref([] as FormSetPropsType[])
const getOptions = async () => {
const res = await getIssueCategoryOptionsApi()
searchSetSchemaList.value.push({
field: 'category_id',
path: 'componentProps.options',
value: res.data
})
}
getOptions()
// 新增类别事件
const auditAction = async () => {
push('/help/issue/form')
}
// 编辑事件
const updateAction = async (row: any) => {
push(`/help/issue/form?id=${row.id}`)
}
// 删除事件
const delData = async (row: any) => {
tableObject.currentRow = row
const { delListApi } = methods
loading.value = true
await delListApi([row.id], false).finally(() => {
loading.value = false
})
}
getList()
</script>
<template>
<ContentWrap>
<Search
:schema="searchSchema"
:setSchemaList="searchSetSchemaList"
@search="setSearchParams"
@reset="setSearchParams"
/>
<div class="mb-8px flex justify-between">
<ElRow>
<ElCol :span="1.5">
<ElButton type="primary" @click="auditAction">新增问题</ElButton>
</ElCol>
</ElRow>
<RightToolbar
@get-list="getList"
v-model:table-size="tableSize"
v-model:columns="columns"
:cache-table-headers-key="cacheTableHeadersKey"
/>
</div>
<Table
v-model:limit="tableObject.limit"
v-model:page="tableObject.page"
:columns="columns"
:data="tableObject.tableData"
:loading="tableObject.loading"
:selection="false"
:size="tableSize"
:border="true"
:pagination="{
total: tableObject.count
}"
@register="register"
>
<template #is_active="{ row }">
<ElSwitch :value="row.is_active" size="small" disabled />
</template>
<template #action="{ row }">
<ElButton type="primary" link size="small" @click="updateAction(row)">
{{ t('exampleDemo.edit') }}
</ElButton>
<ElButton type="danger" link size="small" @click="delData(row)">
{{ t('exampleDemo.del') }}
</ElButton>
</template>
</Table>
</ContentWrap>
</template>