Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev

This commit is contained in:
100011797 2023-07-10 17:55:44 +08:00
commit 7504dc3f88
7 changed files with 26 additions and 16 deletions

View File

@ -102,6 +102,7 @@ const uploadChange = async (info: Record<string, any>) => {
.then((response: any) => {
count.value = response.result?.total || 0
onlyMessage('导入成功');
errMessage.value = '';
})
.catch((err) => {
errMessage.value = err?.response?.data?.message || '导入失败'

View File

@ -458,11 +458,11 @@ const uploader: uploaderType = {
uploader.imageTypes
.map((m: string) => m.split('.')[1])
.filter((typeStr) => file.type.includes(typeStr)).length > 0;
const sizeBool = file.size / 1024 / 1024 < 4;
const sizeBool = file.size / 1024 / 1024 < 2;
if (!typeBool) {
onlyMessage(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`, 'error');
} else if (!sizeBool) {
onlyMessage(`图片大小必须小于4M`, 'error');
onlyMessage(`图片大小必须小于2M`, 'error');
}
return typeBool && sizeBool;
},

View File

@ -17,6 +17,7 @@
v-model:value="form.data.parentId"
style="width: 100%"
placeholder="请选择上级组织"
allowClear
:tree-data="treeData"
:field-names="{ value: 'id' }"
@change="handleTreeSelectChange"

View File

@ -128,7 +128,7 @@ function getTree(cb?: Function) {
treeMap.clear()
getTreeData_api(params)
.then((resp: any) => {
selectedKeys.value = [resp.result[0].id];
selectedKeys.value = [resp.result[0]?.id];
sourceTree.value = resp.result.sort((a: any, b: any) =>
a.sortIndex === b.sortIndex
? b.createTime - a.createTime
@ -272,7 +272,8 @@ init();
align-items: center;
.title {
width: calc(100% - 80px);
flex: 1;
min-width: 80px;
}
.func-btns {
display: none;

View File

@ -93,25 +93,25 @@
</template>
<template #content>
<h3 class="card-item-content-title" style='margin-bottom: 18px;'>
<Ellipsis style="width: calc(100% - 100px);"
>
{{ slotProps.name }}
</Ellipsis>
</h3>
<j-row>
<j-col :span="12">
<div class="card-item-content-text">ID</div>
<Ellipsis style="width: calc(100% - 20px);">
<div
style="cursor: pointer"
class="card-item-content-value"
>
{{ slotProps.id }}
</div>
</Ellipsis>
</j-col>
<j-col :span="12">
<div class="card-item-content-text">
资产权限
</div>
<Ellipsis style="width: calc(100% - 20px);">
<div
style="cursor: pointer"
class="card-item-content-value"
@ -123,6 +123,7 @@
)
}}
</div>
</Ellipsis>
</j-col>
</j-row>
</template>
@ -303,7 +304,6 @@ const columns = [
key: 'permission',
ellipsis: true,
scopedSlots: true,
width: 300,
},
{
title: '注册时间',
@ -311,7 +311,6 @@ const columns = [
key: 'registryTime',
ellipsis: true,
scopedSlots: true,
width: 200,
search: {
type: 'date',
},
@ -330,6 +329,7 @@ const columns = [
],
},
scopedSlots: true,
width:80
},
{

View File

@ -89,25 +89,25 @@
</template>
<template #content>
<h3 class="card-item-content-title" style='margin-bottom: 18px;'>
<Ellipsis style="width: calc(100% - 100px);"
>
{{ slotProps.name }}
</Ellipsis>
</h3>
<j-row>
<j-col :span="12">
<div class="card-item-content-text">ID</div>
<Ellipsis style="width: calc(100% - 20px);">
<div
style="cursor: pointer"
class="card-item-content-value"
>
{{ slotProps.id }}
</div>
</Ellipsis>
</j-col>
<j-col :span="12">
<div class="card-item-content-text">
资产权限
</div>
<Ellipsis style="width: calc(100% - 20px);">
<div
style="cursor: pointer"
class="card-item-content-value"
@ -119,6 +119,7 @@
)
}}
</div>
</Ellipsis>
</j-col>
</j-row>
</template>
@ -297,7 +298,7 @@ const columns = [
dataIndex: 'state',
key: 'state',
ellipsis: true,
width: '80px',
width: 80,
search: {
type: 'select',
options: [

View File

@ -5,6 +5,7 @@
<j-form ref="basicFormRef" :model="form.data" class="basic-form">
<div class="row" style="display: flex">
<j-form-item
ref="uploadIcon"
label="菜单图标"
name="icon"
:rules="[
@ -252,7 +253,7 @@
<ChooseIconDialog
v-if="dialogVisible"
v-model:visible="dialogVisible"
@confirm="(typeStr:string)=>form.data.icon = typeStr"
@confirm="(typeStr:string)=>choseIcon(typeStr)"
/>
</div>
</template>
@ -288,6 +289,7 @@ const routeParams = {
//
const basicFormRef = ref<FormInstance>();
const permissFormRef = ref<FormInstance>();
const uploadIcon = ref<FormInstance>();
const form = reactive({
data: {
name: '',
@ -393,6 +395,10 @@ const form = reactive({
});
form.init();
const choseIcon = (typeStr:string) =>{
form.data.icon = typeStr;
uploadIcon.value?.clearValidate();
}
//
const dialogVisible = ref(false);