forked from ccsens_fe/tall-mui-3
18 changed files with 188 additions and 243 deletions
@ -1,12 +1,7 @@ |
|||
import domain from '@/config/domains'; |
|||
const apiUrl = process.env.VUE_APP_API_URL; |
|||
const mock = `${apiUrl}${domain}`; |
|||
const plugin = `${apiUrl}/pluginshop/plugin`; |
|||
|
|||
const install = (Vue, vm) => { |
|||
vm.$u.api = { ...vm.$u.api } || {}; |
|||
vm.$u.api.getPlugin = param => vm.$u.post(`${mock}/plugin`, param); |
|||
vm.$u.api.getOtherPlugin = param => vm.$u.post(`${plugin}/query`, param); |
|||
vm.$u.api.getPlugin = param => vm.$u.post(`${uni.$t.domain}/plugin`, param); |
|||
vm.$u.api.getOtherPlugin = param => vm.$u.post(`${uni.$t.domain}/pluginshop/plugin/query`, param); |
|||
}; |
|||
|
|||
export default { install }; |
|||
|
@ -1,12 +1,7 @@ |
|||
const apiUrl = process.env.VUE_APP_API_URL; |
|||
import domainPath from '@/config/domains'; |
|||
const tall = `${apiUrl}${domainPath}`; |
|||
const project = `${tall}/project`; |
|||
|
|||
const install = (Vue, vm) => { |
|||
vm.$u.api = { ...vm.$u.api } || {}; |
|||
//根据id获取项目信息
|
|||
vm.$u.api.findProjectById = param => vm.$u.post(`${project}/findProjectById`, param); |
|||
vm.$u.api.findProjectById = param => vm.$u.post(`${uni.$t.domain}/project/findProjectById`, param); |
|||
}; |
|||
|
|||
export default { install }; |
|||
|
@ -1,11 +1,7 @@ |
|||
const apiUrl = process.env.VUE_APP_API_URL; |
|||
import domain from '@/config/domains'; |
|||
const role = `${apiUrl}${domain}/role`; |
|||
|
|||
const install = (Vue, vm) => { |
|||
vm.$u.api = { ...vm.$u.api } || {}; |
|||
//根据时间基准点和角色查找定期任务
|
|||
vm.$u.api.findShowRole = param => vm.$u.post(`${role}/show`, param); |
|||
vm.$u.api.findShowRole = param => vm.$u.post(`${uni.$t.domain}/role/show`, param); |
|||
}; |
|||
|
|||
export default { install }; |
|||
|
@ -1,15 +1,11 @@ |
|||
const apiUrl = process.env.VUE_APP_API_URL; |
|||
import domain from '@/config/domains'; |
|||
const task = `${apiUrl}${domain}/task`; |
|||
|
|||
const install = (Vue, vm) => { |
|||
vm.$u.api = { ...vm.$u.api } || {}; |
|||
vm.$u.api.getGlobal = param => vm.$u.post(`${task}/global`, param); |
|||
vm.$u.api.getPermanent = param => vm.$u.post(`${task}/permanent`, param); |
|||
vm.$u.api.getGlobal = param => vm.$u.post(`${uni.$t.domain}/task/global`, param); |
|||
vm.$u.api.getPermanent = param => vm.$u.post(`${uni.$t.domain}/task/permanent`, param); |
|||
//根据时间基准点和角色查找定期任务
|
|||
vm.$u.api.getRegularTask = param => vm.$u.post(`${task}/regular`, param); |
|||
vm.$u.api.getRegularTask = param => vm.$u.post(`${uni.$t.domain}/task/regular`, param); |
|||
//修改任务状态
|
|||
vm.$u.api.updateTaskType = param => vm.$u.post(`${task}/type`, param); |
|||
vm.$u.api.updateTaskType = param => vm.$u.post(`${uni.$t.domain}/task/type`, param); |
|||
}; |
|||
|
|||
export default { install }; |
|||
|
@ -1,12 +1,7 @@ |
|||
const apiUrl = process.env.VUE_APP_API_URL; |
|||
import domainPath from '@/config/domains'; |
|||
const tall = `${apiUrl}${domainPath}`; |
|||
const wbs = `${tall}/wbs`; |
|||
|
|||
const install = (Vue, vm) => { |
|||
vm.$u.api = { ...vm.$u.api } || {}; |
|||
// 导入wbs
|
|||
vm.$u.api.import = formData => vm.$t.chooseAndUpload(wbs, formData); |
|||
vm.$u.api.import = formData => vm.$t.chooseAndUpload(`${uni.$t.domain}/wbs`, formData); |
|||
}; |
|||
|
|||
export default { install }; |
|||
|
@ -1,182 +1,71 @@ |
|||
<template> |
|||
<view class="bg-white u-p-t-30 u-p-b-30"> |
|||
<view class="flex items-center"> |
|||
<view class="flex items-center justify-center rounded-full event-pic"> |
|||
<image style="width: 25px; height: 25px" src="../../static/local_play1.png"></image> |
|||
</view> |
|||
<view class="title">我的LWBS</view> |
|||
</view> |
|||
<view v-for="(task, index) in tasks" :key="index"> |
|||
<view> |
|||
<view class="py-3 mt-4 bg-white"> |
|||
<view v-for="(project, index) in projects" :key="index"> |
|||
<!-- 有子项目 --> |
|||
<view class="flex items-center justify-between item" v-if="index <= 2"> |
|||
<view class="flex items-center"> |
|||
<view class="text-white rounded-full firstTask" v-if="index === 0"> |
|||
<view class="flex items-center justify-center">{{ index + 1 }}</view> |
|||
</view> |
|||
<view class="text-white rounded-full sencondTask" v-else-if="index === 1"> |
|||
<view class="flex items-center justify-center">{{ index + 1 }}</view> |
|||
</view> |
|||
<view class="text-white rounded-full thirdTask" v-else-if="index === 2"> |
|||
<view class="flex items-center justify-center">{{ index + 1 }}</view> |
|||
</view> |
|||
<view> |
|||
<view class="flex items-center"> |
|||
<view class="title">{{ task.taskName }}</view> |
|||
<!-- 状态 --> |
|||
<view class="text-green-400 bg-green-100 rounded-full u-p-l-10 u-p-r-10 states">{{ task.state }}</view> |
|||
<view class="flex items-center justify-between p-3"> |
|||
<view class="text-blue-400 border border-blue-200 rounded-full order bg-blue-50"> |
|||
{{ index + 1 }} |
|||
</view> |
|||
<view class="flex items-center text-gray-400 dates"> |
|||
<view class="pr-2">{{ task.time }}</view> |
|||
<view>时长:{{ task.duration }}</view> |
|||
|
|||
<view class="flex-1 px-3"> |
|||
<view class="flex items-center mb-1"> |
|||
<view class="mr-2">{{ project.name }}</view> |
|||
<!-- 状态 TODO:--> |
|||
<view class="px-2 text-xs text-green-400 bg-green-100 rounded-full">进行中</view> |
|||
</view> |
|||
|
|||
<view class="flex items-center text-xs text-gray-400"> |
|||
<view class="pr-2">{{ $moment(+project.startTime).format('MM-DD HH:mm') }}</view> |
|||
至 |
|||
<view class="pl-2"> {{ $moment(+project.endTime).format('MM-DD HH:mm') }}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<!-- 箭头 --> |
|||
<u-icon name="arrow-right" color="#A4A6AB" size="14px" @click="openProjectItem(index)"></u-icon> |
|||
</view> |
|||
<!-- 没有子项目 --> |
|||
<view class="item" v-else> |
|||
<view class="flex items-center"> |
|||
<view class="w-8 h-8 bg-white border rounded-full routine"> |
|||
<view class="flex items-center justify-center">{{ index + 1 }}</view> |
|||
</view> |
|||
<view> |
|||
<view class="flex items-center"> |
|||
<view class="title">{{ task.taskName }}</view> |
|||
<view class="px-2 text-green-400 bg-green-100 rounded-full states">{{ task.state }}</view> |
|||
</view> |
|||
<view class="flex items-center text-gray-400 dates"> |
|||
<view class="pr-2">{{ task.time }}</view> |
|||
<view>时长:{{ task.duration }}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view v-if="isrotate === index"> |
|||
这是子项目 |
|||
<ProjectItem /> |
|||
</view> |
|||
<u-icon name="arrow-right" class="text-gray-400" size="14px" @click="openProject(project)"></u-icon> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapState } from 'vuex'; |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
isrotate: -1, |
|||
tasks: [ |
|||
{ |
|||
taskName: '山西省三大中心建设', |
|||
state: '正在进行', |
|||
time: '05月31日 00:00', |
|||
duration: '365天', |
|||
}, |
|||
{ |
|||
taskName: '1号康复室', |
|||
state: '正在进行', |
|||
time: '01月31日 00:00', |
|||
duration: '727天', |
|||
}, |
|||
{ |
|||
taskName: '盐湖医院远程康复', |
|||
state: '正在进行', |
|||
time: '05月31日 00:00', |
|||
duration: '65天', |
|||
}, |
|||
{ |
|||
taskName: '山西省三大中心建设', |
|||
state: '正在进行', |
|||
time: '05月31日 00:00', |
|||
duration: '365天', |
|||
}, |
|||
{ |
|||
taskName: '1号康复室', |
|||
state: '正在进行', |
|||
time: '01月31日 00:00', |
|||
duration: '727天', |
|||
}, |
|||
{ |
|||
taskName: '盐湖医院远程康复', |
|||
state: '正在进行', |
|||
time: '05月31日 00:00', |
|||
duration: '65天', |
|||
}, |
|||
], |
|||
}; |
|||
return {}; |
|||
}, |
|||
|
|||
computed: mapState('project', ['projects']), |
|||
|
|||
methods: { |
|||
// 展开子项目 |
|||
openProjectItem(index) { |
|||
if (this.isrotate === -1) { |
|||
this.isrotate = index; |
|||
} else { |
|||
this.isrotate = -1; |
|||
} |
|||
/** |
|||
* 打开项目 |
|||
* @param {object} project 所点击的项目的信息 |
|||
*/ |
|||
openProject(project) { |
|||
console.log('project: ', project); |
|||
const { name, id, url } = project; |
|||
console.log(uni.$t.domain); |
|||
url && (uni.$t.domain = url); |
|||
console.log('uni.$t.domain: ', uni.$t.domain); |
|||
this.$u.route('pages/project/project', { |
|||
p: id, |
|||
pname: name, |
|||
url: encodeURIComponent(url), |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.firstTask { |
|||
background: linear-gradient(45deg, #9000ff, #5e00ff); |
|||
width: 32px; |
|||
height: 32px; |
|||
margin-right: 16px; |
|||
line-height: 32px; |
|||
font-size: 16px; |
|||
text-align: center; |
|||
border: 1px solid #eee; |
|||
} |
|||
.sencondTask { |
|||
background: linear-gradient(45deg, #0081ff, #1cbbb4); |
|||
width: 32px; |
|||
height: 32px; |
|||
margin-right: 16px; |
|||
line-height: 32px; |
|||
font-size: 16px; |
|||
text-align: center; |
|||
border: 1px solid #eee; |
|||
} |
|||
.thirdTask { |
|||
background: linear-gradient(45deg, #39b54a, #8dc63f); |
|||
.order { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width: 32px; |
|||
height: 32px; |
|||
margin-right: 16px; |
|||
line-height: 32px; |
|||
font-size: 16px; |
|||
text-align: center; |
|||
border: 1px solid #eee; |
|||
} |
|||
.routine { |
|||
width: 32px; |
|||
height: 32px; |
|||
margin-right: 16px; |
|||
line-height: 32px; |
|||
font-size: 16px; |
|||
text-align: center; |
|||
border: 1px solid #eee; |
|||
} |
|||
.event-pic { |
|||
margin: 0 14px; |
|||
width: 36px; |
|||
height: 36px; |
|||
background: linear-gradient(45deg, #ff9700, #ed1c24); |
|||
} |
|||
.title { |
|||
font-size: 15px; |
|||
margin-right: 12px; |
|||
} |
|||
.dates { |
|||
font-size: 12px; |
|||
} |
|||
.states { |
|||
font-size: 10px; |
|||
} |
|||
.item { |
|||
border-bottom: 1px solid #fafafa; |
|||
height: 60px; |
|||
padding: 10px 16px; |
|||
font-size: 13px; |
|||
} |
|||
</style> |
|||
|
@ -1,6 +1,7 @@ |
|||
/* eslint-disable */ |
|||
const state = { |
|||
project: { name: '加载中...' }, // 当前项目信息
|
|||
projects: [], // 项目列表
|
|||
}; |
|||
|
|||
export default state; |
|||
|
Loading…
Reference in new issue