|
|
@@ -5,8 +5,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import axios from '@/assets/js/axios'
|
|
|
+ import * as types from '@/store/mutation-types'
|
|
|
import AppList from './common/AppList'
|
|
|
|
|
|
+ function bindAppWithSpace (spaceUU, appUid, success, error) {
|
|
|
+ console.log(appUid)
|
|
|
+ const params = { appUid }
|
|
|
+
|
|
|
+ axios.put(`/api/user/space/${spaceUU}/bindAppWithSpace`, {}, { params })
|
|
|
+ .then(success)
|
|
|
+ .catch(error)
|
|
|
+ }
|
|
|
+
|
|
|
export default {
|
|
|
name: 'enterprise-apps',
|
|
|
components: {
|
|
|
@@ -14,37 +25,45 @@
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- apps: [
|
|
|
- {
|
|
|
- label: 'UAS系统',
|
|
|
- status: 2
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'B2B商务平台',
|
|
|
- status: 2
|
|
|
- },
|
|
|
- {
|
|
|
- label: '优软商城',
|
|
|
- status: 1
|
|
|
- },
|
|
|
- {
|
|
|
- label: '金融服务',
|
|
|
- status: 0
|
|
|
- },
|
|
|
- {
|
|
|
- label: '优软人才网',
|
|
|
- status: 0
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'UU众创',
|
|
|
- status: 0
|
|
|
- },
|
|
|
- {
|
|
|
- label: '定制商城',
|
|
|
- status: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ apps () {
|
|
|
+ // 1 开通失败, 2 已开通, 0 未开通
|
|
|
+ const appList = this.$store.getters.enAppsList
|
|
|
+
|
|
|
+ for (const app of appList) {
|
|
|
+ if (app.status === 0 || app.status === 1) {
|
|
|
+ app.action = this.openApplication
|
|
|
}
|
|
|
- ]
|
|
|
+ }
|
|
|
+ console.log(this.$store.getters.enAppsList)
|
|
|
+ return this.$store.getters.enAppsList
|
|
|
+ },
|
|
|
+ enterprise () {
|
|
|
+ return this.$store.state.enterprises.savedEnterprise
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ showErrorMessage (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ },
|
|
|
+ openApplication (app) {
|
|
|
+ console.log('开通')
|
|
|
+ const spaceUU = this.enterprise.spaceUU
|
|
|
+
|
|
|
+ const success = userSpace => {
|
|
|
+ this.$store.commit(types.CHOOSE_ENTERPRISE, userSpace)
|
|
|
+
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(app)
|
|
|
+ bindAppWithSpace(spaceUU, app.uid, success, this.showErrorMessage)
|
|
|
}
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.$store.dispatch('retrieveAllApps')
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -59,8 +78,5 @@
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
- .admin-message::after {
|
|
|
- content: 'ABV';
|
|
|
- color: black;
|
|
|
- }
|
|
|
+
|
|
|
</style>
|