diff --git a/template/src/config/styles/mp/index.less b/template/src/config/styles/mp/index.less index 8036eec..e7f654d 100644 --- a/template/src/config/styles/mp/index.less +++ b/template/src/config/styles/mp/index.less @@ -1,2 +1,2 @@ //小程序使用 -@import "@oak-general-business/config/styles/mp/index.less"; +@import "../../../../node_modules/oak-general-business/es/config/styles/mp/index.less"; diff --git a/template/src/config/styles/web/index.less b/template/src/config/styles/web/index.less index a6463fd..72fad38 100644 --- a/template/src/config/styles/web/index.less +++ b/template/src/config/styles/web/index.less @@ -1 +1 @@ -@import '@oak-general-business/config/styles/web/index.less'; // 少量公共样式 \ No newline at end of file +@import '../../../../node_modules/oak-general-business/es/config/styles/web/index.less'; // 少量公共样式 \ No newline at end of file diff --git a/template/src/features/Console.ts b/template/src/features/Console.ts new file mode 100644 index 0000000..72ee710 --- /dev/null +++ b/template/src/features/Console.ts @@ -0,0 +1,16 @@ +import { EntityDict } from '@project/oak-app-domain'; +import { Feature } from 'oak-frontend-base'; +import { CommonAspectDict } from 'oak-common-aspect'; +import { AspectDict } from '../aspects/AspectDict'; +import { BackendRuntimeContext } from '@project/context/BackendRuntimeContext'; +import { FrontendRuntimeContext } from '@project/context/FrontendRuntimeContext'; +import { Cache } from 'oak-frontend-base/es/features/cache'; + +export default class Console extends Feature { + private cache: Cache>; + + constructor(cache: Cache>) { + super(); + this.cache = cache; + } +} \ No newline at end of file diff --git a/template/src/features/Menu.ts b/template/src/features/Menu.ts index 28b35ca..cbe4227 100644 --- a/template/src/features/Menu.ts +++ b/template/src/features/Menu.ts @@ -84,7 +84,7 @@ export default class Menu extends Feature { } refreshMenus() { - const roomId = this.console.getRoomId(); + /* const roomId = this.console.getRoomId(); const menus = this.contextMenuFactory.getMenusByContext>('room', roomId); const menuGroup = groupBy(menus, 'parent'); this.menus = (menus as any[]).filter(ele => !ele.parent).concat( @@ -98,7 +98,7 @@ export default class Menu extends Feature { }; }).filter((ele) => !!ele.children) ); - this.publish(); + this.publish(); */ } getMenus() { diff --git a/template/src/features/index.ts b/template/src/features/index.ts index 5ef0de8..1ff48aa 100644 --- a/template/src/features/index.ts +++ b/template/src/features/index.ts @@ -7,6 +7,8 @@ import { BackendRuntimeContext } from '../context/BackendRuntimeContext'; import { FrontendRuntimeContext } from '../context/FrontendRuntimeContext'; import { AAD, AFD } from '@project/types/RuntimeCxt'; import Sample from './Sample'; +import Console from './Console'; +import Menu from './Menu'; export function initialize( generalFeatures: BasicFeatures< @@ -36,9 +38,13 @@ export function initialize( } = generalFeatures; const sample = new Sample(cache); + const console = new Console(cache); + const menu = new Menu(contextMenuFactory, console); return { sample, + console, + menu, }; } diff --git a/template/src/pages/store/detail/index.json b/template/src/pages/store/detail/index.json deleted file mode 100644 index 8b4705f..0000000 --- a/template/src/pages/store/detail/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "书店详情", - "usingComponents": {} -} \ No newline at end of file diff --git a/template/src/pages/store/detail/index.less b/template/src/pages/store/detail/index.less deleted file mode 100644 index 500ce61..0000000 --- a/template/src/pages/store/detail/index.less +++ /dev/null @@ -1,5 +0,0 @@ -/** index.wxss **/ - -.container { - display: flex; -} diff --git a/template/src/pages/store/detail/index.ts b/template/src/pages/store/detail/index.ts deleted file mode 100644 index 7b452d6..0000000 --- a/template/src/pages/store/detail/index.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { Schema as ExtraFile } from '@oak-app-domain/ExtraFile/Schema'; - -export default OakComponent({ - entity: 'store', - projection: { - id: 1, - iState: 1, - name: 1, - coordinate: 1, - areaId: 1, - addrDetail: 1, - extraFile$entity: { - $entity: 'extraFile', - data: { - id: 1, - tag1: 1, - origin: 1, - bucket: 1, - objectId: 1, - filename: 1, - extra1: 1, - extension: 1, - type: 1, - entity: 1, - }, - filter: { - tag1: { - $in: ['cover'], - }, - }, - }, - }, - isList: false, - formData: function ({ data: store, features }) { - - return { - iState: store?.iState, - name: store?.name, - coordinate: store?.coordinate, - areaId: store?.areaId, - addrDetail: store?.addrDetail, - id: store?.id, - }; - }, - methods: { - async confirm() { - await this.execute(); - this.navigateBack(); - }, - async reset() { - // 重置 - this.clean(); - }, - }, -}); diff --git a/template/src/pages/store/detail/index.wxml b/template/src/pages/store/detail/index.wxml deleted file mode 100644 index e65a4b8..0000000 --- a/template/src/pages/store/detail/index.wxml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/template/src/pages/store/detail/locales/zh_CN.json b/template/src/pages/store/detail/locales/zh_CN.json deleted file mode 100644 index 7c40b40..0000000 --- a/template/src/pages/store/detail/locales/zh_CN.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "submit": "提交", - "reset": "重置" -} \ No newline at end of file diff --git a/template/src/pages/store/detail/web.module.less b/template/src/pages/store/detail/web.module.less deleted file mode 100644 index 6fcbd7c..0000000 --- a/template/src/pages/store/detail/web.module.less +++ /dev/null @@ -1,8 +0,0 @@ - -.container { - background: var(--td-bg-color-container); - box-shadow: 0 2px 3px #0000001a; - border-radius: 3px; - padding: 30px 32px; -} - diff --git a/template/src/pages/store/detail/web.tsx b/template/src/pages/store/detail/web.tsx deleted file mode 100644 index cc22f51..0000000 --- a/template/src/pages/store/detail/web.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React, { useState, useRef } from 'react'; -import Style from './web.module.less'; -import { WebComponentProps } from 'oak-frontend-base'; -import { EntityDict } from '@oak-app-domain'; - -export default function Render(props: WebComponentProps) { - const { t } = props.methods; - const { data } = props; - - return
; -} diff --git a/template/src/pages/store/list/index.json b/template/src/pages/store/list/index.json deleted file mode 100644 index 7291308..0000000 --- a/template/src/pages/store/list/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "书店管理", - "usingComponents": {} -} \ No newline at end of file diff --git a/template/src/pages/store/list/index.less b/template/src/pages/store/list/index.less deleted file mode 100644 index efb2fe1..0000000 --- a/template/src/pages/store/list/index.less +++ /dev/null @@ -1 +0,0 @@ -/** index.wxss **/ diff --git a/template/src/pages/store/list/index.ts b/template/src/pages/store/list/index.ts deleted file mode 100644 index 3e3fd90..0000000 --- a/template/src/pages/store/list/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { OpSchema as ExtraFile } from '@oak-app-domain/ExtraFile/Schema'; - -export default OakComponent({ - entity: 'store', - projection: { - id: 1, - iState: 1, - name: 1, - coordinate: 1, - areaId: 1, - addrDetail: 1, - extraFile$entity: { - $entity: 'extraFile', - data: { - id: 1, - tag1: 1, - origin: 1, - bucket: 1, - objectId: 1, - filename: 1, - extra1: 1, - extension: 1, - type: 1, - entity: 1, - }, - filter: { - tag1: { - $in: ['cover'], - }, - }, - }, - }, - isList: true, - formData: function ({ data: stores, features }) { - - return { - stores: stores?.map((store, index: number) => { - return { - iState: store?.iState, - name: store?.name, - coordinate: store?.coordinate, - areaId: store?.areaId, - addrDetail: store?.addrDetail, - id: store?.id, - }; - }), - }; - }, - // filters: [], - // sorters: [], - methods: { - goUpsert() { - this.navigateTo({ - url: '/store/upsert', - }); - }, - goUpsertById(id: string) { - this.navigateTo({ - url: '/store/upsert', - oakId: id, - }); - }, - goDetailById(id: string) { - this.navigateTo({ - url: '/store/detail', - oakId: id, - }); - }, - onRemove(id: string) { - this.removeItem(id); - this.execute(); - }, - }, -}); diff --git a/template/src/pages/store/list/index.wxml b/template/src/pages/store/list/index.wxml deleted file mode 100644 index e65a4b8..0000000 --- a/template/src/pages/store/list/index.wxml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/template/src/pages/store/list/locales/zh_CN.json b/template/src/pages/store/list/locales/zh_CN.json deleted file mode 100644 index 4735578..0000000 --- a/template/src/pages/store/list/locales/zh_CN.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "action": { - "add": "添加书店" - } -} \ No newline at end of file diff --git a/template/src/pages/store/list/web.module.less b/template/src/pages/store/list/web.module.less deleted file mode 100644 index 5c1feeb..0000000 --- a/template/src/pages/store/list/web.module.less +++ /dev/null @@ -1,4 +0,0 @@ -.container { - background: var(--td-bg-color-container); -} - diff --git a/template/src/pages/store/list/web.pc.module.less b/template/src/pages/store/list/web.pc.module.less deleted file mode 100644 index cd731cc..0000000 --- a/template/src/pages/store/list/web.pc.module.less +++ /dev/null @@ -1,8 +0,0 @@ - - -.container { - background: var(--td-bg-color-container); - box-shadow: 0 2px 3px #0000001a; - border-radius: 3px; - padding: 30px 32px; -} \ No newline at end of file diff --git a/template/src/pages/store/list/web.pc.tsx b/template/src/pages/store/list/web.pc.tsx deleted file mode 100644 index 84d6c79..0000000 --- a/template/src/pages/store/list/web.pc.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React, { useState, useRef } from 'react'; -import Style from './web.pc.module.less'; -import { WebComponentProps } from 'oak-frontend-base'; -import { EntityDict } from '@oak-app-domain'; - -export default function Render(props: WebComponentProps) { - const { t } = props.methods; - const { data } = props; - - return
; -} diff --git a/template/src/pages/store/list/web.tsx b/template/src/pages/store/list/web.tsx deleted file mode 100644 index 84d6c79..0000000 --- a/template/src/pages/store/list/web.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React, { useState, useRef } from 'react'; -import Style from './web.pc.module.less'; -import { WebComponentProps } from 'oak-frontend-base'; -import { EntityDict } from '@oak-app-domain'; - -export default function Render(props: WebComponentProps) { - const { t } = props.methods; - const { data } = props; - - return
; -} diff --git a/template/src/pages/store/upsert/index.json b/template/src/pages/store/upsert/index.json deleted file mode 100644 index ddd2225..0000000 --- a/template/src/pages/store/upsert/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "编辑书店", - "usingComponents": {} -} \ No newline at end of file diff --git a/template/src/pages/store/upsert/index.less b/template/src/pages/store/upsert/index.less deleted file mode 100644 index efb2fe1..0000000 --- a/template/src/pages/store/upsert/index.less +++ /dev/null @@ -1 +0,0 @@ -/** index.wxss **/ diff --git a/template/src/pages/store/upsert/index.ts b/template/src/pages/store/upsert/index.ts deleted file mode 100644 index 5e87991..0000000 --- a/template/src/pages/store/upsert/index.ts +++ /dev/null @@ -1,57 +0,0 @@ - -export default OakComponent({ - entity: 'store', - projection: { - id: 1, - iState: 1, - name: 1, - coordinate: 1, - areaId: 1, - addrDetail: 1, - extraFile$entity: { - $entity: 'extraFile', - data: { - id: 1, - tag1: 1, - origin: 1, - bucket: 1, - objectId: 1, - filename: 1, - extra1: 1, - extension: 1, - type: 1, - entity: 1, - }, - filter: { - tag1: { - $in: ['cover'], - }, - }, - }, - }, - isList: false, - formData: function ({ data: store, features }) { - return { - iState: store?.iState, - name: store?.name, - coordinate: store?.coordinate, - areaId: store?.areaId, - addrDetail: store?.addrDetail, - id: store?.id, - extraFile$entity: store?.extraFile$entity, - }; - }, - data: { - visible: false, - }, - methods: { - async confirm() { - await this.execute(); - this.navigateBack(); - }, - async reset() { - // 重置 - this.clean(); - }, - }, -}); diff --git a/template/src/pages/store/upsert/index.wxml b/template/src/pages/store/upsert/index.wxml deleted file mode 100644 index e65a4b8..0000000 --- a/template/src/pages/store/upsert/index.wxml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/template/src/pages/store/upsert/locales/zh_CN.json b/template/src/pages/store/upsert/locales/zh_CN.json deleted file mode 100644 index 7c40b40..0000000 --- a/template/src/pages/store/upsert/locales/zh_CN.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "submit": "提交", - "reset": "重置" -} \ No newline at end of file diff --git a/template/src/pages/store/upsert/web.module.less b/template/src/pages/store/upsert/web.module.less deleted file mode 100644 index 3211acc..0000000 --- a/template/src/pages/store/upsert/web.module.less +++ /dev/null @@ -1,4 +0,0 @@ -.container { - background-color: var(--td-bg-color-container); - padding: 30px 32px; -} \ No newline at end of file diff --git a/template/src/pages/store/upsert/web.tsx b/template/src/pages/store/upsert/web.tsx deleted file mode 100644 index cc22f51..0000000 --- a/template/src/pages/store/upsert/web.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React, { useState, useRef } from 'react'; -import Style from './web.module.less'; -import { WebComponentProps } from 'oak-frontend-base'; -import { EntityDict } from '@oak-app-domain'; - -export default function Render(props: WebComponentProps) { - const { t } = props.methods; - const { data } = props; - - return
; -} diff --git a/template/web/src/app/test/router/allRouters.ts b/template/web/src/app/test/router/allRoutersTemplate.ts similarity index 100% rename from template/web/src/app/test/router/allRouters.ts rename to template/web/src/app/test/router/allRoutersTemplate.ts diff --git a/template/web/src/index.tsx b/template/web/src/index.tsx index 6b5cbe8..4355645 100644 --- a/template/web/src/index.tsx +++ b/template/web/src/index.tsx @@ -51,8 +51,6 @@ const init = async () => { error = err; } - // 这个操作要在初始化完成后异步调用 - features.token.loadTokenInfo(); const application = features.application.getApplication(); const folder = application?.system?.folder;