调整工程目录

This commit is contained in:
aixianling
2022-02-16 15:10:40 +08:00
parent 28be9ca0c5
commit f52b8f94e2
33 changed files with 58 additions and 53 deletions

View File

@@ -11,7 +11,7 @@
</u-radio-group>
<input class="codeText" v-model="search" placeholder="搜索要查找的应用"/>
<div flex class="appsPane wrap">
<b v-for="app in appsList" :key="app.key" @tap="handleGotoApp(app)">{{ app.name }}</b>
<b v-for="app in appsList" :key="app.path" @tap="handleGotoApp(app)">{{ app.name }}</b>
</div>
</section>
</template>
@@ -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