联调
This commit is contained in:
48
src/api/infra/config/index.ts
Normal file
48
src/api/infra/config/index.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface ConfigVO {
|
||||||
|
id: number | undefined
|
||||||
|
category: string
|
||||||
|
name: string
|
||||||
|
key: string
|
||||||
|
value: string
|
||||||
|
type: number
|
||||||
|
visible: boolean
|
||||||
|
remark: string
|
||||||
|
createTime: Date
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询参数列表
|
||||||
|
export const getConfigPage = (params: PageParam) => {
|
||||||
|
return request.get({ url: '/admin-api/infra/config/page', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询参数详情
|
||||||
|
export const getConfig = (id: number) => {
|
||||||
|
return request.get({ url: '/admin-api/infra/config/get?id=' + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据参数键名查询参数值
|
||||||
|
export const getConfigKey = (configKey: string) => {
|
||||||
|
return request.get({ url: '/admin-api/infra/config/get-value-by-key?key=' + configKey })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增参数
|
||||||
|
export const createConfig = (data: ConfigVO) => {
|
||||||
|
return request.post({ url: '/admin-api/infra/config/create', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改参数
|
||||||
|
export const updateConfig = (data: ConfigVO) => {
|
||||||
|
return request.put({ url: '/admin-api/infra/config/update', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除参数
|
||||||
|
export const deleteConfig = (id: number) => {
|
||||||
|
return request.delete({ url: '/admin-api/infra/config/delete?id=' + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出参数
|
||||||
|
export const exportConfig = (params) => {
|
||||||
|
return request.download({ url: '/admin-api/infra/config/export', params })
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading" :style="'height:' + height">
|
<div v-loading="loading" style="height: 100%">
|
||||||
<iframe
|
<iframe
|
||||||
ref="frameRef"
|
ref="frameRef"
|
||||||
:src="props.src"
|
:src="props.src"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const appStore = useAppStore()
|
|||||||
|
|
||||||
const show = ref(true)
|
const show = ref(true)
|
||||||
|
|
||||||
const title = computed(() => appStore.getAppInfo.instanceName)
|
const title = computed(() => appStore.getAppInfo?.instanceName)
|
||||||
|
|
||||||
const layout = computed(() => appStore.getLayout)
|
const layout = computed(() => appStore.getLayout)
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ watch(
|
|||||||
<div
|
<div
|
||||||
v-if="show"
|
v-if="show"
|
||||||
:class="[
|
:class="[
|
||||||
'ml-10px text-16px font-700',
|
'ml-10px text-14px font-700',
|
||||||
{
|
{
|
||||||
'text-[var(--logo-title-text-color)]': layout === 'classic',
|
'text-[var(--logo-title-text-color)]': layout === 'classic',
|
||||||
'text-[var(--top-header-text-color)]':
|
'text-[var(--top-header-text-color)]':
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const { start, done } = useNProgress()
|
|||||||
|
|
||||||
const { loadStart, loadDone } = usePageLoading()
|
const { loadStart, loadDone } = usePageLoading()
|
||||||
// 路由不重定向白名单
|
// 路由不重定向白名单
|
||||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register']
|
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/swagger']
|
||||||
|
|
||||||
// 路由加载前
|
// 路由加载前
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
|
|||||||
@@ -54,11 +54,24 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
path: '',
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/Home/index',
|
redirect: '/Home/index',
|
||||||
|
name: '',
|
||||||
meta: {
|
meta: {
|
||||||
title: '首页',
|
title: '首页',
|
||||||
hidden: true
|
hidden: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/swagger',
|
||||||
|
component: () => import('@/views/Basic/Swagger/index.vue'),
|
||||||
|
name: 'swagger',
|
||||||
|
meta: {
|
||||||
|
title: '接口文档',
|
||||||
|
noCache: true,
|
||||||
|
hidden: true,
|
||||||
|
canTo: true,
|
||||||
|
icon: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
import { store } from '../index'
|
import { store } from '../index'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import {
|
import { getAccessToken, removeToken } from '@/utils/auth'
|
||||||
getAccessToken,
|
|
||||||
removeToken,
|
|
||||||
setToken,
|
|
||||||
getRefreshToken,
|
|
||||||
getTenantId,
|
|
||||||
getAppId,
|
|
||||||
setTenantId,
|
|
||||||
setAppId
|
|
||||||
} from '@/utils/auth'
|
|
||||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import { getInfo, loginOut } from '@/api/login'
|
import { getInfo, loginOut } from '@/api/login'
|
||||||
|
|
||||||
@@ -86,18 +77,8 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
refresh() {
|
refresh() {
|
||||||
const token = getAccessToken()
|
wsCache.delete(CACHE_KEY.USER)
|
||||||
const refreshToken = getRefreshToken()
|
|
||||||
const tenantId = getTenantId()
|
|
||||||
const appId = getAppId()
|
|
||||||
wsCache.clear()
|
|
||||||
this.resetState()
|
this.resetState()
|
||||||
setTenantId(tenantId)
|
|
||||||
setAppId(appId)
|
|
||||||
setToken({
|
|
||||||
accessToken: token, // 访问令牌
|
|
||||||
refreshToken: refreshToken // 刷新令牌
|
|
||||||
})
|
|
||||||
window.location.href = ''
|
window.location.href = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ export function formatPast2(ms) {
|
|||||||
* @param cellValue 字段值
|
* @param cellValue 字段值
|
||||||
*/
|
*/
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export const dateFormatter = (row, column, cellValue) => {
|
export const dateFormatter = (row: any, column: any, cellValue: any) => {
|
||||||
if (!cellValue) {
|
if (!cellValue) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,11 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleQuery"> 搜索</el-button>
|
<el-button @click="handleQuery" v-hasPermi="['basic:dept:search']"> 搜索</el-button>
|
||||||
<el-button @click="resetQuery"> 重置</el-button>
|
<el-button @click="resetQuery" v-hasPermi="['basic:dept:reset']"> 重置</el-button>
|
||||||
<el-button type="primary" plain @click="openForm('create')"> 新增 </el-button>
|
<el-button type="primary" plain @click="openForm('create')" v-hasPermi="['basic:dept:add']">
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -25,8 +27,22 @@
|
|||||||
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||||
<el-table-column label="操作" class-name="fixed-width" width="160">
|
<el-table-column label="操作" class-name="fixed-width" width="160">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" @click="openForm('update', scope.row.id)"> 修改 </el-button>
|
<el-button
|
||||||
<el-button link type="danger" @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['basic:dept:update']"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['basic:dept:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-tabs v-model="tabIndex" type="border-card">
|
<el-tabs v-model="tabIndex" type="border-card">
|
||||||
<el-tab-pane label="线索管理" :name="0">
|
<el-tab-pane label="线索管理" :name="0" v-if="checkPermi(['basic:setting:clue'])">
|
||||||
<BSClue v-if="tabIndex == 0" />
|
<BSClue v-if="tabIndex == 0" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="销售提成" :name="10">
|
<el-tab-pane label="销售提成" :name="10" v-if="checkPermi(['basic:setting:comission'])">
|
||||||
<BSSalerComission v-if="tabIndex == 10" />
|
<BSSalerComission v-if="tabIndex == 10" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
<script setup name="GeneralSetting">
|
<script setup name="GeneralSetting">
|
||||||
import BSClue from './Comp/BSClue.vue'
|
import BSClue from './Comp/BSClue.vue'
|
||||||
import BSSalerComission from './Comp/BSSalerComission.vue'
|
import BSSalerComission from './Comp/BSSalerComission.vue'
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
const tabIndex = ref(0)
|
const tabIndex = ref(0)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -13,7 +13,13 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">保存权限</el-button>
|
<el-button
|
||||||
|
:disabled="formLoading"
|
||||||
|
type="primary"
|
||||||
|
@click="submitForm"
|
||||||
|
v-hasPermi="['basic:role:update-menu']"
|
||||||
|
>保存权限</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -49,7 +49,13 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label-width="0">
|
<el-form-item label-width="0">
|
||||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">保存权限</el-button>
|
<el-button
|
||||||
|
:disabled="formLoading"
|
||||||
|
type="primary"
|
||||||
|
@click="submitForm"
|
||||||
|
v-hasPermi="['basic:role:update-data']"
|
||||||
|
>保存权限</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -3,7 +3,13 @@
|
|||||||
<el-card shadow="always" :body-style="{ padding: '10px' }">
|
<el-card shadow="always" :body-style="{ padding: '10px' }">
|
||||||
<div class="flex justify-between items-center" style="width: 300px">
|
<div class="flex justify-between items-center" style="width: 300px">
|
||||||
<div class="text-16px font-bold">角色列表</div>
|
<div class="text-16px font-bold">角色列表</div>
|
||||||
<el-button type="primary" style="padding: 0px" text @click="openForm('create')">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
style="padding: 0px"
|
||||||
|
text
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['basic:role:add']"
|
||||||
|
>
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,6 +27,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
style="padding: 0px"
|
style="padding: 0px"
|
||||||
text
|
text
|
||||||
|
v-hasPermi="['basic:role:update']"
|
||||||
@click="openForm('update', item.id)"
|
@click="openForm('update', item.id)"
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
@@ -30,6 +37,7 @@
|
|||||||
class="ml-10px"
|
class="ml-10px"
|
||||||
style="padding: 0px"
|
style="padding: 0px"
|
||||||
text
|
text
|
||||||
|
v-hasPermi="['basic:role:delete']"
|
||||||
@click="handleDelete(item.id)"
|
@click="handleDelete(item.id)"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
@@ -84,7 +92,7 @@ const message = useMessage() // 消息弹窗
|
|||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
const list = ref([]) // 列表的数据
|
const list = ref<any>([]) // 列表的数据
|
||||||
|
|
||||||
const libraryIndex = ref(0)
|
const libraryIndex = ref(0)
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
|
|||||||
24
src/views/Basic/Swagger/index.vue
Normal file
24
src/views/Basic/Swagger/index.vue
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<IFrame :src="src" />
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import * as ConfigApi from '@/api/infra/config'
|
||||||
|
|
||||||
|
defineOptions({ name: 'InfraSwagger' })
|
||||||
|
|
||||||
|
const loading = ref(true) // 是否加载中
|
||||||
|
const src = ref(import.meta.env.VITE_BASE_URL + '/doc.html') // Knife4j UI
|
||||||
|
// const src = ref(import.meta.env.VITE_BASE_URL + '/swagger-ui') // Swagger UI
|
||||||
|
|
||||||
|
/** 初始化 */
|
||||||
|
onMounted(async () => {
|
||||||
|
try {
|
||||||
|
const data = await ConfigApi.getConfigKey('url.swagger')
|
||||||
|
if (data && data.length > 0) {
|
||||||
|
src.value = data
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -26,9 +26,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleQuery">搜索</el-button>
|
<el-button @click="handleQuery" v-hasPermi="['basic:employee:search']">搜索</el-button>
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery" v-hasPermi="['basic:employee:reset']">重置</el-button>
|
||||||
<el-button type="primary" plain @click="openForm('create')"> 新增 </el-button>
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['basic:employee:add']"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
@@ -43,6 +50,7 @@
|
|||||||
v-model="scope.row.status"
|
v-model="scope.row.status"
|
||||||
:active-value="0"
|
:active-value="0"
|
||||||
:inactive-value="1"
|
:inactive-value="1"
|
||||||
|
v-hasPermi="['basic:employee:update']"
|
||||||
@change="handleStatusChange(scope.row)"
|
@change="handleStatusChange(scope.row)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -55,11 +63,30 @@
|
|||||||
/>
|
/>
|
||||||
<el-table-column label="操作" width="260">
|
<el-table-column label="操作" width="260">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="primary" link @click="openForm('update', scope.row.id)">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['basic:employee:update']"
|
||||||
|
>
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" link @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
<el-button
|
||||||
<el-button type="primary" link @click="handleResetPwd(scope.row)"> 重置密码 </el-button>
|
type="primary"
|
||||||
|
link
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['basic:employee:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
@click="handleResetPwd(scope.row)"
|
||||||
|
v-hasPermi="['basic:employee:password']"
|
||||||
|
>
|
||||||
|
重置密码
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
Reference in New Issue
Block a user