调整工程目录
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user