parent
809a66956c
commit
95f6f45e88
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="tableContainer">
|
|
||||||
<j-data-table
|
<j-data-table
|
||||||
|
v-if="!heavyLoad"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:data-source="dataSource"
|
:data-source="dataSource"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -37,7 +37,6 @@
|
||||||
:hasPermission="`${permission}:update`"
|
:hasPermission="`${permission}:update`"
|
||||||
key="update"
|
key="update"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
|
||||||
:disabled="hasOperate('add', type) || !editStatus"
|
:disabled="hasOperate('add', type) || !editStatus"
|
||||||
:tooltip="{
|
:tooltip="{
|
||||||
title: hasOperate('add', type)
|
title: hasOperate('add', type)
|
||||||
|
@ -204,8 +203,9 @@
|
||||||
</template>
|
</template>
|
||||||
</j-data-table>
|
</j-data-table>
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
type="dashed"
|
type="primary"
|
||||||
block
|
block
|
||||||
|
ghost
|
||||||
:hasPermission="`${permission}:update`"
|
:hasPermission="`${permission}:update`"
|
||||||
key="add"
|
key="add"
|
||||||
:disabled="hasOperate('add', type)"
|
:disabled="hasOperate('add', type)"
|
||||||
|
@ -219,9 +219,9 @@
|
||||||
@click="handleAddClick()"
|
@click="handleAddClick()"
|
||||||
placement="topRight"
|
placement="topRight"
|
||||||
>
|
>
|
||||||
新增
|
<template #icon><AIcon type="PlusOutlined"/></template>
|
||||||
|
新增行
|
||||||
</PermissionButton>
|
</PermissionButton>
|
||||||
</div>
|
|
||||||
<PropertiesModal
|
<PropertiesModal
|
||||||
v-if="type === 'properties' && detailData.visible"
|
v-if="type === 'properties' && detailData.visible"
|
||||||
:data="detailData.data"
|
:data="detailData.data"
|
||||||
|
@ -279,6 +279,7 @@ import {useSystem} from "store/system";
|
||||||
import {storeToRefs} from "pinia";
|
import {storeToRefs} from "pinia";
|
||||||
import { FULL_CODE } from 'jetlinks-ui-components/es/DataTable'
|
import { FULL_CODE } from 'jetlinks-ui-components/es/DataTable'
|
||||||
import { usePermissionStore } from '@/store/permission';
|
import { usePermissionStore } from '@/store/permission';
|
||||||
|
import App from '@/App.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
target: {
|
target: {
|
||||||
|
@ -323,7 +324,7 @@ const detailData = reactive({
|
||||||
visible:false
|
visible:false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const heavyLoad = ref<Boolean>(false)
|
||||||
|
|
||||||
const showSave = ref(metadata.value.length !== 0)
|
const showSave = ref(metadata.value.length !== 0)
|
||||||
|
|
||||||
|
@ -449,7 +450,6 @@ const removeItem = (index: number) => {
|
||||||
// }
|
// }
|
||||||
if (_data.length === 0) {
|
if (_data.length === 0) {
|
||||||
showSave.value = false
|
showSave.value = false
|
||||||
|
|
||||||
handleSaveClick()
|
handleSaveClick()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -559,11 +559,6 @@ onUnmounted(() => {
|
||||||
|
|
||||||
watch(() => metadata.value, () => {
|
watch(() => metadata.value, () => {
|
||||||
dataSource.value = metadata.value
|
dataSource.value = metadata.value
|
||||||
if(!dataSource.value.length){
|
|
||||||
nextTick(()=>{
|
|
||||||
tableContainer.value.classList.add('tableContainer')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, { immediate: true })
|
}, { immediate: true })
|
||||||
|
|
||||||
onBeforeRouteUpdate((to, from, next) => { // 设备管理内路由跳转
|
onBeforeRouteUpdate((to, from, next) => { // 设备管理内路由跳转
|
||||||
|
@ -582,9 +577,4 @@ onBeforeRouteLeave((to, from, next) => { // 设备管理外路由跳转
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-bottom: 16px;
|
padding-bottom: 16px;
|
||||||
}
|
}
|
||||||
.tableContainer{
|
|
||||||
:deep(.ant-table-body){
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -49,6 +49,7 @@ const handleOk = async () => {
|
||||||
...form.checkedMenu,
|
...form.checkedMenu,
|
||||||
// ...form.half,
|
// ...form.half,
|
||||||
]);
|
]);
|
||||||
|
dealMenu(items)
|
||||||
console.log(items);
|
console.log(items);
|
||||||
if (form.checkedSystem) {
|
if (form.checkedSystem) {
|
||||||
if (items && items.length !== 0) {
|
if (items && items.length !== 0) {
|
||||||
|
@ -169,6 +170,17 @@ function getSystemList(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dealMenu = (data:any)=>{
|
||||||
|
data?.forEach((i:any)=>{
|
||||||
|
i.options = {
|
||||||
|
show:true
|
||||||
|
}
|
||||||
|
if(i.children){
|
||||||
|
dealMenu(i.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
watch(() => props.data, (newVal: any) => {
|
watch(() => props.data, (newVal: any) => {
|
||||||
form.checkedSystem = newVal?.page.configuration?.checkedSystem
|
form.checkedSystem = newVal?.page.configuration?.checkedSystem
|
||||||
if (form.checkedSystem) {
|
if (form.checkedSystem) {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
title="集成菜单"
|
title="集成菜单"
|
||||||
visible
|
visible
|
||||||
width="800px"
|
width="800px"
|
||||||
|
:maskClosable="false"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@ok="cancel"
|
@ok="cancel"
|
||||||
>
|
>
|
||||||
|
@ -106,12 +107,10 @@
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入名称',
|
message: '请输入名称',
|
||||||
trigger: 'change',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
max: 64,
|
max: 64,
|
||||||
message: '最多可输入64个字符',
|
message: '最多可输入64个字符',
|
||||||
trigger: 'change',
|
|
||||||
},
|
},
|
||||||
]">
|
]">
|
||||||
<j-input v-model:value="formData.name" placeholder="请输入名称" />
|
<j-input v-model:value="formData.name" placeholder="请输入名称" />
|
||||||
|
@ -122,12 +121,10 @@
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入编码',
|
message: '请输入编码',
|
||||||
trigger: 'change',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
max: 64,
|
max: 64,
|
||||||
message: '最多可输入64个字符',
|
message: '最多可输入64个字符',
|
||||||
trigger: 'change',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
validator: checkCode,
|
validator: checkCode,
|
||||||
|
@ -152,12 +149,12 @@
|
||||||
</j-col> -->
|
</j-col> -->
|
||||||
</j-row>
|
</j-row>
|
||||||
</div>
|
</div>
|
||||||
<j-form-item label="页面地址" name="url" :rules="[
|
<j-form-item label="页面地址" name="url" :validateFirst="true" :rules="[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入页面地址',
|
message: '请输入页面地址',
|
||||||
},
|
},
|
||||||
{ max: 128, message: '最多可输入128字符' },
|
{ max: 128, message: '最多可输入128个字符'},
|
||||||
{ pattern: /^\//, message: '请正确填写地址,以/开头' },
|
{ pattern: /^\//, message: '请正确填写地址,以/开头' },
|
||||||
]">
|
]">
|
||||||
<j-input v-model:value="formData.url" placeholder="请输入页面地址" />
|
<j-input v-model:value="formData.url" placeholder="请输入页面地址" />
|
||||||
|
@ -268,6 +265,7 @@ const addChildrenMenu = (data:any) =>{
|
||||||
const addMenu = () =>{
|
const addMenu = () =>{
|
||||||
initFormData()
|
initFormData()
|
||||||
formData.value.sortIndex = rootMenuTotal.value
|
formData.value.sortIndex = rootMenuTotal.value
|
||||||
|
sourceCode.value = ''
|
||||||
showControls.value = true
|
showControls.value = true
|
||||||
editType.value = 'add'
|
editType.value = 'add'
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,7 +312,8 @@ const tableRef = ref();
|
||||||
const current = ref<any>({})
|
const current = ref<any>({})
|
||||||
const table = {
|
const table = {
|
||||||
refresh: () => {
|
refresh: () => {
|
||||||
tableRef.value.reload(queryParams.value);
|
// tableRef.value.reload(queryParams.value);
|
||||||
|
window.location.reload()
|
||||||
},
|
},
|
||||||
toAdd: () => {
|
toAdd: () => {
|
||||||
visible.value = true
|
visible.value = true
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
visible
|
visible
|
||||||
title="菜单图标"
|
title="菜单图标"
|
||||||
width="800px"
|
width="800px"
|
||||||
|
:maskClosable="false"
|
||||||
@cancel="emits('update:visible', false)"
|
@cancel="emits('update:visible', false)"
|
||||||
@ok="confirm"
|
@ok="confirm"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue