55 changed files with 2432 additions and 558 deletions
@ -1,68 +1,82 @@ |
|||
# 1.0.0 (2022-01-11) |
|||
# 1.0.0 (2022-01-12) |
|||
|
|||
### 🌟 新功能 |
|||
范围|描述|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) |
|||
- | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91) |
|||
- | 日历页首页 | [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) |
|||
- | 时间轴接口 | [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) |
|||
- | 添加 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) |
|||
- | 项目列表 | [a52e6d5](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a52e6d5) |
|||
- | 项目操作面板 | [3beb05e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3beb05e) |
|||
|
|||
| 范围 | 描述 | commitId | |
|||
| ------- | ------------------------ | ------------------------------------------------------------------------ | |
|||
| - | 表单验证 | [8f3bc1e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8f3bc1e) | |
|||
| - | 更新代码 | [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) | |
|||
| - | 日历页添加 | [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) | |
|||
| - | 时间轴展示 | [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) | |
|||
| - | 手机号登录 | [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) | |
|||
| - | 项目操作面板 | [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) | |
|||
| - | 账户名密码登录 | [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) |
|||
- | 细节调整 | [bdd5f87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/bdd5f87) |
|||
|
|||
| 范围 | 描述 | commitId | |
|||
| ---- | ----------------------- | ------------------------------------------------------------------------ | |
|||
| - | 细节调整 | [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 |
|||
--|--|-- |
|||
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) |
|||
- | 修复一些内容 | [3cdb1ce](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3cdb1ce) |
|||
|
|||
| 范围 | 描述 | 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) | |
|||
|
|||
### 📦 持续集成 |
|||
范围|描述|commitId |
|||
--|--|-- |
|||
- | 添加drone.yml | [9fbae89](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9fbae89) |
|||
|
|||
| 范围 | 描述 | commitId | |
|||
| ---- | -------------- | ------------------------------------------------------------------------ | |
|||
| - | 测试 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) | |
|||
| - | 测试 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 | [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) | |
|||
|
|||
### 🔨 代码重构 |
|||
范围|描述|commitId |
|||
--|--|-- |
|||
- | project init 重构 | [2457a87](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2457a87) |
|||
- | 重构project init 部分 | [c7bf2df](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/c7bf2df) |
|||
|
|||
| 范围 | 描述 | commitId | |
|||
| ---- | ---------------------- | ------------------------------------------------------------------------ | |
|||
| - | 项目列表 | [0486e98](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0486e98) | |
|||
| - | 重构 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) | |
|||
|
|||
### 🚀 性能优化 |
|||
范围|描述|commitId |
|||
--|--|-- |
|||
- | 更新代码 | [0dd443b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0dd443b) |
|||
|
|||
| 范围 | 描述 | commitId | |
|||
| ---- | -------- | ------------------------------------------------------------------------ | |
|||
| - | 更新代码 | [0dd443b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0dd443b) | |
|||
|
|||
### chore |
|||
范围|描述|commitId |
|||
--|--|-- |
|||
- | editorconfig update | [0c08089](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0c08089) |
|||
|
|||
| 范围 | 描述 | commitId | |
|||
| ---- | ------------------- | ------------------------------------------------------------------------ | |
|||
| - | editorconfig update | [0c08089](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/0c08089) | |
|||
|
|||
范围|描述|commitId |
|||
--|--|-- |
|||
- | Initial commit | [52b8f49](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/52b8f49) |
|||
|
|||
| 范围 | 描述 | commitId | |
|||
| ---- | -------------- | ------------------------------------------------------------------------ | |
|||
| - | Initial commit | [52b8f49](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/52b8f49) | |
|||
|
@ -0,0 +1,21 @@ |
|||
import Config from '@/common/js/config.js' |
|||
|
|||
const apiUrl = Config.apiUrl; |
|||
const defaultwbs = `${apiUrl}/defaultwbs`; |
|||
|
|||
export function setupPlugin(app) { |
|||
uni.$u.api = { ...uni.$u.api } || {}; |
|||
// 获取插件信息
|
|||
uni.$u.api.getOtherPlugin = param => uni.$u.post(`${apiUrl}/pluginshop/plugin/query?pluginId=${param.pluginId}&styleType=${param.styleType}`); |
|||
|
|||
// 查询子任务
|
|||
uni.$u.api.findSonTask = param => uni.$u.post(`${defaultwbs}/task/findSonTask`, param); |
|||
// 查询子项目
|
|||
uni.$u.api.findSonProject = param => uni.$u.post(`${defaultwbs}/project/findSonProject`, param); |
|||
// 提交交付物
|
|||
uni.$u.api.saveDeliver = param => uni.$u.post(`${defaultwbs}/deliver/save`, param); |
|||
// 查询任务的交付物历史记录
|
|||
uni.$u.api.queryDeliverOfTask = param => uni.$u.post(`${defaultwbs}/deliver/queryDeliverOfTask`, param); |
|||
// 检查交付物
|
|||
uni.$u.api.checkDeliver = param => uni.$u.post(`${defaultwbs}/deliver/checkDeliver`, param); |
|||
}; |
@ -1,8 +1,16 @@ |
|||
// 默认主题文件 |
|||
.theme-default { |
|||
background-color: #333; |
|||
background-color: #007aff; |
|||
color: #fff; |
|||
.u-card { |
|||
font-size: 24px !important; |
|||
color: #0f0; |
|||
} |
|||
.u-navbar { |
|||
background-color: #007aff !important; |
|||
color: #fff; |
|||
.uicon-nav-back { |
|||
color: #fff !important; |
|||
} |
|||
} |
|||
} |
|||
|
@ -0,0 +1,89 @@ |
|||
<template> |
|||
<view class="my-3" v-if="data.allMembers && data.allMembers.length"> |
|||
<view class="flex justify-between"> |
|||
<view class="flex flex-wrap text-center items-center"> |
|||
<u-tag |
|||
:type="member.checked ? 'primary' : 'info'" |
|||
:mode="member.checked ? 'dark' : 'light'" |
|||
v-for="(member, index) in data.topMembers" |
|||
:key="member.memberId" |
|||
class="mb-2 mr-3" |
|||
style="width: 60px" |
|||
:text="member.name" |
|||
:closeable="false" |
|||
@click="tagClick(index, member, 'topMembers')" |
|||
/> |
|||
<span class="ml-2" v-if="!data.show" @click="data.show = true">...</span> |
|||
</view> |
|||
</view> |
|||
<!-- 折叠起来的 --> |
|||
<view class="flex flex-wrap text-center items-center" v-if="data.show"> |
|||
<u-tag |
|||
:type="member.checked ? 'primary' : 'info'" |
|||
:mode="member.checked ? 'dark' : 'light'" |
|||
v-for="(member, index) in data.bottomMembers" |
|||
:key="member.memberId" |
|||
class="mb-2 mr-3" |
|||
style="width: 60px" |
|||
:text="member.name" |
|||
:closeable="false" |
|||
@click="tagClick(index, member, 'bottomMembers')" |
|||
/> |
|||
<u-icon class="ml-2" name="arrow-up" v-if="data.show" size="26" @click="data.show = false"></u-icon> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { reactive, computed, onMounted } from 'vue'; |
|||
import { useStore } from 'vuex'; |
|||
|
|||
const props = defineProps({ |
|||
checkerList: { |
|||
default: () => [], |
|||
type: Array, |
|||
}, |
|||
}); |
|||
|
|||
const data = reactive({ |
|||
allMembers: [], |
|||
show: false, |
|||
topMembers: [], |
|||
bottomMembers: [], |
|||
}); |
|||
|
|||
const store = useStore(); |
|||
const members = computed(() => store.state.role.members); |
|||
const emit = defineEmits(['setCheckerList']); |
|||
|
|||
onMounted(() => { |
|||
if (members.value && members.value.length) { |
|||
data.allMembers = members.value; |
|||
// TODO: 等后台返回默认检查人后修改 |
|||
data.allMembers.forEach(item => { |
|||
item.checked = false; |
|||
}); |
|||
data.topMembers = members.value.slice(0, 3); |
|||
data.bottomMembers = members.value.slice(3); |
|||
} |
|||
}); |
|||
|
|||
function tagClick(index, item, membersType) { |
|||
// 点击选择或取消选择 |
|||
const arr = uni.$u.deepClone(data[membersType]); |
|||
arr[index].checked = !arr[index].checked; |
|||
data[membersType] = [...arr]; |
|||
// 将选中的id传给checkerList |
|||
emit('setCheckerList', arr[index].checked, item); |
|||
} |
|||
|
|||
// 清空所有选中的检查人 |
|||
function clearChecked() { |
|||
for (let i = 0; i < data.topMembers.length; i++) { |
|||
data.topMembers[i].checked = false; |
|||
} |
|||
for (let i = 0; i < data.bottomMembers.length; i++) { |
|||
data.bottomMembers[i].checked = false; |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,104 @@ |
|||
<template> |
|||
<view> |
|||
<!-- #ifdef H5 --> |
|||
<view |
|||
class="content" |
|||
id="project" |
|||
:data-did="task.detailId" |
|||
:data-param="param" |
|||
:data-pdu="task.planDuration" |
|||
:data-pid="projectId" |
|||
:data-pstart="task.planStart" |
|||
:data-rdu="task.realDuration" |
|||
:data-rid="roleId" |
|||
:data-tid="task.id" |
|||
:data-tname="task.name" |
|||
:data-token="token" |
|||
:data-rstart="task.realStart" |
|||
:data-uid="userId" |
|||
></view> |
|||
<!-- #endif --> |
|||
<!-- #ifdef APP-PLUS --> |
|||
<view |
|||
class="content" |
|||
id="project" |
|||
:data-did="task.detailId" |
|||
:data-param="param" |
|||
:data-pdu="task.planDuration" |
|||
:data-pid="projectId" |
|||
:data-pstart="task.planStart" |
|||
:data-rdu="task.realDuration" |
|||
:data-rid="roleId" |
|||
:data-tid="task.id" |
|||
:data-tname="task.name" |
|||
:data-token="token" |
|||
:data-rstart="task.realStart" |
|||
:data-uid="userId" |
|||
></view> |
|||
<!-- #endif --> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { computed } from 'vue'; |
|||
import { useStore } from 'vuex'; |
|||
|
|||
defineProps({ |
|||
task: { default: () => {}, type: Object }, |
|||
pluginId: { default: '1', type: String }, |
|||
styleType: { default: 0, type: Number }, |
|||
pluginTaskId: { default: '', type: String }, |
|||
param: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const store = useStore(); |
|||
const roleId = computed(() => store.state.role.roleId); |
|||
const token = computed(() => store.state.user.token); |
|||
const userId = computed(() => store.getters['user/userId']); |
|||
const projectId = computed(() => store.getters['project/projectId']); |
|||
</script> |
|||
|
|||
<script module="project" lang="renderjs"> |
|||
export default { |
|||
data() { |
|||
return { |
|||
pluginContent: null, |
|||
pluginJs: null, |
|||
}; |
|||
}, |
|||
|
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.getPlugin(); |
|||
}); |
|||
}, |
|||
|
|||
methods: { |
|||
// 获取插件信息 |
|||
async getPlugin() { |
|||
const params = { pluginId: this.pluginId, styleType: this.styleType }; |
|||
this.$catchReq.getOtherPlugin(params, (err, res) => { |
|||
if (err) { |
|||
console.error('err: ', err); |
|||
} else { |
|||
if (!res || !res.id) return; |
|||
if (res.html && res.js) { |
|||
this.$nextTick(() => { |
|||
this.init(res); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
init(res) { |
|||
const content = document.querySelector('.content'); |
|||
content.innerHTML = res.html; |
|||
|
|||
const script = document.createElement('script'); |
|||
script.innerHTML = res.js; |
|||
document.body.appendChild(script); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
@ -0,0 +1,22 @@ |
|||
export default { |
|||
created() { |
|||
if (this.type === 'message') { |
|||
// 不显示遮罩
|
|||
this.maskShow = false; |
|||
// 获取子组件对象
|
|||
this.childrenMsg = null; |
|||
} |
|||
}, |
|||
methods: { |
|||
customOpen() { |
|||
if (this.childrenMsg) { |
|||
this.childrenMsg.open(); |
|||
} |
|||
}, |
|||
customClose() { |
|||
if (this.childrenMsg) { |
|||
this.childrenMsg.close(); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
@ -0,0 +1,23 @@ |
|||
import message from './message.js'; |
|||
// 定义 type 类型:弹出类型:top/bottom/center
|
|||
const config = { |
|||
// 顶部弹出
|
|||
top: 'top', |
|||
// 底部弹出
|
|||
bottom: 'bottom', |
|||
// 居中弹出
|
|||
center: 'center', |
|||
// 消息提示
|
|||
message: 'top', |
|||
// 对话框
|
|||
dialog: 'center', |
|||
// 分享
|
|||
share: 'bottom', |
|||
}; |
|||
|
|||
export default { |
|||
data() { |
|||
return { config: config }; |
|||
}, |
|||
mixins: [message], |
|||
}; |
@ -0,0 +1,246 @@ |
|||
<template> |
|||
<view class="uni-popup-dialog"> |
|||
<view class="uni-dialog-title"> |
|||
<text class="uni-dialog-title-text" :class="['uni-popup__' + dialogType]">{{ title }}</text> |
|||
</view> |
|||
<view class="uni-dialog-content"> |
|||
<text class="uni-dialog-content-text" v-if="mode === 'base'">{{ content }}</text> |
|||
<input v-else class="uni-dialog-input" v-model="val" type="text" :placeholder="placeholder" :focus="focus" /> |
|||
</view> |
|||
<view class="uni-dialog-button-group"> |
|||
<view class="uni-dialog-button" @click="close"> |
|||
<text class="uni-dialog-button-text">取消</text> |
|||
</view> |
|||
<view class="uni-dialog-button uni-border-left" @click="onOk"> |
|||
<text class="uni-dialog-button-text uni-button-color">确定</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
/** |
|||
* PopUp 弹出层-对话框样式 |
|||
* @description 弹出层-对话框样式 |
|||
* @tutorial https://ext.dcloud.net.cn/plugin?id=329 |
|||
* @property {String} value input 模式下的默认值 |
|||
* @property {String} placeholder input 模式下输入提示 |
|||
* @property {String} type = [success|warning|info|error] 主题样式 |
|||
* @value success 成功 |
|||
* @value warning 提示 |
|||
* @value info 消息 |
|||
* @value error 错误 |
|||
* @property {String} mode = [base|input] 模式、 |
|||
* @value base 基础对话框 |
|||
* @value input 可输入对话框 |
|||
* @property {String} content 对话框内容 |
|||
* @property {Boolean} beforeClose 是否拦截取消事件 |
|||
* @event {Function} confirm 点击确认按钮触发 |
|||
* @event {Function} close 点击取消按钮触发 |
|||
*/ |
|||
|
|||
export default { |
|||
name: 'uniPopupDialog', |
|||
props: { |
|||
value: { |
|||
type: [String, Number], |
|||
default: '', |
|||
}, |
|||
placeholder: { |
|||
type: [String, Number], |
|||
default: '请输入内容', |
|||
}, |
|||
/** |
|||
* 对话框主题 success/warning/info/error 默认 success |
|||
*/ |
|||
type: { |
|||
type: String, |
|||
default: 'error', |
|||
}, |
|||
/** |
|||
* 对话框模式 base/input |
|||
*/ |
|||
mode: { |
|||
type: String, |
|||
default: 'base', |
|||
}, |
|||
/** |
|||
* 对话框标题 |
|||
*/ |
|||
title: { |
|||
type: String, |
|||
default: '提示', |
|||
}, |
|||
/** |
|||
* 对话框内容 |
|||
*/ |
|||
content: { |
|||
type: String, |
|||
default: '', |
|||
}, |
|||
/** |
|||
* 拦截取消事件 ,如果拦截取消事件,必须监听close事件,执行 done() |
|||
*/ |
|||
beforeClose: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogType: 'error', |
|||
focus: false, |
|||
val: '', |
|||
}; |
|||
}, |
|||
inject: ['popup'], |
|||
watch: { |
|||
type(val) { |
|||
this.dialogType = val; |
|||
}, |
|||
mode(val) { |
|||
if (val === 'input') { |
|||
this.dialogType = 'info'; |
|||
} |
|||
}, |
|||
value(val) { |
|||
this.val = val; |
|||
}, |
|||
}, |
|||
created() { |
|||
// 对话框遮罩不可点击 |
|||
this.popup.mkclick = false; |
|||
if (this.mode === 'input') { |
|||
this.dialogType = 'info'; |
|||
this.val = this.value; |
|||
} else { |
|||
this.dialogType = this.type; |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.focus = true; |
|||
}, |
|||
methods: { |
|||
/** |
|||
* 点击确认按钮 |
|||
*/ |
|||
onOk() { |
|||
this.$emit( |
|||
'confirm', |
|||
() => { |
|||
this.popup.close(); |
|||
if (this.mode === 'input') this.val = this.value; |
|||
}, |
|||
this.mode === 'input' ? this.val : '', |
|||
); |
|||
}, |
|||
/** |
|||
* 点击取消按钮 |
|||
*/ |
|||
close() { |
|||
if (this.beforeClose) { |
|||
this.$emit('close', () => { |
|||
this.popup.close(); |
|||
}); |
|||
return; |
|||
} |
|||
this.popup.close(); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.uni-popup-dialog { |
|||
width: 300px; |
|||
border-radius: 15px; |
|||
background-color: #fff; |
|||
} |
|||
|
|||
.uni-dialog-title { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: row; |
|||
justify-content: center; |
|||
padding-top: 15px; |
|||
padding-bottom: 5px; |
|||
} |
|||
|
|||
.uni-dialog-title-text { |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
} |
|||
|
|||
.uni-dialog-content { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: row; |
|||
justify-content: center; |
|||
align-items: center; |
|||
padding: 5px 15px 15px 15px; |
|||
} |
|||
|
|||
.uni-dialog-content-text { |
|||
font-size: 14px; |
|||
color: #6e6e6e; |
|||
} |
|||
|
|||
.uni-dialog-button-group { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: row; |
|||
border-top-color: #f5f5f5; |
|||
border-top-style: solid; |
|||
border-top-width: 1px; |
|||
} |
|||
|
|||
.uni-dialog-button { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
|
|||
flex: 1; |
|||
flex-direction: row; |
|||
justify-content: center; |
|||
align-items: center; |
|||
height: 45px; |
|||
} |
|||
|
|||
.uni-border-left { |
|||
border-left-color: #f0f0f0; |
|||
border-left-style: solid; |
|||
border-left-width: 1px; |
|||
} |
|||
|
|||
.uni-dialog-button-text { |
|||
font-size: 14px; |
|||
} |
|||
|
|||
.uni-button-color { |
|||
color: $uni-color-primary; |
|||
} |
|||
|
|||
.uni-dialog-input { |
|||
flex: 1; |
|||
font-size: 14px; |
|||
} |
|||
|
|||
.uni-popup__success { |
|||
color: $uni-color-success; |
|||
} |
|||
|
|||
.uni-popup__warn { |
|||
color: $uni-color-warning; |
|||
} |
|||
|
|||
.uni-popup__error { |
|||
color: $uni-color-error; |
|||
} |
|||
|
|||
.uni-popup__info { |
|||
color: #909399; |
|||
} |
|||
</style> |
@ -0,0 +1,115 @@ |
|||
<template> |
|||
<view class="uni-popup-message" :class="'uni-popup__' + [type]"> |
|||
<text class="uni-popup-message-text" :class="'uni-popup__' + [type] + '-text'">{{ message }}</text> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
/** |
|||
* PopUp 弹出层-消息提示 |
|||
* @description 弹出层-消息提示 |
|||
* @tutorial https://ext.dcloud.net.cn/plugin?id=329 |
|||
* @property {String} type = [success|warning|info|error] 主题样式 |
|||
* @value success 成功 |
|||
* @value warning 提示 |
|||
* @value info 消息 |
|||
* @value error 错误 |
|||
* @property {String} message 消息提示文字 |
|||
* @property {String} duration 显示时间,设置为 0 则不会自动关闭 |
|||
*/ |
|||
|
|||
export default { |
|||
name: 'UniPopupMessage', |
|||
props: { |
|||
/** |
|||
* 主题 success/warning/info/error 默认 success |
|||
*/ |
|||
type: { |
|||
type: String, |
|||
default: 'success', |
|||
}, |
|||
/** |
|||
* 消息文字 |
|||
*/ |
|||
message: { |
|||
type: String, |
|||
default: '', |
|||
}, |
|||
/** |
|||
* 显示时间,设置为 0 则不会自动关闭 |
|||
*/ |
|||
duration: { |
|||
type: Number, |
|||
default: 3000, |
|||
}, |
|||
}, |
|||
inject: ['popup'], |
|||
data() { |
|||
return {}; |
|||
}, |
|||
created() { |
|||
this.popup.childrenMsg = this; |
|||
}, |
|||
methods: { |
|||
open() { |
|||
if (this.duration === 0) return; |
|||
clearTimeout(this.popuptimer); |
|||
this.popuptimer = setTimeout(() => { |
|||
this.popup.close(); |
|||
}, this.duration); |
|||
}, |
|||
close() { |
|||
clearTimeout(this.popuptimer); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.uni-popup-message { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: row; |
|||
background-color: #e1f3d8; |
|||
padding: 10px 15px; |
|||
border-color: #eee; |
|||
border-style: solid; |
|||
border-width: 1px; |
|||
} |
|||
.uni-popup-message-text { |
|||
font-size: 14px; |
|||
padding: 0; |
|||
} |
|||
|
|||
.uni-popup__success { |
|||
background-color: #e1f3d8; |
|||
} |
|||
|
|||
.uni-popup__success-text { |
|||
color: #67c23a; |
|||
} |
|||
|
|||
.uni-popup__warn { |
|||
background-color: #faecd8; |
|||
} |
|||
|
|||
.uni-popup__warn-text { |
|||
color: #e6a23c; |
|||
} |
|||
|
|||
.uni-popup__error { |
|||
background-color: #fde2e2; |
|||
} |
|||
|
|||
.uni-popup__error-text { |
|||
color: #f56c6c; |
|||
} |
|||
|
|||
.uni-popup__info { |
|||
background-color: #f2f6fc; |
|||
} |
|||
|
|||
.uni-popup__info-text { |
|||
color: #909399; |
|||
} |
|||
</style> |
@ -0,0 +1,171 @@ |
|||
<template> |
|||
<view class="uni-popup-share"> |
|||
<view class="uni-share-title"> |
|||
<text class="uni-share-title-text">{{ title }}</text> |
|||
</view> |
|||
<view class="uni-share-content"> |
|||
<view class="uni-share-content-box"> |
|||
<view class="uni-share-content-item" v-for="(item, index) in bottomData" :key="index" @click.stop="select(item, index)"> |
|||
<image class="uni-share-image" :src="item.icon" mode="aspectFill"></image> |
|||
<text class="uni-share-text">{{ item.text }}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="uni-share-button-box"> |
|||
<button class="uni-share-button" @click="close">取消</button> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'UniPopupShare', |
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: '分享到', |
|||
}, |
|||
}, |
|||
inject: ['popup'], |
|||
data() { |
|||
return { |
|||
bottomData: [ |
|||
{ |
|||
text: '微信', |
|||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-2.png', |
|||
name: 'wx', |
|||
}, |
|||
{ |
|||
text: '支付宝', |
|||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-8.png', |
|||
name: 'wx', |
|||
}, |
|||
{ |
|||
text: 'QQ', |
|||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/gird-3.png', |
|||
name: 'qq', |
|||
}, |
|||
{ |
|||
text: '新浪', |
|||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-1.png', |
|||
name: 'sina', |
|||
}, |
|||
{ |
|||
text: '百度', |
|||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-7.png', |
|||
name: 'copy', |
|||
}, |
|||
{ |
|||
text: '其他', |
|||
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-5.png', |
|||
name: 'more', |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
created() {}, |
|||
methods: { |
|||
/** |
|||
* 选择内容 |
|||
*/ |
|||
select(item, index) { |
|||
this.$emit( |
|||
'select', |
|||
{ |
|||
item, |
|||
index, |
|||
}, |
|||
() => { |
|||
this.popup.close(); |
|||
}, |
|||
); |
|||
}, |
|||
/** |
|||
* 关闭窗口 |
|||
*/ |
|||
close() { |
|||
this.popup.close(); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.uni-popup-share { |
|||
background-color: #fff; |
|||
} |
|||
.uni-share-title { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: row; |
|||
align-items: center; |
|||
justify-content: center; |
|||
height: 40px; |
|||
} |
|||
.uni-share-title-text { |
|||
font-size: 14px; |
|||
color: #666; |
|||
} |
|||
.uni-share-content { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: row; |
|||
justify-content: center; |
|||
padding-top: 10px; |
|||
} |
|||
|
|||
.uni-share-content-box { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: row; |
|||
flex-wrap: wrap; |
|||
width: 360px; |
|||
} |
|||
|
|||
.uni-share-content-item { |
|||
width: 90px; |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: column; |
|||
justify-content: center; |
|||
padding: 10px 0; |
|||
align-items: center; |
|||
} |
|||
|
|||
.uni-share-content-item:active { |
|||
background-color: #f5f5f5; |
|||
} |
|||
|
|||
.uni-share-image { |
|||
width: 30px; |
|||
height: 30px; |
|||
} |
|||
|
|||
.uni-share-text { |
|||
margin-top: 10px; |
|||
font-size: 14px; |
|||
color: #3b4144; |
|||
} |
|||
|
|||
.uni-share-button-box { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex-direction: row; |
|||
padding: 10px 15px; |
|||
} |
|||
|
|||
.uni-share-button { |
|||
flex: 1; |
|||
border-radius: 50px; |
|||
color: #666; |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.uni-share-button::after { |
|||
border-radius: 50px; |
|||
} |
|||
</style> |
@ -0,0 +1,289 @@ |
|||
<template> |
|||
<view v-if="showPopup" class="uni-popup" :class="[popupstyle]" @touchmove.stop.prevent="clear"> |
|||
<uni-transition v-if="maskShow" :mode-class="['fade']" :styles="maskClass" :duration="duration" :show="showTrans" @click="onTap" /> |
|||
<uni-transition :mode-class="ani" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap"> |
|||
<view class="uni-popup__wrapper-box" @click.stop="clear"> |
|||
<slot /> |
|||
</view> |
|||
</uni-transition> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import uniTransition from '../uni-transition/uni-transition.vue'; |
|||
import popup from './popup.js'; |
|||
/** |
|||
* PopUp 弹出层 |
|||
* @description 弹出层组件,为了解决遮罩弹层的问题 |
|||
* @tutorial https://ext.dcloud.net.cn/plugin?id=329 |
|||
* @property {String} type = [top|center|bottom] 弹出方式 |
|||
* @value top 顶部弹出 |
|||
* @value center 中间弹出 |
|||
* @value bottom 底部弹出 |
|||
* @value message 消息提示 |
|||
* @value dialog 对话框 |
|||
* @value share 底部分享示例 |
|||
* @property {Boolean} animation = [ture|false] 是否开启动画 |
|||
* @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗 |
|||
* @event {Function} change 打开关闭弹窗触发,e={show: false} |
|||
*/ |
|||
|
|||
export default { |
|||
name: 'UniPopup', |
|||
components: { uniTransition }, |
|||
props: { |
|||
// 开启动画 |
|||
animation: { |
|||
type: Boolean, |
|||
default: true, |
|||
}, |
|||
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层 |
|||
// message: 消息提示 ; dialog : 对话框 |
|||
type: { |
|||
type: String, |
|||
default: 'center', |
|||
}, |
|||
// maskClick |
|||
maskClick: { |
|||
type: Boolean, |
|||
default: true, |
|||
}, |
|||
}, |
|||
provide() { |
|||
return { popup: this }; |
|||
}, |
|||
mixins: [popup], |
|||
watch: { |
|||
/** |
|||
* 监听type类型 |
|||
*/ |
|||
type: { |
|||
handler: function (newVal) { |
|||
this[this.config[newVal]](); |
|||
}, |
|||
immediate: true, |
|||
}, |
|||
/** |
|||
* 监听遮罩是否可点击 |
|||
* @param {Object} val |
|||
*/ |
|||
maskClick(val) { |
|||
this.mkclick = val; |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
duration: 300, |
|||
ani: [], |
|||
showPopup: false, |
|||
showTrans: false, |
|||
maskClass: { |
|||
position: 'fixed', |
|||
bottom: 0, |
|||
top: 0, |
|||
left: 0, |
|||
right: 0, |
|||
backgroundColor: 'rgba(0, 0, 0, 0.4)', |
|||
}, |
|||
transClass: { |
|||
position: 'fixed', |
|||
left: 0, |
|||
right: 0, |
|||
}, |
|||
maskShow: true, |
|||
mkclick: true, |
|||
popupstyle: 'top', |
|||
}; |
|||
}, |
|||
created() { |
|||
this.mkclick = this.maskClick; |
|||
if (this.animation) { |
|||
this.duration = 300; |
|||
} else { |
|||
this.duration = 0; |
|||
} |
|||
}, |
|||
methods: { |
|||
clear(e) { |
|||
// TODO nvue 取消冒泡 |
|||
e.stopPropagation(); |
|||
}, |
|||
open() { |
|||
this.showPopup = true; |
|||
this.$nextTick(() => { |
|||
new Promise(resolve => { |
|||
clearTimeout(this.timer); |
|||
this.timer = setTimeout(() => { |
|||
this.showTrans = true; |
|||
// fixed by mehaotian 兼容 app 端 |
|||
this.$nextTick(() => { |
|||
resolve(); |
|||
}); |
|||
}, 50); |
|||
}).then(res => { |
|||
console.log('res: ', res); |
|||
// 自定义打开事件 |
|||
clearTimeout(this.msgtimer); |
|||
this.msgtimer = setTimeout(() => { |
|||
this.customOpen && this.customOpen(); |
|||
}, 100); |
|||
this.$emit('change', { |
|||
show: true, |
|||
type: this.type, |
|||
}); |
|||
}); |
|||
}); |
|||
}, |
|||
close(type) { |
|||
this.showTrans = false; |
|||
this.$nextTick(() => { |
|||
this.$emit('change', { |
|||
show: false, |
|||
type, |
|||
}); |
|||
clearTimeout(this.timer); |
|||
// 自定义关闭事件 |
|||
this.customOpen && this.customClose(); |
|||
this.timer = setTimeout(() => { |
|||
this.showPopup = false; |
|||
}, 300); |
|||
}); |
|||
}, |
|||
onTap() { |
|||
if (!this.mkclick) return; |
|||
this.close(); |
|||
}, |
|||
/** |
|||
* 顶部弹出样式处理 |
|||
*/ |
|||
top() { |
|||
this.popupstyle = 'top'; |
|||
this.ani = ['slide-top']; |
|||
this.transClass = { |
|||
position: 'fixed', |
|||
left: 0, |
|||
right: 0, |
|||
}; |
|||
}, |
|||
/** |
|||
* 底部弹出样式处理 |
|||
*/ |
|||
bottom() { |
|||
this.popupstyle = 'bottom'; |
|||
this.ani = ['slide-bottom']; |
|||
this.transClass = { |
|||
position: 'fixed', |
|||
left: 0, |
|||
right: 0, |
|||
bottom: 0, |
|||
}; |
|||
}, |
|||
/** |
|||
* 中间弹出样式处理 |
|||
*/ |
|||
center() { |
|||
this.popupstyle = 'center'; |
|||
this.ani = ['zoom-out', 'fade']; |
|||
this.transClass = { |
|||
position: 'fixed', |
|||
/* #ifndef APP-NVUE */ |
|||
display: 'flex', |
|||
flexDirection: 'column', |
|||
/* #endif */ |
|||
bottom: 0, |
|||
left: 0, |
|||
right: 0, |
|||
top: 0, |
|||
justifyContent: 'center', |
|||
alignItems: 'center', |
|||
}; |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.uni-popup { |
|||
position: fixed; |
|||
/* #ifndef APP-NVUE */ |
|||
z-index: 99; |
|||
/* #endif */ |
|||
} |
|||
|
|||
.uni-popup__mask { |
|||
position: absolute; |
|||
top: 0; |
|||
bottom: 0; |
|||
left: 0; |
|||
right: 0; |
|||
background-color: $uni-bg-color-mask; |
|||
opacity: 0; |
|||
} |
|||
|
|||
.mask-ani { |
|||
transition-property: opacity; |
|||
transition-duration: 0.2s; |
|||
} |
|||
|
|||
.uni-top-mask { |
|||
opacity: 1; |
|||
} |
|||
|
|||
.uni-bottom-mask { |
|||
opacity: 1; |
|||
} |
|||
|
|||
.uni-center-mask { |
|||
opacity: 1; |
|||
} |
|||
|
|||
.uni-popup__wrapper { |
|||
/* #ifndef APP-NVUE */ |
|||
display: block; |
|||
/* #endif */ |
|||
position: absolute; |
|||
} |
|||
|
|||
.top { |
|||
/* #ifdef H5 */ |
|||
top: var(--window-top); |
|||
/* #endif */ |
|||
/* #ifndef H5 */ |
|||
top: 0; |
|||
/* #endif */ |
|||
} |
|||
|
|||
.bottom { |
|||
bottom: 0; |
|||
} |
|||
|
|||
.uni-popup__wrapper-box { |
|||
/* #ifndef APP-NVUE */ |
|||
display: block; |
|||
/* #endif */ |
|||
position: relative; |
|||
/* iphonex 等安全区设置,底部安全区适配 */ |
|||
/* #ifndef APP-NVUE */ |
|||
padding-bottom: constant(safe-area-inset-bottom); |
|||
padding-bottom: env(safe-area-inset-bottom); |
|||
/* #endif */ |
|||
} |
|||
|
|||
.content-ani { |
|||
// transition: transform 0.3s; |
|||
transition-property: transform, opacity; |
|||
transition-duration: 0.2s; |
|||
} |
|||
|
|||
.uni-top-content { |
|||
transform: translateY(0); |
|||
} |
|||
|
|||
.uni-bottom-content { |
|||
transform: translateY(0); |
|||
} |
|||
|
|||
.uni-center-content { |
|||
transform: scale(1); |
|||
opacity: 1; |
|||
} |
|||
</style> |
@ -0,0 +1,97 @@ |
|||
// 定义插件相关信息
|
|||
/* eslint-disable */ |
|||
export default { |
|||
defaults: [ |
|||
{ |
|||
id: 1, |
|||
name: 'TASK_NAME', |
|||
description: '任务名插件', |
|||
component: 'p-task-title', |
|||
}, |
|||
{ |
|||
id: 2, |
|||
name: 'TASK_DESCRIPTION', |
|||
description: '任务描述插件', |
|||
component: 'p-task-description', |
|||
}, |
|||
{ |
|||
id: 3, |
|||
name: 'TASK_DURATION_DELAY', |
|||
description: '任务时长延迟插件(+-1min)时间格式可设置', |
|||
component: 'p-task-duration-delay', |
|||
}, |
|||
{ |
|||
id: 4, |
|||
name: 'TASK_START_TIME_DELAY', |
|||
description: '任务开始时间延迟插件(+-1hour)', |
|||
component: 'p-task-start-time-delay', |
|||
}, |
|||
{ |
|||
id: 5, |
|||
name: 'DELIVERABLE', |
|||
description: '交付物插件(人 + 交付物)可配置【仅人】 or 【仅交付物】 or 【人+交付物】', |
|||
component: 'p-deliverable', |
|||
}, |
|||
{ |
|||
id: 6, |
|||
name: 'SUBTASKS', |
|||
description: '子任务插件:显示子任务', |
|||
component: 'p-subtasks', |
|||
}, |
|||
{ |
|||
id: 7, |
|||
name: 'SUB_PROJECT', |
|||
description: '子项目插件:显示子项目', |
|||
component: 'p-sub-project', |
|||
}, |
|||
{ |
|||
id: 8, |
|||
name: 'TASK_COUNTDOWN', |
|||
description: '任务倒计时插件', |
|||
component: 'p-task-countdown', |
|||
}, |
|||
{ |
|||
id: 9, |
|||
name: 'MANAGE_PROJECT', |
|||
description: '项目信息管理插件', |
|||
component: 'p-manage-project', |
|||
}, |
|||
|
|||
{ |
|||
id: 10, |
|||
name: 'MANAGE_ROLE', |
|||
description: '角色信息管理插件', |
|||
component: 'p-manage-role', |
|||
}, |
|||
{ |
|||
id: 11, |
|||
name: 'MANAGE_MEMBER', |
|||
description: '成员信息管理插件', |
|||
component: 'p-manage-member', |
|||
}, |
|||
{ |
|||
id: 12, |
|||
name: 'MANAGE_TASK', |
|||
description: '任务信息管理插件', |
|||
component: 'p-manage-task', |
|||
}, |
|||
{ |
|||
id: 13, |
|||
name: 'WBS_IMPORT', |
|||
description: '导入WBS新建项目', |
|||
component: 'p-wbs-import', |
|||
}, |
|||
{ |
|||
id: 14, |
|||
name: 'WBS_IMPORT_UPDATE', |
|||
description: '导入WBS更新项目', |
|||
component: 'p-wbs-update', |
|||
}, |
|||
{ |
|||
id: 15, |
|||
name: 'DELIVER_CHECK', |
|||
description: '交付物检查', |
|||
component: 'p-deliver-check', |
|||
}, |
|||
], // 默认插件id列表
|
|||
}; |
@ -0,0 +1,8 @@ |
|||
<template> |
|||
</template> |
|||
|
|||
<script> |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -1,8 +1,130 @@ |
|||
<template> |
|||
<view class="u-p-l-50 u-p-r-50 u-p-t-30"> |
|||
<u-form :model="form" ref="loginForm" :error-type="['message']"> |
|||
<u-form-item label="手机号码" prop="phone" label-width="150"> |
|||
<u-input placeholder="请输入手机号" v-model="form.phone" type="number"></u-input> |
|||
</u-form-item> |
|||
|
|||
<u-form-item label="图形验证码" prop="verificationCodeValue" label-width="150"> |
|||
<u-input placeholder="请输入计算结果" v-model="form.verificationCodeValue" type="number"></u-input> |
|||
<image slot="right" :src="imageBase64" mode="aspectFit" class="code-image" @click="getImageCode"></image> |
|||
</u-form-item> |
|||
|
|||
<u-form-item label="验证码" prop="smsCode" label-width="150"> |
|||
<u-input @focus="mixinInit.hasvalue(form)" placeholder="请输入验证码" v-model="form.smsCode" type="text"></u-input> |
|||
<u-button slot="right" type="primary" size="mini" v-show="mixinInit.dataObj.showPaste" @click="mixinInit.setCode" class="u-m-r-20">粘贴</u-button> |
|||
<u-button slot="right" size="mini" v-if="mixinInit.dataObj.showInterval">{{ mixinInit.dataObj.interval }}</u-button> |
|||
</u-form-item> |
|||
|
|||
<view class="flex flex-nowrap"> |
|||
<view class="flex-sub"></view> |
|||
<view class="u-m-t-30 u-font-12 text-gray-400" @click="openPage('/pages/user/forgetPassword')">忘记密码</view> |
|||
</view> |
|||
</u-form> |
|||
|
|||
<view class="u-m-t-50"> |
|||
<u-button @click="submit" type="primary">立即登录</u-button> |
|||
</view> |
|||
|
|||
<view class="flex justify-between"> |
|||
<view class="u-m-t-30" style="color: #2885ED;" @click="openPage('/pages/user/rigister')">新用户注册</view> |
|||
<view class="u-m-t-30" style="color: #2885ED;" @click="openPage('/pages/user/accountLogin')">用户名登录</view> |
|||
</view> |
|||
|
|||
<view style="margin-top: 200rpx;text-align: center; color: #999999;font-size: 35rpx;"> |
|||
快速登录 |
|||
</view> |
|||
<view style="text-align: center; margin-top: 20rpx;" @click="mixinInit.handleWxLogin"> |
|||
<image src="/common/img/weixinIcon.png" mode="" style="width: 85rpx;height: 85rpx;"></image> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
<script setup> |
|||
import { ref, computed, reactive } from 'vue'; |
|||
import { useStore } from 'vuex'; |
|||
import { onLoad, onReady } from '@dcloudio/uni-app'; |
|||
import userMixin from '@/hooks/user/userMixin' |
|||
|
|||
const store = useStore(); |
|||
const mixinInit = userMixin(); |
|||
const loginForm = ref(null); |
|||
|
|||
const form = reactive({ |
|||
phone: '', |
|||
verificationCodeId: '', // 图形验证码id |
|||
verificationCodeValue: '', // 图形验证码值 |
|||
smsCode: '' |
|||
}); |
|||
const imageBase64 = ref(null); // 图形验证码图片 |
|||
|
|||
getImageCode(); |
|||
|
|||
onReady(() => { |
|||
loginForm.value.setRules(mixinInit.rules); |
|||
}); |
|||
|
|||
const submit = () => { |
|||
loginForm.value.validate(valid => { |
|||
if (valid) { |
|||
login() |
|||
} |
|||
}); |
|||
} |
|||
|
|||
// 获取图形验证码 |
|||
async function getImageCode() { |
|||
uni.$ui.showLoading(); |
|||
try { |
|||
const data = await uni.$u.api.getImageCode(); |
|||
imageBase64.value = data.imageBase64 || ''; |
|||
form.verificationCodeId = data.verificationCodeId || ''; |
|||
uni.$ui.hideLoading(); |
|||
} catch (error) { |
|||
uni.$ui.hideLoading(); |
|||
uni.$ui.showToast(error); |
|||
} |
|||
} |
|||
|
|||
async function login() { |
|||
uni.$ui.showLoading(); |
|||
try { |
|||
const params = reactive({ |
|||
client: 1, |
|||
data: { |
|||
identifier: form.phone, |
|||
credential: form.smsCode, |
|||
}, |
|||
type: 1, |
|||
}); |
|||
|
|||
let res = await uni.$u.api.signin(params); |
|||
store.commit('user/setToken', res.token); |
|||
store.commit('user/setUser', res); |
|||
uni.$storage.setStorageSync('anyringToken', res.token || ''); |
|||
uni.$storage.setStorageSync('user', JSON.stringify(res)); |
|||
|
|||
uni.$ui.hideLoading(); |
|||
|
|||
uni.navigateTo({ |
|||
url: '/pages/index/index' |
|||
}); |
|||
} catch (error) { |
|||
uni.$ui.hideLoading(); |
|||
uni.$ui.showToast(error); |
|||
} |
|||
} |
|||
|
|||
function openPage(url) { |
|||
uni.navigateTo({ |
|||
url: url |
|||
}) |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
<style lang="scss" scoped> |
|||
.code-image { |
|||
width: 200rpx; |
|||
height: 70rpx; |
|||
} |
|||
</style> |
|||
|
@ -1,266 +0,0 @@ |
|||
import { ref, computed } from 'vue'; |
|||
import { useStore } from 'vuex'; |
|||
import clipboard from "@/common/js/dc-clipboard/clipboard.js" |
|||
|
|||
export default function mixinInit { |
|||
const store = useStore(); |
|||
const user = computed(() => store.state.user.user); |
|||
const rules = ref({ |
|||
phone: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入手机号', |
|||
trigger: ['change','blur'], |
|||
}, |
|||
{ |
|||
validator: (rule, value, callback) => { |
|||
// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
|
|||
return this.$u.test.mobile(value); |
|||
}, |
|||
message: '手机号码不正确', |
|||
// 触发器可以同时用blur和change,二者之间用英文逗号隔开
|
|||
trigger: ['change','blur'], |
|||
} |
|||
], |
|||
verificationCodeValue: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入图形验证码', |
|||
trigger: ['change','blur'], |
|||
}, |
|||
{ |
|||
type: 'number', |
|||
message: '图形验证码只能为数字', |
|||
trigger: ['change','blur'], |
|||
} |
|||
], |
|||
smsCode: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入验证码', |
|||
trigger: ['change','blur'], |
|||
}, |
|||
{ |
|||
type: 'number', |
|||
message: '验证码只能为数字', |
|||
trigger: ['change','blur'], |
|||
} |
|||
], |
|||
account: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入用户名', |
|||
trigger: ['change','blur'], |
|||
}, |
|||
{ |
|||
min: 2, |
|||
max: 20, |
|||
message: '用户名长度在2到20个字符', |
|||
trigger: ['change','blur'], |
|||
}, |
|||
{ |
|||
pattern: /^[a-zA-Z0-9._-]{2,20}$/, |
|||
message: '请输入2-20位字母、数字、汉字或字符"_ - ."', |
|||
trigger: ['change','blur'], |
|||
} |
|||
], |
|||
password: [ |
|||
{ |
|||
required: true, |
|||
message: '请输入密码', |
|||
trigger: ['change','blur'], |
|||
}, |
|||
{ |
|||
min: 6, |
|||
max: 20, |
|||
message: '密码长度在6到20个字符', |
|||
trigger: ['change','blur'], |
|||
}, |
|||
{ |
|||
// 正则不能含有两边的引号
|
|||
pattern: /^[a-zA-Z0-9._-]{6,20}$/, |
|||
message: '请输入6-20位字母、数字、汉字或字符"_ - ."', |
|||
trigger: ['change','blur'], |
|||
} |
|||
], |
|||
}); |
|||
const errorType = ref(['message']); |
|||
const labelPosition = ref('left'); |
|||
const border = ref(false); |
|||
const smsCode = ref(''); // 短信验证码
|
|||
const showInterval = ref(false); |
|||
const interval = ref(120); |
|||
const codeTimer = ref(null); |
|||
const showPaste = ref(false); |
|||
|
|||
return { |
|||
errorType, |
|||
// getImageCode,
|
|||
// hasvalue,
|
|||
// getCode,
|
|||
// getCodeInterval,
|
|||
// checkRules,
|
|||
// setCode,
|
|||
// getClipboardContents,
|
|||
// verifyPhone,
|
|||
// verifyLoginname,
|
|||
// handleWxLogin
|
|||
} |
|||
} |
|||
|
|||
|
|||
// const mixin = {
|
|||
// computed: mapState('user', ['user']),
|
|||
|
|||
// onReady() {
|
|||
// this.$refs.uForm.setRules(this.rules);
|
|||
// },
|
|||
|
|||
// methods: {
|
|||
// ...mapActions('user', ['sendCode']),
|
|||
|
|||
// 获取图形验证码
|
|||
// async getImageCode() {
|
|||
// this.$util.showLoading();
|
|||
// try {
|
|||
// const data = await uni.$u.api.getImageCode();
|
|||
// const { imageBase64, verificationCodeId } = data;
|
|||
// this.imageBase64 = imageBase64 || '';
|
|||
// this.verificationCodeId = verificationCodeId || '';
|
|||
// uni.hideLoading();
|
|||
// } catch (error) {
|
|||
// uni.hideLoading();
|
|||
// uni.$ui.showToast(error);
|
|||
// }
|
|||
// },
|
|||
|
|||
// //有图片验证码的值
|
|||
// hasvalue() {
|
|||
// if(this.model.smsCode || this.model.showPaste) return
|
|||
// if (!this.verifyPhone(this.model.phone)) {
|
|||
// uni.$ui.showToast('请输入正确的手机号');
|
|||
// return;
|
|||
// }
|
|||
// if (!this.model.verificationCodeValue) {
|
|||
// uni.$ui.showToast('请输入图形验证码');
|
|||
// return;
|
|||
// }
|
|||
// this.getCode();
|
|||
// },
|
|||
|
|||
// // 获取验证码
|
|||
// async getCode() {
|
|||
// try {
|
|||
// const { phone, verificationCodeValue } = this.model;
|
|||
// const { verificationCodeId } = this;
|
|||
|
|||
// if (!verificationCodeId || !verificationCodeValue) {
|
|||
// uni.$ui.showToast('缺少图形验证码参数');
|
|||
// return;
|
|||
// }
|
|||
// const params = {
|
|||
// phone,
|
|||
// verificationCodeId,
|
|||
// verificationCodeValue,
|
|||
// };
|
|||
// const date = await store.dispatch('user/sendCode', params);
|
|||
// getCodeInterval();
|
|||
// showPaste.value = true;
|
|||
// } catch (err) {
|
|||
// throw err;
|
|||
// }
|
|||
// },
|
|||
|
|||
// // 获取验证码倒计时
|
|||
// getCodeInterval() {
|
|||
// this.showInterval = true;
|
|||
// this.codeTimer = setInterval(() => {
|
|||
// if (this.interval === 0) {
|
|||
// clearInterval(this.codeTimer);
|
|||
// this.codeTimer = null;
|
|||
// this.showInterval = false;
|
|||
// this.interval = 120;
|
|||
// return;
|
|||
// }
|
|||
// this.interval = this.interval - 1;
|
|||
// }, 1000);
|
|||
// },
|
|||
|
|||
// // 验证信息
|
|||
// checkRules() {
|
|||
// // const { smsCode, phone, user } = this;
|
|||
// if (!this.verifyPhone(phone.value)) {
|
|||
// uni.$ui.showToast('请输入正确的手机号');
|
|||
// return false;
|
|||
// }
|
|||
// if (!smsCode.value) {
|
|||
// uni.$ui.showToast('验证码无效');
|
|||
// return false;
|
|||
// }
|
|||
|
|||
// if (phone.value === user.value.phone) {
|
|||
// uni.$ui.showToast('新手机号不能与旧手机号相同');
|
|||
// return;
|
|||
// }
|
|||
// return true;
|
|||
// },
|
|||
|
|||
// // 粘贴
|
|||
// setCode() {
|
|||
// // 获取粘贴板内容
|
|||
// // 小程序平台
|
|||
// //#ifdef MP-WEIXIN
|
|||
// var _this = this
|
|||
// uni.getClipboardData({
|
|||
// success (res) {
|
|||
// _this.smsCode = res.data;
|
|||
// }
|
|||
// });
|
|||
// //#endif
|
|||
|
|||
// // 非小程序平台
|
|||
// //#ifndef MP-WEIXIN
|
|||
// this.getClipboardContents()
|
|||
// //#endif
|
|||
// },
|
|||
|
|||
// // 非小程序平台粘贴
|
|||
// async getClipboardContents() {
|
|||
// try {
|
|||
// const text = await navigator.clipboard.readText();
|
|||
// this.smsCode = text;
|
|||
// } catch (err) {
|
|||
// console.error('Failed to read clipboard contents: ', err);
|
|||
// }
|
|||
// },
|
|||
|
|||
// /**
|
|||
// * 验证手机号格式
|
|||
// * @param {string} phone 手机号
|
|||
// */
|
|||
// verifyPhone(phone) {
|
|||
// const phoneExg = /^1\d{10}$/;
|
|||
// return phoneExg.test(phone);
|
|||
// },
|
|||
|
|||
// /**
|
|||
// * 验证账号/密码 格式
|
|||
// * @param {string} account 账号
|
|||
// */
|
|||
// verifyLoginname(account) {
|
|||
// const accountExg = /^[a-zA-Z0-9._-]{2,20}$/;
|
|||
// return accountExg.test(account);
|
|||
// },
|
|||
|
|||
// // 微信登录
|
|||
// handleWxLogin() {
|
|||
// const origin = 'https://test.tall.wiki/pt-mui'; // 测试
|
|||
// const appid = 'wxd1842e073e0e6d91';
|
|||
// const state = 'wx_web';
|
|||
// const href = 'https://open.weixin.qq.com/connect/qrconnect';
|
|||
// // eslint-disable-next-line
|
|||
// window.location.href =
|
|||
// `${href}?appid=${appid}&redirect_uri=${origin}&response_type=code&scope=snsapi_login&state=${state}#wechat_redirect`;
|
|||
// },
|
|||
// // }
|
|||
// };
|
@ -0,0 +1,8 @@ |
|||
<template> |
|||
</template> |
|||
|
|||
<script> |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,62 @@ |
|||
<template> |
|||
<!-- 上传交付物 --> |
|||
<view class="px-3 py-6 bg-white"> |
|||
<u-input :auto-height="autoHeight" :border="border" :height="height" :type="type" placeholder="输入备注" v-model="remark" /> |
|||
<view class="flex flex-row-reverse text-xs text-gray-400 mt-2">{{ wordNum }}/140</view> |
|||
<!-- 评分 --> |
|||
<view class="flex justify-between mt-3"> |
|||
<slider :value="score" @change="sliderChange" max="100" min="0" show-value style="width: 60%" /> |
|||
<u-input :border="border" :type="type1" @input="changeNumber" maxlength="100" placeholder="输入分数" v-model="score" /> |
|||
</view> |
|||
|
|||
<view class="flex flex-col justify-center mt-5"> |
|||
<u-button @click="submit" size="medium" type="primary">提交</u-button> |
|||
<u-button @click="$emit('closeScore')" class="mt-2" size="medium">取消</u-button> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { reactive, watchEffect } from 'vue'; |
|||
|
|||
const data = reactive({ |
|||
remark: '', |
|||
type: 'textarea', |
|||
border: true, |
|||
height: 100, |
|||
autoHeight: true, |
|||
wordNum: 0, |
|||
score: 0, |
|||
type1: 'number', |
|||
}); |
|||
|
|||
const emit = defineEmits(['submit']); |
|||
|
|||
|
|||
watchEffect(() => { |
|||
if(remark) { |
|||
data.wordNum = remark.value.length; |
|||
} |
|||
|
|||
if(score) { |
|||
data.score1 = score.value; |
|||
} |
|||
}); |
|||
|
|||
// 提交交付物 |
|||
function submit() { |
|||
emit('submit', this.remark, this.score); |
|||
} |
|||
|
|||
function sliderChange(e) { |
|||
data.score = e.detail.value; |
|||
} |
|||
|
|||
function changeNumber(e) { |
|||
if (e > 100) { |
|||
data.score = 100; |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style></style> |
@ -0,0 +1,131 @@ |
|||
<template> |
|||
<!-- 交付物 --> |
|||
<view class="mt-3"> |
|||
<view v-if="data.lists && data.lists.length"> |
|||
<view :key="list.id" v-for="list in data.lists"> |
|||
<view class="p-3 mt-3 shadow"> |
|||
<view class="text-gray-400 pb-2"> |
|||
<span class="mr-4">{{ list.name }}</span> |
|||
<span>{{ $moment(+list.time).format('YYYY-MM-DD HH:mm:ss') }}</span> |
|||
</view> |
|||
<view class="pb-2 flex flex-wrap overflow-hidden" v-if="list.content"> |
|||
<a :href="list.content" class="text-blue-500" target="_blank" v-if="CheckUrl(list.content)">{{ list.content }}</a> |
|||
<span v-else>{{ list.content }}</span> |
|||
</view> |
|||
<view :key="checker.checkerId" v-for="checker in list.checkerList" class="mb-2"> |
|||
<view class="flex justify-between"> |
|||
<view class="font-bold"> |
|||
{{ checker.checkerName }} |
|||
<span v-if="checker.isMine">(我)</span> |
|||
</view> |
|||
<view> |
|||
<span class="text-blue-500" v-if="checker.status === 1">通过</span> |
|||
<span class="text-red-500" v-if="checker.status === 2">驳回</span> |
|||
<span class="ml-4" v-if="checker.status !== 0">{{ checker.score }}分</span> |
|||
<span class="text-gray-400" v-if="checker.status === 0 && !checker.isMine">未审核</span> |
|||
<view v-if="checker.status === 0 && checker.isMine"> |
|||
<u-button @click="showScore(checker.checkId, 2)" class="mr-3" plain size="mini" type="error">驳回</u-button> |
|||
<u-button @click="showScore(checker.checkId, 1)" plain size="mini" type="primary">通过</u-button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="text-gray-400 text-xs mt-1">{{ checker.remark }}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<u-empty icon-size="90" mode="history" text="暂未上传交付物" v-else></u-empty> |
|||
|
|||
<!-- 评分 --> |
|||
<!-- <uni-popup :maskClick="false" background-color="#fff" ref="popup" type="bottom"><PDeliverCheck @closeScore="closeScore" @submit="submit"></PDeliverCheck></uni-popup> --> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { ref, reactive, onMounted, computed } from 'vue'; |
|||
import { useStore } from 'vuex'; |
|||
// import UniPopup from '../../components/uni-popup/uni-popup.vue'; |
|||
import PDeliverCheck from '../p-deliver-check/p-deliver-check.vue'; |
|||
|
|||
const props = defineProps({ task: { type: Object, default: null } }); |
|||
|
|||
const data = reactive({ |
|||
lists: [], |
|||
show: false, |
|||
options: null, |
|||
loading: true, // 是否显示骨架屏组件 |
|||
}); |
|||
|
|||
const store = useStore(); |
|||
const projectId = computed(() => store.getters['project/projectId']); |
|||
const popup = ref(null); |
|||
|
|||
onMounted(() => { |
|||
getDeliverOfTask(); |
|||
}); |
|||
|
|||
async function getDeliverOfTask() { |
|||
try { |
|||
const params = { projectId: projectId.value, taskSubId: props.task.id }; |
|||
const res = await uni.$u.api.queryDeliverOfTask(params); |
|||
data.lists = res; |
|||
} catch (error) { |
|||
console.error('p-delivery-history.vue getDeliverOfTask error: ', error); |
|||
uni.$ui.showToast(error.msg || '提交失败'); |
|||
} |
|||
} |
|||
|
|||
function showScore(checkId, status) { |
|||
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center'] |
|||
popup.open('bottom'); |
|||
data.options = { checkId, status }; |
|||
} |
|||
|
|||
function closeScore() { |
|||
popup.close('bottom'); |
|||
} |
|||
|
|||
async function submit(remark, score) { |
|||
try { |
|||
await checkDeliver(remark, score); |
|||
closeScore(); |
|||
} catch (error) { |
|||
console.error('error: ', error); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 检查交付物 |
|||
* @param {string} checkId 检查记录id |
|||
* @param {string} projectId 项目id |
|||
* @param {string} remark 评论 |
|||
* @param {number} score 分数 |
|||
* @param {number} status 检查状态(1-通过,2-驳回) |
|||
*/ |
|||
async function checkDeliver(remark, score) { |
|||
try { |
|||
data.show = true; |
|||
const { checkId, status } = data.options; |
|||
const params = { checkId, projectId: projectId.value, status, remark, score }; |
|||
await uni.$u.api.checkDeliver(params); |
|||
uni.$ui.showToast('交付物检查成功'); |
|||
data.options = null; |
|||
getDeliverOfTask(); |
|||
} catch (error) { |
|||
console.error('p-delivery-history.vue checkDeliver error: ', error); |
|||
uni.$t.ui.showToast('交付物检查失败,请稍后重试'); |
|||
data.options = null; |
|||
} |
|||
} |
|||
|
|||
// 判断内容是不是链接 |
|||
function CheckUrl(url) { |
|||
const reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(.)+$/; |
|||
if (!reg.test(url)) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
</script> |
|||
|
|||
<style></style> |
@ -0,0 +1,149 @@ |
|||
<template> |
|||
<!-- 交付物 --> |
|||
<view class="mt-3"> |
|||
<view v-if="lists && lists.length"> |
|||
<view :key="list.id" v-for="list in lists"> |
|||
<view class="text-gray-400 u-font-12 font-thin leading-none"> |
|||
<span class="mr-2">{{ list.name }}</span> |
|||
<span>{{ $moment(+list.time).format('YYYY-MM-DD HH:mm:ss') }}</span> |
|||
</view> |
|||
<view class="mt-2 py-1 px-2.5 border border-gray-200 rounded flex flex-wrap overflow-hidden break-all" v-if="list.content"> |
|||
<a :href="list.content" class="text-blue-500 u-font-12 font-thin" target="_blank" v-if="CheckUrl(list.content)">{{ |
|||
list.content |
|||
}}</a> |
|||
<span v-else>{{ list.content }}</span> |
|||
</view> |
|||
<view :class="index === 0 ? 'mt-4' : 'mt-3'" v-for="(checker, index) in list.checkerList" :key="index"> |
|||
<view class="flex justify-between leading-none"> |
|||
<view> |
|||
{{ checker.checkerName }} |
|||
<span v-if="checker.isMine">(我)</span> |
|||
</view> |
|||
<view> |
|||
<span class="text-blue-500" v-if="checker.status === 1">通过</span> |
|||
<span class="text-red-500" v-if="checker.status === 2">驳回</span> |
|||
<span class="ml-4" v-if="checker.status !== 0">{{ checker.score }}分</span> |
|||
<span class="text-gray-400" v-if="checker.status === 0 && !checker.isMine">未审核</span> |
|||
<view v-if="checker.status === 0 && checker.isMine"> |
|||
<u-button class="action-btn mr-2" @click="showScore(checker.checkId, 1)" size="mini" shape="circle" type="primary"> |
|||
通过 |
|||
</u-button> |
|||
<u-button class="action-btn" @click="showScore(checker.checkId, 2)" size="mini" shape="circle" type="error">驳回</u-button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="text-gray-400 text-xs mt-1">{{ checker.remark }}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<u-empty icon-size="90" mode="history" text="暂未上传交付物" v-else></u-empty> |
|||
|
|||
<!-- 评分 --> |
|||
<uni-popup :maskClick="false" background-color="#fff" ref="popup" type="bottom"> |
|||
<PDeliverCheck @closeScore="closeScore" @submit="submit"></PDeliverCheck> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex'; |
|||
import UniPopup from '../../components/uni-popup/uni-popup.vue'; |
|||
import PDeliverCheck from '../p-deliver-check/p-deliver-check.vue'; |
|||
|
|||
export default { |
|||
name: 'p-delivery-history', |
|||
props: { task: { type: Object, default: null } }, |
|||
components: { PDeliverCheck, UniPopup }, |
|||
data() { |
|||
return { |
|||
lists: [], |
|||
show: false, |
|||
options: null, |
|||
loading: true, // 是否显示骨架屏组件 |
|||
}; |
|||
}, |
|||
|
|||
computed: mapGetters('project', ['projectId']), |
|||
|
|||
mounted() { |
|||
this.getDeliverOfTask(); |
|||
}, |
|||
|
|||
methods: { |
|||
async getDeliverOfTask() { |
|||
try { |
|||
const { projectId, task } = this; |
|||
const params = { projectId, taskSubId: task.id }; |
|||
const data = await this.$u.api.queryDeliverOfTask(params); |
|||
this.lists = data; |
|||
} catch (error) { |
|||
console.error('p-delivery-history.vue getDeliverOfTask error: ', error); |
|||
this.$t.ui.showToast(error.msg || '提交失败'); |
|||
} |
|||
}, |
|||
|
|||
showScore(checkId, status) { |
|||
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center'] |
|||
this.$refs.popup.open('bottom'); |
|||
this.options = { checkId, status }; |
|||
}, |
|||
|
|||
closeScore() { |
|||
this.$refs.popup.close('bottom'); |
|||
}, |
|||
|
|||
async submit(remark, score) { |
|||
try { |
|||
await this.checkDeliver(remark, score); |
|||
this.closeScore(); |
|||
} catch (error) { |
|||
console.error('error: ', error); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 检查交付物 |
|||
* @param {string} checkId 检查记录id |
|||
* @param {string} projectId 项目id |
|||
* @param {string} remark 评论 |
|||
* @param {number} score 分数 |
|||
* @param {number} status 检查状态(1-通过,2-驳回) |
|||
*/ |
|||
async checkDeliver(remark, score) { |
|||
try { |
|||
this.show = true; |
|||
const { projectId, options } = this; |
|||
const { checkId, status } = options; |
|||
const params = { checkId, projectId, status, remark, score }; |
|||
await this.$u.api.checkDeliver(params); |
|||
this.$t.ui.showToast('交付物检查成功'); |
|||
this.options = null; |
|||
this.getDeliverOfTask(); |
|||
} catch (error) { |
|||
console.error('p-delivery-history.vue checkDeliver error: ', error); |
|||
this.$t.ui.showToast('交付物检查失败,请稍后重试'); |
|||
this.options = null; |
|||
} |
|||
}, |
|||
|
|||
// 判断内容是不是链接 |
|||
CheckUrl(url) { |
|||
var reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(.)+$/; |
|||
if (!reg.test(url)) { |
|||
return false; |
|||
} else { |
|||
return true; |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.action-btn { |
|||
padding: 0; |
|||
width: 80rpx; |
|||
height: 40rpx; |
|||
line-height: 40rpx; |
|||
} |
|||
</style> |
@ -0,0 +1,6 @@ |
|||
<template> |
|||
<view>成员管理</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
</script> |
@ -0,0 +1,6 @@ |
|||
<template> |
|||
<view>项目管理</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
</script> |
@ -0,0 +1,6 @@ |
|||
<template> |
|||
<view>角色管理</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
</script> |
@ -0,0 +1,6 @@ |
|||
<template> |
|||
<view>任务管理</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
</script> |
@ -0,0 +1,54 @@ |
|||
<template> |
|||
<!-- 子项目插件 --> |
|||
<view> |
|||
<view v-for="item in data.sonProject" :key="item.detailId"> |
|||
<span class="text-xs text-blue-500" @click="openProject(item)">{{ item.name }}</span> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { onMounted } from 'vue'; |
|||
import Config from '@/common/js/config.js'; |
|||
|
|||
const props = defineProps({ |
|||
task: { |
|||
type: Object, |
|||
default: () => {}, |
|||
}, |
|||
}); |
|||
|
|||
const data = reactive({ sonProject: [] }); |
|||
|
|||
onMounted(() => { |
|||
getSonProject(); |
|||
}); |
|||
|
|||
async function getSonProject() { |
|||
try { |
|||
const data = await uni.$u.api.findSonProject({ projectId: props.task.detailId }); |
|||
data.sonProject = data; |
|||
} catch (error) { |
|||
console.error('p-subproject.vue getSonProject error: ', error); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 打开项目 |
|||
* @param {object} project 所点击的项目的信息 |
|||
*/ |
|||
function openProject(project) { |
|||
const { name, id, url } = project; |
|||
const { apiUrl } = Config; |
|||
const defaultwbs = `${apiUrl}/defaultwbs`; |
|||
url && (defaultwbs = url); |
|||
uni.$u.route('pages/project/project', { |
|||
u: userId.value, |
|||
p: id, |
|||
pname: name, |
|||
url: encodeURIComponent(url), |
|||
}); |
|||
} |
|||
</script> |
|||
|
|||
<style></style> |
@ -0,0 +1,31 @@ |
|||
<template> |
|||
<view> |
|||
<view v-for="item in data.sonTask" :key="item.detailId"> |
|||
<span class="text-xs text-gray-500">{{ item.name }}</span> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { reactive } from 'vue'; |
|||
|
|||
const props = defineProps({ |
|||
task: { |
|||
type: Object, |
|||
default: () => {}, |
|||
}, |
|||
}); |
|||
const data = reactive({ sonTask: [] }); |
|||
|
|||
async function getSonTask() { |
|||
try { |
|||
const res = await uni.$u.api.findSonTask({ detailId: props.task.detailId }); |
|||
data.sonTask = res; |
|||
} catch (error) { |
|||
console.error('p-subtasks.vue getSonTask error: ', error); |
|||
} |
|||
} |
|||
getSonTask(); |
|||
</script> |
|||
|
|||
<style></style> |
@ -0,0 +1,10 @@ |
|||
<template> |
|||
<!-- 任务倒计时插件 --> |
|||
<view>任务倒计时插件</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
|
|||
</script> |
|||
|
|||
<style></style> |
@ -0,0 +1,9 @@ |
|||
<template> |
|||
<!-- 任务描述 --> |
|||
<view>{{ task.description }}</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineProps({ task: { default: () => {}, type: Object } }); |
|||
|
|||
</script> |
@ -0,0 +1,23 @@ |
|||
<template> |
|||
<view v-if="realDuration && planDuration"> |
|||
<!-- 任务时长延迟插件 --> |
|||
<!-- 超时 --> |
|||
<span class="font-bold text-green-500" v-if="realDuration - 0 > planDuration - 0"> |
|||
+{{ $time.formatDuration(realDuration - planDuration) }} |
|||
</span> |
|||
<!-- 延时 --> |
|||
<span class="font-bold text-red-500" v-if="realDuration - 0 < planDuration - 0"> |
|||
-{{ $time.formatDuration(planDuration - realDuration) }} |
|||
</span> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { computed } from 'vue'; |
|||
|
|||
const props = defineProps({ task: { default: () => {}, type: Object } }); |
|||
|
|||
const realDuration = computed(() => props.task.realDuration); |
|||
const planDuration = computed(() => props.task.planDuration); |
|||
|
|||
</script> |
@ -0,0 +1,18 @@ |
|||
<template> |
|||
<!-- <view>任务开始时间延迟插件</view> --> |
|||
<view v-if="realStart && planStart"> |
|||
<!-- 任务开始时间延迟插件 --> |
|||
<!-- 超时 --> |
|||
<span>{{ $time.formatDuration(+realStart - +planStart) }}</span> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { computed } from 'vue'; |
|||
|
|||
const props = defineProps({ task: { default: () => {}, type: Object } }); |
|||
|
|||
const realStart = computed(() => props.task.realStart); |
|||
const planStart = computed(() => props.task.planStart); |
|||
|
|||
</script> |
@ -0,0 +1,90 @@ |
|||
<template> |
|||
<!-- 上传交付物 --> |
|||
<view class="py-2"> |
|||
<u-input :auto-height="data.autoHeight" :border="data.border" :height="data.height" :type="data.type" v-model="data.content" width="100" /> |
|||
|
|||
<!-- 选择检查人 --> |
|||
<!-- <ChooseChecker ref="checker" :checkerList="data.checkerList" @setCheckerList="setCheckerList"></ChooseChecker> --> |
|||
|
|||
<view class="flex justify-between"> |
|||
<u-button @click="submit" class="m-0" size="mini" type="primary">提交</u-button> |
|||
<u-icon @click="changeShowHistory" name="arrow-up" v-if="data.showHistory"></u-icon> |
|||
<u-icon @click="changeShowHistory" name="arrow-down" v-else></u-icon> |
|||
</view> |
|||
|
|||
<p-delivery-history :task="task" v-if="data.showHistory" /> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { reactive, ref, computed } from 'vue'; |
|||
import { useStore } from 'vuex'; |
|||
// import ChooseChecker from '@/components/ChooseChecker/ChooseChecker.vue'; |
|||
|
|||
const props = defineProps({ |
|||
task: { default: () => {}, type: Object }, |
|||
}); |
|||
|
|||
const data = reactive({ |
|||
content: '', |
|||
type: 'textarea', |
|||
border: true, |
|||
height: 30, |
|||
autoHeight: true, |
|||
checkerList: [], |
|||
showHistory: false, // 展开历史记录 |
|||
}); |
|||
|
|||
const checker = ref(null); |
|||
const store = useStore(); |
|||
const members = computed(() => store.state.role.members); |
|||
const projectId = computed(() => store.getters['project/projectId']); |
|||
const checkers = computed(() => { |
|||
let arr = []; |
|||
if (members.value.length) { |
|||
members.value.forEach(member => { |
|||
const item = { value: member.memberId, label: member.name }; |
|||
arr.push(item); |
|||
}); |
|||
} |
|||
return arr; |
|||
}); |
|||
|
|||
// 设置检查人 |
|||
function setCheckerList(checked, item) { |
|||
if (checked) { |
|||
data.checkerList.push(item.memberId); |
|||
} else { |
|||
const index = data.checkerList.findIndex(checker => checker === item.memberId); |
|||
data.checkerList.splice(index, 1); |
|||
} |
|||
} |
|||
|
|||
// 展开合上历史记录 |
|||
function changeShowHistory() { |
|||
data.showHistory = !data.showHistory; |
|||
} |
|||
|
|||
// 提交交付物 |
|||
async function submit() { |
|||
try { |
|||
const { content, checkerList } = data; |
|||
const { task } = props; |
|||
if (!checkerList.length) { |
|||
uni.$ui.showToast('请选择检查人'); |
|||
return; |
|||
} |
|||
const params = { content, checkerList, projectId: projectId.value, taskSubId: task.id }; |
|||
await uni.$u.api.saveDeliver(params); |
|||
uni.$ui.showToast('交付物提交成功'); |
|||
data.content = ''; |
|||
data.checkerList = []; |
|||
checker.clearChecked(); |
|||
} catch (error) { |
|||
console.error('p-upload-deliverable.vue submit error: ', error); |
|||
uni.$ui.showToast('交付物提交失败,请稍后重试'); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"></style> |
@ -0,0 +1,71 @@ |
|||
<template> |
|||
<view> |
|||
<view @click="handleUpload" v-if="task.name === '导入WBS新建项目'">{{ task.name }}</view> |
|||
<view @click="handleUpdate" v-if="task.name === '导入WBS更新项目'">{{ task.name }}</view> |
|||
<!-- 全局提示框 --> |
|||
<u-top-tips ref="uTips"></u-top-tips> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { ref, computed } from 'vue'; |
|||
import { useStore } from 'vuex'; |
|||
|
|||
defineProps({ task: { type: Object, default: () => {} } }); |
|||
|
|||
const store = useStore(); |
|||
const userId = computed(() => store.state.user.userId); |
|||
const projectId = computed(() => store.getters['project/projectId']); |
|||
const uTips = ref(null); |
|||
|
|||
// 导入成功 |
|||
function onUploadSuccess() { |
|||
uTips.show({ |
|||
title: '导入成功,即将打开新项目', |
|||
type: 'success', |
|||
duration: '3000', |
|||
}); |
|||
} |
|||
|
|||
// 导入失败 |
|||
function onUploadError(error) { |
|||
uTips.show({ |
|||
title: error || '导入失败', |
|||
type: 'error', |
|||
duration: '6000', |
|||
}); |
|||
} |
|||
|
|||
// 更新项目 |
|||
// TODO: 更新接口没写完 |
|||
async function handleUpdate() { |
|||
try { |
|||
await uni.$u.api.import({ projectId: projectId.value }); |
|||
// 导入WBS成功后 |
|||
// 直接打开导入的项目 |
|||
onUploadSuccess(); |
|||
} catch (error) { |
|||
onUploadError(error); |
|||
} |
|||
} |
|||
|
|||
// 导入wbs |
|||
async function handleUpload() { |
|||
try { |
|||
const res = await uni.$u.api.import(); |
|||
// 导入WBS成功后 |
|||
// 直接打开导入的项目 |
|||
onUploadSuccess(); |
|||
setTimeout(() => { |
|||
uni.$u.route('/pages/project/project', { |
|||
u: userId.value, |
|||
p: res.id, |
|||
pname: res.pname, |
|||
url: res.url, |
|||
}); |
|||
}, 2000); |
|||
} catch (error) { |
|||
onUploadError(error); |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue