Browse Source

refactor: 修改插件名的输入框和查看历史记录

deliver
Min5203 4 years ago
parent
commit
99fb88e18f
  1. 3
      CHANGELOG.md
  2. 22
      components/Reviewer/Reviewer.vue
  3. 70
      pages/submitlist/submitlist.vue
  4. 59
      plugins/p-deliver/p-deliver.vue

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 1.0.0 (2022-01-13) # 1.0.0 (2022-01-14)
### 🌟 新功能 ### 🌟 新功能
范围|描述|commitId 范围|描述|commitId
@ -41,6 +41,7 @@
### 🔨 代码重构 ### 🔨 代码重构
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 原有功能提交别的分支 | [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) - | 重构project init 部分 | [c7bf2df](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/c7bf2df)
- | project init 重构 | [2457a87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2457a87) - | project init 重构 | [2457a87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2457a87)

22
components/Reviewer/Reviewer.vue

@ -1,7 +1,7 @@
<template> <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">
<view class="top flex justify-between"> <view class="top flex justify-between">
<view class="mr-3"> <view class="mr-3 text-sm">
审核人 审核人
</view> </view>
<!-- 展示选择的审核人 --> <!-- 展示选择的审核人 -->
@ -14,7 +14,7 @@
</view> </view>
<!-- 点击更换图标 --> <!-- 点击更换图标 -->
<view> <view>
<u-icon v-if="isUicon" name="arrow-down" @click="changeIcon"></u-icon> <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-else="isUicon" name="arrow-up" @click="changeIcon"></u-icon>
</view> </view>
</view> </view>
@ -37,6 +37,10 @@
import {ref , reactive , computed }from 'vue' import {ref , reactive , computed }from 'vue'
// //
let isUicon = ref('true') let isUicon = ref('true')
let arrList = ref([{
checked:true,
name:'冯教授'
}])
// //
const delivers = reactive([ const delivers = reactive([
{ {
@ -80,10 +84,24 @@
return arr return arr
}) })
// //
function changeIcon(){ function changeIcon(){
isUicon.value = !isUicon.value isUicon.value = !isUicon.value
let arr = [];
delivers.forEach((item)=>{
if(item.checked){
arr.push(item)
}
})
arrList.value = arr
// console.log(arrList.value)
} }
defineExpose({
  arrList
})
</script> </script>
<style lang="scss"> <style lang="scss">

70
pages/submitlist/submitlist.vue

@ -1,24 +1,70 @@
<template> <template>
<theme class="h-full w-full pt-1"> <theme class="h-full w-full pt-1">
<view class="bg-white mx-5 my-2 rounded-md p-3"> <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 text-gray-400 mb-2"> <!-- 插件名称和提交时间显示 -->
<view>插件名</view> <view>提交时间</view> <view class="flex justify-between mb-2">
<view>{{item.plugname}}</view>
<view>{{item.subtime}}</view>
</view> </view>
<!-- 提交的链接 -->
<view class="text-blue-400 mb-2"> <view class="text-blue-400 mb-2">
链接 {{item.link}}
</view>
<!-- 该插件物的审核人 -->
<view class="mb-2">审核人</view>
<view class="flex justify-between" v-for="items in item.reviewer">
<view>
<view>
{{items.name}}
</view>
<view>
{{items.advise}}
</view>
<view>
{{items.item}}
</view>
</view>
<view>
{{items}}
</view>
</view> </view>
<view class="mb-2 text-gray-400">审核人</view>
</view> </view>
</theme> </theme>
</template> </template>
<script> <script setup>
export default { import{ref} from 'vue'
data() { const listRef = ref([
return { {
}; plugname:'入职插件V0.8输出',
} subtime:'12/25 13:01',
} link:'https://www.baidu.com/'
reviewer:[
{
name:'冯老师',
time: '12/25 14:22',
advise:'加油!',
state:'已通过',
grade:80
},
{
name:'宋老师',
time: '12/28 8:22',
advise:'不详细!',
state:'已驳回',
grade:''
},
{
name:'张老师',
time: '12/30 6:22',
advise:'',
state:'待审批',
grade:''
},
]
},
])
</script> </script>
<style lang="scss"> <style lang="scss">

59
plugins/p-deliver/p-deliver.vue

@ -4,15 +4,18 @@
<view class="my-2 bg-white p-2 rounded-md relative" @longpress="logoTime" v-if="deliverRef"> <view class="my-2 bg-white p-2 rounded-md relative" @longpress="logoTime" 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" :class="inputRef">
<u-input v-model="iptValue" type="text" :border="false" placeholder="请编辑交付物名称" /> <!-- <u-input v-model="iptValue" type="text" :border="false" placeholder="请编辑交付物名称" /> -->
<view class="self-center" :class="viewRef">{{iptValue}}</view> <view v-model="textValue" class="flex-1">
{{textValue}}
</view>
<view class="self-center" :class="viewRef">{{textValue}}</view>
<u-button type="primary" size="mini" @click="submit" class="self-center" :disabled="sbumitState">提交</u-button> <u-button type="primary" size="mini" @click="submit" class="self-center" :disabled="sbumitState">提交</u-button>
<u-icon v-show="historyIcon" name="arrow-right" class="ml-1" @click="historical"></u-icon> <u-icon v-show="historyIcon" name="arrow-right" class="ml-1" @click="historical"></u-icon>
</view> </view>
<view :class="viewRef" class="py-3 pl-2"> <view :class="viewRef" class="py-3 pl-2">
<span class="relative px-1"> <span class="relative px-1">
<u-badge :is-dot="true" is-center></u-badge> <u-badge :is-dot="true" is-center></u-badge>
{{iptValue}} {{textValue}}
</span> </span>
</view> </view>
<!-- 插件上传方式 --> <!-- 插件上传方式 -->
@ -26,7 +29,6 @@
</view> </view>
</view> </view>
<!-- 提示框 --> <!-- 提示框 -->
<u-toast ref="tips" />
<!-- 取消和确定 --> <!-- 取消和确定 -->
<u-mask :show="showRef" @click="showRef = false"> <u-mask :show="showRef" @click="showRef = false">
@ -56,30 +58,30 @@
<view class="bg-red-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click="deletePlugin" @tap.stop>删除</view> <view class="bg-red-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click="deletePlugin" @tap.stop>删除</view>
</view> </view>
<!-- 插件审核人员选择 --> <!-- 插件审核人员选择 -->
<Reviewer/> <Reviewer ref="reviewerData"></Reviewer>
</view> </view>
</template> </template>
<script setup> <script setup>
import {ref,computed,reactive} from 'vue' import {ref,computed,reactive} from 'vue'
// //
const deliverRef = ref(true) const deliverRef = ref(true) //
const iptValue = ref('') const textValue = ref('入职插件V0.8原型输出') //
const linkValue = ref('') const linkValue = ref('') //
const historyIcon = ref(false) const historyIcon = ref(false) //
const tips = ref('') const showRef = ref(false) //
const showRef = ref(false) const maskRef = ref('hidden') //
const maskRef = ref('hidden') const inputRef = ref('block') //
const inputRef = ref('block') const viewRef = ref('hidden') //
const viewRef = ref('hidden') const newInputRef = ref('') //
const newInputRef = ref('') const submitHistory = reactive([]) //
const submitHistory = reactive([]) const reviewerData = ref()
// const aa = this.$reviewer.arrList
// //
const sbumitState = computed(()=>!(iptValue.value && linkValue.value)) const sbumitState = computed(()=>!( linkValue.value))
// //
function getTime(){ function getTime(){
@ -87,8 +89,7 @@
const DD = uni.$dayjs().$D const DD = uni.$dayjs().$D
const HH = uni.$dayjs().$H const HH = uni.$dayjs().$H
const mm = uni.$dayjs().$m const mm = uni.$dayjs().$m
const getTime = MM + '/' + DD + ' ' + HH + ':' + (mm < 10 ? '0' + mm : mm) return (MM + '/' + DD + ' ' + HH + ':' + (mm < 10 ? '0' + mm : mm))
return getTime
} }
// //
function submit(){ function submit(){
@ -99,21 +100,27 @@
}else{ }else{
inputRef.value = 'hidden' inputRef.value = 'hidden'
viewRef.value = 'block' viewRef.value = 'block'
const time = getTime()
//
const obj = {} const obj = {}
obj.name = iptValue.value const time = getTime()
obj.name = textValue.value
obj.time = time obj.time = time
obj.link = linkValue.value obj.link = linkValue.value
obj.deliver = reviewerData.value.arrList
submitHistory.push(obj) submitHistory.push(obj)
console.log(submitHistory) // console.log(submitHistory)
// console.log(reviewerData.value.arrList)
} }
} }
// //
function historical(){ function historical(){
let editItem = submitHistory
uni.navigateTo({ uni.navigateTo({
url: '/pages/submitList/submitList' url: '/pages/submitList/submitList?editItem=' + encodeURIComponent(JSON.stringify(editItem))
}); });
// console.log(editItem)
} }
@ -171,7 +178,7 @@ function cancelClick(){
} }
// //
function sureClick (){ function sureClick (){
iptValue.value = newInputRef.value textValue.value = newInputRef.value
newInputRef.value = '' newInputRef.value = ''
inputRef.value = 'block' inputRef.value = 'block'
viewRef.value = 'hidden' viewRef.value = 'hidden'

Loading…
Cancel
Save