Jelajahi Sumber

申请加入购物车功能

sujunling 2 tahun lalu
induk
melakukan
b1d7ccb975

TEMPAT SAMPAH
public/static/img/default-dr3.jpg


+ 19 - 2
src/api/resource/plat.ts

@@ -5,7 +5,8 @@ import md5 from 'js-md5';
 
 
 enum Api {
-    CallProvider = '/callProvider'
+    CallProvider = '/callProvider',
+    Apply = '/base-center/resources/addResToCar'
 }
 
 const client = {
@@ -120,4 +121,20 @@ export function tag() {
                 reject(e);
             })
     })
-}
+}
+
+
+/**
+ * @description:获取所有的标签
+ */
+export function apply(params) {
+    return new Promise<void>((resolve, reject) => {
+        defHttp.post({ url: Api.Apply, params, })
+            .then((r) => {
+                resolve(r);
+            }).
+            catch((e) => {
+                reject(e);
+            })
+    })
+}

+ 3 - 1
src/api/sys/user.ts

@@ -96,7 +96,7 @@ export function getMyInfo() {
     }, { joinPrefix: false }).then((i) => {
       console.log(i)
       var u = JSON.parse(i.result);
-      session.setItem('tokenV2', u.tokenV2);
+      
       var a = {
         info: u,
         "userId": "80808080-8080-8080-8080-808080808080",
@@ -119,6 +119,8 @@ export function getMyInfo() {
       }
       resolve(a);
       session.setItem("userInfo", u);
+      session.setItem('tokenV2', u.tokenV2);
+      session.setItem('userId', u.EMPLOYEE_MIS.EMPLOYEE_ID);
     })
   })
 }

+ 6 - 5
src/views/resource/plat/index.vue

@@ -89,17 +89,19 @@ export default defineComponent({
 }
 
 .datacenter-left .page-name {
-  background: #333333;
+  // background: #333333;
+  border-bottom: solid 1px #DEDEDE;
 }
 
 .datacenter-left .page-name p {
   height: 42px;
   line-height: 42px;
-  padding-left: 16px;
   font-size: 16px;
   font-family: PingFang SC;
   font-weight: bold;
-  color: #ffffff;
+  color: #333333;
+  text-align: center;
+  margin-bottom: 0px;
 }
 
 .datacenter-left {
@@ -107,9 +109,8 @@ export default defineComponent({
   width: 250px;
   height: auto;
   margin-right: 16px;
-  border: 1px solid #dfdfdf;
   border-top: none;
-  background: #f5f5f5;
+  background: #F8F8F8;
   overflow: auto;
   height: calc(100% - 20px);
   max-height: 1306px;

+ 275 - 0
src/views/resource/plat/item/FileData copy.vue

@@ -0,0 +1,275 @@
+<template>
+  <div style="background-color: #f0f2f5" class="dark:bg-dark-900">
+    <div class="datacenter-right">
+      <div class="resource_list" id="map_list">
+        <div v-for="(i, n) in list" v-if="list.length" :key="n" data-permission="true" class="resource_item"
+          data-checking="false" data-searching="1" data-ispub="1">
+          <div class="mapItem-top-box">
+            <div class="item-top">
+              <div class="img_container" data-num="1">
+                <img class="tab-list-icon-img-MR00001936 img_mr MR00001936"
+                  :src="i.info && i.info.length && i.info[0].thumbnail" alt="">
+              </div>
+            </div>
+            <div class="item-title">
+              <span class="r_name">{{ i.SERVICENAME }}</span>
+              <span class="r-number" data-num="1" title="编目1次">1</span>
+            </div>
+            <div class="item-msg">
+              <div class="item-msg-val" style="font-weight:bold;font-size:12px;color: #000;">坐标系:{{ i.CRS }}</div>
+              <div class="item-msg-val">适用流程:国家秘密和工作秘密数据成果申请,</div>
+              <div class="item-msg-val">关键字:测试数据</div>
+              <div class="item-msg-val">服务类型:{{ i.TYPENAME }}</div>
+            </div>
+          </div>
+          <div class="operation-box">
+            <div class="operation-item browse-item-btn browse-item-MR00001936">
+              <a target="_blank" :href="`../../mapview.html?/iserver/services/map-16/rest/maps/LZS16envi1%4016.ijs`"
+                style="border-right: 1px #ccc solid;">
+                <span>浏览</span>
+              </a>
+            </div>
+
+            <div class="operation-item alone-apply-btn alone-apply-btn-MR00001936">
+              <span style="border-right: 1px #ccc solid;" onclick="cardApplyItem('mr')">
+                <span>申请</span>
+              </span>
+            </div>
+            <!-- <div class="user-apply-btn user-apply-btn-MR00001936"
+              onclick="addApplyBank(this,'MR00001936','行政区域','1','测试数据','mr','2000坐标系4490')">
+              <span>加入申请库</span>
+            </div>
+            <div class="dis-apply-btn dis-apply-btn-MR00001936">
+              <span>已加入申请库</span>
+            </div> -->
+            <div class="operation-item" @click="handleQuery(i)">
+              <a href="javascript:void(0)" class="">
+                <span>详细</span>
+              </a>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <!-- <BasicTable @register="registerTable" class="dark:bg-dark-900">
+      <template #toolbar>
+        <Authority value="api:yt:smsLog:delete">
+          <Popconfirm title="您确定要批量删除数据" ok-text="确定" cancel-text="取消" @confirm="handleDeleteOrBatchDelete(null)">
+            <a-button type="primary" color="error" :disabled="hasBatchDelete"> 批量删除 </a-button>
+          </Popconfirm>
+        </Authority>
+      </template>
+      <template #remark="{ record }">
+        <Tooltip :title="record.remark">
+          <div class="truncate w-full">{{ record.remark }}</div>
+        </Tooltip>
+      </template>
+      <template #action="{ record }">
+        <TableAction :actions="[
+          {
+            label: '查看',
+            auth: 'api:yt:smsLog:get',
+            icon: 'ant-design:fund-view-outlined',
+            onClick: handleQuery.bind(null, record),
+          },
+          {
+            label: '删除',
+            auth: 'api:yt:smsLog:delete',
+            icon: 'ant-design:delete-outlined',
+            color: 'error',
+            popConfirm: {
+              title: '是否确认删除',
+              confirm: handleDeleteOrBatchDelete.bind(null, record),
+            },
+          },
+        ]" />
+      </template>
+    </BasicTable> -->
+    <!-- 弹出框 -->
+    <MapDrawer @register="registerModal" />
+  </div>
+</template>
+<script lang="ts">
+import { defineComponent, nextTick, onMounted, ref, defineProps, watch } from 'vue';
+import { BasicTable, useTable, TableAction } from '/@/components/Table';
+import { columns, searchFormSchema } from './sms.data';
+import { Popconfirm, Tooltip } from 'ant-design-vue';
+import { Authority } from '/@/components/Authority';
+import { platList, img } from '/@/api/resource/plat';
+// 加载自定义侧边弹出框 组件
+import { useDrawer } from '/@/components/Drawer';
+// 导入子页面【新增、修改】
+import MapDrawer from './MapDrawer.vue';
+
+
+export default defineComponent({
+  name: 'SmsLog',
+  components: { BasicTable, TableAction, Authority, Popconfirm, Tooltip, MapDrawer },
+  setup() {
+    const [registerModal, { openDrawer }] = useDrawer(); //使用右侧弹出框
+    const list = ref([]);
+    const props = defineProps({
+      listData: {
+        type: Array,
+        default: () => [],
+      }
+    })
+
+    // setInterval(() => {
+    //   console.log(props)
+    // }, 2000)
+    onMounted(() => {
+      platList().then((r) => {
+        if (r) {
+          var o = r.find(i => i.type == 'DR')
+          if (o && o.items && o.items.length) {
+            o.items.map(async (i) => i.info = await img(i.SERVICEID))
+            console.log(o);
+            list.value = o.items;
+          }
+        }
+      });
+    });
+
+    function handleQuery(record: Recordable) {
+      console.log("11111:", record)
+      openDrawer(true, {
+        record,
+      });
+    }
+
+    return {
+      registerModal,
+      list,
+      handleQuery,
+    };
+  },
+});
+</script>
+
+<style scoped>
+.datacenter-right .resource_list .item-title .r_name {
+  color: #5e5d5e;
+  display: inline-block;
+  width: 190px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.datacenter-right .resource_list {
+  box-sizing: border-box;
+  width: 100%;
+  float: left;
+  clear: both;
+  display: flex;
+  flex-wrap: wrap;
+  align-items: center;
+}
+
+.datacenter-right .resource_list>div:not(:nth-of-type(4n + 4)) {
+  margin-right: 7px;
+}
+
+.resource_item {
+  height: 318px;
+  width: 224px;
+  margin-bottom: 14px;
+  border: 2px dashed transparent;
+}
+
+.mapItem-top-box {
+  height: 278px;
+  border: 1px solid #dfdfdf;
+  border-bottom: none;
+}
+
+.datacenter-right .resource_list .operation-box {
+  height: 42px;
+  border: 1px solid #dfdfdf;
+  display: flex;
+  margin-bottom: 10px;
+}
+
+.datacenter-right .resource_list .item-top {
+  padding: 13px;
+}
+
+.datacenter-right .resource_list .item-top img {
+  width: 198px;
+  height: 124px;
+}
+
+.datacenter-right .resource_list .item-title {
+  font-size: 14px;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: #5e5d5e;
+  line-height: 16px;
+  padding: 0 0 0 14px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.datacenter-right .resource_list .item-msg {
+  padding: 0 13px 13px;
+}
+
+.img_container {
+  text-align: center;
+}
+
+.img_container {
+  width: 100%;
+  height: 100%;
+  background: #b7bed3;
+  border-radius: 4px;
+}
+
+.datacenter-right .resource_list .item-msg-val {
+  font-size: 12px;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: #5e5d5e;
+  line-height: 22px;
+  opacity: 0.5;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.datacenter-right .resource_list .operation-item {
+  width: 50%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.datacenter-right .resource_list .operation-item.alone-apply-btn {
+  display: none;
+}
+
+.datacenter-right .resource_list .operation-item {
+  width: 50%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.datacenter-right .resource_list .operation-item {
+  width: 50%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.datacenter-right .resource_list .operation-item a {
+  font-size: 12px;
+  width: 100%;
+  text-align: center;
+  color: #5e5d5e;
+  background-color: #ffffff;
+}
+</style>

+ 45 - 22
src/views/resource/plat/item/FileData.vue

@@ -1,4 +1,5 @@
 <template>
+  <Search></Search>
   <div style="background-color: #f0f2f5" class="dark:bg-dark-900">
     <div class="datacenter-right">
       <div class="resource_list" id="map_list">
@@ -8,7 +9,7 @@
             <div class="item-top">
               <div class="img_container" data-num="1">
                 <img class="tab-list-icon-img-MR00001936 img_mr MR00001936"
-                  :src="i.info && i.info.length && i.info[0].thumbnail" alt="">
+                  :src="(i.info && i.info.length && i.info[0].thumbnail) || '/static/img/default-dr3.jpg'" alt="">
               </div>
             </div>
             <div class="item-title">
@@ -24,8 +25,7 @@
           </div>
           <div class="operation-box">
             <div class="operation-item browse-item-btn browse-item-MR00001936">
-              <a target="_blank" :href="`../../mapview.html?/iserver/services/map-16/rest/maps/LZS16envi1%4016.ijs`"
-                style="border-right: 1px #ccc solid;">
+              <a target="_blank" :href="(i.info && i.info.length && i.info[0].thumbnail) || '/static/img/default-dr3.jpg'">
                 <span>浏览</span>
               </a>
             </div>
@@ -47,6 +47,16 @@
                 <span>详细</span>
               </a>
             </div>
+            <div class="operation-item" @click="handleQuery(i)">
+              <a href="javascript:void(0)" class="">
+                <span>加入申请库</span>
+              </a>
+            </div>
+            <div class="operation-item operation-item-active" @click="handleQuery(i)">
+              <a href="javascript:void(0)" class="">
+                <span>已加入申请库</span>
+              </a>
+            </div>
           </div>
         </div>
       </div>
@@ -101,11 +111,12 @@ import { platList, img } from '/@/api/resource/plat';
 import { useDrawer } from '/@/components/Drawer';
 // 导入子页面【新增、修改】
 import MapDrawer from './MapDrawer.vue';
+import Search from './child/Search.vue';
 
 
 export default defineComponent({
   name: 'SmsLog',
-  components: { BasicTable, TableAction, Authority, Popconfirm, Tooltip, MapDrawer },
+  components: { BasicTable, TableAction, Search, Authority, Popconfirm, Tooltip, MapDrawer },
   setup() {
     const [registerModal, { openDrawer }] = useDrawer(); //使用右侧弹出框
     const list = ref([]);
@@ -177,19 +188,24 @@ export default defineComponent({
   width: 224px;
   margin-bottom: 14px;
   border: 2px dashed transparent;
+
+  width: 386px;
+  height: 402px;
+  border-radius: 4px;
+  opacity: 1;
+  background: #FFFFFF;
+  border: 1px solid #DEDEDE;
 }
 
 .mapItem-top-box {
-  height: 278px;
-  border: 1px solid #dfdfdf;
-  border-bottom: none;
+  height: 350px;
 }
 
 .datacenter-right .resource_list .operation-box {
   height: 42px;
-  border: 1px solid #dfdfdf;
   display: flex;
   margin-bottom: 10px;
+  margin-left: 20px;
 }
 
 .datacenter-right .resource_list .item-top {
@@ -197,8 +213,9 @@ export default defineComponent({
 }
 
 .datacenter-right .resource_list .item-top img {
-  width: 198px;
-  height: 124px;
+  width: 360px;
+  height: 190px;
+  border: solid 1px #eeebeb;
 }
 
 .datacenter-right .resource_list .item-title {
@@ -241,28 +258,35 @@ export default defineComponent({
 }
 
 .datacenter-right .resource_list .operation-item {
-  width: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
+  min-width: 50px;
+  height: 34px;
+  opacity: 1;
+  margin-right: 22px;
+  padding: 0 10px;
+  background: #E8E8E8;
+}
+
+.datacenter-right .resource_list .operation-item:hover {
+  background: #0671DD;
+}
+
+.datacenter-right .resource_list .operation-item:hover a {
+  color: #fff;
 }
 
 .datacenter-right .resource_list .operation-item.alone-apply-btn {
   display: none;
 }
 
-.datacenter-right .resource_list .operation-item {
-  width: 50%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
+.operation-item-active {
+  background: #05B069 !important;
 }
 
-.datacenter-right .resource_list .operation-item {
-  width: 50%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
+.operation-item-active a {
+  color: #fff !important;
 }
 
 .datacenter-right .resource_list .operation-item a {
@@ -270,6 +294,5 @@ export default defineComponent({
   width: 100%;
   text-align: center;
   color: #5e5d5e;
-  background-color: #ffffff;
 }
 </style>

+ 66 - 29
src/views/resource/plat/item/MapData.vue

@@ -1,4 +1,5 @@
 <template>
+  <Search></Search>
   <div style="background-color: #f0f2f5" class="dark:bg-dark-900">
     <div class="datacenter-right">
       <div class="resource_list" id="map_list">
@@ -24,8 +25,7 @@
           </div>
           <div class="operation-box">
             <div class="operation-item browse-item-btn browse-item-MR00001936">
-              <a target="_blank" :href="`../../mapview.html?/iserver/services/map-16/rest/maps/LZS16envi1%4016.ijs`"
-                style="border-right: 1px #ccc solid;">
+              <a target="_blank" :href="`../../mapview.html?/iserver/services/map-16/rest/maps/LZS16envi1%4016.ijs`">
                 <span>浏览</span>
               </a>
             </div>
@@ -35,18 +35,21 @@
                 <span>申请</span>
               </span>
             </div>
-            <!-- <div class="user-apply-btn user-apply-btn-MR00001936"
-              onclick="addApplyBank(this,'MR00001936','行政区域','1','测试数据','mr','2000坐标系4490')">
-              <span>加入申请库</span>
-            </div>
-            <div class="dis-apply-btn dis-apply-btn-MR00001936">
-              <span>已加入申请库</span>
-            </div> -->
             <div class="operation-item" @click="handleQuery(i)">
               <a href="javascript:void(0)" class="">
                 <span>详细</span>
               </a>
             </div>
+            <div class="operation-item" @click="applyWay(i)">
+              <a href="javascript:void(0)" class="">
+                <span>加入申请库</span>
+              </a>
+            </div>
+            <div class="operation-item operation-item-active" @click="handleQuery(i)">
+              <a href="javascript:void(0)" class="">
+                <span>已加入申请库</span>
+              </a>
+            </div>
           </div>
         </div>
       </div>
@@ -96,16 +99,19 @@ import { BasicTable, useTable, TableAction } from '/@/components/Table';
 import { columns, searchFormSchema } from './sms.data';
 import { Popconfirm, Tooltip } from 'ant-design-vue';
 import { Authority } from '/@/components/Authority';
-import { platList, img } from '/@/api/resource/plat';
+import { platList, img, apply } from '/@/api/resource/plat';
+import { message } from 'ant-design-vue';
 // 加载自定义侧边弹出框 组件
 import { useDrawer } from '/@/components/Drawer';
 // 导入子页面【新增、修改】
 import MapDrawer from './MapDrawer.vue';
+import Search from './child/Search.vue';
+import { session } from '/@/utils/Memory';
 
 
 export default defineComponent({
   name: 'SmsLog',
-  components: { BasicTable, TableAction, Authority, Popconfirm, Tooltip, MapDrawer },
+  components: { BasicTable, TableAction, Authority, Search, Popconfirm, Tooltip, MapDrawer },
   setup() {
     const [registerModal, { openDrawer }] = useDrawer(); //使用右侧弹出框
     const list = ref([]);
@@ -135,7 +141,26 @@ export default defineComponent({
       });
     }
 
+    function applyWay(i) {
+      console.log(i)
+      apply({
+        addRes: [{
+          resDataType: "1",
+          resId: i.SERVICEID,
+          resName: `${i.SERVICENAME}(${i.CRS})`,
+          resType: 0,
+          workflowType: "MAP",
+        }],
+        userId: session.getItem('userId'),
+      }).then((r) => {
+        if (r.datas && r.resp_code == 0) {
+          message.success('申请成功');
+        }
+      })
+    }
+
     return {
+      applyWay,
       registerModal,
       list,
       handleQuery,
@@ -173,19 +198,24 @@ export default defineComponent({
   width: 224px;
   margin-bottom: 14px;
   border: 2px dashed transparent;
+
+  width: 386px;
+  height: 402px;
+  border-radius: 4px;
+  opacity: 1;
+  background: #FFFFFF;
+  border: 1px solid #DEDEDE;
 }
 
 .mapItem-top-box {
-  height: 278px;
-  border: 1px solid #dfdfdf;
-  border-bottom: none;
+  height: 350px;
 }
 
 .datacenter-right .resource_list .operation-box {
   height: 42px;
-  border: 1px solid #dfdfdf;
   display: flex;
   margin-bottom: 10px;
+  margin-left: 20px;
 }
 
 .datacenter-right .resource_list .item-top {
@@ -193,8 +223,9 @@ export default defineComponent({
 }
 
 .datacenter-right .resource_list .item-top img {
-  width: 198px;
-  height: 124px;
+  width: 360px;
+  height: 190px;
+  border: solid 1px #eeebeb;
 }
 
 .datacenter-right .resource_list .item-title {
@@ -237,28 +268,35 @@ export default defineComponent({
 }
 
 .datacenter-right .resource_list .operation-item {
-  width: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
+  min-width: 50px;
+  height: 34px;
+  opacity: 1;
+  margin-right: 22px;
+  padding: 0 10px;
+  background: #E8E8E8;
+}
+
+.datacenter-right .resource_list .operation-item:hover {
+  background: #0671DD;
+}
+
+.datacenter-right .resource_list .operation-item:hover a {
+  color: #fff;
 }
 
 .datacenter-right .resource_list .operation-item.alone-apply-btn {
   display: none;
 }
 
-.datacenter-right .resource_list .operation-item {
-  width: 50%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
+.operation-item-active {
+  background: #05B069 !important;
 }
 
-.datacenter-right .resource_list .operation-item {
-  width: 50%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
+.operation-item-active a {
+  color: #fff !important;
 }
 
 .datacenter-right .resource_list .operation-item a {
@@ -266,6 +304,5 @@ export default defineComponent({
   width: 100%;
   text-align: center;
   color: #5e5d5e;
-  background-color: #ffffff;
 }
 </style>

+ 98 - 0
src/views/resource/plat/item/child/Search.vue

@@ -0,0 +1,98 @@
+<template>
+    <div class="wrapper">
+        <span class="sqrk">申请入库(1)</span>
+        <span>
+            <a-select ref="select" v-model:value="value" style="width: 200px" :options="options" @focus="focus"
+                @change="handleChange">
+            </a-select>
+        </span>
+        <span>
+            <a-input-search v-model:value="key" placeholder="请输入搜索内容" style="width: 200px" @search="onSearch" />
+        </span>
+        <div>
+            <a-checkbox v-model:checked="checked1">全部</a-checkbox>
+            <a-checkbox v-model:checked="checked2">测试数据1</a-checkbox>
+            <a-checkbox v-model:checked="checked3">测试数据2</a-checkbox>
+            <a-checkbox v-model:checked="checked4">测试数据3</a-checkbox>
+        </div>
+    </div>
+</template>
+
+
+<script lang="ts">
+import { defineComponent, ref, computed, unref } from 'vue';
+export default defineComponent({
+    name: 'Search',
+    components: {},
+    setup() {
+        const value = ref<string>('1');
+        const key = ref<string>('');
+        const checked1 = ref<boolean>(false);
+        const checked2 = ref<boolean>(false);
+        const checked3 = ref<boolean>(false);
+        const checked4 = ref<boolean>(false);
+            
+        const options = ref<SelectTypes['options']>([
+            {
+                value: '1',
+                label: '已审核',
+            },
+            {
+                value: '2',
+                label: '未审核',
+            },
+            {
+                value: '3',
+                label: '未通过',
+            },
+        ]);
+
+        function onSearch() {
+
+        }
+
+        return {
+            options,
+            value,
+            key,
+            onSearch,
+            checked1,
+            checked2,
+            checked3,
+            checked4,
+        };
+    },
+});
+</script>
+<style scoped>
+.wrapper>div {
+    float: right;
+    height: 32px;
+    padding: 5px 0;
+}
+
+.wrapper>span {
+    display: inline-block;
+    margin-right: 30px
+}
+
+.wrapper {
+    width: 100%;
+    height: 54px;
+    border-radius: 4px;
+    background: #edebeb;
+    padding: 11px;
+    margin-bottom: 20px
+}
+
+.sqrk {
+    width: 94px;
+    height: 32px;
+    background: #0671DD;
+    color: #fff;
+    line-height: 32px;
+    display: block;
+    text-align: center;
+    border-radius: 4px;
+}
+</style>