|
@@ -1,73 +1,130 @@
|
|
|
+
|
|
|
<template>
|
|
|
<div>
|
|
|
- <list ref="list">
|
|
|
- <!-- 新增课程 -->
|
|
|
- <Header slot="add" v-if="tool.checkAuth($route.name, 'insert')">
|
|
|
- <save />
|
|
|
- </Header>
|
|
|
- <!-- 详情 -->
|
|
|
- <template v-slot:detail="scope">
|
|
|
- <div class="inline-16">
|
|
|
- <el-button type="text" size="mini" @click="openDetail(scope.data.data)">详情</el-button>
|
|
|
+ <basicLayout
|
|
|
+ ref="basicLayout"
|
|
|
+ :oldFormPath="{
|
|
|
+ add:'HManagement/archives_ad/modules',
|
|
|
+ }"
|
|
|
+ tableName="listTable"
|
|
|
+ idName="sat_sharematerialid"
|
|
|
+ :apiId="{query:20221102143102,del:20221102143602}"
|
|
|
+ :options="options"
|
|
|
+ @listData="listData"
|
|
|
+ >
|
|
|
+ <div slot="custom">
|
|
|
+ </div>
|
|
|
+ <div slot="titleRight" style="display:flex;margin-left:10px">
|
|
|
+ </div>
|
|
|
+ <template v-slot:tbList="scope">
|
|
|
+ <div v-if="scope.data.column.columnname === 'status'">
|
|
|
+ <span :style="scope.data.column.data.status === '审核' ? 'color:#52C41A' : ''">{{
|
|
|
+ scope.data.column.data.status == '审核' ? '发布' : scope.data.column.data.status
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ <p v-else-if="scope.data.column.columnname === 'title'">
|
|
|
+ 【{{ getType(scope.data.column.data.type) }}】{{ scope.data.column.data.title }}
|
|
|
+ </p>
|
|
|
+ <div v-else>
|
|
|
+ {{scope.data.column.data[[scope.data.column.columnname]]}}
|
|
|
</div>
|
|
|
</template>
|
|
|
- <!-- 编辑 -->
|
|
|
- <template v-slot:edit="scope" v-if="tool.checkAuth($route.name, 'update')">
|
|
|
- <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" v-if="tool.checkAuth($route.name, 'release')">
|
|
|
- <release :data="scope.data.data" @onSuccess="onSuccess" />
|
|
|
- </template>
|
|
|
- <!-- 数据分析 -->
|
|
|
- <template v-slot:data_statistics="scope" v-if="tool.checkAuth($route.name, 'analysis')">
|
|
|
- <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" v-if="tool.checkAuth($route.name, 'delete')">
|
|
|
- <on-del :data="scope.data.data" @onSuccess="onSuccess" />
|
|
|
+ <template v-slot:tbOpreation="scope">
|
|
|
+ <el-button class="inline-16" type="text" size="mini" @click="openDetail(scope.data.data)">详 情</el-button>
|
|
|
+ <release :data="scope.data.data" @onSuccess="$refs.basicLayout.listData()" />
|
|
|
+ <el-button v-if="tool.checkAuth($route.name,'update')" type="text" size="mini" @click="EditBtn(scope.data.data)">编 辑</el-button>
|
|
|
+ <el-button v-if="tool.checkAuth($route.name,'data_analysis')" type="text" class="inline-16" size="mini" @click="dataCalc(scope.data.data)">数 据 统 计</el-button>
|
|
|
+ <on-del v-if="tool.checkAuth($route.name,'delete')" :data="scope.data.data" @onSuccess="$refs.basicLayout.listData()" />
|
|
|
</template>
|
|
|
- </list>
|
|
|
-
|
|
|
+ </basicLayout>
|
|
|
<detail ref="detail" v-if="currentFile && tool.checkAuth($route.name, 'read')" :currentSelectFile="currentFile">
|
|
|
</detail>
|
|
|
+ <!--抽屉面板-->
|
|
|
+ <el-drawer
|
|
|
+ title="我是标题"
|
|
|
+ :visible.sync="drawer"
|
|
|
+ :with-header="false"
|
|
|
+ direction="rtl"
|
|
|
+ size="90%"
|
|
|
+ append-to-body
|
|
|
+ @close="closeDrawer">
|
|
|
+ <div class="detail__panel">
|
|
|
+ <router-view/>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Header from '@/SManagement/archives_upload/components/Header';//业务端上传
|
|
|
-import save from '@/SManagement/archives_upload/components/save';
|
|
|
-
|
|
|
-import list from './modules/list.vue';
|
|
|
import detail from '@/SManagement/archives_ad/components/detail'
|
|
|
-import release from './modules/release.vue';
|
|
|
-import onDel from './modules/delete.vue';
|
|
|
+import onDel from './modules/delete.vue'
|
|
|
+import release from './modules/release.vue'
|
|
|
+
|
|
|
+import {mapGetters} from 'vuex'
|
|
|
+import { log } from '@antv/g2plot/lib/utils'
|
|
|
+
|
|
|
+
|
|
|
export default {
|
|
|
- name: "archives_adlist",
|
|
|
- components: { list, release, onDel, detail, Header, save },
|
|
|
+ components:{
|
|
|
+ detail,
|
|
|
+ onDel,
|
|
|
+ release
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
- currentFile: {}
|
|
|
+ options:[
|
|
|
+ ],
|
|
|
+ currentFile: {},
|
|
|
+ drawer:false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $route (val) {
|
|
|
+ if (val.path == '/archives_adlist') {
|
|
|
+ this.$refs.basicLayout.listData()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ DrawerShow (val) {
|
|
|
+ val ? this.drawer = true : this.drawer = false
|
|
|
}
|
|
|
},
|
|
|
- methods: {
|
|
|
- onSuccess () {
|
|
|
- this.$refs.list.getList();
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ DrawerShow:'DrawerShow'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ closeDrawer () {
|
|
|
+ this.$router.push('/archives_adlist')
|
|
|
+ this.$store.dispatch('DrawerShowChange',false)
|
|
|
+ },
|
|
|
+ /* 新建的数据批量删除 */
|
|
|
+ listData (data) {
|
|
|
+ let initID = '9999' + JSON.parse(window.sessionStorage.getItem("active_account")).userid;
|
|
|
+ let deleteList = [];
|
|
|
+ data.forEach(v => (initID == v.sat_sharematerial_classid && v.title == '') ? deleteList.push(v.sat_sharematerialid) : '');
|
|
|
+ if (deleteList.length != 0) this.handleDelete(deleteList);
|
|
|
},
|
|
|
- /* 编辑素材 */
|
|
|
- editData (data) {
|
|
|
- window.sessionStorage.setItem('newMaterial', JSON.stringify(data));
|
|
|
- this.$router.push({
|
|
|
- path: '/upload_archives',
|
|
|
- query: {
|
|
|
- id: data.sat_sharematerialid
|
|
|
+ /* 处理批量删除 */
|
|
|
+ handleDelete(list) {
|
|
|
+ this.$api.requested({
|
|
|
+ "id": 20221102143602,
|
|
|
+ "content": {
|
|
|
+ "sat_sharematerialid": list
|
|
|
}
|
|
|
- });
|
|
|
+ }).then(res => {
|
|
|
+ console.log("处理删除", res);
|
|
|
+ if (res.msg == '成功') this.$refs.basicLayout.listData()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getType(type) {
|
|
|
+ if (type == 1) {
|
|
|
+ return '图片'
|
|
|
+ } else if (type == 2) {
|
|
|
+ return '视频'
|
|
|
+ } else if (type == 3) {
|
|
|
+ return '图文'
|
|
|
+ }
|
|
|
},
|
|
|
/* 打开详情 */
|
|
|
openDetail (data) {
|
|
@@ -86,26 +143,19 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- 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)
|
|
|
+ EditBtn (data) {
|
|
|
+ window.sessionStorage.setItem('newMaterial', JSON.stringify(data))
|
|
|
+ this.$store.dispatch('DrawerShowChange',true)
|
|
|
+ this.$router.push({path:'/upload_archives',query:{id:data.sat_sharematerialid}})
|
|
|
+ },
|
|
|
+ dataCalc (data) {
|
|
|
+ window.sessionStorage.setItem('newMaterial', JSON.stringify(data))
|
|
|
+ this.$store.dispatch('DrawerShowChange',true)
|
|
|
+ this.$router.push({path:'/archives_ad_analysis',query:{id:data.sat_sharematerialid}})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-/deep/.header .left .el-button img {
|
|
|
- margin-left: -6px;
|
|
|
-}
|
|
|
+</script>
|
|
|
+<style>
|
|
|
</style>
|