Browse Source

feat: 角色栏展示修改,体验角色栏修改

carbasic
aBin 4 years ago
parent
commit
65833072c5
  1. 6
      .env.development
  2. 6
      .env.production
  3. 3
      CHANGELOG.md
  4. 20
      src/apis/role.js
  5. 18
      src/apis/tall.js
  6. 21
      src/components/Experience/Experience.vue
  7. 2
      src/components/Globals/Globals.vue
  8. 51
      src/pages/project/project.vue
  9. 10
      src/store/role/mutations.js
  10. 1
      src/store/role/state.js

6
.env.development

@ -1,4 +1,4 @@
VUE_APP_NODE_ENV=development
VUE_APP_BASE_URL=https://test.tall.wiki/
VUE_APP_API_URL=https://test.tall.wiki/gateway
VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws
VUE_APP_BASE_URL=https://www.tall.wiki/
VUE_APP_API_URL=https://www.tall.wiki/gateway
VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws

6
.env.production

@ -1,4 +1,4 @@
VUE_APP_NODE_ENV=production
VUE_APP_BASE_URL=https://test.tall.wiki/
VUE_APP_API_URL=https://test.tall.wiki/gateway
VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws
VUE_APP_BASE_URL=https://www.tall.wiki/
VUE_APP_API_URL=https://www.tall.wiki/gateway
VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2021-10-12)
# 0.1.0 (2021-10-14)
### 🌟 新功能
范围|描述|commitId
@ -226,6 +226,7 @@
- | 测试接口 | [215e074](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/215e074)
- | 插件查询及展示 | [4dba770](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/4dba770)
- | 角色栏文字颜色修改 | [215c6b3](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/215c6b3)
- | 角色栏展示修改 | [2b70ff5](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/2b70ff5)
- | 解决警告 | [c932b09](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/c932b09)
- | 日常任务样式修改 | [4628301](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/4628301)
- | 日历的更改 | [7353ac8](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/7353ac8)

20
src/apis/role.js

@ -1,8 +1,24 @@
const url = process.env.VUE_APP_API_URL;
// 查询首页按钮的名称及跳转
export const queryMustShow = {
async index(params) {
try {
/* #endif */
const data = await uni.$u.http.post(`${url}/carbasics/v4.0/role/queryMustShow`, params);
return data;
} catch (error) {
throw new Error(error);
}
},
};
const install = (Vue, vm) => {
vm.$u.api = { ...vm.$u.api } || {};
//根据项目id查找角色
// 根据项目id查找所有体验角色
vm.$u.api.queryMustShow = params => queryMustShow.index(params);
// 根据项目id查找角色
vm.$u.api.findShowRole = param => vm.$u.post(`${uni.$t.domain}/role/show`, param);
//根据项目id查找所有成员
// 根据项目id查找所有成员
vm.$u.api.queryChecker = param => vm.$u.post(`${uni.$t.domain}/deliver/queryChecker`, param);
};

18
src/apis/tall.js

@ -1,5 +1,6 @@
const apiUrl = process.env.VUE_APP_API_URL;
export const tall = `${apiUrl}/tall3/v3.0`;
export const carbasics = `${apiUrl}/carbasics/v4.0`;
import { mp } from '@/config/user.js';
@ -18,10 +19,25 @@ export const login = {
},
};
// 查询首页按钮的名称及跳转
export const getQueryButton = {
async index(params) {
try {
/* #endif */
const data = await uni.$u.http.post(`${carbasics}/questionnaire/queryButton`, params);
return data;
} catch (error) {
throw new Error(error);
}
},
};
const install = (Vue, vm) => {
vm.$u.api = { ...vm.$u.api } || {};
// 登录
vm.$u.api.signin = params => login.index(params);
// 查询首页的按钮展示及跳转
vm.$u.api.getQueryButton = params => getQueryButton.index(params);
// 获取图片验证码
vm.$u.api.getImageCode = () => vm.$u.get(`${tall}/users/code`);
// 获取短信验证码
@ -35,6 +51,8 @@ const install = (Vue, vm) => {
vm.$u.api.getProjects = (startTime, endTime) => vm.$u.post(`${tall}/project/query`, { startTime, endTime });
// 查询日历是否有小红点
vm.$u.api.findRedPoint = (startTime, endTime) => vm.$u.post(`${tall}/project/day`, { startTime, endTime });
// 查询首页的按钮展示及跳转
vm.$u.api.getQueryButton = params => getQueryButton.index(params);
};
export default { install };

21
src/components/Experience/Experience.vue

@ -3,7 +3,7 @@
<img class="role-img" src="https://www.tall.wiki/staticrec/img/qcp-role.png" alt="" />
<view class="change-role-btn flex flex-row flex-nowrap">
<view
v-for="(item, index) in roles"
v-for="(item, index) in experienceRole"
:key="index"
class="role-btn"
:class="roleId === item.id ? 'avtive-btn' : 'no-active'"
@ -15,26 +15,35 @@
</view>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
import { mapState, mapGetters, mapMutations } from 'vuex';
export default {
name: 'Experience',
data() {
return { roles: [] };
},
computed: {
...mapState('role', ['visibleRoles', 'invisibleRoles', 'roleId']),
...mapState('role', ['visibleRoles', 'invisibleRoles', 'roleId', 'experienceRole']),
...mapState('task', ['tasks']),
...mapGetters('project', ['projectId']),
},
watch: {
visibleRoles(val) {
if (val && val.length) {
this.roles = [...this.visibleRoles];
// this.roles = [...this.visibleRoles, ...this.invisibleRoles];
// this.roles = [...this.visibleRoles];
this.roles = [...this.visibleRoles, ...this.invisibleRoles];
}
},
},
created() {
const params = { param: { projectId: this.projectId } };
this.getRoles(params);
},
methods: {
...mapMutations('role', ['setRoleId']),
...mapMutations('role', ['setRoleId', 'setExperienceRole']),
async getRoles(params) {
const data = await uni.$u.api.queryMustShow(params);
this.setExperienceRole(data);
},
//
// projectroleId
// projectroleId

2
src/components/Globals/Globals.vue

@ -64,7 +64,7 @@ export default {
...mapGetters('task', ['globals']),
globalsHeight: function () {
let h = ((this.sysHeight - 44 - 30 - 10) / 3) * 3;
let h = ((this.sysHeight - 44 - 30 - 10) / 5) * 3;
return h;
},
},

51
src/pages/project/project.vue

@ -9,7 +9,7 @@
<!-- 角色栏 -->
<Roles />
<!-- 体验项目切换角色 -->
<!-- <Experience v-if="showEXP" /> -->
<Experience v-if="showEXP" />
<!-- 日常任务面板 -->
<Globals />
@ -17,16 +17,16 @@
<TimeLine @getTasks="getTasks" class="flex-1 overflow-hidden" ref="timeLine" />
<!-- 医院项目的问卷悬浮按钮 -->
<view style="z-index: 99" class="absolute bottom-10 right-5" v-if="showQuestion">
<view style="z-index: 99" class="absolute bottom-10 right-5" v-if="name">
<view
@click="openQuestionnaire(true)"
@click="openQuestionnaire"
class="relative text-white bg-blue-400 flex justify-center items-center w-12 h-12 rounded-full shadow-2xl"
>
问卷
{{ name }}
<!-- <u-badge type="error" :count="count" :offset="[-8, -8]"></u-badge> -->
</view>
<u-popup v-model="showQuestionList" mode="bottom" border-radius="14">
<!-- <u-popup v-model="showQuestionList" mode="bottom" border-radius="14">
<view class="h-64">
<view class="text-center font-bold fixed bg-white py-3 top-0 w-full">请选择</view>
<view class="flex flex-col mx-3 pt-10 pb-6 h-full overflow-y-auto" :class="questionnaires.length < 5 ? 'justify-center' : ''">
@ -42,7 +42,7 @@
</view>
<view class="fixed bottom-0 bg-white h-6 w-full"></view>
</view>
</u-popup>
</u-popup> -->
</view>
</view>
</view>
@ -65,6 +65,8 @@ export default {
chooseItem: false,
showGuide: false,
showEXP: false,
name: '',
url: '',
};
},
@ -78,8 +80,11 @@ export default {
...mapGetters('user', ['userId']),
},
onLoad(options) {
async onLoad(options) {
console.log('this.$route.query: ', this.$route);
const data = await this.$u.api.getQueryButton({});
this.name = data.name;
this.url = data.url;
if (options.share && options.share === '1') {
this.shareInit(options);
} else {
@ -128,16 +133,16 @@ export default {
},
//
questionnaires(val) {
if (val && val.length) {
this.showQuestion = true;
val.forEach(item => {
if (item.isWrite === 0 || item.isWrite === -1) {
this.count += 1;
}
});
}
},
// questionnaires(val) {
// if (val && val.length) {
// this.showQuestion = true;
// val.forEach(item => {
// if (item.isWrite === 0 || item.isWrite === -1) {
// this.count += 1;
// }
// });
// }
// },
},
mounted() {
@ -375,7 +380,7 @@ export default {
// TODO
this.getProjectById({ projectId: options.p, num: 0 }); // id
//
this.handleQueryNotWrite(options.p);
// this.handleQueryNotWrite(options.p);
this.getByProject(options.p);
}
},
@ -494,14 +499,8 @@ export default {
},
//
openQuestionnaire(value, type) {
this.chooseItem = value;
if (this.count === 1 || this.chooseItem) {
window.location.href = `https://www.tall.wiki/carbasics/survey?userId=${this.user.id}&type=${type}`;
// window.location.href = `https://www.baidu.com`;
} else {
this.showQuestionList = true;
}
openQuestionnaire() {
window.location.href = `${this.url}?userId=${this.user.id}`;
},
// id

10
src/store/role/mutations.js

@ -34,6 +34,16 @@ const mutations = {
setMembers(state, data) {
state.members = data || [];
},
/**
* 设置项目下所有体验橘色
* @param {Object} state
* @param {Array} data 服务端返回的模板数组
*/
setExperienceRole(state, data) {
console.log('data11111111111111: ', data);
state.experienceRole = data || [];
},
};
export default mutations;

1
src/store/role/state.js

@ -3,6 +3,7 @@ const state = {
visibleRoles: [], // 展示的角色信息
roleId: '', // 当前展示查看的角色id
members: [], // 项目下所有成员
experienceRole: [], // 所有体验项目的角色
};
export default state;

Loading…
Cancel
Save