diff --git a/template/admin/src/layout/navBars/tagsView/tagsView.vue b/template/admin/src/layout/navBars/tagsView/tagsView.vue index b2787ead7..97da63385 100644 --- a/template/admin/src/layout/navBars/tagsView/tagsView.vue +++ b/template/admin/src/layout/navBars/tagsView/tagsView.vue @@ -62,7 +62,7 @@ export default { // 获取布局配置信息 getThemeConfig() { return this.$store.state.themeConfig.themeConfig; - }, + }, // 动态设置 tagsView 风格样式 setTagsStyle() { return this.$store.state.themeConfig.themeConfig.tagsStyle; diff --git a/template/admin/src/pages/system/codeGeneration/components/TableForm.vue b/template/admin/src/pages/system/codeGeneration/components/TableForm.vue index ed0099d04..458afd03f 100644 --- a/template/admin/src/pages/system/codeGeneration/components/TableForm.vue +++ b/template/admin/src/pages/system/codeGeneration/components/TableForm.vue @@ -49,7 +49,7 @@ @@ -100,8 +100,7 @@ export default { }, }, id: { - type: String, - default: '', + type: String | Number, }, }, data() { @@ -231,7 +230,12 @@ export default { if ((!el.field || !el.field_type) && !['addTimestamps', 'addSoftDelete'].includes(el.field_type)) { return this.$Message.warning('请先完善上一条数据'); } - if (el.is_table && !el.table_name && !['addTimestamps', 'addSoftDelete'].includes(el.field_type)) { + if ( + el.is_table && + !el.table_name && + !Number(el.primaryKey) && + !['addTimestamps', 'addSoftDelete'].includes(el.field_type) + ) { return this.$Message.warning('请输入列表名'); } } diff --git a/template/admin/src/pages/system/codeGeneration/index.vue b/template/admin/src/pages/system/codeGeneration/index.vue index 56ea9b117..5e6858047 100644 --- a/template/admin/src/pages/system/codeGeneration/index.vue +++ b/template/admin/src/pages/system/codeGeneration/index.vue @@ -89,7 +89,7 @@ export default { tableField: [], rowList: [], reqloading: false, - id: "", + id: '', }; }, created() { @@ -102,9 +102,8 @@ export default { methods: { getDetail(id) { crudDet(id).then((res) => { - console.log(res); let data = res.data.crudInfo.field; - this.formItem.foundation.pid = data.pid; + this.formItem.foundation.pid = Number(data.pid); this.formItem.foundation.tableName = data.tableName; this.formItem.foundation.modelName = data.modelName; this.formItem.foundation.menuName = data.menuName; diff --git a/template/admin/src/store/module/app.js b/template/admin/src/store/module/app.js index 89a44ad62..574347bd3 100644 --- a/template/admin/src/store/module/app.js +++ b/template/admin/src/store/module/app.js @@ -77,13 +77,15 @@ export default { }, addTag(state, { route, type = 'unshift' }) { let router = getRouteTitleHandled(route); - console.log(router, 'routerrouterrouter'); + let i = state.tagNavList.findIndex((item) => item.path === route.path); + if (!routeHasExist(state.tagNavList, router)) { - if (type === 'push') state.tagNavList.push(router); - else { - if (router.name === homeName) state.tagNavList.unshift(router); - else state.tagNavList.splice(1, 0, router); - } + if (type === 'push') + if (i < 1) state.tagNavList.push(router); + else { + if (router.name === homeName) state.tagNavList.unshift(router); + else state.tagNavList.splice(1, 0, router); + } setTagNavListInLocalstorage([...state.tagNavList]); } },