diff --git a/bin/serve.js b/bin/serve.js index fc5e714f..0f76c0cf 100644 --- a/bin/serve.js +++ b/bin/serve.js @@ -81,8 +81,21 @@ const start = () => { } json.pages.push(app) } - }).then(() => { - return findApp('src/apps', file => { + }).then(() => findApp('src/apps', file => { + if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) { + let app = { + name: file.replace(/.*\\([^\\]+).vue/g, '$1'), + path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/') + } + let vue = fs.readFileSync(file).toString() + if (/appName/.test(vue)) { + let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1'), + title = appName.replace(/(appName:|["'])/g, '') + app.style = {navigationBarTitleText: title} + } + json.pages.push(app) + } + })).then(() => findApp('src/saas', file => { if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) { let app = { name: file.replace(/.*\\([^\\]+).vue/g, '$1'), @@ -96,26 +109,23 @@ const start = () => { } json.pages.push(app) } - }).then(() => { - return findApp('src/saas', file => { - if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) { - let app = { - name: file.replace(/.*\\([^\\]+).vue/g, '$1'), - path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/') - } - let vue = fs.readFileSync(file).toString() - if (/appName/.test(vue)) { - let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1'), - title = appName.replace(/(appName:|["'])/g, '') - app.style = {navigationBarTitleText: title} - } - json.pages.push(app) + })).then(() => findApp('src/project', file => { + if (/.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) { + let app = { + name: file.replace(/.*\\([^\\]+).vue/g, '$1'), + path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/') } - }) - }).then(() => { - fsExtra.outputJson('src/pages.json', json, () => { - chalkTag.done('生成pages.json') - }) + let vue = fs.readFileSync(file).toString() + if (/appName/.test(vue)) { + let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1'), + title = appName.replace(/(appName:|["'])/g, '') + app.style = {navigationBarTitleText: title} + } + json.pages.push(app) + } + })).then(() => { + fsExtra.outputJson('src/pages.json', json, () => { + chalkTag.done('生成pages.json') }) }) diff --git a/package.json b/package.json index ebabc3e0..323b7692 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "src/saas" ], "workspaces": [ - "project/*" + "src/project/*" ], "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", diff --git a/src/pages/loading.vue b/src/pages/loading.vue index 3037446e..4d3c1cbd 100644 --- a/src/pages/loading.vue +++ b/src/pages/loading.vue @@ -11,7 +11,7 @@
- {{ app.name }} + {{ app.name }}
@@ -28,8 +28,9 @@ export default { computed: { ...mapState(['token', 'openUser', 'user']), appsList() { - let {search} = this - return this.apps?.filter(e => !!search ? e.name.indexOf(search) > -1 : true) || [] + let {search, currentLib} = this + return this.apps.filter(e => (currentLib == "apps" && e.path.indexOf("project")) || e.path.indexOf(currentLib) > -1) + .filter(e => !!search ? e.name.indexOf(search) > -1 : true) || [] }, currentApp() { return this.apps.find(e => e.key == this.$route.query.app) || {} @@ -51,15 +52,15 @@ export default { ...mapMutations(['logout']), ...mapActions(['agentSign']), handleGotoApp(app) { - uni.navigateTo({url: `/${this.currentLib}${app.path}`}) + console.log(app) + uni.navigateTo({url: `${app.path}`}) }, handleLogin() { uni.navigateTo({url: "./login"}) }, getApps() { this.apps = [] - let applications = this.currentLib == "apps" ? require.context('../apps', true, /\.(\/.+)\/App[^\/]+\.vue$/) : - this.currentLib == "saas" ? require.context('../saas', true, /\.(\/.+)\/App[^\/]+\.vue$/) : null + let applications = require.context('../', true, /\.(\/.+)\/App[^\/]+\.vue$/) applications.keys().map(path => { if (applications(path).default) { let {name: key, appName: name} = applications(path).default diff --git a/src/apps/AppDocumentFlow/AppDocumentFlow.vue b/src/project/shandong10086/AppDocumentFlow/AppDocumentFlow.vue similarity index 100% rename from src/apps/AppDocumentFlow/AppDocumentFlow.vue rename to src/project/shandong10086/AppDocumentFlow/AppDocumentFlow.vue diff --git a/src/apps/AppDocumentFlow/components/approval.vue b/src/project/shandong10086/AppDocumentFlow/components/approval.vue similarity index 100% rename from src/apps/AppDocumentFlow/components/approval.vue rename to src/project/shandong10086/AppDocumentFlow/components/approval.vue diff --git a/src/apps/AppDocumentFlow/components/detail.vue b/src/project/shandong10086/AppDocumentFlow/components/detail.vue similarity index 96% rename from src/apps/AppDocumentFlow/components/detail.vue rename to src/project/shandong10086/AppDocumentFlow/components/detail.vue index 141dd0d4..9e1a3538 100644 --- a/src/apps/AppDocumentFlow/components/detail.vue +++ b/src/project/shandong10086/AppDocumentFlow/components/detail.vue @@ -17,7 +17,9 @@ 紧急程度: {{ $dict.getLabel("documentEmergencyLevel", detail.emergencyLevel) }} + :style="{color:$dict.getColor('documentEmergencyLevel',detail.emergencyLevel)}">{{ + $dict.getLabel("documentEmergencyLevel", detail.emergencyLevel) + }} @@ -54,7 +56,7 @@
-
{{ detail.readType == 0 ? "流转信息" : "传阅情况" }} +
{{ detail.readType == 0 ? "流转信息" : "传阅情况" }} ({{ $dict.getLabel("documentStatus", detail.status) }})
@@ -98,13 +100,10 @@