ZaiZai 2 жил өмнө
parent
commit
1f1b0e13c6

+ 5 - 1
pages/image/info.vue

@@ -6,11 +6,15 @@
             </hc-nav-back-bar>
         </template>
         <!-- 轮播图 -->
-        <swiper class="screen-swiper square-dot h-8xl" indicator-dots circular autoplay interval="5000" duration="500">
+        <template v-if="dataInfo.type === 1">
+            <video class="h-8xl w-full" :src="dataInfo.imageUrl"/>
+        </template>
+        <swiper class="screen-swiper square-dot h-8xl" indicator-dots circular autoplay interval="5000" duration="500" v-if="dataInfo.type === 2">
             <swiper-item v-for="(item,index) in imageList" :key="index">
                 <image :src="item" mode="aspectFill"/>
             </swiper-item>
         </swiper>
+
         <!-- 详情 -->
         <view class="relative bg-white">
             <view class="text-black text-36 hc-p">{{dataInfo.title}}</view>

+ 13 - 9
pages/image/position.vue

@@ -86,18 +86,23 @@ const bindTypeChange = ({detail}) => {
     typeIndex.value = detail.value
 }
 
-//查看
-const viewClick = () => {
+const toPageNode = () => {
     const {primaryKeyId} = treeItem.value
     if (!primaryKeyId) {
         errorToast('请先选择最后的一个树节点')
         return false;
     }
     //准备跳转路由
-    const node = encodeURIComponent(JSON.stringify({
+    return encodeURIComponent(JSON.stringify({
         ...pageNode.value,
         treeId: primaryKeyId
     }));
+}
+
+//查看
+const viewClick = () => {
+    const node = toPageNode()
+    if (!node) return false;
     uni.navigateTo({
         url: `/pages/image/view?node=${node}`
     });
@@ -105,11 +110,10 @@ const viewClick = () => {
 
 //拍照/上传
 const uploadClick = () => {
-    //const {leaf, primaryKeyId} = treeItem.value
-    console.log(treeItem.value)
+    const node = toPageNode()
+    if (!node) return false;
+    uni.navigateTo({
+        url: `/pages/image/form?node=${node}`
+    })
 }
 </script>
-
-<style scoped lang="scss">
-
-</style>

+ 23 - 8
pages/image/view.vue

@@ -3,7 +3,9 @@
         <template #top>
             <view class="hc-paging-top-bar mb-1">
                 <hc-nav-back-bar title="声像文件">
-                    <text class="text-26 text-red-4" @click="deleteTap" v-if="dataList.length > 0">删除</text>
+                    <text class="text-26" :class="isDelete?'':'text-red-4'" @click="deleteTap" v-if="dataList.length > 0">
+                        {{isDelete? '取消' : '删除'}}
+                    </text>
                 </hc-nav-back-bar>
                 <view class="cu-bar bg-white search py-2" un-border-t="1 solid gray-2" v-if="pageNode.type === 1">
                     <view class="search-form radius">
@@ -14,18 +16,27 @@
                         <button class="cu-btn bg-blue-5 text-white" hover-class="none" @click="searchClick">搜索</button>
                     </view>
                 </view>
+                <view class="cu-bar bg-white search py-2" un-border-t="1 solid gray-2" v-if="pageNode.type === 2">
+                    <view class="search-form radius">
+                        <uni-datetime-picker type="datetime" v-model="searchForm.queryDate"/>
+                    </view>
+                    <view class="action">
+                        <button class="cu-btn bg-blue-5 text-white" hover-class="none" @click="searchClick">搜索</button>
+                    </view>
+                </view>
             </view>
         </template>
 
-        <!-- 树类型的列表 -->
-        <template v-for="(item, index) in dataList" :key="index" v-if="pageNode.type === 1">
+        <!-- 数据列表 -->
+        <template v-for="(item, index) in dataList" :key="index">
             <view class="bg-white hc-p hc-flex" un-border-b="1 solid gray-2" @click="itemClick(item)">
                 <view class="hc-flex mr-2" v-if="isDelete" @click.stop="checkClick(item)">
                     <uni-icons type="checkbox-filled" size="26" color="#ee5b20" v-if="item.check"/>
                     <uni-icons type="checkbox" size="26" color="#9a9a9a" v-else/>
                 </view>
                 <view class="hc-flex">
-                    <hc-img class="b-rounded" :src="item.imageUrl?.toString()?.split(',')[0]" width="50" height="50"/>
+                    <video class="h-100 w-100 b-rounded" :src="item.imageUrl" :controls="false" :show-center-play-btn="false" v-if="item.type === 1"/>
+                    <hc-img class="b-rounded" :src="item.imageUrl?.toString()?.split(',')[0]" width="50" height="50" v-if="item.type === 2"/>
                 </view>
                 <view class="relative flex-1 ml-3">
                     <view class="text-30 text-black clip-2">{{item.title}}</view>
@@ -77,7 +88,6 @@ const dataList = ref([])
 //页面启动
 onLoad(({node}) => {
     pageNode.value = node ? JSON.parse(decodeURIComponent(node)) : {};
-    console.log(pageNode.value)
 })
 
 //条件搜索
@@ -95,14 +105,19 @@ const getDataList = async (pageNo, pageSize) => {
         return false;
     }
     //树类型
+    const form = searchForm.value
     if (type === 1 && treeId) {
-        searchForm.value.wbsIdsStr = treeId
+        delete form.queryDate
+        form.wbsIdsStr = treeId
+    }
+    if (type === 2) {
+        delete form.wbsIdsStr
+        delete form.queryStr
     }
-    //staDate endDate
     //获取数据
     uni.showLoading({title: '获取数据中...', mask: true});
     const { data } = await mainApi.getPageList({
-        ...searchForm.value,
+        ...form,
         projectId: projectId.value,
         contractId: contractId.value,
         classifyId: id,

+ 4 - 0
style/app.scss

@@ -226,3 +226,7 @@ uni-modal {
     overflow: hidden;
     text-overflow: ellipsis;
 }
+
+.uni-calendar__mask, .uni-calendar__content {
+    z-index: 9999999 !important;
+}