fix: bug#18550、18545、

This commit is contained in:
leiqiaochu 2023-09-20 21:49:23 +08:00
parent 351a399135
commit 7943a4108f
3 changed files with 109 additions and 129 deletions

View File

@ -14,7 +14,6 @@
> >
新增字典 新增字典
</PermissionButton> </PermissionButton>
<!-- <j-button type="primary" @click="showSave" style="width: 60%;">新增字典</j-button> -->
<PermissionButton <PermissionButton
type="text" type="text"
hasPermission="system/Dictionary:down" hasPermission="system/Dictionary:down"
@ -22,7 +21,6 @@
> >
下载 下载
</PermissionButton> </PermissionButton>
<!-- <j-button type="text" @click="downVisible=true">下载</j-button> -->
<j-upload <j-upload
:before-upload="beforeUpload" :before-upload="beforeUpload"
accept=".json" accept=".json"
@ -44,10 +42,10 @@
<div class="itemText"><Ellipsis style="width: calc(100%-100px)">{{ item.name }}</Ellipsis></div> <div class="itemText"><Ellipsis style="width: calc(100%-100px)">{{ item.name }}</Ellipsis></div>
<div @click="(e) => e.stopPropagation()"> <div @click="(e) => e.stopPropagation()">
<j-popconfirm v-if="hasPermission('system/Dictionary:action')" :title="item.data.status === 1 ? '确定禁用?' : '确定启用?'" @confirm="()=>updateDic(item.data)"> <j-popconfirm v-if="hasPermission('system/Dictionary:action')" :title="item.data.status === 1 ? '确定禁用?' : '确定启用?'" @confirm="()=>updateDic(item.data)">
<j-switch v-model:checked="item.status" :disabled="!hasPermission('system/Dictionary:action')" :checkedValue="1" :unCheckedValue="0"></j-switch> <j-switch :checked="item.status" :disabled="!hasPermission('system/Dictionary:action')" :checkedValue="1" :unCheckedValue="0"></j-switch>
</j-popconfirm> </j-popconfirm>
<j-tooltip v-else placement="top" title="暂无权限,请联系管理员"> <j-tooltip v-else placement="top" title="暂无权限,请联系管理员">
<j-switch v-model:checked="item.status" :disabled="!hasPermission('system/Dictionary:action')" :checkedValue="1" :unCheckedValue="0"></j-switch> <j-switch :checked="item.status" :disabled="!hasPermission('system/Dictionary:action')" :checkedValue="1" :unCheckedValue="0"></j-switch>
</j-tooltip> </j-tooltip>
<PermissionButton <PermissionButton
type="text" type="text"
@ -59,9 +57,6 @@
> >
删除 删除
</PermissionButton> </PermissionButton>
<!-- <j-popconfirm title="确认删除?" @confirm="()=>deleteDic(item.id)">
<j-button type="text">删除</j-button>
</j-popconfirm> -->
<PermissionButton <PermissionButton
type="text" type="text"
hasPermission="system/Dictionary:update" hasPermission="system/Dictionary:update"
@ -69,7 +64,6 @@
> >
编辑 编辑
</PermissionButton> </PermissionButton>
<!-- <j-button type="text" @click="()=>showEdit(item.data)">编辑</j-button> -->
</div> </div>
</div> </div>
</template> </template>

View File

@ -3,51 +3,33 @@
<div class="des_head"> <div class="des_head">
<div>字典ID<span>{{ data.id }}</span></div> <div>字典ID<span>{{ data.id }}</span></div>
<div>说明<span>{{ data.describe }}</span></div> <div>说明<span>{{ data.describe }}</span></div>
<div>创建日期<span>{{ data.name }}</span></div> <div>创建日期<span> {{
dayjs(
data?.createTime,
).format(
'YYYY-MM-DD HH:mm:ss',
)
}}</span></div>
</div> </div>
<div class="contain"> <div class="contain">
<pro-search <pro-search :columns="columns" @search="handleSearch" />
:columns="columns" <JProTable :columns="columns" model="TABLE" :request="queryItem" :params="params" ref="tableRef">
@search="handleSearch"
/>
<JProTable :columns="columns"
model="TABLE"
:request="queryItem"
:params="params"
ref="tableRef"
>
<template #headerTitle> <template #headerTitle>
<PermissionButton <PermissionButton type="primary" @click="add" hasPermission="system/Dictionary:add">
type="primary"
@click="add"
hasPermission="system/Dictionary:add"
>
新增 新增
</PermissionButton> </PermissionButton>
</template> </template>
<template #action="slotProps"> <template #action="slotProps">
<j-space> <j-space>
<template <template v-for="i in getActions(slotProps, 'table')" :key="i.key">
v-for="i in getActions(slotProps, 'table')" <PermissionButton :disabled="i.disabled" :popConfirm="i.popConfirm" :tooltip="{
:key="i.key"
>
<PermissionButton
:disabled="i.disabled"
:popConfirm="i.popConfirm"
:tooltip="{
...i.tooltip, ...i.tooltip,
}" }" @click="i.onClick" type="link" style="padding: 0 5px" :danger="i.key === 'delete'"
@click="i.onClick" :hasPermission="'system/Dictionary:' + i.key
type="link" ">
style="padding: 0 5px" <template #icon>
:danger="i.key === 'delete'" <AIcon :type="i.icon" />
:hasPermission=" </template>
'system/Dictionary:' + i.key
"
>
<template #icon
><AIcon :type="i.icon"
/></template>
</PermissionButton> </PermissionButton>
</template> </template>
</j-space> </j-space>
@ -55,7 +37,8 @@
</JProTable> </JProTable>
</div> </div>
</div> </div>
<Save v-if="saveVisible" :dicId='data.id' :type="modalType" :data="current" :sort=sort @closeModal="closeModal" @refresh="refresh"/> <Save v-if="saveVisible" :dicId='data.id' :type="modalType" :data="current" :sort=sort @closeModal="closeModal"
@refresh="refresh" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -64,6 +47,7 @@ import Save from './Save/index.vue'
import type { ActionsType } from './typings'; import type { ActionsType } from './typings';
import { onlyMessage } from '@/utils/comm'; import { onlyMessage } from '@/utils/comm';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
import dayjs from 'dayjs';
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
@ -228,6 +212,7 @@ watch(()=>props?.data?.id,()=>{
.des_head { .des_head {
padding: 10px 20px; padding: 10px 20px;
background-color: rgb(242, 242, 242); background-color: rgb(242, 242, 242);
span { span {
color: rgb(127, 127, 127) color: rgb(127, 127, 127)
} }

View File

@ -94,10 +94,11 @@
: '删除', : '删除',
}" }"
:popConfirm="{ :popConfirm="{
title: `确认删除`, title:slotProps?.type?.id === 'application' ? '此操作将同步删除对应的第三方配置,确认删除?':'确认删除',
onConfirm: () => onConfirm: () =>
table.clickDel(slotProps.id), table.clickDel(slotProps.id),
}" }"
:disabled="slotProps.status" :disabled="slotProps.status"
> >
<AIcon type="DeleteOutlined" /> <AIcon type="DeleteOutlined" />
@ -215,7 +216,7 @@ const columns = [
dataIndex: 'action', dataIndex: 'action',
key: 'action', key: 'action',
fixed: 'right', fixed: 'right',
width: 150, width: 200,
scopedSlots: true, scopedSlots: true,
}, },
]; ];