diff --git a/webs/cop-web/src/views/config/component-manage/create/modules/index.ts b/webs/cop-web/src/views/config/component-manage/create/modules/index.js similarity index 90% rename from webs/cop-web/src/views/config/component-manage/create/modules/index.ts rename to webs/cop-web/src/views/config/component-manage/create/modules/index.js index c7d178a..50536e9 100644 --- a/webs/cop-web/src/views/config/component-manage/create/modules/index.ts +++ b/webs/cop-web/src/views/config/component-manage/create/modules/index.js @@ -13,6 +13,6 @@ const codeMap = new Map([ ]) const vueFiles = require.context('./', true, /\.vue$/) export const components = getModules(vueFiles) -export function getCurrentComponent(type: string) { +export function getCurrentComponent(type) { return codeMap.get(type) || `${type.toLowerCase()}-module` } diff --git a/webs/cop-web/src/views/config/component-manage/create/options/index.ts b/webs/cop-web/src/views/config/component-manage/create/options/index.js similarity index 90% rename from webs/cop-web/src/views/config/component-manage/create/options/index.ts rename to webs/cop-web/src/views/config/component-manage/create/options/index.js index df3437b..dc0399d 100644 --- a/webs/cop-web/src/views/config/component-manage/create/options/index.ts +++ b/webs/cop-web/src/views/config/component-manage/create/options/index.js @@ -13,6 +13,6 @@ const codeMap = new Map([ ]) const vueFiles = require.context('./', true, /\.vue$/) export const optionComponents = getModules(vueFiles) -export function getCurrentOptionComponent(type: string) { +export function getCurrentOptionComponent(type) { return codeMap.get(type) || `${type.toLowerCase()}-option` } diff --git a/webs/cop-web/src/views/task/graph/maintain/components/index.ts b/webs/cop-web/src/views/task/graph/maintain/components/index.js similarity index 93% rename from webs/cop-web/src/views/task/graph/maintain/components/index.ts rename to webs/cop-web/src/views/task/graph/maintain/components/index.js index 257e0de..7ea3e14 100644 --- a/webs/cop-web/src/views/task/graph/maintain/components/index.ts +++ b/webs/cop-web/src/views/task/graph/maintain/components/index.js @@ -7,7 +7,7 @@ const vueFiles = require.context('./', true, /\.vue$/) export const components = getModules(vueFiles) // 优先在map里取值, 组件命名规范 task.software.nginx => NginxNode task.software.iscsi.client=>IscsiClient -export function getCurrentComponent(code: string) { +export function getCurrentComponent(code) { const [f, s = 'Node'] = code.split('task.maintain.')[1].split('.') // 自定义组件 if (code.includes('task.maintain.custom')) return 'CustomNode' diff --git a/webs/cop-web/src/views/task/graph/software/components/index.ts b/webs/cop-web/src/views/task/graph/software/components/index.js similarity index 94% rename from webs/cop-web/src/views/task/graph/software/components/index.ts rename to webs/cop-web/src/views/task/graph/software/components/index.js index 68212c1..bfabc35 100644 --- a/webs/cop-web/src/views/task/graph/software/components/index.ts +++ b/webs/cop-web/src/views/task/graph/software/components/index.js @@ -17,7 +17,7 @@ const vueFiles = require.context('./', true, /\.vue$/) export const components = getModules(vueFiles) // 优先在map里取值, 组件命名规范 task.software.nginx => NginxItem task.software.iscsi.client=>IscsiClient -export function getCurrentComponent(code: string) { +export function getCurrentComponent(code) { const [f, s = 'Item'] = code.split('task.software.')[1].split('.') return codeMap.get(code) || `${upperFirst(f)}${upperFirst(s)}` } diff --git a/webs/cop-web/tsconfig.json b/webs/cop-web/tsconfig.json index 783efca..7400356 100644 --- a/webs/cop-web/tsconfig.json +++ b/webs/cop-web/tsconfig.json @@ -27,6 +27,6 @@ }, "lib": ["esnext", "dom", "dom.iterable", "scripthost"] }, - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"], + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx", "src/views/task/graph/maintain/components/index.js", "src/views/task/graph/software/components/index.js", "src/views/config/component-manage/create/options/index.js"], "exclude": ["node_modules"] }