Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -22,7 +22,7 @@ from django_filters.rest_framework import DjangoFilterBackend
|
||||
from django_filters.utils import get_model_field
|
||||
from rest_framework.filters import BaseFilterBackend
|
||||
from django_filters.conf import settings
|
||||
from dvadmin.system.models import Dept, ApiWhiteList, RoleMenuButtonPermission
|
||||
from dvadmin.system.models import Dept, ApiWhiteList, RoleMenuButtonPermission, MenuButton
|
||||
from dvadmin.utils.models import CoreModel
|
||||
|
||||
class CoreModelFilterBankend(BaseFilterBackend):
|
||||
@@ -149,11 +149,14 @@ class DataLevelPermissionsFilter(BaseFilterBackend):
|
||||
if _pk: # 判断是否是单例查询
|
||||
re_api = re.sub(_pk,'{id}', api)
|
||||
role_id_list = request.user.role.values_list('id', flat=True)
|
||||
# 修复权限获取bug
|
||||
menu_button_ids = MenuButton.objects.filter(api=re_api,method=method).values_list('id', flat=True)
|
||||
role_permission_list = []
|
||||
if menu_button_ids:
|
||||
role_permission_list=RoleMenuButtonPermission.objects.filter(
|
||||
role__in=role_id_list,
|
||||
role__status=1,
|
||||
menu_button__api=re_api,
|
||||
menu_button__method=method).values(
|
||||
menu_button_id__in=menu_button_ids).values(
|
||||
'data_range'
|
||||
)
|
||||
dataScope_list = [] # 权限范围列表
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry.cn-zhangjiakou.aliyuncs.com/dvadmin-pro/dvadmin3-base-web:16.19-alpine
|
||||
FROM registry.cn-zhangjiakou.aliyuncs.com/dvadmin-pro/dvadmin3-base-web:18.20-alpine
|
||||
WORKDIR /web/
|
||||
COPY web/. .
|
||||
RUN yarn install --registry=https://registry.npmmirror.com
|
||||
|
||||
@@ -11,8 +11,14 @@
|
||||
|
||||
<div v-if="props.inputType === 'image' && props.multiple"
|
||||
style="width: 100%; display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px;">
|
||||
<el-image v-for="item, index in (data || [])" :src="item" :key="index" fit="scale-down" class="itemList"
|
||||
<div v-for="item, index in (data || [])" style="position: relative;"
|
||||
:style="{ width: props.inputSize + 'px', height: props.inputSize + 'px' }">
|
||||
<el-image :src="item" :key="index" fit="scale-down" class="itemList"
|
||||
:style="{ width: props.inputSize + 'px', aspectRatio: '1 / 1' }" />
|
||||
<el-icon v-show="(!!data && !props.disabled)" class="closeHover" :size="16" @click="clearOne(item)">
|
||||
<Close />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div style="position: relative;" :style="{ width: props.inputSize + 'px', height: props.inputSize + 'px' }">
|
||||
<div
|
||||
style="position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;">
|
||||
@@ -22,10 +28,6 @@
|
||||
</div>
|
||||
<div @click="selectVisiable = true && !props.disabled" class="addControllorHover"
|
||||
:style="{ cursor: props.disabled ? 'not-allowed' : 'pointer' }"></div>
|
||||
<el-icon v-show="(!!data && !props.disabled) && !props.multiple" class="closeHover" :size="16"
|
||||
@click="clear">
|
||||
<Close />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="props.inputType === 'image' && !props.multiple" class="form-display" style="position: relative;"
|
||||
@@ -350,8 +352,12 @@ const clearState = () => {
|
||||
// all数据不能清,因为all只会在挂载的时候赋值一次
|
||||
// listAllData.value = [];
|
||||
};
|
||||
const clear = () => { data.value = null; onDataChange(null); }
|
||||
|
||||
const clear = () => { data.value = null; onDataChange(null); };
|
||||
const clearOne = (item: any) => {
|
||||
let _l = (JSON.parse(JSON.stringify(data.value)) as any[]).filter((i: any) => i !== item)
|
||||
data.value = _l;
|
||||
onDataChange(_l);
|
||||
};
|
||||
|
||||
// 网络文件部分
|
||||
const netLoading = ref<boolean>(false);
|
||||
@@ -409,7 +415,15 @@ watch(
|
||||
const { ui } = useUi();
|
||||
const formValidator = ui.formItem.injectFormItemContext();
|
||||
const onDataChange = (value: any) => {
|
||||
emit('update:modelValue', value);
|
||||
let _v = null;
|
||||
if (value) {
|
||||
if (typeof value === 'string') _v = value.replace(/\\/g, '/');
|
||||
else {
|
||||
_v = [];
|
||||
for (let i of value) _v.push(i.replace(/\\/g, '/'));
|
||||
}
|
||||
}
|
||||
emit('update:modelValue', _v);
|
||||
formValidator.onChange();
|
||||
formValidator.onBlur();
|
||||
};
|
||||
|
||||
@@ -228,26 +228,26 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
|
||||
show: false
|
||||
}
|
||||
},
|
||||
fileselectortest: {
|
||||
title: '文件选择器测试',
|
||||
type: 'file-selector',
|
||||
column: {
|
||||
minWidth: 200
|
||||
},
|
||||
form: {
|
||||
component: {
|
||||
name: fileSelector,
|
||||
vModel: 'modelValue',
|
||||
tabsShow: 0b1111,
|
||||
itemSize: 100,
|
||||
multiple: true,
|
||||
selectable: true,
|
||||
showInput: true,
|
||||
inputType: 'image',
|
||||
valueKey: 'url',
|
||||
}
|
||||
}
|
||||
}
|
||||
// fileselectortest: {
|
||||
// title: '文件选择器测试',
|
||||
// type: 'file-selector',
|
||||
// column: {
|
||||
// minWidth: 200
|
||||
// },
|
||||
// form: {
|
||||
// component: {
|
||||
// name: fileSelector,
|
||||
// vModel: 'modelValue',
|
||||
// tabsShow: 0b1111,
|
||||
// itemSize: 100,
|
||||
// multiple: true,
|
||||
// selectable: true,
|
||||
// showInput: true,
|
||||
// inputType: 'image',
|
||||
// valueKey: 'url',
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user