Procházet zdrojové kódy

添加广场界面,修改文件列表和上传界面

chillqi před 3 roky
rodič
revize
b02b24d0da

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1020 - 1
package-lock.json


+ 1 - 1
package.json

@@ -18,7 +18,7 @@
     "vue-i18n": "^9.0.0",
     "vue-router": "^4.0.10",
     "vue-schart": "^2.0.0",
-    "vuex": "^4.0.2",
+    "vuex": "^4.1.0",
     "wangeditor": "^4.7.4"
   },
   "devDependencies": {

+ 1 - 0
src/api/_prefix.js

@@ -7,5 +7,6 @@ export const PIC_MODULE= `${API_MODULE}/picture`
 export const POST_MODULE=`${NEW_API_MODULE}/posts`
 export const COMMENT_MODULE=`${NEW_API_MODULE}/comment`
 export const MAIL_MODULE=`${NEW_API_MODULE}/mail`
+export const SQUARE_MODULE= `${NEW_API_MODULE}/square`
 
 

+ 4 - 0
src/api/file.js

@@ -305,3 +305,7 @@ export const analysisFile = (fieldIds,funcId) => {
     //     "data": ""
     // })
 }
+
+export const shareFile = (userId,fileId) => {
+
+}

+ 26 - 0
src/api/square.js

@@ -0,0 +1,26 @@
+import {axios} from '../utils/request'
+import {SQUARE_MODULE} from "./_prefix";
+
+export const sharedFileList = userId => {
+    return axios.get(`${SQUARE_MODULE}/sharedFileList`, {
+        params: {
+            userId: userId
+        }
+    }).then(res => {
+            return res;
+        }
+    )
+}
+
+export const sharedModelList = userId => {
+    return axios.get(`${SQUARE_MODULE}/sharedModelList`, {
+        params: {
+            userId: userId
+        }
+    }).then(res => {
+            return res;
+        }
+    )
+}
+
+

+ 6 - 0
src/components/Sidebar.vue

@@ -108,6 +108,12 @@ export default {
             title: "数据分析",
           },
 
+          {
+            icon: "el-icon-office-building",
+            index: "/newSquare",
+            title: "数据广场",
+          },
+
           {
               icon: "el-icon-user",
               index: "/user",

+ 10 - 2
src/router/index.js

@@ -1,6 +1,6 @@
 import {createRouter, createWebHashHistory} from "vue-router";
 import Home from "../views/Home.vue";
-import squareLayout from "../views/square.vue";
+import squareLayout from "../views/Square.vue";
 
 const routes = [
     {
@@ -114,6 +114,14 @@ const routes = [
                 },
                 component: () => import ( /* webpackChunkName: "upload" */ "../views/file/Upload.vue")
             },
+            {
+                path: "/newSquare",
+                name: "newSquare",
+                meta: {
+                    title: '数据广场'
+                },
+                component: () => import ( /* webpackChunkName: "upload" */ "../views/newSquare.vue")
+            },
             {
                 path: '/user',
                 name: 'user',
@@ -228,7 +236,7 @@ const routes = [
         meta: {
             title: '登录'
         },
-        component: () => import ( /* webpackChunkName: "login" */ "../views/unused/Login.vue")
+        component: () => import ("../views/user/Login.vue")
     }
 ];
 

+ 516 - 0
src/views/Square.vue

@@ -0,0 +1,516 @@
+<template>
+  <el-container style="height:100%; background: url(src/assets/img/earth.jpg)" direction="vertical">
+    <v-header style="height: 70px" @getCollection="getCollection()" @getMine="getMine()"></v-header>
+
+    <el-main>
+      <div class="el-menu-demo" >
+        <el-menu :default-active="activeIndex" mode="horizontal" @select="handleSelect"
+                 background-color="transparent" text-color="#fff" active-text-color="#ffd04b">
+          <el-menu-item index="1">数据</el-menu-item>
+          <el-menu-item index="2">模型</el-menu-item>
+        </el-menu>
+      </div>
+
+      <div class="grid-content">
+        <el-input placeholder="请输入内容" v-model="input" class="searchClass">
+          <template #append>
+            <el-button icon="el-icon-search" @click="handleSearch"/>
+          </template>
+        </el-input>
+      </div>
+
+      <div class="postList">
+        <div style="" v-for="(post, index) in postList" :key="post.postId"
+             v-show="index >= (currentPage-1)*8 && index < currentPage*4">
+          <el-card shadow="hover"
+                   style="height: 120px; margin-bottom: 10px; border-radius: 10px; background-color: #262626">
+            <div class="taskTitle">
+              <span style="font-size: 18px; font-weight: bold;color: #eeeeee">{{ post.title }}</span>
+            </div>
+            <div class="desciption">
+              <div class="ellipsis-line" style="font-size: 14px; width: 800px; float: left; color: #dbd0d0; margin-top: 10px">
+                {{ post.content }}
+              </div>
+              <div style="font-size: 5px; width: 150px; float: left; color: #dbd0d0; margin-top: 10px">
+                <i class="el-icon-thumb" style="color: white ;"></i>
+                {{ post.praise }}
+                <i class="el-icon-chat-line-round" style="color: white"></i>
+                {{ post.comment_num }}
+                <i class="el-icon-time" style="color: white ;"></i>
+                {{ post.updateTime }}
+              </div>
+              <el-button style="float: right;" size="small" type="warning" @click="handlePostDetail(post.postId)"
+                         round>查看详情
+              </el-button>
+            </div>
+
+          </el-card>
+        </div>
+        <el-pagination
+                layout="prev, pager, next"
+                :total="pages"
+                style="float: right; margin-top: 10px; padding-bottom: 20px;"
+                :current-page.sync="currentPage"
+                background>
+        </el-pagination>
+      </div>
+    </el-main>
+
+  </el-container>
+  <el-dialog :title="title" v-model="collectionDetailVisble" min-width="30%" width="66%" style="">
+    <span style="font-size: 18px; font-weight: bold;color: black;">{{ currentPost.content }}</span>
+    <el-form ref="formRef" label-width="120px">
+      <el-form-item label="模型类型名:" >
+        {{config.modelTypeName}}
+      </el-form-item>
+      <el-form-item label="模型描述:" >
+        {{config.modelDes}}
+      </el-form-item>
+      <el-form-item label="模型详情:" >
+        {{}}
+      </el-form-item>
+      <el-form-item label="特征字段:" >
+        <el-table :data="tableData" border class="table"  ref="fieldTable" header-cell-class-name="table-header" @selection-change="">
+          <el-table-column label="字段名" width="120%">
+            <template #default="scope"><span>{{ scope.row.fieldName }}</span></template>
+          </el-table-column>
+          <el-table-column label="别名">
+            <template #default="scope">{{ scope.row.aliasName }}</template>
+          </el-table-column>
+          <el-table-column label="描述">
+            <template #default="scope">{{ scope.row.fieldDes }}</template>
+          </el-table-column>
+          <el-table-column label="取值类型">
+            <template #default="scope">{{ scope.row.fieldType }}</template>
+          </el-table-column>
+          <el-table-column label="分布类型">
+            <template #default="scope">{{ scope.row.conOrDis }}</template>
+          </el-table-column>
+          <el-table-column label="空值率">
+            <template #default="scope">{{ scope.row.nullsRatio }}</template>
+          </el-table-column>
+
+          <el-table-column label="值域" width="150%">
+            <template #default="scope">{{ scope.row.valueInfo }}</template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+
+      <el-form-item label="模型列表:" >
+        <el-table :data="modelData" border class="table" ref="fieldTable" header-cell-class-name="table-header" @selection-change="">
+          <el-table-column label="模型名" width="150%">
+            <template #default="scope"><span>{{ scope.row.modelName }}</span></template>
+          </el-table-column>
+          <el-table-column label="模型类别" width="150%">
+            <template #default="scope">{{ scope.row.modelDetailName }}</template>
+          </el-table-column>
+          <el-table-column label="训练结果">
+            <template #default="scope" >
+              <div v-if="scope.row.trainedStatus===-1">accuracy:0.87</div>
+              <div v-else="">已训练</div></template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary"  @click="">添加到我的配置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-collapse >
+      <el-collapse-item name="1" title="评论">
+        <div style="margin-top: 20px;border:2px solid #a6a9ad;box-shadow: 0 0 5px rgba(0,0,0,.1);padding: 5px;">
+          <v-write-comment :width="500" :post-id="currentPost.postId" style="margin-left: 250px" >
+          </v-write-comment>
+          <v-comments :comment-list="commentList" :width="800" style="margin-top: 5px;margin-left: 160px"></v-comments>
+        </div>
+      </el-collapse-item>
+      <el-collapse-item title="写信给作者————更加快捷" name="2">
+        <div style="width: 600px;margin-left: 250px">
+          <el-input
+                  type="textarea"
+                  autosize
+                  placeholder="标题"
+                  v-model="mailTitle">
+          </el-input>
+          <div style="margin: 20px 0;"></div>
+          <el-input
+                  type="textarea"
+                  :autosize="{ minRows: 3, maxRows: 5}"
+                  placeholder="正文"
+                  v-model="mailContent">
+          </el-input>
+          <el-button type="danger" icon="el-icon-message" big circle style="margin-left: 600px;" @click="sendMailTo()"></el-button>
+        </div>
+      </el-collapse-item>
+    </el-collapse>
+
+    <template #footer>
+                <span class="dialog-footer">
+                    <el-button @click="detailVisble = false">取 消</el-button>
+                    <el-button type="primary" @click="saveEdit">确 定</el-button>
+                </span>
+    </template>
+  </el-dialog>
+  <el-dialog :title="title" v-model=" squareDetailVisble" min-width="30%" width="66%" style="">
+    <span style="font-size: 18px; font-weight: bold;color: black;">{{ currentPost.content }}</span>
+    <el-form ref="formRef" label-width="120px">
+      <el-form-item label="模型类型名:" >
+        {{config.modelTypeName}}
+      </el-form-item>
+      <el-form-item label="模型描述:" >
+        {{config.modelDes}}
+      </el-form-item>
+      <el-form-item label="模型详情:" >
+        {{}}
+      </el-form-item>
+      <el-form-item label="特征字段:" >
+        <el-table :data="tableData" border class="table"  ref="fieldTable" header-cell-class-name="table-header" @selection-change="">
+          <el-table-column label="字段名" width="120%">
+            <template #default="scope"><span>{{ scope.row.fieldName }}</span></template>
+          </el-table-column>
+          <el-table-column label="别名">
+            <template #default="scope">{{ scope.row.aliasName }}</template>
+          </el-table-column>
+          <el-table-column label="描述">
+            <template #default="scope">{{ scope.row.fieldDes }}</template>
+          </el-table-column>
+          <el-table-column label="取值类型">
+            <template #default="scope">{{ scope.row.fieldType }}</template>
+          </el-table-column>
+          <el-table-column label="分布类型">
+            <template #default="scope">{{ scope.row.conOrDis }}</template>
+          </el-table-column>
+          <el-table-column label="空值率">
+            <template #default="scope">{{ scope.row.nullsRatio }}</template>
+          </el-table-column>
+
+          <el-table-column label="值域" width="150%">
+            <template #default="scope">{{ scope.row.valueInfo }}</template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+
+      <el-form-item label="模型列表:" >
+        <el-table :data="modelData" border class="table" ref="fieldTable" header-cell-class-name="table-header" @selection-change="">
+          <el-table-column label="模型名" width="150%">
+            <template #default="scope"><span>{{ scope.row.modelName }}</span></template>
+          </el-table-column>
+          <el-table-column label="模型类别" width="150%">
+            <template #default="scope">{{ scope.row.modelDetailName }}</template>
+          </el-table-column>
+          <el-table-column label="训练结果">
+            <template #default="scope" >
+              <div v-if="scope.row.trainedStatus===-1">accuracy:0.87</div>
+              <div v-else="">已训练</div></template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+    </el-form>
+    <v-comments :comment-list="commentList" :width="800" style="margin-top: 20px;border:2px solid #a6a9ad;box-shadow: 0 0 5px rgba(0,0,0,.1);padding: 5px;"></v-comments>
+    <template #footer>
+                <span class="dialog-footer">
+                    <el-button @click="detailVisble = false">取 消</el-button>
+                    <el-button type="primary" @click="collect(currentPost.postId)">收藏</el-button>
+                </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+  import vHeader from "../components/SquareHeader.vue";
+  import {searchPost, getPostByPostId, getUserCollection, getUserPost,collection} from "../api/posts";
+  import {getComment} from "../api/comment";
+  import {sendMail} from "../api/mail";
+  import {ref, reactive} from "vue";
+  import {getFileDetail} from "../api/file";
+  import vComments from "../components/Comments.vue"
+  import vWriteComment from "../components/WriteComment.vue"
+  import {getOneConfig} from "../api/config";
+
+  export default {
+    setup() {
+      const collectionDetailVisble = ref(false);
+      const squareDetailVisble = ref(false);
+      const tableData = ref([])
+      return {collectionDetailVisble, tableData, squareDetailVisble};
+    },
+    components: {
+      vHeader, vComments,
+      vWriteComment
+    },
+    data() {
+      return {
+        input: '',
+        select: '',
+        src: "src/assets/img/earth.jpg",
+        fit: 'cover',
+        postList: [
+          {
+            postId: 1,
+            title: "111",
+            content: "123456789",
+            praise: 5,
+            comment_num: 10,
+            updateTime: null,
+          }
+        ],
+        currentPage: 1,
+        title: "12121",
+        currentPost: null,
+        commentList: [],
+        currentState: 0,
+        mailTitle:"",
+        mailContent:"",
+        config: null,
+        modelData:null,
+        activeIndex: 1
+      };
+    },
+
+    methods: {
+      sendMailTo(){
+        sendMail({"title":this.mailTitle,"fromUserId":1,"toUserId":this.currentPost.userId,"content":this.mailContent}).then(res=>{
+          if(res.success){
+            this.$message({
+              message: '发送成功!',
+              type: 'success'
+            });
+            this.mailContent=""
+            this.mailTitle=""
+          }
+          else{
+            this.$message({
+              message: '发送失败!',
+              type: 'fail'
+            });
+          }
+        })
+      },
+      collect(postId){
+        collection({"userId":1,"postId":postId}).then(res =>
+        {
+          if(res.success){
+            this.$message({
+              message: '收藏成功!',
+              type: 'success'
+            });
+          }
+        })
+      },
+      handleSearch() {
+        console.log("doing")
+        searchPost({
+          keyword: this.input,
+          flagList: "",
+          userId: 0
+        }).then(res => {
+          this.postList = res.object
+          console.log(this.postList)
+          this.currentState = 0
+        })
+      },
+      handleCollectionDetail(postId) {
+        const data = ref([])
+        getPostByPostId({"postId": postId}).then(res => {
+          const postDetail = res.object
+          const fileId = postDetail.shareFileList[0]
+          this.currentPost = postDetail
+          this.title = postDetail.title
+
+          getComment({"userId": 1}).then(res => {
+            if (fileId != null) {
+              getOneConfig({"configId":this.currentPost.configId}).then(res => {
+                this.config=res.data
+                data.value=res.data.featureList
+                this.modelData=res.data.modelInfos
+                for (var i = 0; i < data.value.length; i++) {
+                  if (data.value[i].conOrDis === 1) {
+                    data.value[i].conOrDis = "连续值"
+                  } else {
+                    data.value[i].conOrDis = "离散值"
+                  }
+                }
+                this.tableData = data
+                console.log(data)
+                console.log("fileId=" + fileId)
+                this.collectionDetailVisble = true
+              })
+            }
+            this.commentList = res.object
+            console.log(this.commentList)
+          })
+
+        })
+      },
+      handleSearchDetail(postId) {
+        const data = ref([])
+        getPostByPostId({"postId": postId}).then(res => {
+          const postDetail = res.object
+          const fileId = postDetail.shareFileList[0]
+          this.currentPost = postDetail
+          this.title = postDetail.title
+          getComment({"userId": 1}).then(res => {
+            if (fileId != null) {
+              getOneConfig({"configId":this.currentPost.configId}).then(res => {
+                this.config=res.data
+                data.value=res.data.featureList
+                this.modelData=res.data.modelInfos
+                for (var i = 0; i < data.value.length; i++) {
+                  if (data.value[i].conOrDis === 1) {
+                    data.value[i].conOrDis = "连续值"
+                  } else {
+                    data.value[i].conOrDis = "离散值"
+                  }
+                }
+                this.tableData = data
+                this.squareDetailVisble = true
+                console.log(data)
+                console.log("fileId=" + fileId)
+              })
+            }
+            this.commentList = res.object
+            console.log(this.commentList)
+          })
+        })
+      },
+
+      handlePostDetail(postId) {
+        console.log("ddd")
+        if (this.currentState == 1) {
+          this.handleCollectionDetail(postId)
+        }
+        if (this.currentState == 0) {
+          this.handleSearchDetail(postId)
+        }
+
+      },
+
+      getCollection() {
+        getUserCollection({userId: 0}).then(
+                res => {
+                  this.postList = res.object
+                  console.log(this.postList)
+                  this.currentState = 1
+                }
+        )
+      },
+      getMine() {
+        getUserPost({userId: 0}).then(
+                res => {
+                  this.postList = res.object
+                  console.log(this.postList)
+                  this.currentState = 2
+                }
+        )
+      }
+    }
+  }
+
+
+</script>
+
+<style>
+  .header {
+    color: #fff;
+
+  }
+
+  .el-dialog__title {
+    font-size: 26px !important;
+    font-weight: bold;
+    color: black
+  }
+
+  .searchClass {
+    border: 1px solid #262626;
+    border-radius: 20px;
+    background: #1f1e1e;
+    height: 50px;
+  }
+
+  .searchClass .el-input-group__prepend {
+    border: none;
+    background-color: transparent;
+    padding: 0 10px 0 30px;
+  }
+
+  .searchClass .el-input-group__append {
+    border: none;
+    background-color: transparent;
+  }
+
+  .searchClass .el-input__inner {
+    height: 50px;
+    line-height: 36px;
+    border: none;
+    background-color: transparent;
+  }
+
+  .searchClass .el-icon-search {
+    font-size: 16px;
+  }
+
+  .searchClass .centerClass {
+    height: 100%;
+    line-height: 100%;
+    display: inline-block;
+    vertical-align: middle;
+    text-align: right;
+  }
+
+  .searchClass .line {
+    width: 1px;
+    height: 26px;
+    background-color: #262626;
+    margin-left: 14px;
+  }
+
+  .searchClass:hover {
+    border: 1px solid #262626;
+    background: #262626;
+  }
+
+  .searchClass:hover .line {
+    background-color: #D5E3E8;
+  }
+
+  .searchClass:hover .el-icon-search {
+    color: #ffd04b;
+    font-size: 16px;
+  }
+
+  .el-col {
+    border-radius: 30px
+  }
+
+  .el-menu-demo {
+    width: 46%;
+    margin-left: 27%;
+  }
+
+  .grid-content {
+    border-radius: 4px;
+    min-height: 36px;
+    width: 50%;
+    margin-left: 25%;
+  }
+
+  .el-menu-demo .el-menu-item:hover{
+    color: #ffd04b !important;
+    background: linear-gradient(270deg, transparent, transparent)!important;
+  }
+
+  /*.el-input__inner{*/
+  /*  border-radius: 30px!important;*/
+  /*  border-color: #262626!important;*/
+  /*  background-color: #606266!important;*/
+  /*  height: 50px!important;*/
+
+  /*}*/
+
+  .postList {
+    margin-top: 40px;
+    width: 70%;
+    margin-left: 15%;
+  }
+</style>

+ 94 - 38
src/views/file/FileList.vue

@@ -1,57 +1,81 @@
 <template>
-  <div class="">
+  <div>
     <div class="crumbs">
       <el-breadcrumb separator="/">
         <el-breadcrumb-item><i class="el-icon-lx-file"></i> 我的文件</el-breadcrumb-item>
       </el-breadcrumb>
     </div>
 
-    <div class="container">
-          <el-table :data="state.fileList" :show-header="true" style="width: 100%">
-
-            <el-table-column label="文件名">
-              <template #default="scope">
-                <span class="message-title">{{scope.row.fileName}}</span>
-              </template>
-            </el-table-column>
-
-            <el-table-column width="240" label="操作">
-              <template #default="scope">
-                <!----------------------------todo------------------------------->
-                <!----------------------------获取文件详细信息、跳转到响应页面;删除文件------------------------------->
-                <div style="display:flex;width: 100%;justify-content:space-around;">
-                  <el-button size="small" @click="handleFileDetail(scope.row.fileId)">查看详情</el-button>
-
-                <!--  scope.$index 是数组下标,这里再传一个fileId             handleFileDelete(scope.$index,scope.row.fileId)   -->
-                  <el-button size="small" type="danger"  @click="handleDeleteDialog(scope.row.fileId);dialogVisible=true">
-                    删除文件
-                  </el-button>
-                </div>
-              </template>
-            </el-table-column>
-          </el-table>
-
-
-
-        <router-link to="/upload">
-          <el-button type="primary" size="large">文件上传</el-button>
-        </router-link>
+    <div class="container" v-if="ms_username === ''">
+      请<el-button>登录</el-button>后查看!
+    </div>
 
+    <div class="container" v-if="ms_username !== ''">
+      <router-link to="/upload">
+        <el-button type="primary" size="large">上传文件</el-button>
+      </router-link>
+
+      <el-table
+              :data="state.fileList"
+              :show-header="true"
+              style="width: 100%; margin-top: 20px"
+      >
+        <el-table-column label="文件名">
+          <template #default="scope">
+            <span class="message-title">{{scope.row.fileName}}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" width="300">
+          <template #default="scope">
+            <!----------------------------todo------------------------------->
+            <!----------------------------获取文件详细信息、跳转到响应页面;删除文件------------------------------->
+            <div style="display:flex; width: 100%;">
+              <el-button size="small" style="margin-right: 10px"
+                         @click="handleFileDetail(scope.row.fileId)">查看</el-button>
+              <el-button size="small" type="warning" style="margin-right: 10px"
+                         @click="handleShareDialog(scope.row.fileId);shareDialogVisible=true">分享</el-button>
+            <!--  scope.$index 是数组下标,这里再传一个fileId             handleFileDelete(scope.$index,scope.row.fileId)   -->
+              <el-button size="small" type="danger"
+                         @click="handleDeleteDialog(scope.row.fileId);deleteDialogVisible=true">删除</el-button>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
     </div>
 
-    <!--  对话框  -->
     <el-dialog
-        v-model="dialogVisible"
+            v-model="shareDialogVisible"
+            title="确认共享"
+            width="30%"
+            top="30vh"
+    >
+      <span>确认要共享该文件到广场吗?</span>
+      <template #footer>
+      <span class="dialog-footer">
+        <el-button @click="shareDialogVisible = false;">
+          取消
+        </el-button>
+        <el-button type="warning" @click="shareDialogVisible = false;handleFileShare()">
+          确认
+        </el-button>
+      </span>
+      </template>
+    </el-dialog>
+
+    <el-dialog
+        v-model="deleteDialogVisible"
         title="确认删除"
         width="30%"
+        top="30vh"
     >
       <span>确认要删除该文件吗?</span>
       <template #footer>
       <span class="dialog-footer">
-        <el-button @click="dialogVisible = false;toDeleteFileId=0;">
+        <el-button @click="deleteDialogVisible = false;toDeleteFileId=0;">
           取消
         </el-button>
-        <el-button type="danger" @click="dialogVisible = false;toDeleteFileId=0;handleFileDelete()">
+        <el-button type="danger" @click="deleteDialogVisible = false;toDeleteFileId=0;handleFileDelete()">
           确认
         </el-button>
       </span>
@@ -70,6 +94,7 @@ import {ElMessage} from "element-plus";
 export default {
   name: "fileList",
   setup() {
+    const ms_username = localStorage.getItem('ms_username');
     const currentTab = ref("first");
     const router = useRouter();
 
@@ -84,7 +109,11 @@ export default {
         }
       ],
     });
-    let dialogVisible=ref(false);
+
+    let shareDialogVisible=ref(false);
+    let toShareFileId=ref(0);
+
+    let deleteDialogVisible=ref(false);
     let toDeleteFileId=ref(0);
 
     //用户Id => 文件列表
@@ -110,12 +139,32 @@ export default {
       })
     }
 
+    //打开提示确认删除的对话框,将fileId保存下来
+    const handleShareDialog = (fileId)=>{
+      toShareFileId=fileId;
+      console.log("handleShareDialog:"+fileId)
+      //ElMessage.info("要删除的文件Id fileId:"+fileId)
+    }
+
+    const handleFileShare = (fileId)=>{
+      console.log("fileId:"+toShareFileId)
+      shareFile(toDeleteFileId).then(res=>{
+        if(res.status===200){
+          ElMessage.success("分享成功!")
+          getFileList(userId);
+        }
+        else{
+          ElMessage.error("删除失败!错误码:"+res.status)
+        }
+      })
+    }
+
     //打开提示确认删除的对话框,将fileId保存下来
     const handleDeleteDialog = (fileId)=>{
       toDeleteFileId=fileId;
       console.log("handleDeleteDialog")
       console.log("fileId:"+fileId)
-      ElMessage.info("要删除的文件Id fileId:"+fileId)
+      //ElMessage.info("要删除的文件Id fileId:"+fileId)
     }
 
     //删除对应文件
@@ -149,14 +198,21 @@ export default {
     })
 
     return {
+      ms_username,
+
       currentTab,
       state,
 
-      dialogVisible,
+      shareDialogVisible,
+      toShareFileId,
+      handleShareDialog,
+
+      deleteDialogVisible,
       toDeleteFileId,
       handleDeleteDialog,
 
       handleFileDetail,
+      handleFileShare,
       handleFileDelete,
       handlePicDetail,
       handlePicDelete,

+ 143 - 67
src/views/file/Upload.vue

@@ -8,66 +8,112 @@
         <el-breadcrumb-item>文件上传</el-breadcrumb-item>
       </el-breadcrumb>
     </div>
+
     <div class="container">
-      <div>
-        <el-form
-            :model="form"
-            :rules="rules"
-            ref="formRef"
-            label-width="120px"
-        >
-          <!--   文件名:       -->
-          <el-form-item label="文件重命名" prop="fileName"  style="width: 400px;">
-            <el-input placeholder="在此填写上传后的文件名" v-model="form.fileName">
-              <template #append>.csv</template>
-            </el-input>
-          </el-form-item>
-
-          <el-form-item label="上传文件">
-            <!-- accept接收文件类型,auto-upload:false 关闭自动上传,drag 允许拖动,name=file,上传文件的字段名           -->
-            <!-- file-list:接收文件上传的数组,before-upload:配合accept属性,检查文件类型、后缀,before-remove:删除提醒           -->
-            <!-- on-change:获取文件,将文件保存在fileList里;limit:最多上传文件数           -->
-            <el-upload
-                ref="uploadRef"
-                accept='text/csv'
-                :auto-upload=false
-                drag
-                name="file"
-                :file-list="fileList"
-                :before-upload="beforeUploadFile"
-                :before-remove="beforeRemoveFile"
-                :on-change="getFile"
-                :on-exceed="handleExceed"
-                :limit="1"
-                class="upload-demo"
-                style="width: 500px;"
-                >
-              <div class="row-flex" style="height:100%;width:100%;">
-                <el-button icon="upload" style="border:0">点击上传或者拖拽文件上传</el-button>
-              </div>
-            </el-upload>
-
-            <span slot="tip">{{message}}</span>
-          </el-form-item>
-
-          <!--    操作:      -->
-          <el-form-item>
-            <el-button
-                type="primary"
-                @click="submitForm(formRef,uploadRef)"
-            >
-              立即创建
-            </el-button>
-
-            <el-button
-                @click="resetForm(formRef,uploadRef)"
-            >
-              重置
-            </el-button>
-            <div>提示:若有字段内容为中文,请设置为UTF-8编码格式。</div>
-          </el-form-item>
-        </el-form>
-      </div>
+      <el-radio-group v-model="fileTypeRadio" style="margin-bottom: 30px; margin-left: 30px">
+        <el-radio-button label="1">本地文件</el-radio-button>
+        <el-radio-button label="2">数据库表</el-radio-button>
+      </el-radio-group>
+
+      <el-form
+          v-if="fileTypeRadio === '1'"
+          :model="csvForm"
+          :rules="rules"
+          ref="formRef"
+          label-width="120px"
+      >
+
+        <el-form-item label="上传文件" required>
+          <!-- accept接收文件类型,auto-upload:false 关闭自动上传,drag 允许拖动,name=file,上传文件的字段名           -->
+          <!-- file-list:接收文件上传的数组,before-upload:配合accept属性,检查文件类型、后缀,before-remove:删除提醒           -->
+          <!-- on-change:获取文件,将文件保存在fileList里;limit:最多上传文件数           -->
+          <el-upload
+              ref="uploadRef"
+              accept='text/csv'
+              :auto-upload=false
+              drag
+              name="file"
+              :file-list="fileList"
+              :before-upload="beforeUploadFile"
+              :before-remove="beforeRemoveFile"
+              :on-change="getFile"
+              :on-exceed="handleExceed"
+              :limit="1"
+              class="upload-demo"
+              style="width: 500px;"
+              >
+            <i class="el-icon-upload"></i>
+            <div style="height:100px; width:100%;">
+              <el-button icon="upload" style="border:0">点击上传或者拖拽文件上传</el-button>
+            </div>
+          </el-upload>
+
+          <span slot="tip">{{message}}</span>
+        </el-form-item>
+
+        <el-form-item label="文件重命名" prop="fileName" style="width: 480px;">
+          <el-input placeholder="请输入上传后的文件名" v-model="csvForm.fileName">
+            <template #append>.csv</template>
+          </el-input>
+        </el-form-item>
+
+        <!--    操作:      -->
+        <el-form-item>
+          <el-button
+              type="primary"
+              @click="submitForm(formRef,uploadRef)"
+          >立即创建</el-button>
+
+          <el-button
+              @click="resetForm(formRef,uploadRef)"
+          >重置</el-button>
+          <div>提示:若有字段内容为中文,请设置为UTF-8编码格式。</div>
+        </el-form-item>
+      </el-form>
+
+      <el-form
+              v-if="fileTypeRadio === '2'"
+              :model="tableForm"
+              :rules="rules"
+              ref="formRef"
+              label-width="120px"
+      >
+
+        <el-form-item label="数据库地址" required style="width: 480px;">
+          <el-input placeholder="请输入数据库ip地址" v-model="tableForm.address"></el-input>
+        </el-form-item>
+
+        <el-form-item label="用户名" required style="width: 480px;">
+          <el-input placeholder="请输入数据库用户名" v-model="tableForm.username"></el-input>
+        </el-form-item>
+
+        <el-form-item label="密码" required style="width: 480px;">
+          <el-input type="password" placeholder="请输入数据库密码" v-model="tableForm.password"></el-input>
+        </el-form-item>
+
+        <el-form-item label="数据表名" required style="width: 480px;">
+          <el-input placeholder="请输入数据库表名" v-model="tableForm.tableName"></el-input>
+        </el-form-item>
+
+        <el-form-item label="文件重命名" prop="fileName" style="width: 480px;">
+          <el-input placeholder="请输入上传后的文件名" v-model="tableForm.fileName">
+            <template #append>.csv</template>
+          </el-input>
+        </el-form-item>
+
+        <!--    操作:      -->
+        <el-form-item>
+          <el-button
+                  type="primary"
+                  @click="submitTableForm"
+          >立即创建</el-button>
+
+          <el-button
+                  @click="resetTableForm"
+          >重置</el-button>
+          <div>提示:若有字段内容为中文,请设置为UTF-8编码格式。</div>
+        </el-form-item>
+      </el-form>
     </div>
   </div>
 </template>
@@ -81,7 +127,7 @@ export default {
   name: "Upload",
   setup() {
     //表单,不要和ref重名
-    const form= reactive({
+    const csvForm= reactive({
       fileName: '',
     });
     //DOM元素
@@ -91,7 +137,6 @@ export default {
     //文件列表
     let fileList= [];
 
-
     //校验规则
     const rules = reactive({
       fileName:
@@ -129,7 +174,7 @@ export default {
           //用于放数据  FormData类型
           let formData= new FormData();
           //将表单内其他内容添加进formData
-          formData.append('fileName', form.fileName+'.csv')
+          formData.append('fileName', csvForm.fileName+'.csv')
           formData.append('file', fileList[0].raw);
           formData.append('userId', "1")
 
@@ -138,14 +183,14 @@ export default {
           UploadFile(formData).then(res => {
             console.log(res)
             fileList=[]
-            form.fileName=''
+            csvForm.fileName=''
             formEl.resetFields()
             uploadEl.clearFiles()
             if (res.status === 200)
             {
               ElMessageBox({
                 title: '文件上传',
-                message: `文件: ${form.fileName}上传成功`,
+                message: `文件: ${csvForm.fileName}上传成功`,
                 confirmButtonText: '确定',
                 beforeClose: (action, instance, done) => {
                   if (action === 'confirm') {
@@ -167,7 +212,7 @@ export default {
                 ElMessage.error("上传失败!失败码:"+res.status);
               }
           })
-          console.log(form.fileName);
+          console.log(csvForm.fileName);
         }
         else {
           ElMessage.error('校验失败!')
@@ -232,7 +277,7 @@ export default {
     }
 
     return{
-      form,
+      csvForm,
       rules,
       message,
       fileList,
@@ -245,10 +290,41 @@ export default {
       beforeRemoveFile,
       handleExceed,
     }
+  },
+
+  data() {
+    return {
+      fileTypeRadio: '1',
+      tableForm: [{
+        address: "",
+        username: "",
+        password: "",
+        tableName: "",
+        fileName: ""
+      }]
+    }
+  },
+
+  methods: {
+    submitTableForm() {
+      const ms_username = localStorage.getItem("ms_username");
+
+
+
+    },
+
+    resetTableForm() {
+      this.tableForm.address = "";
+      this.tableForm.username = "";
+      this.tableForm.password = "";
+      this.tableForm.tableName = "";
+      this.tableForm.fileName = "";
+    }
+
   }
 }
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 309 - 0
src/views/newSquare.vue

@@ -0,0 +1,309 @@
+<template>
+    <div>
+        <div class="crumbs">
+            <el-breadcrumb separator="/">
+                <el-breadcrumb-item><i class="el-icon-office-building"></i> 数据广场</el-breadcrumb-item>
+            </el-breadcrumb>
+        </div>
+
+        <el-tabs type="border-card" class="main">
+            <el-tab-pane label="共享文件">
+                <div v-for="index in sharedFileList" :key="index.id">
+                    <el-card shadow="hover"
+                             style="margin-bottom: 10px; border-radius: 5px; border-color: #606266; color: #606266">
+                        <el-row style="align-items: center">
+                            <el-col :span="12">
+                                <div>
+                                    <span style="font-size: 18px; font-weight: bold">{{ index.fileName }}</span>
+                                </div>
+                                <div style="align-items: center">
+                                    <div style="font-size: 5px; float: left; margin-top: 10px; margin-bottom: 10px">
+                                        <i class="el-icon-thumb"></i>
+                                        {{ index.fileUri }}
+                                        <i class="el-icon-user" style="margin-left: 5px"></i>
+                                        {{ index.userId }}
+                                        <i class="el-icon-time" style="margin-left: 5px"></i>
+                                        {{ index.uploadTime }}
+                                    </div>
+                                </div>
+                            </el-col>
+                            <el-col :span="12" style="text-align: right">
+                                <el-button style="margin-left: 10px" type="warning" size="small" @click="handleCollectFile(index.id)"
+                                >收藏文件
+                                </el-button>
+                            </el-col>
+                        </el-row>
+                        <el-table :data="index.fileFieldList" border size="small">
+                            <el-table-column label="序号">
+                                <template #default="scope">{{ scope.row.id}}</template>
+                            </el-table-column>
+                            <el-table-column label="字段名">
+                                <template #default="scope">{{ scope.row.fieldName}}</template>
+                            </el-table-column>
+                            <el-table-column label="空值率">
+                                <template #default="scope">{{ scope.row.nullRate }}</template>
+                            </el-table-column>
+                            <el-table-column label="数据类型">
+                                <template #default="scope">{{ scope.row.dataType }}</template>
+                            </el-table-column>
+                        </el-table>
+                    </el-card>
+                </div>
+            </el-tab-pane>
+
+            <el-tab-pane label="共享模型">
+                <div v-for="index in sharedModelList" :key="index.id">
+                    <el-card shadow="hover"
+                             style="margin-bottom: 10px; border-radius: 5px; border-color: #606266; color: #606266">
+                        <el-row style="align-items: center">
+                            <el-col :span="12">
+                                <div>
+                                    <span style="font-size: 18px; font-weight: bold">{{ index.modelName }}</span>
+                                </div>
+                                <div style="align-items: center">
+                                    <div style="font-size: 5px; float: left; margin-top: 10px; margin-bottom: 10px">
+                                        <i class="el-icon-thumb"></i>
+                                        {{ index.modelUri }}
+                                        <i class="el-icon-user" style="margin-left: 5px"></i>
+                                        {{ index.userId }}
+                                    </div>
+                                </div>
+                            </el-col>
+                            <el-col :span="12" style="text-align: right">
+                                <el-button style="margin-left: 10px" type="warning" size="small" @click="handleCollectModel(index.id)"
+                                >收藏模型
+                                </el-button>
+                            </el-col>
+                        </el-row>
+                        <el-descriptions border size="small" :column="2">
+                            <el-descriptions-item label="配置名">{{index.configId}}</el-descriptions-item>
+                            <el-descriptions-item label="机器学习算法">{{index.machineLearningAlgorithm}}</el-descriptions-item>
+                            <el-descriptions-item label="训练参数">{{transTrainParams(index.trainParams)}}</el-descriptions-item>
+                            <el-descriptions-item label="训练状态">{{index.trainingState}}</el-descriptions-item>
+                            <el-descriptions-item label="训练结果">{{transTrainParams(index.trainResultMap)}}</el-descriptions-item>
+                        </el-descriptions>
+                    </el-card>
+                </div>
+            </el-tab-pane>
+
+            <el-tab-pane label="已收藏文件">
+                <div v-for="index in collectFileList" :key="index.id">
+                    <el-card shadow="hover"
+                             style="margin-bottom: 10px; border-radius: 5px; border-color: #606266; color: #606266">
+                        <el-row style="align-items: center">
+                            <el-col :span="12">
+                                <div>
+                                    <span style="font-size: 18px; font-weight: bold">{{ index.fileName }}</span>
+                                </div>
+                                <div style="align-items: center">
+                                    <div style="font-size: 5px; float: left; margin-top: 10px; margin-bottom: 10px">
+                                        <i class="el-icon-thumb"></i>
+                                        {{ index.fileUri }}
+                                        <i class="el-icon-user" style="margin-left: 5px"></i>
+                                        {{ index.userId }}
+                                        <i class="el-icon-time" style="margin-left: 5px"></i>
+                                        {{ index.uploadTime }}
+                                    </div>
+                                </div>
+                            </el-col>
+                            <el-col :span="12" style="text-align: right">
+                            </el-col>
+                        </el-row>
+                        <el-table :data="index.fileFieldList" border size="small">
+                            <el-table-column label="序号">
+                                <template #default="scope">{{ scope.row.id}}</template>
+                            </el-table-column>
+                            <el-table-column label="字段名">
+                                <template #default="scope">{{ scope.row.fieldName}}</template>
+                            </el-table-column>
+                            <el-table-column label="空值率">
+                                <template #default="scope">{{ scope.row.nullRate }}</template>
+                            </el-table-column>
+                            <el-table-column label="数据类型">
+                                <template #default="scope">{{ scope.row.dataType }}</template>
+                            </el-table-column>
+                        </el-table>
+                    </el-card>
+                </div>
+            </el-tab-pane>
+
+            <el-tab-pane label="已收藏模型">
+                <div v-for="index in collectModelList" :key="index.id">
+                    <el-card shadow="hover"
+                             style="margin-bottom: 10px; border-radius: 5px; border-color: #606266; color: #606266">
+                        <el-row style="align-items: center">
+                            <el-col :span="12">
+                                <div>
+                                    <span style="font-size: 18px; font-weight: bold">{{ index.modelName }}</span>
+                                </div>
+                                <div style="align-items: center">
+                                    <div style="font-size: 5px; float: left; margin-top: 10px; margin-bottom: 10px">
+                                        <i class="el-icon-thumb"></i>
+                                        {{ index.modelUri }}
+                                        <i class="el-icon-user" style="margin-left: 5px"></i>
+                                        {{ index.userId }}
+                                    </div>
+                                </div>
+                            </el-col>
+                            <el-col :span="12" style="text-align: right">
+                            </el-col>
+                        </el-row>
+                        <el-descriptions border size="small" :column="2">
+                            <el-descriptions-item label="配置名">{{index.configId}}</el-descriptions-item>
+                            <el-descriptions-item label="机器学习算法">{{index.machineLearningAlgorithm}}</el-descriptions-item>
+                            <el-descriptions-item label="训练参数">{{transTrainParams(index.trainParams)}}</el-descriptions-item>
+                            <el-descriptions-item label="训练状态">{{index.trainingState}}</el-descriptions-item>
+                            <el-descriptions-item label="训练结果">{{transTrainParams(index.trainResultMap)}}</el-descriptions-item>
+                        </el-descriptions>
+                    </el-card>
+                </div>
+            </el-tab-pane>
+        </el-tabs>
+    </div>
+</template>
+
+<script>
+    import {sharedFileList} from "../api/square";
+
+    export default {
+        name: "newSquare",
+
+        mounted() {
+            this.getSharedFileList();
+            this.getSharedModelList();
+        },
+
+        data() {
+            return {
+                sharedFileList: [
+                    {
+                        id: 1,
+                        fileName: '123',
+                        uploadTime: '2023/4/19',
+                        userId: 1,
+                        fileUri: 'http://www.ai.com',
+                        fileFieldList: [
+                            {
+                                id: 1,
+                                fieldName: '1',
+                                nullRate: '2%',
+                                dataType: 'Number',
+                            }
+                        ]
+                    }
+                ],
+
+                sharedModelList: [
+                    {
+                        id: 1,
+                        modelName: 'abc',
+                        userId: 1,
+                        modelUri: 'http://www.ai.com',
+                        configId: 1,
+                        machineLearningAlgorithm: 'DECISION_TREE_CLASSIFICATION',
+                        trainParams: [
+                            {
+                                key: 'abc',
+                                value: 'int'
+                            },
+                            {
+                                key: 'abc1',
+                                value: 'int1'
+                            }
+                        ],
+                        trainingState: '未训练',
+                        trainResultMap: [
+                            {
+                                key: 'abc',
+                                value: 'int'
+                            }
+                        ],
+                    }
+                ],
+
+                collectFileList: [
+                    {
+                        id: 1,
+                        fileName: '123',
+                        uploadTime: '2023/4/19',
+                        userId: 1,
+                        fileUri: 'http://www.ai.com',
+                        fileFieldList: [
+                            {
+                                id: 1,
+                                fieldName: '1',
+                                nullRate: '2%',
+                                dataType: 'Number',
+                            }
+                        ]
+                    }
+                ],
+
+                collectModelList: [
+                    {
+                        id: 1,
+                        modelName: 'abc',
+                        userId: 1,
+                        modelUri: 'http://www.ai.com',
+                        configId: 1,
+                        machineLearningAlgorithm: 'DECISION_TREE_CLASSIFICATION',
+                        trainParams: [
+                            {
+                                key: 'abc',
+                                value: 'int'
+                            },
+                            {
+                                key: 'abc1',
+                                value: 'int1'
+                            }
+                        ],
+                        trainingState: '未训练',
+                        trainResultMap: [
+                            {
+                                key: 'abc',
+                                value: 'int'
+                            }
+                        ],
+                    }
+                ],
+            };
+        },
+
+        methods: {
+            getSharedFileList() {
+                sharedFileList({
+                    "userId": localStorage.getItem("userId")
+                }).then(res => {
+                    this.sharedFileList = res.list;
+                })
+
+            },
+
+            getSharedModelList() {
+
+            },
+
+            handleCollectFile(fileId) {
+
+            },
+            handleCollectModel(fileId) {
+
+            },
+            transTrainParams(trainParams) {
+                let result = '';
+                for (let i of trainParams) {
+                    result += (i.key + ': ' + i.value + ', ');
+                }
+                result = result.substring(0, result.length - 2);
+                return result;
+            }
+
+        }
+    }
+</script>
+
+<style scoped>
+.dialogClass {
+    width: 80%;
+}
+</style>

+ 0 - 489
src/views/square.vue

@@ -1,489 +0,0 @@
-<template>
-
-  <el-container style=" height:100%;background: url(src/assets/img/earth.jpg) " direction="vertical">
-    <v-header style="height: 70px" @getCollection="getCollection()" @getMine="getMine()"></v-header>
-    <el-main>
-      <el-row :gutter="20" style="width: 100%;height: 200px">
-        <el-col :span="8" :offset="8">
-          <div class="grid-content" style="margin-top: 70px;">
-            <el-input placeholder="请输入内容" v-model="input" class="searchClass">
-              <template #append>
-                <el-button icon="el-icon-search" @click="handleSearch()"/>
-              </template>
-            </el-input>
-          </div>
-        </el-col>
-      </el-row>
-      <el-row :gutter="20" style="width: 100%;">
-        <el-col :span="8" :offset="7">
-          <div class="postList" style="width: 800px;">
-            <div style="" v-for="(post, index) in postList" :key="post.postId"
-                 v-show="index >= (currentPage-1)*8 && index < currentPage*4">
-              <el-card shadow="hover"
-                       style="height: 120px; margin-bottom: 5px; border-radius: 10px; background-color: #262626">
-                <div class="taskTitle">
-                  <span style="font-size: 18px; font-weight: bold;color: #eeeeee">{{ post.title }}</span>
-                  <el-button type="text" style="margin-left: 15px; margin-right: 15px; color: #000000">
-                    {{ post.update_time }}
-                  </el-button>
-                </div>
-                <div class="desciption">
-                  <div class="ellipsis-line" style="font-size: 14px; width: 800px; float: left;color: #dbd0d0">
-                    {{ post.content }}
-                  </div>
-                  <div style="font-size: 5px; width: 150px;float: left;color: #dbd0d0;margin-top: 10px">
-                    <i class="el-icon-thumb" style="color: white ;"></i>
-                    {{ post.praise }}
-                    <i class="el-icon-chat-line-round" style="color: white"></i>
-                    {{ post.comment_num }}
-                    <i class="el-icon-time" style="color: white ;"></i>
-                    {{ post.updateTime }}
-                  </div>
-                  <el-button style="float: right;" size="small" type="warning" @click="handlePostDetail(post.postId)"
-                             round>查看详情
-                  </el-button>
-                </div>
-
-              </el-card>
-            </div>
-            <el-pagination
-                layout="prev, pager, next"
-                :total="pages"
-                style="float: right; margin-top: 10px; padding-bottom: 20px;"
-                :current-page.sync="currentPage"
-                background>
-            </el-pagination>
-          </div>
-        </el-col>
-      </el-row>
-    </el-main>
-  </el-container>
-  <el-dialog :title="title" v-model="collectionDetailVisble" min-width="30%" width="66%" style="">
-    <span style="font-size: 18px; font-weight: bold;color: black;">{{ currentPost.content }}</span>
-    <el-form ref="formRef" label-width="120px">
-      <el-form-item label="模型类型名:" >
-        {{config.modelTypeName}}
-      </el-form-item>
-      <el-form-item label="模型描述:" >
-        {{config.modelDes}}
-      </el-form-item>
-      <el-form-item label="模型详情:" >
-        {{}}
-      </el-form-item>
-      <el-form-item label="特征字段:" >
-        <el-table :data="tableData" border class="table"  ref="fieldTable" header-cell-class-name="table-header" @selection-change="">
-          <el-table-column label="字段名" width="120%">
-            <template #default="scope"><span>{{ scope.row.fieldName }}</span></template>
-          </el-table-column>
-          <el-table-column label="别名">
-            <template #default="scope">{{ scope.row.aliasName }}</template>
-          </el-table-column>
-          <el-table-column label="描述">
-            <template #default="scope">{{ scope.row.fieldDes }}</template>
-          </el-table-column>
-          <el-table-column label="取值类型">
-            <template #default="scope">{{ scope.row.fieldType }}</template>
-          </el-table-column>
-          <el-table-column label="分布类型">
-            <template #default="scope">{{ scope.row.conOrDis }}</template>
-          </el-table-column>
-          <el-table-column label="空值率">
-            <template #default="scope">{{ scope.row.nullsRatio }}</template>
-          </el-table-column>
-
-          <el-table-column label="值域" width="150%">
-            <template #default="scope">{{ scope.row.valueInfo }}</template>
-          </el-table-column>
-        </el-table>
-      </el-form-item>
-
-      <el-form-item label="模型列表:" >
-        <el-table :data="modelData" border class="table" ref="fieldTable" header-cell-class-name="table-header" @selection-change="">
-          <el-table-column label="模型名" width="150%">
-            <template #default="scope"><span>{{ scope.row.modelName }}</span></template>
-          </el-table-column>
-          <el-table-column label="模型类别" width="150%">
-            <template #default="scope">{{ scope.row.modelDetailName }}</template>
-          </el-table-column>
-          <el-table-column label="训练结果">
-            <template #default="scope" >
-              <div v-if="scope.row.trainedStatus===-1">accuracy:0.87</div>
-              <div v-else="">已训练</div></template>
-          </el-table-column>
-        </el-table>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary"  @click="">添加到我的配置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-collapse >
-    <el-collapse-item name="1" title="评论">
-    <div style="margin-top: 20px;border:2px solid #a6a9ad;box-shadow: 0 0 5px rgba(0,0,0,.1);padding: 5px;">
-    <v-write-comment :width="500" :post-id="currentPost.postId" style="margin-left: 250px" >
-    </v-write-comment>
-    <v-comments :comment-list="commentList" :width="800" style="margin-top: 5px;margin-left: 160px"></v-comments>
-    </div>
-    </el-collapse-item>
-      <el-collapse-item title="写信给作者————更加快捷" name="2">
-        <div style="width: 600px;margin-left: 250px">
-        <el-input
-            type="textarea"
-            autosize
-            placeholder="标题"
-            v-model="mailTitle">
-        </el-input>
-        <div style="margin: 20px 0;"></div>
-        <el-input
-            type="textarea"
-            :autosize="{ minRows: 3, maxRows: 5}"
-            placeholder="正文"
-            v-model="mailContent">
-        </el-input>
-          <el-button type="danger" icon="el-icon-message" big circle style="margin-left: 600px;" @click="sendMailTo()"></el-button>
-        </div>
-      </el-collapse-item>
-    </el-collapse>
-
-      <template #footer>
-                <span class="dialog-footer">
-                    <el-button @click="detailVisble = false">取 消</el-button>
-                    <el-button type="primary" @click="saveEdit">确 定</el-button>
-                </span>
-    </template>
-  </el-dialog>
-  <el-dialog :title="title" v-model=" squareDetailVisble" min-width="30%" width="66%" style="">
-    <span style="font-size: 18px; font-weight: bold;color: black;">{{ currentPost.content }}</span>
-    <el-form ref="formRef" label-width="120px">
-      <el-form-item label="模型类型名:" >
-        {{config.modelTypeName}}
-      </el-form-item>
-      <el-form-item label="模型描述:" >
-        {{config.modelDes}}
-      </el-form-item>
-      <el-form-item label="模型详情:" >
-        {{}}
-      </el-form-item>
-      <el-form-item label="特征字段:" >
-        <el-table :data="tableData" border class="table"  ref="fieldTable" header-cell-class-name="table-header" @selection-change="">
-          <el-table-column label="字段名" width="120%">
-            <template #default="scope"><span>{{ scope.row.fieldName }}</span></template>
-          </el-table-column>
-          <el-table-column label="别名">
-            <template #default="scope">{{ scope.row.aliasName }}</template>
-          </el-table-column>
-          <el-table-column label="描述">
-            <template #default="scope">{{ scope.row.fieldDes }}</template>
-          </el-table-column>
-          <el-table-column label="取值类型">
-            <template #default="scope">{{ scope.row.fieldType }}</template>
-          </el-table-column>
-          <el-table-column label="分布类型">
-            <template #default="scope">{{ scope.row.conOrDis }}</template>
-          </el-table-column>
-          <el-table-column label="空值率">
-            <template #default="scope">{{ scope.row.nullsRatio }}</template>
-          </el-table-column>
-
-          <el-table-column label="值域" width="150%">
-            <template #default="scope">{{ scope.row.valueInfo }}</template>
-          </el-table-column>
-        </el-table>
-      </el-form-item>
-
-      <el-form-item label="模型列表:" >
-        <el-table :data="modelData" border class="table" ref="fieldTable" header-cell-class-name="table-header" @selection-change="">
-          <el-table-column label="模型名" width="150%">
-            <template #default="scope"><span>{{ scope.row.modelName }}</span></template>
-          </el-table-column>
-          <el-table-column label="模型类别" width="150%">
-            <template #default="scope">{{ scope.row.modelDetailName }}</template>
-          </el-table-column>
-          <el-table-column label="训练结果">
-            <template #default="scope" >
-              <div v-if="scope.row.trainedStatus===-1">accuracy:0.87</div>
-              <div v-else="">已训练</div></template>
-          </el-table-column>
-        </el-table>
-      </el-form-item>
-    </el-form>
-    <v-comments :comment-list="commentList" :width="800" style="margin-top: 20px;border:2px solid #a6a9ad;box-shadow: 0 0 5px rgba(0,0,0,.1);padding: 5px;"></v-comments>
-    <template #footer>
-                <span class="dialog-footer">
-                    <el-button @click="detailVisble = false">取 消</el-button>
-                    <el-button type="primary" @click="collect(currentPost.postId)">收藏</el-button>
-                </span>
-    </template>
-  </el-dialog>
-</template>
-
-<script>
-import vHeader from "../components/SquareHeader.vue";
-import {searchPost, getPostByPostId, getUserCollection, getUserPost,collection} from "../api/posts";
-import {getComment} from "../api/comment";
-import {sendMail} from "../api/mail";
-import {ref, reactive} from "vue";
-import {getFileDetail} from "../api/file";
-import vComments from "../components/Comments.vue"
-import vWriteComment from "../components/WriteComment.vue"
-import {getOneConfig} from "../api/config";
-
-export default {
-  setup() {
-    const collectionDetailVisble = ref(false);
-    const squareDetailVisble = ref(false);
-    const tableData = ref([])
-    return {collectionDetailVisble, tableData, squareDetailVisble};
-  },
-  components: {
-    vHeader, vComments,
-    vWriteComment
-  },
-  data() {
-    return {
-      input: '',
-      select: '',
-      src: "src/assets/img/earth.jpg",
-      fit: 'cover',
-      postList: [],
-      currentPage: 1,
-      title: "12121",
-      currentPost: null,
-      commentList: [],
-      currentState: 0,
-      mailTitle:"",
-      mailContent:"",
-      config: null,
-      modelData:null
-    };
-  },
-
-  methods: {
-    sendMailTo(){
-      sendMail({"title":this.mailTitle,"fromUserId":1,"toUserId":this.currentPost.userId,"content":this.mailContent}).then(res=>{
-        if(res.success){
-          this.$message({
-            message: '发送成功!',
-            type: 'success'
-          });
-          this.mailContent=""
-          this.mailTitle=""
-        }
-        else{
-          this.$message({
-            message: '发送失败!',
-            type: 'fail'
-          });
-        }
-      })
-    },
-    collect(postId){
-      collection({"userId":1,"postId":postId}).then(res =>
-      {
-        if(res.success){
-          this.$message({
-            message: '收藏成功!',
-            type: 'success'
-          });
-        }
-      })
-    },
-    handleSearch() {
-      console.log("doing")
-      searchPost({
-        keyword: this.input,
-        flagList: "",
-        userId: 0
-      }).then(res => {
-        this.postList = res.object
-        console.log(this.postList)
-        this.currentState = 0
-      })
-    },
-    handleCollectionDetail(postId) {
-      const data = ref([])
-      getPostByPostId({"postId": postId}).then(res => {
-        const postDetail = res.object
-        const fileId = postDetail.shareFileList[0]
-        this.currentPost = postDetail
-        this.title = postDetail.title
-
-        getComment({"userId": 1}).then(res => {
-          if (fileId != null) {
-            getOneConfig({"configId":this.currentPost.configId}).then(res => {
-              this.config=res.data
-              data.value=res.data.featureList
-              this.modelData=res.data.modelInfos
-              for (var i = 0; i < data.value.length; i++) {
-                if (data.value[i].conOrDis === 1) {
-                  data.value[i].conOrDis = "连续值"
-                } else {
-                  data.value[i].conOrDis = "离散值"
-                }
-              }
-              this.tableData = data
-              console.log(data)
-              console.log("fileId=" + fileId)
-              this.collectionDetailVisble = true
-            })
-          }
-          this.commentList = res.object
-          console.log(this.commentList)
-        })
-
-      })
-    },
-    handleSearchDetail(postId) {
-      const data = ref([])
-      getPostByPostId({"postId": postId}).then(res => {
-        const postDetail = res.object
-        const fileId = postDetail.shareFileList[0]
-        this.currentPost = postDetail
-        this.title = postDetail.title
-        getComment({"userId": 1}).then(res => {
-          if (fileId != null) {
-            getOneConfig({"configId":this.currentPost.configId}).then(res => {
-              this.config=res.data
-              data.value=res.data.featureList
-              this.modelData=res.data.modelInfos
-              for (var i = 0; i < data.value.length; i++) {
-                if (data.value[i].conOrDis === 1) {
-                  data.value[i].conOrDis = "连续值"
-                } else {
-                  data.value[i].conOrDis = "离散值"
-                }
-              }
-              this.tableData = data
-              this.squareDetailVisble = true
-              console.log(data)
-              console.log("fileId=" + fileId)
-            })
-          }
-          this.commentList = res.object
-          console.log(this.commentList)
-        })
-      })
-    },
-
-    handlePostDetail(postId) {
-      console.log("ddd")
-      if (this.currentState == 1) {
-        this.handleCollectionDetail(postId)
-      }
-      if (this.currentState == 0) {
-        this.handleSearchDetail(postId)
-      }
-
-    },
-
-    getCollection() {
-      getUserCollection({userId: 0}).then(
-          res => {
-            this.postList = res.object
-            console.log(this.postList)
-            this.currentState = 1
-          }
-      )
-    },
-    getMine() {
-      getUserPost({userId: 0}).then(
-          res => {
-            this.postList = res.object
-            console.log(this.postList)
-            this.currentState = 2
-          }
-      )
-    }
-  }
-}
-
-
-</script>
-
-<style>
-.header {
-  color: #fff;
-
-}
-
-.el-dialog__title {
-  font-size: 26px !important;
-  font-weight: bold;
-  color: black
-}
-
-.searchClass {
-  border: 1px solid #262626;
-  border-radius: 20px;
-  background: #1f1e1e;
-  height: 50px;
-}
-
-.searchClass .el-input-group__prepend {
-  border: none;
-  background-color: transparent;
-  padding: 0 10px 0 30px;
-}
-
-.searchClass .el-input-group__append {
-  border: none;
-  background-color: transparent;
-}
-
-.searchClass .el-input__inner {
-  height: 50px;
-  line-height: 36px;
-  border: none;
-  background-color: transparent;
-}
-
-.searchClass .el-icon-search {
-  font-size: 16px;
-}
-
-.searchClass .centerClass {
-  height: 100%;
-  line-height: 100%;
-  display: inline-block;
-  vertical-align: middle;
-  text-align: right;
-}
-
-.searchClass .line {
-  width: 1px;
-  height: 26px;
-  background-color: #262626;
-  margin-left: 14px;
-}
-
-.searchClass:hover {
-  border: 1px solid #262626;
-  background: #262626;
-}
-
-.searchClass:hover .line {
-  background-color: #D5E3E8;
-}
-
-.searchClass:hover .el-icon-search {
-  color: #409eff;
-  font-size: 16px;
-}
-
-.el-col {
-  border-radius: 30px
-}
-
-.grid-content {
-  border-radius: 4px;
-  min-height: 36px;
-}
-
-/*.el-input__inner{*/
-/*  border-radius: 30px!important;*/
-/*  border-color: #262626!important;*/
-/*  background-color: #606266!important;*/
-/*  height: 50px!important;*/
-
-/*}*/
-</style>

+ 0 - 0
src/views/unused/Login.vue → src/views/user/Login.vue


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů