From f52b8f94e265f02b129e56dc3c0a42854812fec8 Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 16 Feb 2022 15:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B7=A5=E7=A8=8B=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/serve.js | 52 +++++++++++------- package.json | 2 +- src/pages/loading.vue | 13 +++-- .../AppDocumentFlow/AppDocumentFlow.vue | 0 .../AppDocumentFlow/components/approval.vue | 0 .../AppDocumentFlow/components/detail.vue | 9 ++- .../AppIntelligentSecurity.vue | 0 .../AppIntelligentSecurity/img/local-icon.png | Bin .../img/monitor-icon.png | Bin .../img/not-play-icon.png | Bin .../AppIntelligentSecurity/img/off-icon.png | Bin .../AppIntelligentSecurity/img/offline.png | Bin .../AppIntelligentSecurity/img/on-icon.png | Bin .../AppIntelligentSecurity/img/play-icon.png | Bin .../AppIntelligentSecurity/monitorDetail.vue | 0 .../AppPeopleList.vue/AppPeopleList.vue | 0 .../AppPeopleList.vue/Content.vue | 0 .../AppPeopleList.vue/DetailCard.vue | 4 +- .../AppPeopleList.vue/DetailPeople.vue | 0 .../AppPeopleList.vue/ExamineList.vue | 4 +- .../AppPeopleList.vue/PeopleList.vue | 0 .../AppPeopleList.vue/components/img/4.png | Bin .../AppPeopleList.vue/components/img/44.png | Bin .../components/img/blue-bg.png | Bin .../components/img/green-bg.png | Bin .../AppPhoneList/AppPhoneList.vue | 11 ++-- .../shandong10086}/AppPhoneList/add.vue | 0 .../AppPhoneList/img/del-icon.png | Bin .../AppPhoneList/img/edit-icon.png | Bin .../shandong10086}/AppPhoneList/img/empty.png | Bin .../shandong10086}/AppPhoneList/list.vue | 11 ++-- .../shandong10086}/AppPhoneList/myAddList.vue | 2 +- .../project}/shandong10086/package.json | 3 - 33 files changed, 58 insertions(+), 53 deletions(-) rename src/{apps => project/shandong10086}/AppDocumentFlow/AppDocumentFlow.vue (100%) rename src/{apps => project/shandong10086}/AppDocumentFlow/components/approval.vue (100%) rename src/{apps => project/shandong10086}/AppDocumentFlow/components/detail.vue (96%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/AppIntelligentSecurity.vue (100%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/img/local-icon.png (100%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/img/monitor-icon.png (100%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/img/not-play-icon.png (100%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/img/off-icon.png (100%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/img/offline.png (100%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/img/on-icon.png (100%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/img/play-icon.png (100%) rename src/{apps => project/shandong10086}/AppIntelligentSecurity/monitorDetail.vue (100%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/AppPeopleList.vue (100%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/Content.vue (100%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/DetailCard.vue (97%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/DetailPeople.vue (100%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/ExamineList.vue (99%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/PeopleList.vue (100%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/components/img/4.png (100%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/components/img/44.png (100%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/components/img/blue-bg.png (100%) rename src/{apps => project/shandong10086}/AppPeopleList.vue/components/img/green-bg.png (100%) rename src/{apps => project/shandong10086}/AppPhoneList/AppPhoneList.vue (97%) rename src/{apps => project/shandong10086}/AppPhoneList/add.vue (100%) rename src/{apps => project/shandong10086}/AppPhoneList/img/del-icon.png (100%) rename src/{apps => project/shandong10086}/AppPhoneList/img/edit-icon.png (100%) rename src/{apps => project/shandong10086}/AppPhoneList/img/empty.png (100%) rename src/{apps => project/shandong10086}/AppPhoneList/list.vue (95%) rename src/{apps => project/shandong10086}/AppPhoneList/myAddList.vue (98%) rename {project => src/project}/shandong10086/package.json (71%) 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 @@