Merge remote-tracking branch 'origin/master'

This commit is contained in:
H0nGzA1
2023-02-11 16:00:43 +08:00
18 changed files with 186 additions and 200 deletions

View File

@@ -1,5 +1,4 @@
import { request } from "/@/utils/service";
// import request from "/@/utils/request";
export function getCaptcha() {
return request({
@@ -19,4 +18,4 @@ export function getUserInfo() {
url: '/api/system/user/user_info/',
method: 'get',
});
}
}

View File

@@ -74,6 +74,7 @@ import { NextLoading } from '/@/utils/loading';
import * as loginApi from '/@/views/system/login/api';
import { useUserInfo } from '/@/stores/userInfo';
import { DictionaryStore } from '/@/stores/dictionary';
import {BtnPermissionStore} from "/@/plugin/permission/store.permission";
import { Md5 } from 'ts-md5';
export default defineComponent({
@@ -139,8 +140,8 @@ export default defineComponent({
const loginSuccess = () => {
//登录成功获取用户信息,获取系统字典数据
getUserInfo();
//获取所有字典
DictionaryStore().getSystemDictionarys();
// 初始化登录成功时间问候语
let currentTimeInfo = currentTime.value;
// 登录成功,跳到转首页

View File

@@ -81,11 +81,8 @@ export const createCrudOptions = function ({
},
name: {
title: '权限名称',
type: 'dict-select',
type: 'text',
search: {show: true},
dict: dict({
data: dictionary('system_button')
}),
column: {
minWidth: 120,
sortable: true,
@@ -103,7 +100,7 @@ export const createCrudOptions = function ({
},
helper: {
render (h) {
return (< el-alert title="手动输入不在列表中的新值" type="warning" description="比较常用的建议放在字典管理中"/>
return (< el-alert title="手动输入" type="warning" description="页面中按钮的名称或者自定义一个名称"/>
)
}
}
@@ -122,7 +119,7 @@ export const createCrudOptions = function ({
placeholder: '输入权限标识',
helper: {
render (h) {
return (< el-alert title="用于前端按钮权限的判断展示" type="warning" description="使用方法vm.hasPermissions(权限值)"/>
return (< el-alert title="唯一值" type="warning" description="用于判断前端按钮权限或接口权限"/>
)
}
}

View File

@@ -3,12 +3,14 @@ import { dict, PageQuery, AddReq, DelReq, EditReq, CrudExpose, CrudOptions, } fr
import { dictionary } from "/@/utils/dictionary";
import iconSelector from '/@/components/iconSelector/index.vue'
import {useCompute} from '@fast-crud/fast-crud'
import {inject} from 'vue'
const {compute} = useCompute()
interface CreateCrudOptionsTypes {
crudOptions: CrudOptions;
}
export const createCrudOptions = function ({ crudExpose,menuButtonRef }: { crudExpose: CrudExpose,menuButtonRef:any }): CreateCrudOptionsTypes {
const hasPermissions = inject('$hasPermissions')
//验证路由地址
const validateWebPath = (rule: string, value: string, callback: Function) => {
const isLink = crudExpose.getFormData().is_link
@@ -67,6 +69,13 @@ export const createCrudOptions = function ({ crudExpose,menuButtonRef }: { crudE
load:loadContentMethod,
treeProps:{children: 'children', hasChildren: 'hasChild'}
},
actionbar: {
buttons: {
add: {
show: hasPermissions('Menu:Create')
}
}
},
rowHandle: {
buttons: {
custom: {
@@ -77,10 +86,11 @@ export const createCrudOptions = function ({ crudExpose,menuButtonRef }: { crudE
content: "按钮配置"
},
show:compute(({row}:any)=>{
if (row.web_path && !row.is_link) {
return true
if (row.web_path && !row.is_link) {
return true && hasPermissions()
}
return false
}),
click:(context:any):void => {
const {row} = context