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 django_filters.utils import get_model_field
|
||||||
from rest_framework.filters import BaseFilterBackend
|
from rest_framework.filters import BaseFilterBackend
|
||||||
from django_filters.conf import settings
|
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
|
from dvadmin.utils.models import CoreModel
|
||||||
|
|
||||||
class CoreModelFilterBankend(BaseFilterBackend):
|
class CoreModelFilterBankend(BaseFilterBackend):
|
||||||
@@ -149,13 +149,16 @@ class DataLevelPermissionsFilter(BaseFilterBackend):
|
|||||||
if _pk: # 判断是否是单例查询
|
if _pk: # 判断是否是单例查询
|
||||||
re_api = re.sub(_pk,'{id}', api)
|
re_api = re.sub(_pk,'{id}', api)
|
||||||
role_id_list = request.user.role.values_list('id', flat=True)
|
role_id_list = request.user.role.values_list('id', flat=True)
|
||||||
role_permission_list=RoleMenuButtonPermission.objects.filter(
|
# 修复权限获取bug
|
||||||
role__in=role_id_list,
|
menu_button_ids = MenuButton.objects.filter(api=re_api,method=method).values_list('id', flat=True)
|
||||||
role__status=1,
|
role_permission_list = []
|
||||||
menu_button__api=re_api,
|
if menu_button_ids:
|
||||||
menu_button__method=method).values(
|
role_permission_list=RoleMenuButtonPermission.objects.filter(
|
||||||
'data_range'
|
role__in=role_id_list,
|
||||||
)
|
role__status=1,
|
||||||
|
menu_button_id__in=menu_button_ids).values(
|
||||||
|
'data_range'
|
||||||
|
)
|
||||||
dataScope_list = [] # 权限范围列表
|
dataScope_list = [] # 权限范围列表
|
||||||
for ele in role_permission_list:
|
for ele in role_permission_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/
|
WORKDIR /web/
|
||||||
COPY web/. .
|
COPY web/. .
|
||||||
RUN yarn install --registry=https://registry.npmmirror.com
|
RUN yarn install --registry=https://registry.npmmirror.com
|
||||||
|
|||||||
@@ -11,8 +11,14 @@
|
|||||||
|
|
||||||
<div v-if="props.inputType === 'image' && props.multiple"
|
<div v-if="props.inputType === 'image' && props.multiple"
|
||||||
style="width: 100%; display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px;">
|
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', aspectRatio: '1 / 1' }" />
|
: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: relative;" :style="{ width: props.inputSize + 'px', height: props.inputSize + 'px' }">
|
||||||
<div
|
<div
|
||||||
style="position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;">
|
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>
|
||||||
<div @click="selectVisiable = true && !props.disabled" class="addControllorHover"
|
<div @click="selectVisiable = true && !props.disabled" class="addControllorHover"
|
||||||
:style="{ cursor: props.disabled ? 'not-allowed' : 'pointer' }"></div>
|
: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>
|
</div>
|
||||||
<div v-if="props.inputType === 'image' && !props.multiple" class="form-display" style="position: relative;"
|
<div v-if="props.inputType === 'image' && !props.multiple" class="form-display" style="position: relative;"
|
||||||
@@ -350,8 +352,12 @@ const clearState = () => {
|
|||||||
// all数据不能清,因为all只会在挂载的时候赋值一次
|
// all数据不能清,因为all只会在挂载的时候赋值一次
|
||||||
// listAllData.value = [];
|
// 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);
|
const netLoading = ref<boolean>(false);
|
||||||
@@ -409,7 +415,15 @@ watch(
|
|||||||
const { ui } = useUi();
|
const { ui } = useUi();
|
||||||
const formValidator = ui.formItem.injectFormItemContext();
|
const formValidator = ui.formItem.injectFormItemContext();
|
||||||
const onDataChange = (value: any) => {
|
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.onChange();
|
||||||
formValidator.onBlur();
|
formValidator.onBlur();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -228,26 +228,26 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
|
|||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fileselectortest: {
|
// fileselectortest: {
|
||||||
title: '文件选择器测试',
|
// title: '文件选择器测试',
|
||||||
type: 'file-selector',
|
// type: 'file-selector',
|
||||||
column: {
|
// column: {
|
||||||
minWidth: 200
|
// minWidth: 200
|
||||||
},
|
// },
|
||||||
form: {
|
// form: {
|
||||||
component: {
|
// component: {
|
||||||
name: fileSelector,
|
// name: fileSelector,
|
||||||
vModel: 'modelValue',
|
// vModel: 'modelValue',
|
||||||
tabsShow: 0b1111,
|
// tabsShow: 0b1111,
|
||||||
itemSize: 100,
|
// itemSize: 100,
|
||||||
multiple: true,
|
// multiple: true,
|
||||||
selectable: true,
|
// selectable: true,
|
||||||
showInput: true,
|
// showInput: true,
|
||||||
inputType: 'image',
|
// inputType: 'image',
|
||||||
valueKey: 'url',
|
// valueKey: 'url',
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user