|
|
@ -1,4 +1,4 @@ |
|
|
|
<template> |
|
|
|
<!-- <template> |
|
|
|
<div> |
|
|
|
<w-grid |
|
|
|
ref="gridRef" |
|
|
@ -6,6 +6,7 @@ |
|
|
|
draggable |
|
|
|
sort-no |
|
|
|
tree |
|
|
|
:checkbox-selection="false" |
|
|
|
:data-url="testGrid.dataUrl" |
|
|
|
:fetch-data-url="testGrid.fetchDataUrl" |
|
|
|
:columns="testGrid.tableColumns" |
|
|
@ -128,7 +129,227 @@ const testGrid = { |
|
|
|
], |
|
|
|
}; |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
// testGridRef.value.replaceRowsFun([{ typeName: '股权投资信息', typeDesc: '股权投资信息', lastModifier: 'admin', lastModifyDate: '2023-12-26' }]); |
|
|
|
}); |
|
|
|
</script> --> |
|
|
|
|
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<w-grid |
|
|
|
ref="gridRef" |
|
|
|
:title="testGrid.title" |
|
|
|
draggable |
|
|
|
sort-no |
|
|
|
:pageable="false" |
|
|
|
tree |
|
|
|
tree-relationship-field="parentId" |
|
|
|
:checkbox-selection="false" |
|
|
|
:data-url="testGrid.dataUrl" |
|
|
|
:fetch-data-url="testGrid.fetchDataUrl" |
|
|
|
:columns="testGrid.tableColumns" |
|
|
|
:toolbar-actions="testGrid.toolbar" |
|
|
|
:query-form-fields="testGrid.queryFormFields" |
|
|
|
:query-form-cols-num="3" |
|
|
|
@selection="selection" |
|
|
|
></w-grid> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, onMounted, nextTick } from 'vue'; |
|
|
|
import { useI18n } from 'vue-i18n'; |
|
|
|
import { axios, Environment } from '@/platform'; |
|
|
|
import EnableIcon from '@/platform/components/grid/EnableIcon.vue'; |
|
|
|
import { IconEnum } from '@/platform/enums'; |
|
|
|
|
|
|
|
const { t } = useI18n(); |
|
|
|
|
|
|
|
const gridRef = ref(); |
|
|
|
const selection = (details) => { |
|
|
|
console.info('details====', details); |
|
|
|
}; |
|
|
|
const testGrid = { |
|
|
|
title: '菜单列表', |
|
|
|
dataUrl: Environment.apiContextPath('api/system/menu'), |
|
|
|
fetchDataUrl: Environment.apiContextPath('/api/developer/plugins/parameters'), |
|
|
|
toolbar: [ |
|
|
|
['query', 'separator', 'moreQuery'], |
|
|
|
'reset', |
|
|
|
'refresh', |
|
|
|
'separator', |
|
|
|
{ |
|
|
|
name: 'custBtn', |
|
|
|
extend: 'add', |
|
|
|
icon: undefined, |
|
|
|
label: '自定义按钮', |
|
|
|
enableIf: (selected, grid) => { |
|
|
|
if (selected && selected.length > 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
}, |
|
|
|
// beforeClick: (selected, context, grid) => { |
|
|
|
// console.info('先执行before'); |
|
|
|
// context.aaa = '111'; |
|
|
|
// }, |
|
|
|
click: (selected, context, _click, grid) => { |
|
|
|
_click(selected); |
|
|
|
}, |
|
|
|
afterClick: (selected, context, grid) => { |
|
|
|
console.info('=grid==', grid.getEditorForm()); |
|
|
|
// gridRefs.addEditFormRef.setFieldValue('userName', '李四'); |
|
|
|
}, |
|
|
|
}, |
|
|
|
[ |
|
|
|
{ |
|
|
|
name: 'op', |
|
|
|
icon: 'difference', |
|
|
|
label: '操作', |
|
|
|
}, |
|
|
|
'add', |
|
|
|
'edit', |
|
|
|
'clone', |
|
|
|
'remove', |
|
|
|
'separator', |
|
|
|
'view', |
|
|
|
'export', |
|
|
|
], |
|
|
|
'separator', |
|
|
|
], |
|
|
|
queryFormFields: [ |
|
|
|
{ label: '菜单名称', name: 'name', type: 'w-password' }, |
|
|
|
{ label: '菜单类型', name: 'userName', type: 'select' }, |
|
|
|
{ label: '是否可用', name: 'enable', type: 'select' }, |
|
|
|
], |
|
|
|
tableColumns: [ |
|
|
|
{ |
|
|
|
name: 'id', |
|
|
|
label: 'id', |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: 'parentId', |
|
|
|
label: 'parentId', |
|
|
|
}, |
|
|
|
{ name: 'code', label: 'code' }, |
|
|
|
{ name: 'defaultValue', label: 'defaultValue' }, |
|
|
|
{ |
|
|
|
name: 'order', |
|
|
|
label: 'order', |
|
|
|
}, |
|
|
|
{ name: 'configurationFileUrl', label: 'configurationFileUrl' }, |
|
|
|
], |
|
|
|
}; |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
// testGridRef.value.replaceRowsFun([{ typeName: '股权投资信息', typeDesc: '股权投资信息', lastModifier: 'admin', lastModifyDate: '2023-12-26' }]); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|
<!-- <template> |
|
|
|
<div> |
|
|
|
<w-grid |
|
|
|
ref="gridRef" |
|
|
|
:title="testGrid.title" |
|
|
|
draggable |
|
|
|
sort-no |
|
|
|
:pageable="false" |
|
|
|
:checkbox-selection="false" |
|
|
|
:fetch-data-url="testGrid.fetchDataUrl" |
|
|
|
:columns="testGrid.tableColumns" |
|
|
|
:toolbar-actions="testGrid.toolbar" |
|
|
|
:query-form-fields="testGrid.queryFormFields" |
|
|
|
:query-form-cols-num="3" |
|
|
|
@selection="selection" |
|
|
|
></w-grid> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, onMounted, nextTick } from 'vue'; |
|
|
|
import { useI18n } from 'vue-i18n'; |
|
|
|
import { axios, Environment } from '@/platform'; |
|
|
|
import EnableIcon from '@/platform/components/grid/EnableIcon.vue'; |
|
|
|
import { IconEnum } from '@/platform/enums'; |
|
|
|
|
|
|
|
const { t } = useI18n(); |
|
|
|
|
|
|
|
const gridRef = ref(); |
|
|
|
const selection = (details) => { |
|
|
|
console.info('details====', details); |
|
|
|
}; |
|
|
|
const testGrid = { |
|
|
|
title: '菜单列表', |
|
|
|
fetchDataUrl: Environment.apiContextPath('/api/developer/plugins/restartProperties'), |
|
|
|
toolbar: [ |
|
|
|
['query', 'separator', 'moreQuery'], |
|
|
|
'reset', |
|
|
|
'refresh', |
|
|
|
'separator', |
|
|
|
{ |
|
|
|
name: 'custBtn', |
|
|
|
extend: 'add', |
|
|
|
icon: undefined, |
|
|
|
label: '自定义按钮', |
|
|
|
enableIf: (selected, grid) => { |
|
|
|
if (selected && selected.length > 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
}, |
|
|
|
// beforeClick: (selected, context, grid) => { |
|
|
|
// console.info('先执行before'); |
|
|
|
// context.aaa = '111'; |
|
|
|
// }, |
|
|
|
click: (selected, context, _click, grid) => { |
|
|
|
_click(selected); |
|
|
|
}, |
|
|
|
afterClick: (selected, context, grid) => { |
|
|
|
console.info('=grid==', grid.getEditorForm()); |
|
|
|
// gridRefs.addEditFormRef.setFieldValue('userName', '李四'); |
|
|
|
}, |
|
|
|
}, |
|
|
|
[ |
|
|
|
{ |
|
|
|
name: 'op', |
|
|
|
icon: 'difference', |
|
|
|
label: '操作', |
|
|
|
}, |
|
|
|
'add', |
|
|
|
'edit', |
|
|
|
'clone', |
|
|
|
'remove', |
|
|
|
'separator', |
|
|
|
'view', |
|
|
|
'export', |
|
|
|
], |
|
|
|
'separator', |
|
|
|
], |
|
|
|
queryFormFields: [ |
|
|
|
{ label: '菜单名称', name: 'name', type: 'w-password' }, |
|
|
|
{ label: '菜单类型', name: 'userName', type: 'select' }, |
|
|
|
{ label: '是否可用', name: 'enable', type: 'select' }, |
|
|
|
], |
|
|
|
tableColumns: [ |
|
|
|
{ |
|
|
|
name: 'id', |
|
|
|
label: 'id', |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: 'parentId', |
|
|
|
label: 'parentId', |
|
|
|
}, |
|
|
|
{ name: 'code', label: 'code' }, |
|
|
|
{ name: 'defaultValue', label: 'defaultValue' }, |
|
|
|
{ |
|
|
|
name: 'order', |
|
|
|
label: 'order', |
|
|
|
}, |
|
|
|
{ name: 'configurationFileUrl', label: 'configurationFileUrl' }, |
|
|
|
], |
|
|
|
}; |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
// testGridRef.value.replaceRowsFun([{ typeName: '股权投资信息', typeDesc: '股权投资信息', lastModifier: 'admin', lastModifyDate: '2023-12-26' }]); |
|
|
|
}); |
|
|
|
</script> --> |
|
|
|