Skip to content

Commit

Permalink
Merge branch 'main' into dev2.7.7
Browse files Browse the repository at this point in the history
# Conflicts:
#	web/src/pathInfo.json
#	web/vitePlugin/componentName/index.js
  • Loading branch information
pixel(奇淼 committed Oct 26, 2024
2 parents dcd0eb2 + 6bb8f8a commit d1da92d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 27 deletions.
57 changes: 38 additions & 19 deletions web/src/pathInfo.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
{
"/src/view/about/index.vue": "About",
"/src/view/dashboard/components/banner.vue": "UnNameComponent",
"/src/view/dashboard/components/card.vue": "UnNameComponent",
"/src/view/dashboard/components/charts-content-numbers.vue": "UnNameComponent",
"/src/view/dashboard/components/charts-people-numbers.vue": "UnNameComponent",
"/src/view/dashboard/components/charts.vue": "UnNameComponent",
"/src/view/dashboard/components/notice.vue": "UnNameComponent",
"/src/view/dashboard/components/pluginTable.vue": "UnNameComponent",
"/src/view/dashboard/components/quickLinks.vue": "UnNameComponent",
"/src/view/dashboard/components/table.vue": "UnNameComponent",
"/src/view/dashboard/components/wiki.vue": "UnNameComponent",
"/src/view/dashboard/components/banner.vue": "Banner",
"/src/view/dashboard/components/card.vue": "Card",
"/src/view/dashboard/components/charts-content-numbers.vue": "ChartsContentNumbers",
"/src/view/dashboard/components/charts-people-numbers.vue": "ChartsPeopleNumbers",
"/src/view/dashboard/components/charts.vue": "Charts",
"/src/view/dashboard/components/notice.vue": "Notice",
"/src/view/dashboard/components/pluginTable.vue": "PluginTable",
"/src/view/dashboard/components/quickLinks.vue": "QuickLinks",
"/src/view/dashboard/components/table.vue": "Table",
"/src/view/dashboard/components/wiki.vue": "Wiki",
"/src/view/dashboard/components/banner.vue": "Banner",
"/src/view/dashboard/components/card.vue": "Card",
"/src/view/dashboard/components/charts-content-numbers.vue": "ChartsContentNumbers",
"/src/view/dashboard/components/charts-people-numbers.vue": "ChartsPeopleNumbers",
"/src/view/dashboard/components/charts.vue": "Charts",
"/src/view/dashboard/components/notice.vue": "Notice",
"/src/view/dashboard/components/pluginTable.vue": "PluginTable",
"/src/view/dashboard/components/quickLinks.vue": "QuickLinks",
"/src/view/dashboard/components/table.vue": "Table",
"/src/view/dashboard/components/wiki.vue": "Wiki",
"/src/view/dashboard/index.vue": "Dashboard",
"/src/view/error/index.vue": "Error",
"/src/view/error/reload.vue": "Reload",
Expand All @@ -23,10 +33,10 @@
"/src/view/layout/aside/asideComponent/menuItem.vue": "MenuItem",
"/src/view/layout/aside/combinationMode.vue": "GvaAside",
"/src/view/layout/aside/headMode.vue": "GvaAside",
"/src/view/layout/aside/index.vue": "UnNameComponent",
"/src/view/layout/aside/index.vue": "Index",
"/src/view/layout/aside/normalMode.vue": "GvaAside",
"/src/view/layout/header/index.vue": "UnNameComponent",
"/src/view/layout/header/tools.vue": "UnNameComponent",
"/src/view/layout/header/index.vue": "Index",
"/src/view/layout/header/tools.vue": "Tools",
"/src/view/layout/index.vue": "GvaLayout",
"/src/view/layout/screenfull/index.vue": "Screenfull",
"/src/view/layout/search/search.vue": "BtnBox",
Expand All @@ -43,25 +53,34 @@
"/src/view/superAdmin/dictionary/sysDictionary.vue": "SysDictionary",
"/src/view/superAdmin/dictionary/sysDictionaryDetail.vue": "SysDictionaryDetail",
"/src/view/superAdmin/index.vue": "SuperAdmin",
"/src/view/superAdmin/menu/components/components-cascader.vue": "UnNameComponent",
"/src/view/superAdmin/menu/components/components-cascader.vue": "ComponentsCascader",
"/src/view/superAdmin/menu/icon.vue": "Icon",
"/src/view/superAdmin/menu/menu.vue": "Menus",
"/src/view/superAdmin/operation/sysOperationRecord.vue": "SysOperationRecord",
"/src/view/superAdmin/params/sysParams.vue": "SysParams",
"/src/view/superAdmin/user/user.vue": "User",
"/src/view/system/state.vue": "State",
"/src/view/systemTools/aiPainter/aiPainter.vue": "UnNameComponent",
"/src/view/systemTools/aiPainter/components/dynamicHtmlRenderer.vue": "UnNameComponent",
"/src/view/systemTools/aiPainter/aiPainter.vue": "AiPainter",
"/src/view/systemTools/aiPainter/components/dynamicHtmlRenderer.vue": "DynamicHtmlRenderer",
"/src/view/systemTools/autoCode/component/fieldDialog.vue": "FieldDialog",
"/src/view/systemTools/autoCode/component/previewCodeDialg.vue": "UnNameComponent",
"/src/view/systemTools/autoCode/component/previewCodeDialg.vue": "PreviewCodeDialg",
"/src/view/systemTools/autoCode/index.vue": "AutoCode",
"/src/view/systemTools/autoCodeAdmin/index.vue": "AutoCodeAdmin",
"/src/view/systemTools/autoPkg/autoPkg.vue": "AutoPkg",
"/src/view/systemTools/exportTemplate/exportTemplate.vue": "ExportTemplate",
"/src/view/systemTools/formCreate/index.vue": "FormGenerator",
"/src/view/systemTools/index.vue": "System",
"/src/view/systemTools/installPlugin/index.vue": "UnNameComponent",
"/src/view/systemTools/pubPlug/pubPlug.vue": "UnNameComponent",
"/src/view/systemTools/installPlugin/index.vue": "Index",
"/src/view/systemTools/pubPlug/pubPlug.vue": "PubPlug",
"/src/view/layout/aside/index.vue": "Index",
"/src/view/layout/header/index.vue": "Index",
"/src/view/layout/header/tools.vue": "Tools",
"/src/view/superAdmin/menu/components/components-cascader.vue": "ComponentsCascader",
"/src/view/systemTools/aiPainter/aiPainter.vue": "UnNameComponent",
"/src/view/systemTools/aiPainter/components/dynamicHtmlRenderer.vue": "UnNameComponent",
"/src/view/systemTools/autoCode/component/previewCodeDialg.vue": "PreviewCodeDialg",
"/src/view/systemTools/installPlugin/index.vue": "Index",
"/src/view/systemTools/pubPlug/pubPlug.vue": "PubPlug",
"/src/view/systemTools/system/system.vue": "Config",
"/src/plugin/announcement/form/info.vue": "InfoForm",
"/src/plugin/announcement/view/info.vue": "Info",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ const emits = defineEmits(['change'])
const pathOptions = ref([])
const tempPath = ref('')
const activeComponent = ref('')
const activeComponent = ref([])
const pathIsSelect = ref(true)
const togglePathIsSelect = () => {
if(pathIsSelect.value){
tempPath.value = activeComponent.value?.join('/')
tempPath.value = activeComponent.value?.join('/') || ''
}else{
activeComponent.value = tempPath.value.split('/')
console.log(activeComponent.value)
activeComponent.value = tempPath.value?.split('/') || []
}
pathIsSelect.value = !pathIsSelect.value
Expand Down
6 changes: 3 additions & 3 deletions web/src/view/systemTools/autoCode/component/fieldDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ const getDBTableList = async () => {
}
const dbColumnList = ref([])
const selectDB = async (val) => {
const selectDB = async (val,isInit) => {
middleDate.value.dataSource.table = val
const res = await getColumn({
businessDB: middleDate.value.dataSource.dbName,
Expand All @@ -472,7 +472,7 @@ const selectDB = async (val) => {
isPrimary: item.primaryKey,
comment: item.columnComment
}));
if (dbColumnList.value.length > 0) {
if (dbColumnList.value.length > 0 && !isInit) {
middleDate.value.dataSource.label = dbColumnList.value[0].columnName
middleDate.value.dataSource.value = dbColumnList.value[0].columnName
}
Expand All @@ -486,7 +486,7 @@ defineExpose({ fieldDialogForm })
onMounted(()=>{
getDbFunc()
if(middleDate.value.dataSource.table){
selectDB(middleDate.value.dataSource.table)
selectDB(middleDate.value.dataSource.table,true)
}
})
</script>
10 changes: 9 additions & 1 deletion web/vitePlugin/componentName/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import fs from 'fs';
import path from 'path';
import chokidar from 'chokidar';

const toPascalCase = (str) => {
return str.replace(/(^\w|-\w)/g, clearAndUpper);
};

const clearAndUpper = (text) => {
return text.replace(/-/, '').toUpperCase();
};

// 递归获取目录下所有的 .vue 文件
const getAllVueFiles = (dir, fileList = []) => {
const files = fs.readdirSync(dir);
Expand Down Expand Up @@ -36,7 +44,7 @@ const vueFilePathPlugin = (outputFilePath) => {
const content = fs.readFileSync(filePath, 'utf-8');
const componentName = extractComponentName(content);
let relativePath ="/" + path.relative(root, filePath).replace(/\\/g, '/');
acc[relativePath] = componentName || "UnNameComponent";
acc[relativePath] = componentName || toPascalCase(path.basename(filePath, '.vue'));
return acc;
}, {});
const outputContent = JSON.stringify(pathNameMap, null, 2);
Expand Down

0 comments on commit d1da92d

Please sign in to comment.