zhaoxiaohai 3 rokov pred
rodič
commit
ffca59b30c

+ 12 - 0
src/HManagement/archives_ad/archives_adclass/index.vue

@@ -0,0 +1,12 @@
+<template>
+    <div>这里是class</div>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+<style>
+</style>

+ 54 - 0
src/HManagement/archives_ad/dataAnalysis/index.vue

@@ -0,0 +1,54 @@
+<template>
+  <div>
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="经销商分析" name="first">
+        <share-data></share-data>
+
+      </el-tab-pane>
+      <el-tab-pane label="团队内部分析" name="second">团队内部分析</el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<script>
+import shareData from "@/HManagement/archives_ad/dataAnalysis/modules/adShareData.vue";
+
+export default {
+  components: { shareData },
+  data() {
+    return {
+      activeName: "first",
+    }
+  },
+  methods: {
+    handleClick(tab, event) {
+      console.log(tab, event);
+    }
+  },
+  mounted() {
+  }
+}
+</script>
+
+<style scoped>
+/deep/.el-tabs__header {
+  padding-left: 15px !important;
+  background: #fff;
+}
+
+/deep/.el-tabs__nav-wrap::after {
+  height: 0 !important;
+}
+
+.share-data {
+  width: 100%;
+}
+
+.share-data .chart {
+  display: flex;
+  justify-content: space-between;
+  height: 435px;
+  background: red;
+  width: 100%;
+}
+</style>

+ 131 - 0
src/HManagement/archives_ad/dataAnalysis/modules/adShareData.vue

@@ -0,0 +1,131 @@
+<template>
+    <div class="content">
+        <div class="chart">
+            <div class="box">
+                <div class="title-box">
+                    <div class="title">分析次数</div>
+                    <el-radio-group v-model="tabPosition" style="margin-right:33px;" size="small">
+                        <el-radio-button label="year">年</el-radio-button>
+                        <el-radio-button label="month">月</el-radio-button>
+                        <el-radio-button label="day">日</el-radio-button>
+                    </el-radio-group>
+                </div>
+                <div id="container" style="width: calc(100% - 33px); height: 374px; margin-top: 40px;"></div>
+            </div>
+            <div class="box">
+                <div class="title-box">
+                    <div class="title">分析渠道</div>
+                </div>
+                <div id="pie" style="width: calc(100% - 33px); height: 374px; margin-top: 40px;"></div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+import { Line, Pie } from '@antv/g2plot';
+export default {
+    name: "adShareData",
+    data() {
+        return {
+            tabPosition: "year",
+        }
+    },
+    mounted() {
+        /* 折线图 */
+        fetch('https://gw.alipayobjects.com/os/bmw-prod/1d565782-dde4-4bb6-8946-ea6a38ccf184.json')
+            .then((res) => res.json())
+            .then((data) => {
+                const line = new Line('container', {
+                    data,
+                    padding: '0',
+                    xField: 'Date',
+                    yField: 'scales',
+                    xAxis: {
+                        // type: 'timeCat',
+                        tickCount: 12,
+                    },
+                    yAxis: {
+                        tickCount: 9,
+                    }
+                });
+                line.render();
+            });
+
+        /* 饼状图 */
+        const data = [
+            { type: '分类一', value: 27 },
+            { type: '分类二', value: 25 },
+        ];
+
+        const piePlot = new Pie('pie', {
+            appendPadding: 10,
+            data,
+            angleField: 'value',
+            colorField: 'type',
+            radius: 0.75,
+            legend: {
+                position: 'leftTop'
+            },
+            label: {
+                type: 'spider',
+                labelHeight: 28,
+                content: '{name}\n{percentage}',
+            },
+            interactions: [{ type: 'element-selected' }, { type: 'element-active' }],
+        });
+
+        piePlot.render();
+    }
+}
+</script>
+
+<style scoped>
+.content {
+    width: 100%;
+    background: #fff;
+    padding: 20px 16px;
+    box-sizing: border-box;
+}
+
+.title-box {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    height: 36px;
+    box-sizing: border-box;
+}
+
+.title {
+    position: relative;
+    font-size: 14px;
+    font-family: PingFang SC-Bold, PingFang SC;
+    font-weight: bold;
+    color: #333333;
+    padding-left: 11px;
+}
+
+.title::after {
+    position: absolute;
+    content: '';
+    display: block;
+    width: 4px;
+    height: 20px;
+    background: #3874F6;
+    top: 0;
+    left: 0;
+}
+
+.chart {
+    display: flex;
+    justify-content: space-between;
+    width: 100%;
+    margin-top: 22rpx;
+    height: 450px;
+}
+
+.chart .box {
+    flex: 1;
+    height: 50px;
+}
+</style>

+ 96 - 0
src/HManagement/archives_ad/index.vue

@@ -0,0 +1,96 @@
+<template>
+    <div>
+        <list ref="list">
+            <!-- 新增课程 -->
+            <insert slot="add">
+                <save slot="save" type="upload_image" @btnClick="uploadClick"></save>
+                <save slot="save" type="upload_video" @btnClick="uploadClick"></save>
+                <save slot="save" type="upload_fwb" @btnClick="uploadClick"></save>
+            </insert>
+
+            <!-- 操作按钮 -->
+            <template v-slot:detail="scope">
+                <detail :id="scope.data.data.sat_sharematerialid" />
+            </template>
+
+
+
+            <template v-slot:edit="scope">
+                <el-button slot="edit" type="text" size="small" class="inline-16"
+                    :disabled="scope.data.data.status == '审核'" @click="editData(scope.data.data)">编辑</el-button>
+            </template>
+
+
+
+            <template v-slot:release="scope">
+                <release :data="scope.data.data" @onSuccess="onSuccess" />
+            </template>
+
+            <template v-slot:data_statistics="scope">
+                <el-button type="text" size="small" @click="
+                    $router.push({
+                        path: '/archives_ad_analysis?id=' + scope.data.data.sat_sharematerialid
+                    })
+                ">数据统计</el-button>
+            </template>
+
+            <template v-slot:del="scope">
+                <on-del :data="scope.data.data" @onSuccess="onSuccess" />
+            </template>
+        </list>
+    </div>
+</template>
+
+<script>
+import insert from '@/SManagement/archives_upload/components/Header';//业务端上传
+import save from '@/SManagement/archives_upload/components/save';
+
+
+import list from './modules/list.vue';
+import detail from './modules/detail.vue';
+import release from './modules/release.vue';
+import onDel from './modules/delete.vue';
+export default {
+    name: "archives_adlist",
+    components: { list, release, onDel, detail, insert, save },
+    methods: {
+        onSuccess() {
+            this.$refs.list.getList();
+        },
+        uploadClick(type) {
+            window.sessionStorage.setItem('uploadType', type)
+            this.$router.push({
+                path: '/upload_archives',
+            })
+        },
+        editData(data) {
+            window.sessionStorage.setItem('uploadType', data.type)
+            this.$router.push({
+                name: 'upload',
+                params: {
+                    data: JSON.stringify(data)
+                }
+            })
+        },
+        async getAgentData() {
+            const res = await this.$api.requested({
+                "classname": "webmanage.saletool.courseware.statistics.agent",
+                "method": "getAgentStudyData",
+                "content": {
+                    "sat_coursewareid": this.$route.query.id
+                }
+            })
+            this.pieStudyData = [{ type: '已学习', num: res.data.studyNum }, { type: '未学习', num: res.data.unStudyNum }]
+            this.pieDownloadData = [{ type: '已下载', num: res.data.downloadNum }, { type: '未下载', num: res.data.unDownloadNum }]
+            this.$refs.studyPie.piePlot.changeData(this.pieStudyData)
+            this.$refs.downloadPie.piePlot.changeData(this.pieDownloadData)
+        }
+    }
+}
+</script>
+
+<style scoped>
+/deep/.header .left .el-button img {
+    margin-left: -6px;
+}
+</style>

+ 35 - 0
src/HManagement/archives_ad/modules/delete.vue

@@ -0,0 +1,35 @@
+<template>
+  <div style="display:inline;margin:0 16px">
+    <el-button slot="reference" size="small" type="text" @click="open">删除</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ['data'],
+  methods: {
+
+    open() {
+      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => this.deleteRow())
+    },
+
+    deleteRow() {
+      this.$api.requested({
+        "classname": "webmanage.saletool.sharematerial.sharematerial",
+        "method": "delete",
+        "content": {
+          "sat_sharematerialid": this.data.sat_sharematerialid
+        }
+      }).then(res => {
+        this.tool.showMessage(res)
+        res.code === 1 ? this.$emit('onSuccess') : ''
+      })
+    },
+  }
+}
+
+</script>

+ 128 - 0
src/HManagement/archives_ad/modules/detail.vue

@@ -0,0 +1,128 @@
+<template>
+    <span>
+        <div class="inline-16">
+            <el-button type="text" size="mini" @click="open">详情</el-button>
+        </div>
+
+
+        <el-drawer title="详情" :size="1080" :visible.sync="show" direction="rtl" :before-close="onClose">
+            <div class="drawer-box">
+                <div class="detail-head">
+                    <div class="title">{{ detail.title }}</div>
+                    <div class="data-display">
+                        <span>浏览数:{{ detail.readcount }}</span>
+                        <span>分享数:{{ detail.sharecount }}</span>
+                        <span>拉新数:{{ detail.newcount }}</span>
+                    </div>
+                </div>
+                <template v-if="detail.type == 1">
+                    <el-image class="file-style" v-for="item in detail.attinfos" :key="item.linksid" :src="item.url"
+                        :preview-src-list="srcList" lazy fit="cover" />
+                </template>
+                <template v-if="detail.type == 2">
+                    <video class="file-style" width="1020px" height="428px" v-for="item in detail.attinfos" controls
+                        :key="item.linksid" :poster="item.subfiles.length > 0 ? item.subfiles[0].url : ''" :src="item.url"></video>
+                </template>
+                <div v-if="detail.type == 3" id="richtext"></div>
+                <div style="height:30px"></div>
+            </div>
+        </el-drawer>
+
+    </span>
+</template>
+
+<script>
+//type 1图片 2视频 3图文
+import { weAtob } from "@/utils/weapp-jwt";
+import MFT from "@/utils/matchingFeilType";
+import fileBlock from "@/components/file-block/index.vue";
+export default {
+    props: ['id'],
+    components: { fileBlock },
+    data() {
+        return {
+            show: false,
+            detail: {},
+            itemStyle: {
+                img: {
+                    width: 52.75,
+                    height: 63.83
+                },
+                title: 16,
+                descript: 12
+            },
+        }
+    },
+    methods: {
+        open() {
+            this.$api.requested({
+                "classname": "webmanage.saletool.sharematerial.sharematerial",
+                "method": "selectDetail",
+                "content": {
+                    "sat_sharematerialid": this.id
+                }
+            }).then(res => {
+                if (res.msg != '成功') return this.$message.error(res.data);
+                console.log("详情", res)
+                res.data.attinfos = MFT.fileList(res.data.attinfos);
+                this.detail = res.data;
+                this.show = true;
+                if (res.data.type == 1) {
+                    let srcList = [];
+                    res.data.attinfos.forEach(v => {
+                        srcList.push(v.url);
+                    });
+                    this.srcList = srcList;
+                } else if (res.data.type == 3) {
+                    setTimeout(() => document.querySelector("#richtext").innerHTML = weAtob(res.data.content), 10);
+                }
+            })
+        },
+        onClose() {
+            this.show = false;
+        }
+    },
+
+}
+</script>
+
+<style scoped>
+.drawer-box {
+    width: 100%;
+    padding: 0 30px;
+}
+
+.detail-head {
+    width: 100%;
+    border-bottom: 1px solid #DDDDDD;
+}
+
+.detail-head .title {
+    font-size: 16px;
+    font-family: PingFang SC-Bold, PingFang SC;
+    font-weight: bold;
+    color: #333333;
+}
+
+.detail-head .data-display {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 361px;
+    height: 20px;
+    margin-top: 10px;
+    font-size: 14px;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #333333;
+    padding-bottom: 20px;
+}
+
+/* 图片视频样式 */
+.file-style {
+    display: block;
+    width: 1020px;
+    height: 428px;
+    margin-top: 10px;
+    border-radius: 4px;
+}
+</style>

+ 140 - 0
src/HManagement/archives_ad/modules/list.vue

@@ -0,0 +1,140 @@
+<template>
+    <div>
+        <slot name="add"></slot>
+        <!-- <div class="container normal-panel normal-margin"></div> -->
+        <div class="container normal-panel">
+            <!-- 表格筛选搜索 -->
+            <div class="flex-align-center search-panel" style="margin-bottom:16px">
+                <div class="flex-align-center">
+                    <p style="flex:1 0 auto;font-size:14px">素材分类:&nbsp;</p>
+
+                    <el-cascader class="cascader" size="small" v-model="selectClassId" :options="selectList"
+                        :props="{ expandTrigger: 'hover', label: 'classname', value: 'sat_sharematerial_classid' }"
+                        @change="handleChange" clearable />
+
+                    <el-input style="width:270px" v-model="params.content.where.condition" @change="getList(true)"
+                        @clear="getList(true)" placeholder="请输入内容" class="input-with-select" size="small" clearable>
+                        <el-button style="width:82px;" slot="append" icon="el-icon-search">查 询
+                        </el-button>
+                    </el-input>
+
+                </div>
+            </div>
+
+            <!-- 表格 -->
+            <tableLayout :layout="tablecols" :data="list" :custom="true" :height="tableHieght">
+                <template v-slot:customcol="scope">
+                    <div v-if="scope.column.columnname === 'status'">
+                        <span :style="scope.column.data.status === '审核' ? 'color:#52C41A' : ''">{{
+                                scope.column.data.status == '审核' ? '发布' : scope.column.data.status
+                        }}</span>
+                    </div>
+                    <p v-else>{{ scope.column.data[scope.column.columnname] }}</p>
+                </template>
+
+                <template v-slot:opreation="scope">
+                    <slot name="detail" :data="scope"></slot>
+                    <slot name="edit" :data="scope"></slot>
+                    <slot name="release" :data="scope"></slot>
+                    <slot name="data_statistics" :data="scope"></slot>
+                    <!-- <el-button size="mini" type="text" @click="onEdit(scope)">数据统计</el-button> -->
+                    <slot name="del" :data="scope"></slot>
+                </template>
+
+            </tableLayout>
+
+            <div style="margin-top:16px;text-align:right">
+                <el-pagination background small @current-change="handleCurrentChange" :current-page="currentPage"
+                    :page-size="params.content.pageSize" layout="total, prev, pager, next, jumper" :total="total">
+                </el-pagination>
+            </div>
+
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: "list",
+    components: {},
+    data() {
+        return {
+            list: [],
+            tablecols: [],
+            params: {
+                "classname": "webmanage.saletool.sharematerial.sharematerial",
+                "method": "select",
+                "content": {
+                    "nocache": true,
+                    "pageNumber": 1,
+                    "pageSize": 20,
+                    "where": {
+                        "condition": ""
+                    }
+                }
+            },
+            currentPage: 1,
+            total: 0,
+
+            selectList: [],//分类列表
+            selectClassId: "",
+
+        }
+    },
+    created() {
+        //获取表结构
+        this.tablecols = this.tool.tabelCol(this.$route.name)['listTable'].tablecols;
+        this.getList();
+        this.getSelectList();
+    },
+    methods: {
+        /* 获取分类列表 */
+        getSelectList() {
+            this.$api.requested({
+                "classname": "webmanage.saletool.sharematerial.sharematerialClass",
+                "method": "select",
+                "content": {
+                    parentid: 0
+                }
+            }).then(res => {
+                if (res.msg != '成功') return this.$message.error(res.data);
+                console.log('获取分类', res)
+                this.selectList = res.data;
+            })
+        },
+        /* 获取列表 */
+        getList(init = false) {
+            //初始化分页
+            if (init) this.currentPage = 1;
+            //是否分类筛选
+            (this.selectClassId) ? this.params.content.where.sat_sharematerial_classid = this.selectClassId : delete (this.params.content.where.sat_sharematerial_classid);
+            //发送请求
+            this.$api.requested(this.params).then(res => {
+                console.log("列表", res)
+                if (res.msg != '成功') return this.$message.error(res.data);
+                this.list = res.data;
+                this.total = res.total;
+                this.params.content.pageNumber = res.pageNumber;
+            })
+        },
+        /* 切换分页 */
+        handleCurrentChange(e) {
+            this.currentPage = e;
+            this.params.content.pageNumber = e;
+            this.getList();
+        },
+        handleChange(value) {
+            this.selectClassId = value[1] ? value[1] : '';
+            this.getList(true);
+        }
+    }
+}
+</script>
+
+<style scoped>
+/* 级联选择器 */
+.cascader {
+    width: 120px;
+    margin-right: 16px;
+}
+</style>

+ 28 - 0
src/HManagement/archives_ad/modules/release.vue

@@ -0,0 +1,28 @@
+<template>
+  <div class="inline-16">
+    <el-button type="text" size="mini" @click="releaseNotice">{{data.status === '新建'?'发布':'取消发布'}}</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['data'],
+  data () {
+    return {}
+  },
+  methods:{
+    async releaseNotice () {
+      const res = await this.$api.requested({
+        "classname": "webmanage.saletool.sharematerial.sharematerial",
+        "method": "audit",
+        "content": {
+            "sat_sharematerialid": this.data.sat_sharematerialid,
+            "type":this.data.status === '新建'?1:0
+        }
+      })
+      this.tool.showMessage(res)
+      res.code === 1?this.$emit('onSuccess'):''
+    }
+  }
+}
+</script>

+ 2 - 0
src/SManagement/archives_ad/components/Edit.vue

@@ -17,6 +17,8 @@ export default {
   methods: {
     edit () {
       console.log(this.fileData.type);
+      console.log(this.fileData);
+
       
       window.sessionStorage.setItem('uploadType',this.fileData.type)      
       this.$router.push({