2 Komitmen 7a3537d259 ... a7fbd479ab

Pembuat SHA1 Pesan Tanggal
  nanshan a7fbd479ab Merge branch 'cy' of http://39.105.160.25:10880/post-project-ui/post-ui into cy 2 tahun lalu
  nanshan f1cfdad32f 上架 2 tahun lalu

+ 18 - 1
src/api/collection/collection.js

@@ -6,4 +6,21 @@ export function collectionList(params){
       url:'/system/collections/list',
       params
     })
-  }
+  }
+
+export function addcollections(data){
+  return request({
+    url: "/system/collections/insert",
+    method:"post",
+    data,
+  });
+}
+
+// 上传文件
+export function upload(file) {
+  return request({
+    url: "/file/upload",
+    method: "post",
+    data: file,
+  });
+}

+ 7 - 0
src/api/notice/notice.js

@@ -27,3 +27,10 @@ export function deleteNotice(id) {
         method: 'delete'
     })
 }
+
+export function searchNotice(params) {
+    return request({
+      url: '/system/poNotice/list',
+      params 
+    })
+  }

+ 6 - 6
src/api/sets/index.js

@@ -70,12 +70,12 @@ export function updataEndtime(data){
 }
 
 //上架
-// export function isGrounding(grounding,tetherId){
-//   return request({
-//     url:/system/tether/isGrounding/ + grounding + "/"+ tetherId,
-//     method:'post',
-//   })
-// }
+export function Grounding(grounding,tetherId){
+  return request({
+    url:"/system/tether/isGrounding/" + grounding + "/"+ tetherId,
+    method:'post',
+  })
+}
 
 
 // 藏品列表

+ 7 - 0
src/router/index.js

@@ -195,6 +195,13 @@ export const constantRoutes = [
         name: 'collectionDetails',
         meta: { title: '藏品详情', icon: 'list' },
         hidden: true
+      },
+      {
+        path: 'addcollections',
+        component: () => import('@/views/sets/addcollections'),
+        name: 'addcollections',
+        meta: { title: '添加藏品', icon: 'list' },
+        hidden: true
       }
     ]
   }

+ 26 - 20
src/views/notice/noticeList.vue

@@ -6,7 +6,7 @@
           <h3 class="el-icon-search" style="margin-left: 10px;">筛选搜索</h3>
           <div id="header-one-btu">
             <el-button @click="empty">重置</el-button>
-            <el-button type="primary">搜索</el-button>
+            <el-button type="primary" @click="check">搜索</el-button>
           </div>
         </div>
         <div id="header-two">
@@ -14,15 +14,15 @@
             <el-col :span="4" id="header-two-left">
               <el-form ref="anFormRef" :model="anForm" label-width="80px">
                 <el-form-item label="公告标题 :">
-                  <el-input v-model="anForm.anName" class="anInput" placeholder="筛选公告标题" center></el-input>
+                  <el-input v-model="input.value1" class="anInput" placeholder="筛选公告标题" center></el-input>
                 </el-form-item>
               </el-form>
             </el-col>
             <el-col :span="8">
               <el-form label-width="80px">
                 <el-form-item label="发布时间:">
-                  <el-date-picker v-model="dataput" type="datetimerange" class="up-input-right" range-separator="至"
-                    start-placeholder="开始日期" end-placeholder="结束日期" align="right">
+                  <el-date-picker v-model="input.value2" type="datetime"
+                    placeholder="开始日期"  align="right">
                   </el-date-picker>
                 </el-form-item>
               </el-form>
@@ -57,7 +57,7 @@
   </div>
 </template>
 <script>
-import { getNotice, deleteNotice } from "@/api/notice/notice"
+import { getNotice, deleteNotice ,searchNotice} from "@/api/notice/notice"
 export default {
   data() {
     return {
@@ -71,6 +71,10 @@ export default {
         pageNum: 1,
         pageSize: 10
       },
+      input:{
+        value1: '', // 搜索姓名
+        value2: ''  // 搜索时间
+      }
     }
   },
   created() {
@@ -100,7 +104,7 @@ export default {
     },
     // 重置按钮
     empty() {
-      this.anForm.anName = "";
+      this.input.value1 = "";
       this.dataput = "";
       this.getnotice();
     },
@@ -128,22 +132,24 @@ export default {
           message: '已取消删除'
         });
       });
-    }
+    },
 
     /**搜索按钮 */  // 没找到具体接口
-    // check() {
-    //   if (this.anForm.anName) {
-    //     let con = {
-    //       name: this.anForm.anName
-    //     }
-    //     searchNotice(con).then((data) => {
-    //       this.tableData = data.list;
-    //       this.total = data.count;
-    //     })
-    //   } else {
-    //     this.getnotice();
-    //   }
-    // },
+    check() {
+      if (this.input.value1 || this.input.value2) {
+        
+        let searchCon = {
+          noticeTitle: this.input.value1,
+          createTime: this.input.value2,
+        }
+        searchNotice(searchCon).then((res) => { 
+          this.tableData = res.rows; 
+          this.total = res.total;
+        })
+      } else {
+        this.getnotice();
+      }
+    }
   }
 };
 

+ 194 - 0
src/views/sets/addcollections.vue

@@ -0,0 +1,194 @@
+<template>
+  <div>
+    <div class="addfrom">
+      <div class="addcenter">
+        <span>有点问题先别试</span>
+        <el-form
+          ref="pubform"
+          label-width="100px"
+          :style="{ border: '1px soild #ccc' }"
+          :model="pubform"
+          :rules="rules"
+        >
+          <el-form-item label="藏品名称" prop="collectionTitle">
+            <el-input v-model="pubform.collectionTitle"></el-input>
+          </el-form-item>
+
+          <el-form-item label="售卖时间" >
+            <el-date-picker
+            type="datetime"
+            placeholder="起始时间"
+            v-model="pubform.showStart"
+            value-format="yyyy-MM-dd HH:mm:ss"
+          >
+          </el-date-picker>
+          <el-date-picker
+            type="datetime"
+            placeholder="结束时间"
+            v-model="pubform.showEnd"
+            value-format="yyyy-MM-dd HH:mm: ss"
+          >
+          </el-date-picker>
+          </el-form-item>
+
+          <el-form-item label="藏品价格" prop="colPrice">
+            <el-input v-model="pubform.colPrice"></el-input>
+          </el-form-item>
+
+          <el-form-item label="藏品状态" prop="remark">
+            <el-input v-model="pubform.remark"></el-input>
+          </el-form-item>
+
+          <el-form-item label="藏品数量" prop="colCount">
+            <el-input v-model="pubform.colCount"></el-input>
+          </el-form-item>
+
+          <el-form-item label="藏品图片" prop="colImage">
+            <el-upload
+              class="avatar-uploader"
+              action="http://39.105.160.25:10996"
+              :show-file-list="false"
+              :on-success="handleAvatarSuccess"
+              :before-upload="beforeAvatarUpload"
+            >
+              <img
+                v-if="this.pubform.colImage"
+                :src="this.pubform.colImage"
+                class="avatar"
+              />
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+            </el-upload>
+          </el-form-item>
+
+          <el-form-item label="备注" prop="colStory">
+            <el-input
+              type="textarea"
+              :rows="4"
+              v-model="pubform.colStory"
+            ></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="submitpub">提交</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { addcollections,upload } from "../../api/collection/collection";
+export default {
+  name: "addPublisher",
+  // props: ["issuerID"],
+  data() {
+    return {
+      imageUrl: "",
+      fileList: [], //上传的文件列表
+      pubform: {
+        collectionTitle: "",
+        colPrice: "",
+        remark: "",
+        colImage: "",
+        colStory: "",
+        showEnd:'',
+        showStart:'',
+        colCount:''
+      },
+
+      rules: {
+        pname: [
+          { required: true, message: "请输入发行方名称", trigger: "blur" },
+        ],
+      },
+    };
+  },
+
+
+  methods: {
+    handleAvatarSuccess() {
+      console.log("上传成功");
+    },
+    beforeAvatarUpload(file) {
+      let formData = new FormData();
+      formData.append("file", file);
+      upload(formData).then((res) => {
+        console.log(res);
+        this.pubform.colImage = res.url;
+      });
+    },
+
+    submitpub() {
+      let valid = this.$refs.pubform.validate().catch((err) => false);
+      if (!valid) {
+        this.$notify({
+          title: "警告",
+          message: "请填写内容",
+          type: "warning",
+        });
+      }
+
+      addcollections(this.pubform).then(() => {
+        this.pubform.collectionTitle = "";
+        this.pubform.showStart = "";
+        this.pubform.colPrice = "";
+        this.pubform.remark = "";
+        this.pubform.colImage = "";
+        this.pubform.colStory = "";
+        this.pubform.showEnd = "";
+        this.pubform.colCount= ""
+      
+      });
+      this.$notify({
+        title: "成功",
+        message: "创建消息成功",
+        type: "success",
+      });
+    },
+  },
+};
+</script>
+
+<style>
+.addfrom {
+  margin: auto;
+  width: 70%;
+  border: solid 2px #fcf6f6;
+  margin-top: 40px;
+  border-radius: 4px;
+}
+.addcenter {
+  margin: auto;
+  width: 60%;
+  margin-top: 40px;
+}
+
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+  width: 200px;
+  height: 200px;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+}
+
+.avatar {
+  width: 100%;
+  height: 100%;
+  display: block;
+}
+</style>

+ 23 - 4
src/views/sets/collectionList.vue

@@ -2,10 +2,15 @@
   <div>
     <div class="header">
       <el-row :style="{ margin: '12px' }">
-        <el-col :span="12">
+        <el-col :span="22">
           <i class="el-icon-search"></i>
           <span :style="{ padding: '4px' }">藏品列表</span>
+         
         </el-col>
+        <el-col :span="2">
+          <el-button @click="addcollist" >添加藏品</el-button>
+        </el-col>
+
       </el-row>
     </div>
     <div class="footer">
@@ -101,16 +106,30 @@ export default {
         pageSize: 10,
       },
       total: 1,
-      tableData: [],
+      tableData: [
+        {
+          collectionId:'1',
+          collectionTitle:'这是第一个',
+          showStart:'2023-02-12 03:42:08',
+          colPrice:20,
+          status:'在售卖',
+          colCount:20,
+
+
+        }
+      ],
     };
   },
   mounted() {
     // this.getcollectionList();
-    this.init();
+    // this.init();
   },
   methods: {
+    addcollist(){
+      this.$router.push("./addcollections");
+    },
     init() {
-      let colList = JSON.parse(JSON.stringify(this.$route.params.rows));
+      let colList =this.$route.params.rows;
       console.log(colList);
       setTimeout(() => {
         collecctionList(colList.tetherId).then((res) => {

+ 22 - 19
src/views/sets/setList.vue

@@ -110,10 +110,10 @@
             width="200"
             align="center"
           >
-            <template slot-scope="scope">  
-                 <el-tag size="medium" >
-                  {{ scope.row.grounding  == '1' ? '未上架' : '已上架' }}
-                </el-tag>
+            <template slot-scope="scope">
+              <el-tag size="medium" :type=" scope.row.grounding == '0' ? 'success' : 'warning' ">
+                {{ scope.row.grounding == "0" ? "已上架" : "未上架" }}
+              </el-tag>
             </template>
           </el-table-column>
           <el-table-column prop="edit" label="操作" width="280" align="center">
@@ -122,7 +122,9 @@
                 >藏品列表</el-button
               >
               <el-row>
-                <el-button type="text" @click="upJia(scope.row)">上架</el-button>
+                <el-button type="text" @click="upJia(scope.row)"
+                  >上架</el-button
+                >
                 <el-button type="text" @click="CurendTime(scope.row)"
                   >修改时间</el-button
                 >
@@ -175,7 +177,7 @@ import {
   advanceList,
   selledList,
   updataEndtime,
-  
+  Grounding,
 } from "@/api/sets/index";
 export default {
   data() {
@@ -197,8 +199,8 @@ export default {
       endTime: [],
       showEnd: "",
       showendtime: "",
-      tetherId:'',
-      grounding:''
+      tetherId: "",
+      grounding: "",
     };
   },
   mounted() {
@@ -206,19 +208,18 @@ export default {
     this.sellingsList();
   },
   methods: {
-   
     submitTime(data) {
       this.dialogFormVisible = false;
       if (!this.showendtime) return;
       console.log(this.showendtime);
       let time = {
-        showTimeEnd:this.showendtime,
-        tetherId:this.tetherId
-      }
-      console.log(time)
+        showTimeEnd: this.showendtime,
+        tetherId: this.tetherId,
+      };
+      console.log(time);
       let { code } = updataEndtime(time).catch((err) => err);
       // console.log(code);
-      this.$message("修改成功,请刷新界面")
+      this.$message("修改成功,请刷新界面");
       // this.sellingsList();
       // this.advancesList();
       // this.selledsList();
@@ -227,7 +228,7 @@ export default {
       console.log(data);
       this.dialogFormVisible = true;
       this.showEnd = data.showTimeEnd;
-      this.tetherId=data.tetherId;
+      this.tetherId = data.tetherId;
     },
     handleCurrentChange(newPage) {
       this.pageInfo.pageNum = newPage;
@@ -315,10 +316,12 @@ export default {
         type: "warning",
       })
         .then(() => {
-       
-          this.$message({
-            type: "success",
-            message: "上架成功!",
+          row.grounding = 0;
+          Grounding(row.grounding, row.tetherId).then(() => {
+            this.$message({
+              type: "success",
+              message: "上架成功!",
+            });
           });
         })
         .catch(() => {