123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543 |
- <template>
- <view class="content">
- <view class="top-fixed">
- <u-search bgColor="#F5F7FA" placeholder="请输入文件名称" v-model="keyword" :showAction="false"></u-search>
- </view>
- <view class="inner">
- <view class="align-center justify-between wrap">
- <view class="box" v-for="(item,index) in dataList" :key="index" @longpress="cancel(item)">
- <view class="img" @click="navgetTo(item)">
- <view class="num">{{item.size||0}}张</view>
- </view>
- <view class="text ellipsis">{{item.fileName}}</view>
- </view>
- <view class="box" @click="open()">
- <view class="add-img">
- <image src="/static/images/user/add_picture_icon24.png" class="w40 h40"></image>
- </view>
- <view class="text">添加文件夹</view>
- </view>
- <view class="box"></view>
- </view>
- <view class="popup-box" v-if="show">
- <view class="info-mask" @click="close()"></view>
- <view class="info-form">
- <view class="title">新建文件夹</view>
- <view class="form-box">
- <view class="form-item">
- <text class="label">文件夹名称</text>
- <input type="text" v-model="fileName" placeholder="请输入文件夹名称" class="form-input" />
- </view>
- </view>
- <view class="btns">
- <view class="sub-btn" @click="add()">确定</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- addAttachment,
- getAttachment,deleteAttachment
- } from '@/api/companyUser.js'
- export default {
- data() {
- return {
- show: false,
- curDate: '',
- markDays: [],
- type: null,
- patientId: null,
- famaleurl: "/static/images/health/female_profile.png",
- maleurl: "/static/images/health/my_heads.png",
- checked: 1,
- dataList: [],
- form: {
- userName: null,
- idCard: null,
- sex: null,
- birthday: null,
- remark: null,
- },
- fileName: null
- };
- },
- onLoad(option) {
- this.getAttachment()
- uni.$on('refreshMyFolder', () => {
- this.getAttachment()
- })
-
- },
- methods: {
- //日历
- onDayClick(data) {
- this.curDate = data.date;
- },
- navgetTo(item) {
- uni.navigateTo({
- url: '/pages_user/user/default?id='+item.attachmentId+'&fileName='+item.fileName
- })
- },
- getAttachment() {
- let data = {
- parentId:0,
- pageNum: 1,
- pageSize: 100
- }
- getAttachment(data).then(
- res => {
- if (res.code == 200) {
- this.dataList = res.data.list
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- });
- }
- },
- rej => {}
- );
- },
- open() {
- this.show = true
- this.fileName=null
- // console.log('close');
- },
- close() {
- this.show = false
- // console.log('close');
- },
- add() {
- let data = {
- // "parentId": 0,
- "type": 0, //文件类型 0:文件夹 1图片 2体检报告
- "fileName": this.fileName //文件名
- }
- addAttachment(data).then(
- res => {
- if (res.code == 200) {
- uni.showToast({
- icon: 'success',
- title: "操作成功",
- });
- this.show = false
- this.getAttachment()
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- });
- }
- },
- rej => {}
- );
- },
- ed(v) {
- console.log(v)
- },
- cancel(item){
- var that=this
- uni.showModal({
- title: '提示',
- content: '确定删除文件吗',
- success: function (res) {
- if (res.confirm) {
- deleteAttachment(item.attachmentId).then(res => {
- if(res.code==200){
- uni.showToast({
- icon:'success',
- title: '删除成功!',
- });
- that.getAttachment()
- }else{
- uni.showToast({
- icon:'none',
- title: res.msg,
- });
- }
- });
- }
- else if (res.cancel) {
-
- }
- }
- });
- },
- onItemIconClick(index, item) {
- console.log(index, item)
- },
-
- // 出生日期选择
- bindDateChange: function(e) {
- this.form.birthday = e.target.value
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- height: 100%;
- background: #fff;
- }
- .content {
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .top-fixed {
- position: absolute;
- top: 0;
- background: #FFFFFF;
- padding: 20rpx;
- width: 100%;
- box-sizing: border-box;
- }
- .popup-box {
- position: fixed;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- z-index: 999;
- display: flex;
- justify-content: center;
- align-items: center;
- .info-mask {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- background-color: rgba($color: #000000, $alpha: 0.5);
- z-index: 999;
- }
- .info-form {
- z-index: 1000;
- width: 650rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 0 30upx;
- background: #FFFFFF;
- border-radius: 16upx;
- .title {
- padding: 30rpx 0rpx 15rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 40upx;
- line-height: 44upx;
- font-family: PingFang SC;
- color: #222222;
- }
- .form-box {
- width: 100%;
- .form-item {
- padding: 30upx 0;
- display: flex;
- align-items: flex-start;
- border-bottom: 1px solid #F1F1F1;
- .label {
- width: 160upx;
- text-align: left;
- font-size: 30upx;
- line-height: 44upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #222222;
- flex-shrink: 0;
- }
- input {
- text-align: left;
- }
- .form-input {
- font-size: 34upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #222222;
- text-align: left;
- }
- }
- }
- .btns {
- width: 100%;
- height: 120upx;
- padding: 0 30upx;
- display: flex;
- align-items: center;
- justify-content: center;
- .sub-btn {
- width: 100%;
- height: 88upx;
- line-height: 88upx;
- text-align: center;
- font-size: 30upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- background: #008FD3;
- border-radius: 44upx;
- }
- }
- }
- }
- .inner {
- // height: calc(100% - 120upx);
- padding: 20upx;
- padding-top: 130rpx;
- .box {
- width: 210rpx;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- margin-bottom: 20rpx;
- .img {
- width: 100%;
- height: 194rpx;
- background-image: url('/static/images/user/cpk_folder_bg.png');
- background-size: 100%;
- background-repeat: no-repeat;
- display: flex;
- align-items: center;
- justify-content: center;
- .num {
- width: 72rpx;
- height: 40rpx;
- background: #F29D0D;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #FFFFFF;
- text-align: center;
- line-height: 40rpx;
- }
- }
- .add-img {
- width: 210rpx;
- height: 188rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #F5F7FA;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- }
- .text {
- margin-top: 20rpx;
- font-family: PingFang SC, PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #222426;
- text-align: left;
- display: block;
- }
- }
- .title-box {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #898E91;
- text-align: left;
- padding: 24rpx 0;
- .select-box {
- display: flex;
- align-items: center;
- justify-content: center;
- text {
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #626468;
- margin-left: 8rpx;
- }
- }
- .select-box2 {
- width: 216rpx;
- height: 64rpx;
- background: #FFFFFF;
- border-radius: 32rpx 32rpx 32rpx 32rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- text {
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #626468;
- margin-left: 5rpx;
- }
- }
- }
- .form-box {
- // padding: 0 30upx;
- background: #FFFFFF;
- border-radius: 16upx;
- overflow: hidden;
- // margin-bottom: 20upx;
- .form-title {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 32rpx;
- color: #626468;
- text-align: left;
- padding: 30rpx 0;
- display: block;
- }
- .form-item {
- padding: 30upx 0;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-bottom: 1px solid #F1F1F1;
- &:last-child {
- border-bottom: none;
- }
- .left {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- .time {
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #898E91;
- text-align: left;
- }
- }
- .check {
- display: flex;
- align-items: center;
- justify-content: center;
- text {
- // font-family: PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #008FD3;
- margin-left: 16rpx;
- }
- }
- .label {
- // width: 150upx;
- text-align: left;
- font-weight: 500;
- font-size: 32rpx;
- color: #222426;
- text-align: left;
- }
- .num {
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: #222426;
- line-height: 34rpx;
- display: flex;
- align-items: center;
- }
- }
- }
- }
- .sub-btn {
- // flex: 1;
- // width: 100%;
- height: 88upx;
- line-height: 88upx;
- text-align: center;
- font-size: 32upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- background: #008FD3;
- border-radius: 44upx;
- display: flex;
- align-items: center;
- border: 2rpx solid #008FD3;
- justify-content: center;
- }
- .btn-box2 {
- z-index: 9999;
- width: 100%;
- padding: 30upx;
- position: fixed;
- bottom: 0;
- left: 0;
- box-sizing: border-box;
- background: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-bottom: 40rpx;
- .sub-btn2 {
- flex: auto;
- height: 88upx;
- line-height: 88upx;
- display: flex;
- align-items: center;
- justify-content: center;
- text-align: center;
- font-size: 32rpx;
- color: #fff;
- font-family: PingFang SC;
- font-weight: bold;
- background: #FF5030;
- border-radius: 44rpx 44rpx 44rpx 44rpx;
- margin-right: 20rpx;
- image {
- margin-right: 16rpx;
- }
- }
- }
- }
- </style>
|