Jelajahi Sumber

前端优化

hmp 4 tahun lalu
induk
melakukan
8f0fb2a399

+ 1 - 1
src/components/activityuv/activityuv.vue

@@ -40,7 +40,7 @@
         </div>
         <div style="display: flex;" v-else>
           <div style="display: flex;justify-content: center;align-items: center;">
-            <el-avatar size="large" src="https://yyzs.nanyue6688.com/obsfile/0ad6d53ecf5448bfb9694fdaed27eadc-avatar.png"></el-avatar>
+            <el-avatar size="large" src="https://music.nanyue6688.com/obsfile/0ad6d53ecf5448bfb9694fdaed27eadc-avatar.png"></el-avatar>
           </div>
            <div style="padding: 10px;">
              <div style="color: #DD6161;">用户已注销</div>

+ 6 - 1
src/views/hitRecord/hitRecord.vue → src/components/hitRecord/hitRecord.vue

@@ -61,6 +61,9 @@
   import {mapGetters} from "vuex";
 
   export default {
+    props:{
+      activityId:String
+    },
     data() {
       return {
         menu:false,
@@ -303,8 +306,10 @@
       },
       onLoad(page, params = {}) {
         this.loading = true;
-        this.query.activityId = this.$route.query.id;
         this.query.typeSub=1
+        if (this.activityId) {
+          this.query.activityId=this.activityId
+        }
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;

+ 14 - 7
src/views/production/production.vue → src/components/production/production.vue

@@ -29,7 +29,7 @@
         </el-button>
       </template>
 
-      <template slot="userInfo" slot-scope="scope">
+      <template slot="userInfo" slot-scope="scope" v-if="scope.row.loginWebVO">
         <div style="display: flex;">
           <div style="display: flex;justify-content: center;align-items: center;">
             <el-avatar size="large" :src="scope.row.loginWebVO.avatar"></el-avatar>
@@ -46,13 +46,13 @@
           {{scope.row.loginWebVO.rank}}
         </el-tag>
       </template>
-      
+
       <template slot="urlsType" slot-scope="scope">
         <div v-if="scope.row.urlsType==0">图文</div>
         <div v-if="scope.row.urlsType==1">视频</div>
       </template>
-      
-      
+
+
 
       <template  slot="urls" slot-scope="scope">
         <el-image v-if="scope.row.urlsType==0" :preview-src-list="[scope.row.urls]" style="width: 50px;height: 50px;" :src="scope.row.urls"></el-image>
@@ -68,6 +68,9 @@
   import {mapGetters} from "vuex";
 
   export default {
+    props:{
+      activityId:String
+    },
     data() {
       return {
         maskshow:false,
@@ -83,7 +86,7 @@
         },
         selectionList: [],
         option: {
-          menu:false,
+          // menu:false,
           memuLeft:true,
           height:'auto',
           calcHeight: 30,
@@ -147,8 +150,9 @@
               }]
             },
             {
-              label: "个人介绍/个人宣言",
+              label: "介绍",
               prop: "introduce",
+              overHidden: true,
               rules: [{
                 required: true,
                 message: "请输入个人介绍/个人宣言",
@@ -190,6 +194,7 @@
             },
             {
               label: "作品封面",
+              hide:true,
               prop: "cover",
               rules: [{
                 required: true,
@@ -331,7 +336,9 @@
       },
       onLoad(page, params = {}) {
         this.loading = true;
-        this.query.activityId = this.$route.query.id;
+        if (this.activityId) {
+          this.query.activityId=this.activityId
+        }
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;

+ 6 - 1
src/views/reawrdRecord/reawrdRecord.vue → src/components/reawrdRecord/reawrdRecord.vue

@@ -77,6 +77,9 @@
   import {mapGetters} from "vuex";
 
   export default {
+    props:{
+      activityId:String
+    },
     data() {
       return {
         form: {},
@@ -323,8 +326,10 @@
       },
       onLoad(page, params = {}) {
         this.loading = true;
-        this.query.activityId = this.$route.query.id;
         this.query.typeSub=2
+        if (this.activityId) {
+          this.query.activityId=this.activityId
+        }
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;

+ 1 - 27
src/router/views/index.js

@@ -21,33 +21,7 @@ export default [{
     },
     component: () =>
       import( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
-  },
-  {
-      path: "useractivitystatistical",
-      name: '查看选手',
-      component: () =>
-        import( /* webpackChunkName: "page" */ '@/views/useractivitystatistical/useractivitystatistical'),
-    },
-    {
-        path: "production",
-        name: '查看作品',
-        component: () =>
-          import( /* webpackChunkName: "page" */ '@/views/production/production'),
-      },
-    {
-        path: "hitRecord",
-        name: '打榜记录',
-        component: () =>
-          import( /* webpackChunkName: "page" */ '@/views/hitRecord/hitRecord'),
-      },
-      {
-          path: "reawrdRecord",
-          name: '打赏记录',
-          component: () =>
-            import( /* webpackChunkName: "page" */ '@/views/reawrdRecord/reawrdRecord'),
-        },
-
-
+  }
   ]
 }, {
   path: '/test',

+ 17 - 14
src/views/activity/activity.vue

@@ -1,9 +1,12 @@
 <template>
   <basic-container>
     <el-dialog @close="dialogShow=false" append-to-body :close-on-click-modal="false" :visible.sync="dialogShow"
-      title="访问人员" width="80%">
-       <activity-uv v-if="dialogTitle=='访问人员'" :ref="refName" :activityId="activityId"></activity-uv>
-       <user-activity-statistical v-if="dialogTitle=='查看选手'" :ref="refName" :activityId="activityId"></user-activity-statistical>
+      :title="dialogTitle" width="80%">
+       <activity-uv v-if="dialogTitle=='访问人员'" ref="refName" :activityId="activityId"></activity-uv>
+       <user-activity-statistical v-if="dialogTitle=='查看选手'" ref="refName" :activityId="activityId"></user-activity-statistical>
+       <production v-if="dialogTitle=='查看作品'" ref="refName" :activityId="activityId"></production>
+       <hit-record v-if="dialogTitle=='打榜记录'" ref="refName" :activityId="activityId"></hit-record>
+       <reawrd-record v-if="dialogTitle=='打赏记录'" ref="refName" :activityId="activityId"></reawrd-record>
     </el-dialog>
 
     <avue-crud id="activity" :option="option" :table-loading="loading" :data="data" :page.sync="page"
@@ -82,13 +85,13 @@
           @click.stop="openDialog(scope.row.id,'查看选手')">查看选手
         </el-button>
         <el-button type="text" size="small" icon="el-icon-view" plain class="none-border"
-          @click.stop="view(scope.row.id,'查看作品')">查看作品
+          @click.stop="openDialog(scope.row.id,'查看作品')">查看作品
         </el-button>
         <el-button type="text" size="small" icon="el-icon-view" plain class="none-border"
-          @click.stop="view(scope.row.id,'打榜记录')">打榜记录
+          @click.stop="openDialog(scope.row.id,'打榜记录')">打榜记录
         </el-button>
         <el-button type="text" size="small" icon="el-icon-view" plain class="none-border"
-          @click.stop="view(scope.row.id,'打赏记录')">打赏记录
+          @click.stop="openDialog(scope.row.id,'打赏记录')">打赏记录
         </el-button>
         <el-button type="text" size="small" icon="el-icon-view" plain class="none-border"
           @click.stop="openDialog(scope.row.id,'访问人员')">访问人员
@@ -104,6 +107,9 @@
 <script>
   import activityUv from "../../components/activityuv/activityuv.vue"
   import activityAdd from "./comps/activity-add.vue"
+  import production from "../../components/production/production.vue"
+  import hitRecord from "../../components/hitRecord/hitRecord.vue"
+  import reawrdRecord from "../../components/reawrdRecord/reawrdRecord.vue"
   import userActivityStatistical from "../../components/useractivitystatistical/useractivitystatistical.vue"
   import {
     getList,
@@ -120,7 +126,10 @@
     components: {
       activityAdd,
       activityUv,
-      userActivityStatistical
+      userActivityStatistical,
+      production,
+      hitRecord,
+      reawrdRecord
     },
     data() {
       return {
@@ -158,7 +167,6 @@
 
         dialogShow:false,
         activityId: '',
-        refName:'',
         dialogTitle:'',
 
         form: {},
@@ -372,15 +380,10 @@
     methods: {
       openDialog(id,name) {
         this.dialogTitle=name
-        if (name=='访问人员') {
-          this.refName='activityUvRef'
-        }else if (name=='查看选手') {
-          this.refName='userActivityStatisticalRef'
-        }
         this.activityId = id
         this.dialogShow = true
         if (this.canReset) {
-          this.$refs[this.refName].refreshChange()
+          this.$refs.refName.refreshChange()
         }
         this.canReset = true
       },

+ 0 - 301
src/views/useractivitystatistical/useractivitystatistical.vue

@@ -1,301 +0,0 @@
-<template>
-  <basic-container>
-    <avue-crud :option="option"
-               :table-loading="loading"
-               :data="data"
-               :page.sync="page"
-               :permission="permissionList"
-               :before-open="beforeOpen"
-               v-model="form"
-               ref="crud"
-               @row-update="rowUpdate"
-               @row-save="rowSave"
-               @row-del="rowDel"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad">
-      <template slot="menuLeft">
-        <el-button type="danger"
-                   size="small"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.useractivitystatistical_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-      </template>
-      <template slot="userInfo" slot-scope="scope">
-        <div style="display: flex;"  v-if="scope.row.loginWebVO">
-          <div style="display: flex;justify-content: center;align-items: center;">
-            <el-avatar size="large" :src="scope.row.loginWebVO.avatar"></el-avatar>
-          </div>
-           <div style="padding: 10px;">
-             <div >昵称:{{scope.row.loginWebVO.nickName}}</div>
-             <div>手机:{{scope.row.loginWebVO.phone}}</div>
-           </div>
-        </div>
-        <div style="display: flex;" v-else>
-          <div style="display: flex;justify-content: center;align-items: center;">
-            <el-avatar size="large" src="https://yyzs.nanyue6688.com/obsfile/0ad6d53ecf5448bfb9694fdaed27eadc-avatar.png"></el-avatar>
-          </div>
-           <div style="padding: 10px;">
-             <div style="color: #DD6161;">用户已注销</div>
-           </div>
-        </div>
-      </template>
-      <template slot="rank" slot-scope="scope" v-if="scope.row.loginWebVO">
-        <el-tag effect="dark">
-          {{scope.row.loginWebVO.rank}}
-        </el-tag>
-      </template>
-    </avue-crud>
-  </basic-container>
-</template>
-
-<script>
-  import {getList, getDetail, add, update, remove} from "@/api/useractivitystatistical/useractivitystatistical";
-  import {mapGetters} from "vuex";
-
-  export default {
-    data() {
-      return {
-        form: {},
-        query: {},
-        loading: true,
-        page: {
-          pageSize: 10,
-          currentPage: 1,
-          total: 0
-        },
-        selectionList: [],
-        option: {
-          menu:false,
-          height:'auto',
-          calcHeight: 30,
-          tip: false,
-          searchShow: true,
-          searchMenuSpan: 6,
-          border: true,
-          index: true,
-          viewBtn: true,
-          selection: true,
-          dialogClickModal: false,
-          column: [
-            {
-              hide:true,
-              label: "用户id",
-              prop: "userId",
-              rules: [{
-                required: true,
-                message: "请输入用户id",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "选手信息",
-              serach:true,
-              prop: "userInfo",
-              slot:true
-            },
-            {
-              label: "排名",
-              prop: "rank",
-              slot:true
-            },
-            {
-              hide:true,
-              label: "活动id",
-              prop: "activityId",
-              rules: [{
-                required: true,
-                message: "请输入活动id",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "活动可用热力值",
-              prop: "usableHotValue",
-              rules: [{
-                required: true,
-                message: "请输入可用热力值",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "活动总热力值",
-              prop: "totalHotValue",
-              rules: [{
-                required: true,
-                message: "请输入总热力值",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "活动可用积分",
-              prop: "usablePointsValue",
-              rules: [{
-                required: true,
-                message: "请输入可用积分",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "活动总积分",
-              prop: "totalPointsValue",
-              rules: [{
-                required: true,
-                message: "请输入总积分",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "用户在此活动收到的总现金",
-              prop: "totalCash",
-              rules: [{
-                required: true,
-                message: "请输入用户在此活动收到的总现金",
-                trigger: "blur"
-              }]
-            },
-          ]
-        },
-        data: []
-      };
-    },
-    computed: {
-      ...mapGetters(["permission"]),
-      permissionList() {
-        return {
-          addBtn: this.vaildData(this.permission.useractivitystatistical_add, false),
-          viewBtn: this.vaildData(this.permission.useractivitystatistical_view, false),
-          delBtn: this.vaildData(this.permission.useractivitystatistical_delete, false),
-          editBtn: this.vaildData(this.permission.useractivitystatistical_edit, false)
-        };
-      },
-      ids() {
-        let ids = [];
-        this.selectionList.forEach(ele => {
-          ids.push(ele.id);
-        });
-        return ids.join(",");
-      }
-    },
-    methods: {
-      rowSave(row, done, loading) {
-        add(row).then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          done();
-        }, error => {
-          loading();
-          window.console.log(error);
-        });
-      },
-      rowUpdate(row, index, done, loading) {
-        update(row).then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          done();
-        }, error => {
-          loading();
-          console.log(error);
-        });
-      },
-      rowDel(row) {
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(row.id);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-          });
-      },
-      handleDelete() {
-        if (this.selectionList.length === 0) {
-          this.$message.warning("请选择至少一条数据");
-          return;
-        }
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(this.ids);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.$refs.crud.toggleSelection();
-          });
-      },
-      beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
-          getDetail(this.form.id).then(res => {
-            this.form = res.data.data;
-          });
-        }
-        done();
-      },
-      searchReset() {
-        this.query = {};
-        this.onLoad(this.page);
-      },
-      searchChange(params, done) {
-        this.query = params;
-        this.page.currentPage = 1;
-        this.onLoad(this.page, params);
-        done();
-      },
-      selectionChange(list) {
-        this.selectionList = list;
-      },
-      selectionClear() {
-        this.selectionList = [];
-        this.$refs.crud.toggleSelection();
-      },
-      currentChange(currentPage){
-        this.page.currentPage = currentPage;
-      },
-      sizeChange(pageSize){
-        this.page.pageSize = pageSize;
-      },
-      refreshChange() {
-        this.onLoad(this.page, this.query);
-      },
-      onLoad(page, params = {}) {
-        this.loading = true;
-        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
-          const data = res.data.data;
-          this.page.total = data.total;
-          this.data = data.records;
-          this.loading = false;
-          this.selectionClear();
-        });
-      }
-    }
-  };
-</script>
-
-<style>
-</style>