diff --git a/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue b/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue
index 7ed256f..bf73ffe 100644
--- a/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue
+++ b/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue
@@ -28,7 +28,10 @@ const emit = defineEmits(['update:modelValue', 'change'])
const magicTable = ref()
const props = defineProps({
- modelValue: Array,
+ modelValue: {
+ type: Array,
+ default: () => []
+ },
cols: {
type: Array,
default: () => []
@@ -36,11 +39,15 @@ const props = defineProps({
showNo: {
type: Boolean,
default: true
+ },
+ operation: {
+ type: Boolean,
+ default: true
}
})
const tableOptions = reactive({
- data: [],
+ data: props.modelValue,
cols: [],
showNo: props.showNo
})
@@ -48,25 +55,26 @@ const tableOptions = reactive({
for (var i in props.cols) {
var col = props.cols[i]
tableOptions.cols.push({
- type: 'dynamic',
- field: col.field,
- label: col.label
+ ...col,
+ type: 'dynamic'
})
}
-tableOptions.cols.push({
- label: '操作',
- type: 'btns',
- width: 85,
- fixed: 'right',
- btns: [{
- label: '删除',
- type: 'danger',
- click: (row, index) => {
- tableOptions.data.splice(index, 1)
- }
- }]
-})
+if(props.operation){
+ tableOptions.cols.push({
+ label: '操作',
+ type: 'btns',
+ width: 85,
+ fixed: 'right',
+ btns: [{
+ label: '删除',
+ type: 'danger',
+ click: (row, index) => {
+ tableOptions.data.splice(index, 1)
+ }
+ }]
+ })
+}
watch(() => props.modelValue, (value) => {
console.log(value)
diff --git a/magic-boot-ui/src/components/magic/basic/mb-search.vue b/magic-boot-ui/src/components/magic/basic/mb-search.vue
index 7a084d3..d9e051f 100644
--- a/magic-boot-ui/src/components/magic/basic/mb-search.vue
+++ b/magic-boot-ui/src/components/magic/basic/mb-search.vue
@@ -56,10 +56,6 @@ for(var key in props.where){
}
}
-watch(() => props.where,() => {
- console.log(props.where)
-})
-
const emit = defineEmits(['search', 'mounted'])
function input(input){
diff --git a/magic-boot-ui/src/components/magic/form/mb-tree.vue b/magic-boot-ui/src/components/magic/form/mb-tree.vue
index af3a714..c601cfa 100644
--- a/magic-boot-ui/src/components/magic/form/mb-tree.vue
+++ b/magic-boot-ui/src/components/magic/form/mb-tree.vue
@@ -75,10 +75,6 @@ const props = defineProps({
}
})
-watch(() => props.checkedIds, (value) => {
- console.log(value)
-})
-
const tree = ref()
const treeData = ref([])
const searchData = ref([])
diff --git a/magic-boot-ui/src/layout/tabs.vue b/magic-boot-ui/src/layout/tabs.vue
index 83e770c..7b6deec 100644
--- a/magic-boot-ui/src/layout/tabs.vue
+++ b/magic-boot-ui/src/layout/tabs.vue
@@ -43,8 +43,10 @@
tabValue.value = global.tabValue.value
})
function openTab(item){
+ console.log(global.visitedViews.map(it => it.name))
proxy.$router.push({
- path: item.props.name
+ path: item.props.name,
+ query: global.visitedViews.filter(it => it.path == item.props.name)[0].query
})
}
function removeTab(path){
@@ -58,7 +60,8 @@
if(it.path == path){
global.visitedViews.splice(i, 1)
proxy.$router.push({
- path: global.visitedViews[global.visitedViews.length - 1].path
+ path: global.visitedViews[global.visitedViews.length - 1].path,
+ query: global.visitedViews[global.visitedViews.length - 1].query
})
}
})
@@ -66,7 +69,8 @@
}
function refresh(path){
proxy.$router.replace({
- path: `/redirect${path}`
+ path: `/redirect${path}`,
+ query: global.visitedViews.filter(it => it.path == path)[0].query
})
}
function close(type, path){
@@ -85,16 +89,17 @@
}
}
}else{
- for(var i = 0; i < global.visitedViews.length; i++){
- if(global.visitedViews[i].path != path){
- global.visitedViews.splice(i, 1)
+ for(var i = 0, len = global.visitedViews.length; i < len; i++){
+ if(global.visitedViews[0].path != path){
+ global.visitedViews.splice(0, 1)
}else{
break;
}
}
}
proxy.$router.push({
- path: path
+ path: path,
+ query: global.visitedViews.filter(it => it.path == path)[0].query
})
}
diff --git a/magic-boot-ui/src/main.js b/magic-boot-ui/src/main.js
index 7938870..725f958 100644
--- a/magic-boot-ui/src/main.js
+++ b/magic-boot-ui/src/main.js
@@ -24,9 +24,13 @@ document.title = global.title
router.beforeEach((to, from) => {
global.tabValue.value = to.path
if((to.name && global.visitedViews.length === 0 || global.visitedViews.every(it => it.path !== to.path)) && !to.path.startsWith('/redirect') && !to.path.startsWith('/login')){
- console.log(to)
global.visitedViews.push(to)
}
+ global.visitedViews.forEach((it, i) => {
+ if(it.path == to.path){
+ global.visitedViews[i] = to
+ }
+ })
return true
})
app.use(globalProperties)
diff --git a/magic-boot-ui/src/views/examples/editor-table.vue b/magic-boot-ui/src/views/examples/editor-table.vue
index 9db396d..adde219 100644
--- a/magic-boot-ui/src/views/examples/editor-table.vue
+++ b/magic-boot-ui/src/views/examples/editor-table.vue
@@ -1,7 +1,7 @@