salary
qsh 6 months ago
parent 34b4f84293
commit 1f9be6227c
  1. 48
      src/api/infra/config/index.ts
  2. 2
      src/components/IFrame/src/IFrame.vue
  3. 4
      src/layout/components/Logo/src/Logo.vue
  4. 2
      src/permission.js
  5. 13
      src/router/modules/remaining.ts
  6. 23
      src/store/modules/user.ts
  7. 2
      src/utils/formatTime.ts
  8. 26
      src/views/Basic/Dept/index.vue
  9. 5
      src/views/Basic/GeneralSet/index.vue
  10. 8
      src/views/Basic/Role/RoleAssignMenuForm.vue
  11. 8
      src/views/Basic/Role/RoleDataPermissionForm.vue
  12. 12
      src/views/Basic/Role/index.vue
  13. 24
      src/views/Basic/Swagger/index.vue
  14. 39
      src/views/Basic/User/index.vue

@ -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>
<template>
<div v-loading="loading" :style="'height:' + height">
<div v-loading="loading" style="height: 100%">
<iframe
ref="frameRef"
:src="props.src"

@ -11,7 +11,7 @@ const appStore = useAppStore()
const show = ref(true)
const title = computed(() => appStore.getAppInfo.instanceName)
const title = computed(() => appStore.getAppInfo?.instanceName)
const layout = computed(() => appStore.getLayout)
@ -72,7 +72,7 @@ watch(
<div
v-if="show"
:class="[
'ml-10px text-16px font-700',
'ml-10px text-14px font-700',
{
'text-[var(--logo-title-text-color)]': layout === 'classic',
'text-[var(--top-header-text-color)]':

@ -13,7 +13,7 @@ const { start, done } = useNProgress()
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) => {

@ -54,11 +54,24 @@ const remainingRouter: AppRouteRecordRaw[] = [
path: '',
component: Layout,
redirect: '/Home/index',
name: '',
meta: {
title: '首页',
hidden: true
}
},
{
path: '/swagger',
component: () => import('@/views/Basic/Swagger/index.vue'),
name: 'swagger',
meta: {
title: '接口文档',
noCache: true,
hidden: true,
canTo: true,
icon: ''
}
},
{
path: '/user',
component: Layout,

@ -1,15 +1,6 @@
import { store } from '../index'
import { defineStore } from 'pinia'
import {
getAccessToken,
removeToken,
setToken,
getRefreshToken,
getTenantId,
getAppId,
setTenantId,
setAppId
} from '@/utils/auth'
import { getAccessToken, removeToken } from '@/utils/auth'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getInfo, loginOut } from '@/api/login'
@ -86,18 +77,8 @@ export const useUserStore = defineStore('admin-user', {
}
},
refresh() {
const token = getAccessToken()
const refreshToken = getRefreshToken()
const tenantId = getTenantId()
const appId = getAppId()
wsCache.clear()
wsCache.delete(CACHE_KEY.USER)
this.resetState()
setTenantId(tenantId)
setAppId(appId)
setToken({
accessToken: token, // 访问令牌
refreshToken: refreshToken // 刷新令牌
})
window.location.href = ''
}
}

@ -142,7 +142,7 @@ export function formatPast2(ms) {
* @param cellValue
*/
// @ts-ignore
export const dateFormatter = (row, column, cellValue) => {
export const dateFormatter = (row: any, column: any, cellValue: any) => {
if (!cellValue) {
return
}

@ -10,9 +10,11 @@
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"> 搜索</el-button>
<el-button @click="resetQuery"> 重置</el-button>
<el-button type="primary" plain @click="openForm('create')"> 新增 </el-button>
<el-button @click="handleQuery" v-hasPermi="['basic:dept:search']"> 搜索</el-button>
<el-button @click="resetQuery" v-hasPermi="['basic:dept:reset']"> 重置</el-button>
<el-button type="primary" plain @click="openForm('create')" v-hasPermi="['basic:dept:add']">
新增
</el-button>
</el-form-item>
</el-form>
@ -25,8 +27,22 @@
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
<el-table-column label="操作" class-name="fixed-width" width="160">
<template #default="scope">
<el-button link type="primary" @click="openForm('update', scope.row.id)"> 修改 </el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)"> 删除 </el-button>
<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>
</el-table-column>
</el-table>

@ -1,10 +1,10 @@
<template>
<div>
<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" />
</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" />
</el-tab-pane>
</el-tabs>
@ -14,6 +14,7 @@
<script setup name="GeneralSetting">
import BSClue from './Comp/BSClue.vue'
import BSSalerComission from './Comp/BSSalerComission.vue'
import { checkPermi } from '@/utils/permission'
const tabIndex = ref(0)
</script>

@ -13,7 +13,13 @@
/>
</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>
</div>

@ -49,7 +49,13 @@
</el-card>
</el-form-item>
<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>
</template>

@ -3,7 +3,13 @@
<el-card shadow="always" :body-style="{ padding: '10px' }">
<div class="flex justify-between items-center" style="width: 300px">
<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>
</div>
@ -21,6 +27,7 @@
type="primary"
style="padding: 0px"
text
v-hasPermi="['basic:role:update']"
@click="openForm('update', item.id)"
>
修改
@ -30,6 +37,7 @@
class="ml-10px"
style="padding: 0px"
text
v-hasPermi="['basic:role:delete']"
@click="handleDelete(item.id)"
>
删除
@ -84,7 +92,7 @@ const message = useMessage() // 消息弹窗
const { t } = useI18n() //
const total = ref(0) //
const list = ref([]) //
const list = ref<any>([]) //
const libraryIndex = ref(0)
const queryParams = reactive({

@ -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-button @click="handleQuery">搜索</el-button>
<el-button @click="resetQuery">重置</el-button>
<el-button type="primary" plain @click="openForm('create')"> 新增 </el-button>
<el-button @click="handleQuery" v-hasPermi="['basic:employee:search']">搜索</el-button>
<el-button @click="resetQuery" v-hasPermi="['basic:employee:reset']">重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['basic:employee:add']"
>
新增
</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list">
@ -43,6 +50,7 @@
v-model="scope.row.status"
:active-value="0"
:inactive-value="1"
v-hasPermi="['basic:employee:update']"
@change="handleStatusChange(scope.row)"
/>
</template>
@ -55,11 +63,30 @@
/>
<el-table-column label="操作" width="260">
<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 type="primary" link @click="handleDelete(scope.row.id)"> 删除 </el-button>
<el-button type="primary" link @click="handleResetPwd(scope.row)"> 重置密码 </el-button>
<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>
</el-table-column>
</el-table>

Loading…
Cancel
Save