|
@@ -48,17 +48,16 @@
|
|
|
style="width: 14px; height: 14px; margin-right: 8px"
|
|
|
/>
|
|
|
|
|
|
- <el-dropdown trigger="click">
|
|
|
+ <el-dropdown trigger="click" @command="handleChapterItem">
|
|
|
<span class="el-dropdown-link">
|
|
|
<i class="el-icon-more"></i>
|
|
|
</span>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item>基础信息</el-dropdown-item>
|
|
|
- <el-dropdown-item>编辑</el-dropdown-item>
|
|
|
- <el-dropdown-item>删除</el-dropdown-item>
|
|
|
- <el-dropdown-item>添加标签</el-dropdown-item>
|
|
|
- <el-dropdown-item>上传录音</el-dropdown-item>
|
|
|
- <el-dropdown-item>微信分享</el-dropdown-item>
|
|
|
+ <el-dropdown-item :command="{type:'beseInfo',item}">基础信息</el-dropdown-item>
|
|
|
+ <el-dropdown-item :command="{type:'del',item}">删除</el-dropdown-item>
|
|
|
+ <el-dropdown-item :command="{type:'adTag',item}">添加标签</el-dropdown-item>
|
|
|
+ <el-dropdown-item :command="{type:'upAudio',item}">上传录音</el-dropdown-item>
|
|
|
+ <el-dropdown-item :command="{type:'wxShare',item}">微信分享</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
@@ -69,17 +68,127 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 添加章节弹窗 -->
|
|
|
- <mDialog>
|
|
|
- <div slot="footer">
|
|
|
+ <m-dialog
|
|
|
+ title="添加章节"
|
|
|
+ :show.sync="isOpenChapterDia"
|
|
|
+ width="650px"
|
|
|
+ @close="isOpenChapterDia=false"
|
|
|
+ >
|
|
|
+ <div class="chapter-dialog-main">
|
|
|
+ <el-form
|
|
|
+ :model="chapterInfo"
|
|
|
+ :rules="chapterRules"
|
|
|
+ ref="formRef"
|
|
|
+ label-position="left"
|
|
|
+ hide-required-asterisk
|
|
|
+ label-width="120px"
|
|
|
+ >
|
|
|
+ <el-form-item prop="chapterName" label="章节名称">
|
|
|
+ <el-input
|
|
|
+ type="text"
|
|
|
+ v-model="chapterInfo.chapterName"
|
|
|
+ style="width:350px;"
|
|
|
+ placeholder="请输入章节名称"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="editors" label="关联品种">
|
|
|
+ <template slot="label">
|
|
|
+ <el-tooltip class="item" effect="dark" :content="$t('ReportManage.CategoryList.related_variety_hint')">
|
|
|
+ <div>
|
|
|
+ <span>{{ $t('ReportManage.CategoryList.related_variety') }}</span>
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
|
|
|
+ <el-cascader
|
|
|
+ :options="reportVarietyOpts"
|
|
|
+ v-model="chapterInfo.varietys"
|
|
|
+ placeholder="请选择关联品种"
|
|
|
+ collapse-tags
|
|
|
+ :show-all-levels="false"
|
|
|
+ :props="{
|
|
|
+ value:'PermissionId',
|
|
|
+ label:'PermissionName',
|
|
|
+ children:'Child',
|
|
|
+ multiple: true,
|
|
|
+ emitPath:false
|
|
|
+ }"
|
|
|
+ style="width:350px;"
|
|
|
+ clearable
|
|
|
+ ></el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="editors" label="编辑人">
|
|
|
+ <el-cascader
|
|
|
+ v-model="chapterInfo.editors"
|
|
|
+ :options="userOpts"
|
|
|
+ :show-all-levels="false"
|
|
|
+ collapse-tags
|
|
|
+ filterable
|
|
|
+ :props="{
|
|
|
+ value:'ItemId',
|
|
|
+ label:'ItemName',
|
|
|
+ children:'Children',
|
|
|
+ emitPath: false,
|
|
|
+ multiple: true
|
|
|
+ }"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择编辑人"
|
|
|
+ style="width:350px;"
|
|
|
+ />
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" style="margin-top: 20px;">
|
|
|
+ <el-button
|
|
|
+ @click="isOpenChapterDia=false"
|
|
|
+ style="width: 132px; height: 40px"
|
|
|
+ ><!-- 取消 -->{{$t('Dialog.cancel_btn')}}</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="handleSaveChapter"
|
|
|
+ type="primary"
|
|
|
+ style="width: 132px; height: 40px"
|
|
|
+ ><!-- 保存 -->{{$t('Dialog.confirm_save_btn')}}</el-button>
|
|
|
</div>
|
|
|
|
|
|
- </mDialog>
|
|
|
+ </m-dialog>
|
|
|
+
|
|
|
+ <!-- 添加标签弹窗 -->
|
|
|
+ <m-dialog
|
|
|
+ :show.sync="isOpenChapterTag"
|
|
|
+ :title="$t('ReportManage.ReportList.set_tags_title')"
|
|
|
+ width="400px"
|
|
|
+ >
|
|
|
+ <div class="edit-tag-wrap">
|
|
|
+ <span>{{chapterInfo.title}}</span>
|
|
|
+ <el-select
|
|
|
+ v-model="chapterInfo.tags"
|
|
|
+ filterable
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
+ :placeholder="$t('ReportManage.ReportList.select_ipt_pld')">
|
|
|
+ <el-option
|
|
|
+ v-for="item in tagOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <div style="margin:30px 0;text-align:center">
|
|
|
+ <el-button type="primary" plain @click="isOpenChapterTag=false">{{$t('Dialog.cancel_btn')}}</el-button>
|
|
|
+ <el-button type="primary" @click="handleSaveChapterTag">{{$t('Dialog.confirm_btn')}}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </m-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import draggable from 'vuedraggable';
|
|
|
import mDialog from '@/components/mDialog.vue';
|
|
|
+import {reportVarietyInterence} from '@/api/modules/reportVariety';
|
|
|
+import { dataAuthInterface,chapterTrendTagList } from '@/api/api.js';
|
|
|
export default {
|
|
|
components: { draggable,mDialog },
|
|
|
data() {
|
|
@@ -117,15 +226,100 @@ export default {
|
|
|
|
|
|
startIndex: 0,
|
|
|
preIndex: 0,
|
|
|
- nextIndex: 0
|
|
|
+ nextIndex: 0,
|
|
|
+
|
|
|
+ /* 章节弹窗 */
|
|
|
+ isOpenChapterDia: false,
|
|
|
+ reportVarietyOpts: [],
|
|
|
+ userOpts: [],
|
|
|
+ chapterInfo: {
|
|
|
+ varietys:[],
|
|
|
+ editors:[],
|
|
|
+ chapterName:'',
|
|
|
+ tags: []
|
|
|
+ },
|
|
|
+ chapterRules: {
|
|
|
+ chapterName: [{
|
|
|
+ required:true,message:'章节名称不能为空',trigger:'blur'
|
|
|
+ }],
|
|
|
+ editors: [{
|
|
|
+ required:true,message:'编辑人不能为空',trigger:'blur'
|
|
|
+ }],
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 标签弹窗 */
|
|
|
+ isOpenChapterTag: false,
|
|
|
+ tagOptions: []
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
-
|
|
|
+ this.getReportVarietyList();
|
|
|
+ this.getUserList();
|
|
|
+ this.getChapterTrendTagList();
|
|
|
},
|
|
|
methods:{
|
|
|
openAddChapter() {
|
|
|
+ this.isOpenChapterDia = true;
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 保存章节编辑 */
|
|
|
+ handleSaveChapter() {
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
+ /* 章节操作 */
|
|
|
+ handleChapterItem({type,item}) {
|
|
|
+ console.log(type,item)
|
|
|
+ switch(type) {
|
|
|
+ case 'beseInfo':
|
|
|
+ this.openAddChapter(item);
|
|
|
+ break
|
|
|
+ case 'del':
|
|
|
+ break
|
|
|
+ case 'adTag':
|
|
|
+ this.openAddChapterTag()
|
|
|
+ break
|
|
|
+ case 'upAudio':
|
|
|
+ break
|
|
|
+ case 'wxShare':
|
|
|
+ break
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ openAddChapterTag() {
|
|
|
+ this.isOpenChapterTag = true;
|
|
|
+ },
|
|
|
+ /* 保存关联章节标签 */
|
|
|
+ handleSaveChapterTag() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取品种数据
|
|
|
+ async getReportVarietyList(){
|
|
|
+ const res = await reportVarietyInterence.filterVarietyOpts();
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.reportVarietyOpts=res.Data||[]
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 获取用户列表 */
|
|
|
+ async getUserList() {
|
|
|
+ const res = await dataAuthInterface.userSearch();
|
|
|
+ if (res.Ret !== 200) return
|
|
|
+
|
|
|
+ this.userOpts = res.Data || []
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取章节标签数据(仅在获取章节列表成功后获取一次)
|
|
|
+ async getChapterTrendTagList(){
|
|
|
+ const res=await chapterTrendTagList()
|
|
|
+ if(res.Ret!==200) return
|
|
|
+
|
|
|
+ let arr=res.Data||[]
|
|
|
+
|
|
|
+ this.tagOptions=arr.map(item=>({value:item.KeyWord,label:item.KeyWord}))
|
|
|
},
|
|
|
|
|
|
/* 拖动开始 记录位置 */
|
|
@@ -210,3 +404,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+<style lang="scss">
|
|
|
+.chapter-dialog-main {
|
|
|
+ .el-cascader .el-input {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|