Commit b3512155 authored by Zhang Xiaojie's avatar Zhang Xiaojie

考勤打卡UI界面

parent cd11800a
...@@ -17,6 +17,7 @@ note?:备注 ...@@ -17,6 +17,7 @@ note?:备注
/* /*
state:今日考勤状态 '异常','正常','早退' state:今日考勤状态 '异常','正常','早退'
*/ */
const state:string = '异常'
const punchList:Array<Punch>=[ const punchList:Array<Punch>=[
{ {
...@@ -36,7 +37,8 @@ const punchList:Array<Punch>=[ ...@@ -36,7 +37,8 @@ const punchList:Array<Punch>=[
export{ export{
Punch, Punch,
punchList punchList,
state
} }
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import { contacts, Person, flatContacts } from './contacts' import { contacts, Person, flatContacts } from './contacts'
import { List, Info, details } from './request' import { List, Info, details } from './request'
import { punchList,Punch } from './attendance' import { punchList,Punch,state } from './attendance'
interface Member { interface Member {
parentId?: number, parentId?: number,
...@@ -105,5 +105,6 @@ export { ...@@ -105,5 +105,6 @@ export {
Info, Info,
details, details,
Punch, Punch,
punchList punchList,
state
} }
\ No newline at end of file
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<p class="team-name text-base mt-3">{{teamname}}</p> <p class="team-name text-base mt-3">{{teamname}}</p>
</div> </div>
<!-- 考勤状态 --> <!-- 考勤状态 -->
<p :class="{normal:(state=='正常')}" <p :class="{normal:(current=='正常')}"
class=" h-8 text-sm bg-bg-warning text-text-warning ml-11 leading-8 px-3 inline-block rounded-2xl mt-3"> class=" h-8 text-sm bg-bg-warning text-text-warning ml-11 leading-8 px-3 inline-block rounded-2xl mt-3">
今日考勤{{state}} 今日考勤{{current}}
</p> </p>
<!-- 打卡 --> <!-- 打卡 -->
<div :last="last"> <div :last="last">
...@@ -44,15 +44,22 @@ ...@@ -44,15 +44,22 @@
</div> </div>
</van-dialog> </van-dialog>
<!-- 编辑备注弹窗 --> <!-- 编辑备注弹窗 -->
<van-dialog v-model="showNote" title="编辑备注" confirm-button-text="提交" :before-close="onBeforeClose"> <van-dialog v-model="show" title="编辑备注" confirm-button-text="提交" :before-close="onBeforeClose" >
<div> <p class=" text-right text-gray-400 text-sm">{{value.length}}/{{min}}-{{max}}</p>
<p class=" text-right text-gray-400 text-sm">{{value.length}}/{{min}}-{{max}}</p> <div class=" relative">
<textarea type="text" v-model="value" :placeholder="hint" <textarea type="text" v-model="value"
class=" w-72 h-56 bg-gray-100 mx-auto mt-1 block box-border text-base text-text-primary" class=" w-72 h-56 bg-gray-100 mx-auto mt-1 pl-2 pt-2 block box-border text-base text-text-primary"
@input="handleInput"> @click="showhint=false" @input="handleInput">
</textarea> </textarea>
<!-- placeholder内容 -->
<div class="hint absolute top-2 left-2 pointer-events-none text-gray-400 text-base" v-show="showhint">
<p>请填写</p>
<p>1.工作计划/完成情况</p>
<p>2.对接人及周期</p>
<p>3.遇到的问题</p>
</div>
</div> </div>
</van-dialog> </van-dialog>
</main-page> </main-page>
</div> </div>
</template> </template>
...@@ -60,31 +67,23 @@ ...@@ -60,31 +67,23 @@
<script lang="ts"> <script lang="ts">
import Vue,{ PropType } from 'vue'; import Vue,{ PropType } from 'vue';
import { punchList,Punch } from '@/DTO' import { punchList,Punch,state } from '@/DTO'
import { Toast } from 'vant'; import { Toast } from 'vant';
export default Vue.extend({ export default Vue.extend({
name:'attendance', name:'attendance',
components:{ components:{
'main-page': () => import('@/layout/main-page.vue'), 'main-page': () => import('@/layout/main-page.vue'),
'punch': () => import('@/views/attendance/components/punch.vue') 'punch': () => import('@/views/attendance/components/punch.vue'),
}, },
props:{ props:{
punch:{ punch:{
type:Object as PropType<Punch> type:Object as PropType<Punch>
}, },
state:{
type:String,
default:'正常'
},
last:{ last:{
type:Boolean, type:Boolean,
default:false default:false
}, },
hint:{
type:String,
default:'请填写\n1.工作计划/完成情况\n2.对接人及周期\n3.遇到的问题'
},
min:{ min:{
type:Number, type:Number,
default:20 default:20
...@@ -92,23 +91,30 @@ export default Vue.extend({ ...@@ -92,23 +91,30 @@ export default Vue.extend({
max:{ max:{
type:Number, type:Number,
default:500 default:500
},
showNote:{
type:Boolean,
default:false
} }
}, },
data(){ data(){
let list:Array<Punch>=[] let list:Array<Punch>=[]
list = punchList list = punchList
let current:string = state
return{ return{
list, list,
name:'姓名', name:'姓名',
memberid:43, memberid:43,
teamname:'杭州复杂美科技有限公司', teamname:'杭州复杂美科技有限公司',
showPunch:false, showPunch:false,
showNote:false,
time:'', time:'',
location:'', location:'',
checkin:true,
current,
showhint:true,
value:'', value:'',
close:false, close:false,
checkin:true show:false
} }
}, },
methods:{ methods:{
...@@ -126,7 +132,7 @@ export default Vue.extend({ ...@@ -126,7 +132,7 @@ export default Vue.extend({
} }
}, },
editNote(isShow:boolean){ editNote(isShow:boolean){
this.showNote = isShow this.show = isShow
}, },
confirm(checkin:boolean){ confirm(checkin:boolean){
let type:string='' let type:string=''
...@@ -140,16 +146,17 @@ export default Vue.extend({ ...@@ -140,16 +146,17 @@ export default Vue.extend({
position:'bottom' position:'bottom'
}) })
}, },
handleInput() { handleInput(e:InputEvent) {
// this.value = '' this.showhint = false
if (this.max > 0 && this.value.length >= this.max) { let size = (e.target as HTMLInputElement).value.length
if (this.max > 0 && size >= this.max) {
this.value = this.value.slice(0,this.max) this.value = this.value.slice(0,this.max)
} else if( this.value.length>=this.min) { } else if( size >= this.min) {
this.close = true this.close = true
} }
else if( this.value.length == 0){ else if( size == 0){
this.value='请填写\n1.工作计划/完成情况\n2.对接人及周期\n3.遇到的问题' this.showhint = true
} }
}, },
onBeforeClose(action:string,done:Function){ onBeforeClose(action:string,done:Function){
if(action==='confirm'){ if(action==='confirm'){
...@@ -172,18 +179,4 @@ export default Vue.extend({ ...@@ -172,18 +179,4 @@ export default Vue.extend({
background-color:#E8F3FF; background-color:#E8F3FF;
color:#32B2F7; color:#32B2F7;
} }
::-webkit-input-placeholder {
color: transparent;
}
::-webkit-input-placeholder:before {
display: block;
color: #999;
content: "第一行请输入提示内容 \A 第二行请输入提示内容";
}
</style> </style>
\ No newline at end of file
...@@ -24,14 +24,12 @@ module.exports = { ...@@ -24,14 +24,12 @@ module.exports = {
'linear-b': '#066BA2', 'linear-b': '#066BA2',
// 按钮 // 按钮
'button-disabled': '#C8D3DE', 'button-disabled': '#C8D3DE',
<<<<<<< HEAD
// 员工信息背景色 // 员工信息背景色
"bg-deep":'#0D73AD', "bg-deep":'#0D73AD',
// 异常字体颜色 // 异常字体颜色
"text-warning":'#CF4646', "text-warning":'#CF4646',
// 异常背景颜色 // 异常背景颜色
"bg-warning":'#FAEEEE', "bg-warning":'#FAEEEE',
=======
// 标签 // 标签
'tag-primary': '#32B2F7', 'tag-primary': '#32B2F7',
'tag-primary-lighter': '#EAF6FF', 'tag-primary-lighter': '#EAF6FF',
...@@ -45,7 +43,6 @@ module.exports = { ...@@ -45,7 +43,6 @@ module.exports = {
'tag-red-lighter': '#FAEEEE', 'tag-red-lighter': '#FAEEEE',
'tag-purple': '#9F82E5', 'tag-purple': '#9F82E5',
'tag-purple-lighter': '#F1ECFD', 'tag-purple-lighter': '#F1ECFD',
>>>>>>> origin/main
}, },
spacing: { spacing: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment