Browse Source

fix: 交付物消息提示

test2
xuesinan 4 years ago
parent
commit
880023ad04
  1. 3
      CHANGELOG.md
  2. 2
      manifest.json
  3. 6
      pages/index/index.vue
  4. 1
      pages/user/login.vue
  5. 21
      plugins/p-deliver-check/check-form-modal.vue
  6. 10
      plugins/p-deliver-check/p-deliver-check.vue
  7. 13
      plugins/p-deliver/p-deliver.vue
  8. 4
      store/socket/actions.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 1.0.0 (2022-03-03) # 1.0.0 (2022-03-04)
### 🌟 新功能 ### 🌟 新功能
范围|描述|commitId 范围|描述|commitId
@ -36,6 +36,7 @@
- | 刻度模式时间轴 | [a9bc53a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a9bc53a) - | 刻度模式时间轴 | [a9bc53a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a9bc53a)
- | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6) - | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6)
- | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91) - | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91)
- | 上传新项目结果提示 | [2625734](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2625734)
- | 设置项目域名 | [1a835f1](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1a835f1) - | 设置项目域名 | [1a835f1](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1a835f1)
- | 设置状态栏 | [9871356](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9871356) - | 设置状态栏 | [9871356](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9871356)
- | 审核插件的基本信息展示 | [aa4f17f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/aa4f17f) - | 审核插件的基本信息展示 | [aa4f17f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/aa4f17f)

2
manifest.json

@ -2,7 +2,7 @@
"name" : "时物链条", "name" : "时物链条",
"appid" : "__UNI__3CBCFFF", "appid" : "__UNI__3CBCFFF",
"description" : "", "description" : "",
"versionName" : "1.0.7", "versionName" : "1.0.9",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */

6
pages/index/index.vue

@ -109,7 +109,6 @@
// //
const onUploadError = error => { const onUploadError = error => {
console.log('11111111')
uni.$ui.showToast(error || '导入失败', 6000); uni.$ui.showToast(error || '导入失败', 6000);
}; };
@ -134,6 +133,11 @@
function signout() { function signout() {
store.commit('user/setToken', ''); store.commit('user/setToken', '');
store.commit('user/setUser', null); store.commit('user/setUser', null);
store.commit('socket/setSocket', null);
store.commit('socket/setConnected', false);
store.commit('socket/uploadNotificationData', []);
store.commit('socket/uploadRingData', []);
store.commit('socket/uploadRemindData', []);
uni.$storage.setStorageSync('anyringToken', ''); uni.$storage.setStorageSync('anyringToken', '');
uni.$storage.setStorageSync('user', ''); uni.$storage.setStorageSync('user', '');
} }

1
pages/user/login.vue

@ -108,6 +108,7 @@
store.commit('user/setUser', res); store.commit('user/setUser', res);
uni.$storage.setStorageSync('anyringToken', res.token || ''); uni.$storage.setStorageSync('anyringToken', res.token || '');
uni.$storage.setStorageSync('user', JSON.stringify(res) || ''); uni.$storage.setStorageSync('user', JSON.stringify(res) || '');
store.dispatch('socket/initSocket');
uni.$ui.hideLoading(); uni.$ui.hideLoading();

21
plugins/p-deliver-check/check-form-modal.vue

@ -32,7 +32,7 @@
</template> </template>
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed, watch, inject } from 'vue';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import { quickWords } from '@/config/deliver'; import { quickWords } from '@/config/deliver';
@ -42,12 +42,26 @@ const props = defineProps({
}); });
const emits = defineEmits(['hide', 'submit-end']); const emits = defineEmits(['hide', 'submit-end']);
const store = useStore(); const store = useStore();
const remindData = computed(() => store.state.socket.remindData); //
const words = computed(() => quickWords[props.data.mode]); // const words = computed(() => quickWords[props.data.mode]); //
const projectId = computed(() => store.getters['project/projectId']); const projectId = computed(() => store.getters['project/projectId']);
const task = inject('task');
const commit = ref(''); // const commit = ref(''); //
const score = ref(100); // const score = ref(100); //
let msgId = ref(null);
watch(remindData, () => {
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data);
if (remind_data.data.taskId === task.id) {
msgId.value = remind.id;
console.log('交付物检查弹框', msgId.value)
}
})
})
/** /**
* 提交评审信息 * 提交评审信息
* 提交成功后隐藏modal 重置表单控件 * 提交成功后隐藏modal 重置表单控件
@ -63,8 +77,9 @@ async function handleSubmit(mode) {
type: mode === 'RESOLVE' ? 1 : 2, type: mode === 'RESOLVE' ? 1 : 2,
remark: commit.value, remark: commit.value,
score: mode === 'RESOLVE' ? score.value : '', score: mode === 'RESOLVE' ? score.value : '',
msgId: props.msgId msgId: msgId.value
}; };
console.log('交付物审核', param, msgId.value)
await uni.$u.api.checkDeliver(param); await uni.$u.api.checkDeliver(param);
handleHide(); // + handleHide(); // +
uni.$ui.showToast('审核信息提交成功'); uni.$ui.showToast('审核信息提交成功');

10
plugins/p-deliver-check/p-deliver-check.vue

@ -81,18 +81,18 @@
</view> </view>
</view> </view>
<checkFormModal :data="checkModal" :msgId="props.msgId" @hide="checkModal.mode = 'HIDE'" @submit-end="$emit('check-success')" /> <checkFormModal :data="checkModal" @hide="checkModal.mode = 'HIDE'" @submit-end="$emit('check-success')" />
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref, reactive, inject, computed } from 'vue'; import { ref, reactive, inject } from 'vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import checkFormModal from './check-form-modal.vue'; import checkFormModal from './check-form-modal.vue';
const props = defineProps({ // const props = defineProps({
msgId: { default: '', type: String } // msgId: { default: '', type: String }
}); // });
const deliverData = inject('deliver'); const deliverData = inject('deliver');
defineEmits(['check-success']); defineEmits(['check-success']);

13
plugins/p-deliver/p-deliver.vue

@ -21,7 +21,7 @@
<script setup> <script setup>
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import { ref, inject, provide, computed } from 'vue'; import { ref, inject, provide, computed, watch } from 'vue';
const store = useStore(); const store = useStore();
const task = inject('task'); const task = inject('task');
@ -33,14 +33,17 @@ const remindData = computed(() => store.state.socket.remindData); // 小红点
deliver.value = pluginInfo && pluginInfo.data ? JSON.parse(pluginInfo.data) : null; deliver.value = pluginInfo && pluginInfo.data ? JSON.parse(pluginInfo.data) : null;
provide('deliver', deliver); provide('deliver', deliver);
let msgId = ref(null); const msgId = ref(null);
remindData.value.forEach(remind => {
watch(remindData, () => {
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data); const remind_data = JSON.parse(remind.data);
if (remind_data.data.taskId === task.id) { if (remind_data.data.taskId === task.id) {
msgId = remind.id; msgId.value = remind.id;
} }
}) });
});
// id // id
async function getDeliverData() { async function getDeliverData() {

4
store/socket/actions.js

@ -72,7 +72,7 @@ const actions = {
case 'Remind': // 小红点 case 'Remind': // 小红点
commit('setRemindData', item); commit('setRemindData', item);
break; break;
case 'Success': // 小红点 case 'SetMsgSuccess': // 成功
let arr = []; let arr = [];
if (data.event === 'Notification') { if (data.event === 'Notification') {
arr = state.notificationData; arr = state.notificationData;
@ -89,7 +89,7 @@ const actions = {
} }
}) })
arr.splice(notification_index, 1); arr.splice(del_index, 1);
if (data.event === 'Notification') { if (data.event === 'Notification') {
commit('uploadNotificationData', arr); commit('uploadNotificationData', arr);

Loading…
Cancel
Save