Browse Source

refactor: 完善历史记录页面和修改插件的TODO

deliver
Min5203 4 years ago
parent
commit
3d58c15a54
  1. 57
      CHANGELOG.md
  2. 34
      common/styles/theme/default.scss
  3. 6
      components/Reviewer/Reviewer.vue
  4. 43
      pages/submitlist/submitlist.vue
  5. 138
      plugins/p-deliver/p-deliver.vue
  6. 1
      utils/upload.js

57
CHANGELOG.md

@ -1,74 +1,75 @@
# 1.0.0 (2022-01-14)
# 1.0.0 (2022-01-17)
### 🌟 新功能
范围|描述|commitId
--|--|--
- | app.vue | [970cf9a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/970cf9a)
- | first commit | [8dc26de](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8dc26de)
project | 日常任务面板添加 | [b3f16ff](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b3f16ff)
theme | theme demo | [9175758](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9175758)
- | vue3 | [12ed2ad](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/12ed2ad)
- | 使用uview完成api请求 | [1b3efd8](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b3efd8)
- | 手机号登录 | [8f455da](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f455da)
- | 手机号登录 | [565585b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/565585b)
- | 表单验证 | [8f3bc1e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f3bc1e)
- | 插件的填写与提交,修改与删除 | [d461252](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d461252)
- | 插件面板分开显示 | [fb5e86b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/fb5e86b)
- | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91)
- | 更新代码 | [392c8cc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/392c8cc)
- | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6)
- | 时间轴展示 | [8b1b380](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8b1b380)
- | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91)
- | 时间轴接口 | [a95d005](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a95d005)
- | 时间轴页面 | [e926b75](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/e926b75)
- | 更新代码 | [392c8cc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/392c8cc)
- | 时间轴展示 | [8b1b380](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8b1b380)
- | 使用uview完成api请求 | [1b3efd8](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b3efd8)
- | 手机号登录 | [8f455da](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f455da)
- | 手机号登录 | [565585b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/565585b)
- | 添加 timeline | [72dad2b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/72dad2b)
- | 表单验证 | [8f3bc1e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f3bc1e)
- | 账户名密码登录 | [ebf456e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ebf456e)
- | 项目操作面板 | [3beb05e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3beb05e)
- | 项目列表 | [a52e6d5](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a52e6d5)
- | 项目列表新 | [88cf48d](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/88cf48d)
- | 项目操作面板 | [3beb05e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3beb05e)
- | 账户名密码登录 | [ebf456e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ebf456e)
- | app.vue | [970cf9a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/970cf9a)
- | first commit | [8dc26de](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8dc26de)
project | 日常任务面板添加 | [b3f16ff](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b3f16ff)
theme | theme demo | [9175758](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9175758)
- | vue3 | [12ed2ad](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/12ed2ad)
### 🎨 代码样式
范围|描述|commitId
--|--|--
- | calender格式及细节调整 | [db9602b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/db9602b)
- | 交付物相关细节调整 | [87ae00d](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/87ae00d)
- | 细节调整 | [bdd5f87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/bdd5f87)
- | calender格式及细节调整 | [db9602b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/db9602b)
### 🐛 Bug 修复
范围|描述|commitId
--|--|--
- | 插件接口修改 | [53c6b90](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/53c6b90)
- | 解决warning | [dcb0079](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/dcb0079)
- | 删除多余的引入 | [050b12a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/050b12a)
- | 时间轴任务 | [98abdf6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/98abdf6)
- | 修复一些内容 | [3cdb1ce](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3cdb1ce)
app.vue | 修复获取token报错的问题 | [9120d54](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9120d54)
createTask | 修复createTask v-model的问题 | [b20d3f0](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b20d3f0)
- | defineExpose, defineEmits不需要引入 | [902cacc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/902cacc)
- | 修复一些内容 | [3cdb1ce](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3cdb1ce)
- | 删除多余的引入 | [050b12a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/050b12a)
- | 插件接口修改 | [53c6b90](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/53c6b90)
- | 时间轴任务 | [98abdf6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/98abdf6)
- | 解决warning | [dcb0079](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/dcb0079)
### 📦 持续集成
范围|描述|commitId
--|--|--
- | ci update | [d38262e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d38262e)
- | drone | [8cddc7b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8cddc7b)
- | 修改.drone.yml | [f5b52e3](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/f5b52e3)
- | 更新drone.yml | [63ec5a3](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/63ec5a3)
- | 更新drone.yml | [a57d598](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a57d598)
- | 测试ci | [6ab95f8](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/6ab95f8)
- | 测试ci' | [d25f2a7](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d25f2a7)
- | 更新drone.yml | [63ec5a3](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/63ec5a3)
- | 更新drone.yml | [a57d598](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a57d598)
- | 添加drone.yml | [9fbae89](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9fbae89)
- | 修改.drone.yml | [f5b52e3](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/f5b52e3)
- | ci update | [d38262e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d38262e)
- | drone | [8cddc7b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8cddc7b)
### 🔨 代码重构
范围|描述|commitId
--|--|--
- | project init 重构 | [2457a87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2457a87)
- | 交付物插件代码审查 | [5f4d47b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/5f4d47b)
- | 项目列表 | [0486e98](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0486e98)
- | 修改插件名的输入框和查看历史记录 | [99fb88e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/99fb88e)
- | 原有功能提交别的分支 | [eb02b72](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/eb02b72)
- | 重构project init 部分 | [c7bf2df](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/c7bf2df)
- | 项目列表 | [0486e98](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0486e98)
- | project init 重构 | [2457a87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2457a87)
### 🚀 性能优化

34
common/styles/theme/default.scss

@ -4,11 +4,8 @@
.u-card {
font-size: 16px !important;
background-color: #f3f3f3 !important;
.deliverHead {
align-items: center;
}
.btns u-button {
margin: 0 !important;
.btns{
color: #007aff;
}
.active {
background-color: #2979ff;
@ -22,6 +19,12 @@
height: 100%;
z-index: 100;
}
.boxModalBorder{
border-top:1px solid #D1D5DB;
}
.deleteModalBorder{
border-right:1px solid #D1D5DB ;
}
}
.u-navbar {
background-color: #007aff !important;
@ -30,7 +33,22 @@
color: #fff !important;
}
}
button {
border: none !important;
}
.box {
border-radius: 8px;
background: #fff;
padding: 16px;
overflow: hidden;
}
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 80%;
}
.rect {
width: 80%;
height: 380rpx;
background-color: #fff;
}
}

6
components/Reviewer/Reviewer.vue

@ -1,5 +1,5 @@
<template>
<view class="deliverFoot border border-solid border-gray-300 rounded-md mt-3 p-2">
<view class="deliverFoot border border-solid border-gray-300 rounded-md mt-3 p-2" @click="changeIcon">
<view class="top flex justify-between">
<view class="mr-3 text-sm">
审核人
@ -14,8 +14,8 @@
</view>
<!-- 点击更换图标 -->
<view>
<u-icon v-if="isUicon" name="arrow-down" @click="isUicon = !isUicon"></u-icon>
<u-icon v-else="isUicon" name="arrow-up" @click="changeIcon"></u-icon>
<u-icon v-if="isUicon" name="arrow-down" ></u-icon>
<u-icon v-else="isUicon" name="arrow-up" ></u-icon>
</view>
</view>
<!-- 隐藏的审核人选项 -->

43
pages/submitlist/submitlist.vue

@ -3,7 +3,7 @@
<view class="bg-white mx-5 my-2 rounded-md p-3 text-gray-400" v-for="item in listRef">
<!-- 插件名称和提交时间显示 -->
<view class="flex justify-between mb-2">
<view>{{item.plugname}}</view>
<view class="text-gray-800">{{item.plugname}}</view>
<view>{{item.subtime}}</view>
</view>
<!-- 提交的链接 -->
@ -12,21 +12,33 @@
</view>
<!-- 该插件物的审核人 -->
<view class="mb-2">审核人</view>
<view class="flex justify-between" v-for="items in item.reviewer">
<view>
<view class="flex justify-between my-3" v-for="items in item.reviewer">
<view>
<view class="pb-2 text-gray-800">
{{items.name}}
</view>
<view>
<view class="pb-2">
{{items.advise}}
</view>
<view>
{{items.item}}
<view class="pb-2">
{{items.time}}
</view>
</view>
<view>
{{items}}
<view class="text-center">
<view :class="items.state === '已通过' ? 'text-green-500' : items.state === '已驳回' ? 'text-red-500' : '' ">
{{items.state}}
</view>
<view v-if="items.state === '已通过'">
<u-circle-progress active-color="#FA8C16" :percent="items.grade" width="90" border-width="7" class="circleProgress mt-2">
<view class="u-progress-content">
<!-- <view class="u-progress-dot"></view> -->
<!-- <text class='u-progress-dot text-xs bg-yellow-500'>{{items.grade}}</text> -->
<view class="u-progress-dot text-white">{{items.grade}}</view>
</view>
</u-circle-progress>
</view>
</view>
</view>
</view>
</theme>
@ -38,7 +50,7 @@
{
plugname:'入职插件V0.8输出',
subtime:'12/25 13:01',
link:'https://www.baidu.com/'
link:'https://www.baidu.com/',
reviewer:[
{
name:'冯老师',
@ -56,7 +68,7 @@
},
{
name:'张老师',
time: '12/30 6:22',
time: '',
advise:'',
state:'待审批',
grade:''
@ -68,5 +80,14 @@
</script>
<style lang="scss">
.circleProgress{
border-radius: 50%;
}
.u-progress-dot{
width: 50rpx;
height: 50rpx;
border-radius: 50%;
line-height: 50rpx;
background-color: #FA8C16;
}
</style>

138
plugins/p-deliver/p-deliver.vue

@ -3,18 +3,18 @@
<!-- TODO if 是测试用的 -->
<view class="my-2 bg-white p-2 rounded-md relative" @longpress.prevent="showMask = true" v-if="deliverRef">
<!-- 插件名称输入和提交 -->
<view class="flex item-center justify-between py-3 pl-2" :class="inputRef">
<view class="flex item-center justify-between py-3 pl-2" >
<!-- <u-input v-model="iptValue" type="text" :border="false" placeholder="请编辑交付物名称" /> -->
<!-- TODO: 可能会有多个交付物 需要遍历 或者展示第一个 -->
<!-- TODO: 应该是交付物的名称 -->
<view :class="viewRef" class="flex-1">
<view class="flex-1">
<span class="relative px-1">
<u-badge :is-dot="true" is-center></u-badge>
<u-badge :is-dot="true" is-center v-if="uBadgeShow"></u-badge>
{{ task.name }}
</span>
</view>
<u-button type="primary" size="mini" @click="submit" class="self-center" :disabled="submitState">提交</u-button>
<u-button type="primary" size="mini" @click="submit" class="self-center" :disabled="submitState" v-show="!uBadgeShow">提交</u-button>
<!-- 查看提交历史的按钮 -->
<u-icon name="arrow-right" class="ml-3" @click="openDeliverHistory"></u-icon>
@ -24,34 +24,39 @@
<view>
<u-input v-model="linkValue" type="text" :border="true" placeholder="请输入交付物地址/链接"> </u-input>
<view class="mt-3">
<u-button size="mini" type="primary" :plain="true" class="mr-3" @click="paste">粘贴</u-button>
<u-button size="mini" type="primary" :plain="true" class="mr-3" @click="uploadFile">文件</u-button>
<u-button size="mini" type="primary" :plain="true" class="mr-3" @click="uploadPhoto">拍照</u-button>
<u-button size="mini" :plain="true" class="mr-3 btns" @click="paste">粘贴</u-button>
<u-button size="mini" :plain="true" class="mr-3 btns" @click="uploadFile">文件</u-button>
<u-button size="mini" :plain="true" class="mr-3 btns" @click="uploadPhoto">拍照</u-button>
</view>
</view>
<!-- 编辑和删除的遮罩层 -->
<view class="mask flex items-center justify-center bg-grey" v-show="showMask" @click="showMask = false">
<view class="bg-yellow-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="showEditModal = true">修改</view>
<view class="bg-red-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="deleteDeliver">删除</view>
<!-- 删除的二次提示modal -->
<u-modal v-model="showDeleteModal" :content="content" :show-cancel-button="true" @confirm="confirmDelete"></u-modal>
</view>
<!-- 编辑交付物标题的modal -->
<u-mask :show="showEditModal" @click="showEditModal = false">
<view class="warp">
<view class="rect rounded-md" @tap.stop>
<view class="text-center my-7 font-semibold"> 交付物标题名称 </view>
<view class="">
<u-input :border="true" class="m-5" placeholder="请输入交付物名称" v-model="newInputRef" />
<u-input :border="true" class="m-5" placeholder="请输入交付物名称" v-model="newInputRef"></u-input>
</view>
<!-- TODO: 边框 -->
<view class="flex justify-around h-12 mt-7 justify-self-stretch">
<view class="leading-12 flex-1 text-center" @click="showEditModal = false"> 取消 </view>
<view class="flex justify-around h-12 mt-7 justify-self-stretch boxModalBorder">
<view class="leading-12 flex-1 text-center deleteModalBorder" @click="showEditModal = false"> 取消 </view>
<view class="text-blue-700 leading-12 flex-1 text-center" @click="confirmEditDeliverName"> 确定 </view>
</view>
</view>
</view>
</u-mask>
<!-- 编辑和删除的遮罩层 -->
<view class="mask flex items-center justify-center bg-grey" v-show="showMask" @click="showMask = false">
<view class="bg-yellow-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="showEditModal = true">修改</view>
<view class="bg-red-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="deleteDeliver">删除</view>
</view>
<!-- 删除二次提示的modal -->
<!-- 插件审核人员选择 -->
<Reviewer ref="reviewerData"></Reviewer>
@ -59,9 +64,11 @@
</template>
<script setup>
import { ref, computed, reactive } from 'vue';
import { ref, computed} from 'vue';
const taskRef = defineProps({ task: { type: Object, default: () => {} } })
// console.log(taskRef.task.name)
defineProps({ task: { type: Object, default: () => {} } })
//
const deliverRef = ref(true); //
@ -70,24 +77,15 @@ const linkValue = ref(''); // 链接的值
const historyIcon = ref(false); //
const showMask = ref(false); //
const showEditModal = ref(false); // modal
const newInputRef = ref(''); //
const submitHistory = reactive([]); //
const reviewerData = ref();
// const aa = this.$reviewer.arrList
const newInputRef = ref(taskRef.task.name); //
// const reviewerData = ref(); //
const showDeleteModal = ref(false) // modal
const content = ref('是否确定删除')
const uBadgeShow = ref(false) //u-badge
//
const submitState = computed(() => !linkValue.value);
//
function getTime() {
const MM = uni.$dayjs().$M + 1;
const DD = uni.$dayjs().$D;
const HH = uni.$dayjs().$H;
const mm = uni.$dayjs().$m;
return `${MM}/${DD} ${HH}:${mm < 10 ? `0${mm}` : mm}`;
}
//
function submit() {
@ -96,27 +94,15 @@ function submit() {
// toast
uni.$ui.showToast('请输入正确的链接');
} else {
inputRef.value = 'hidden';
viewRef.value = 'block';
//
const obj = {};
const time = getTime();
obj.name = textValue.value;
obj.time = time;
obj.link = linkValue.value;
obj.deliver = reviewerData.value.arrList;
submitHistory.push(obj);
// console.log(submitHistory)
// console.log(reviewerData.value.arrList)
uBadgeShow.value = true
}
}
//
function openDeliverHistory() {
const editItem = submitHistory;
uni.navigateTo({ url: `/pages/submitList/submitList?editItem=${encodeURIComponent(JSON.stringify(editItem))}` });
// console.log(editItem)
uni.navigateTo({ url: '/pages/submitList/submitList'});
}
//
@ -129,28 +115,29 @@ function paste() {
}
//
function uploadFile() {
uni.chooseFile({
count: 1, // 100
extension: ['.zip', '.doc'],
success(res) {
// TODO: apiurl
linkValue.value = JSON.stringify(res.tempFilePaths);
},
});
async function uploadFile(){
try{
const data = await uni.$upload.chooseAndUpload('https://test.tall.wiki/filedeal/file/upload/multiple',{}, ['.xls', '.xlsx','.zip','.exe','.pdf','.doc','.docx','.ppt','.pptx'] , 'files')
// console.log(data[0])
linkValue.value = data[0].visitUrl
}catch(error){
console.error('error: ', error);
}
}
//
function uploadPhoto() {
uni.chooseImage({
count: 1, // 9
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success(res) {
// TODO: apiurl
linkValue.value = JSON.stringify(res.tempFilePaths);
},
});
async function uploadPhoto() {
try{
const data = await uni.$upload.chooseAndUpload('https://test.tall.wiki/filedeal/file/upload/multiple',{}, ['.xls', '.xlsx','.zip','.exe','.pdf','.doc','.docx','.ppt','.pptx'] , 'files')
// console.log(data[0])
linkValue.value = data[0].visitUrl
}catch(error){
console.error('error: ', error);
}
}
//
@ -158,18 +145,27 @@ function confirmEditDeliverName() {
// TODO: task
if (!newInputRef.value) {
//TODO:
}
uni.$ui.showToast("输入不能为空");
}else{
//
showEditModal.value = false
showMask.value = false
uBadgeShow.value = false
newInputRef.value = '';
//
historyIcon.value = true;
}
}
//
async function deleteDeliver() {
function deleteDeliver(){
showDeleteModal.value = true
}
//
async function confirmDelete() {
// TODO:
// TODO:
try {
showDeleteModal.value = true
await uni.$u.api.deleteDeliver();
uni.$ui.showToast("删除交付物成功");
} catch (error) {
@ -177,6 +173,8 @@ async function deleteDeliver() {
}
deliverRef.value = false;
}
</script>
<style scoped lang="scss">

1
utils/upload.js

@ -86,7 +86,6 @@ export default {
}) => {
clearTimeout(timer);
uni.hideLoading();
if (statusCode === 200 && data) {
const {
code,

Loading…
Cancel
Save