BUG 29300
This commit is contained in:
		| @@ -2,24 +2,30 @@ | ||||
|   <section class="List"> | ||||
|     <ai-list> | ||||
|       <ai-title slot="title" title="宣传资讯" isShowBottomBorder isShowArea v-model="search.areaId" :instance="instance" | ||||
|         @change="page.current=1,getTableData()"> | ||||
|                 @change="page.current=1,getTableData()"> | ||||
|       </ai-title> | ||||
|       <template #content> | ||||
|         <div class="flex"> | ||||
|         <div class="flex fill"> | ||||
|           <div class="type"> | ||||
|             <div class="title">宣传板块<span><el-button type="text" @click="addType(0, typeList.length+1, '')">添加</el-button></span></div> | ||||
|             <div class="title">宣传板块<span><el-button type="text" | ||||
|                                                     @click="addType(0, typeList.length+1, '')">添加</el-button></span> | ||||
|             </div> | ||||
|             <div class="list"> | ||||
|               <div class="item" v-for="(item, index) in typeList" :key="index" :class="typeIndex == index ? 'active' : ''" @click="typeClick(index)"> | ||||
|               {{item.categoryName}} | ||||
|               <div class="item" v-for="(item, index) in typeList" :key="index" | ||||
|                    :class="typeIndex == index ? 'active' : ''" @click="typeClick(index)"> | ||||
|                 {{ item.categoryName }} | ||||
|               </div> | ||||
|               <div class="item" v-if="!typeList.length">暂无数据</div> | ||||
|             </div> | ||||
|           </div> | ||||
|           <div class="type mini-type"> | ||||
|             <div class="title">模块名称<span><el-button type="text" @click="addType(1, miniTypeList.length+1, typeList[typeIndex].id)">添加</el-button></span></div> | ||||
|             <div class="title">模块名称<span><el-button type="text" | ||||
|                                                     @click="addType(1, miniTypeList.length+1, typeList[typeIndex].id)">添加</el-button></span> | ||||
|             </div> | ||||
|             <div class="list"> | ||||
|               <div class="item" v-for="(item, index) in miniTypeList" :key="index" :class="miniTypeIndex == index ? 'active' : ''" @click="miniTypeClick(index)"> | ||||
|                 <span class="text">{{item.categoryName}}</span> | ||||
|               <div class="item" v-for="(item, index) in miniTypeList" :key="index" | ||||
|                    :class="miniTypeIndex == index ? 'active' : ''" @click="miniTypeClick(index)"> | ||||
|                 <span class="text">{{ item.categoryName }}</span> | ||||
|                 <span class="icon"> | ||||
|                   <i class="el-icon-circle-plus-outline" @click="addNewType(index)"></i> | ||||
|                   <i class="el-icon-edit" @click="editMini(index)"></i> | ||||
| @@ -32,12 +38,15 @@ | ||||
|           <div class="content"> | ||||
|             <ai-search-bar> | ||||
|               <template #right> | ||||
|                 <el-input size="small" placeholder="请输入标题" v-model="search.title" clearable @change="page.current=1,getTableData()"/> | ||||
|                 <el-input size="small" placeholder="请输入标题" v-model="search.title" clearable | ||||
|                           @change="page.current=1,getTableData()"/> | ||||
|               </template> | ||||
|             </ai-search-bar> | ||||
|             <ai-search-bar> | ||||
|               <template #left> | ||||
|                 <el-button type="primary" icon="iconfont iconAdd" @click="showEdit('')" v-if="typeList.length && miniTypeList.length">添加</el-button> | ||||
|                 <el-button type="primary" icon="iconfont iconAdd" @click="showEdit('')" | ||||
|                            v-if="typeList.length && miniTypeList.length">添加 | ||||
|                 </el-button> | ||||
|                 <!-- <el-button icon="iconfont iconDelete" :disabled="!ids.length" @click="handleDelete(ids)">删除</el-button> --> | ||||
|               </template> | ||||
|             </ai-search-bar> | ||||
| @@ -53,7 +62,6 @@ | ||||
|             </ai-table> | ||||
|           </div> | ||||
|         </div> | ||||
|          | ||||
|       </template> | ||||
|     </ai-list> | ||||
|     <ai-dialog :visible.sync="dialog" :title="dialogTitle" @closed="form={}" @onConfirm="submitDialog" width="600px"> | ||||
| @@ -65,8 +73,9 @@ | ||||
|           <el-input-number v-model="form.showIndex" @change="handleChange" :min="1" :max="100"></el-input-number> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|       <ai-table :tableData="newTypeList" :total="newPage.total" :current.sync="newPage.current" :size.sync="newPage.size" | ||||
|                        :col-configs="colConfigsNew" v-if="type == 2"> | ||||
|       <ai-table :tableData="newTypeList" :total="newPage.total" :current.sync="newPage.current" | ||||
|                 :size.sync="newPage.size" | ||||
|                 :col-configs="colConfigsNew" v-if="type == 2"> | ||||
|         <el-table-column slot="options" label="操作" fixed="right" align="center"> | ||||
|           <template slot-scope="{row}"> | ||||
|             <el-button type="text" @click="editNew(row)">编辑</el-button> | ||||
| @@ -139,7 +148,13 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|     showEdit(id) { | ||||
|       this.$router.push({query: {id: id, parentId: this.typeList[this.typeIndex].id, moduleId: this.miniTypeList[this.miniTypeIndex].id}, hash: "#add"}) | ||||
|       this.$router.push({ | ||||
|         query: { | ||||
|           id: id, | ||||
|           parentId: this.typeList[this.typeIndex].id, | ||||
|           moduleId: this.miniTypeList[this.miniTypeIndex].id | ||||
|         }, hash: "#add" | ||||
|       }) | ||||
|     }, | ||||
|     handleDelete(ids) { | ||||
|       this.$confirm("是否删除该条宣传资讯信息").then(() => { | ||||
| @@ -164,10 +179,10 @@ export default { | ||||
|           this.instance.post(`/app/apppublicitycategory/addPublicityCategory`, this.form).then(res => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success('添加成功'); | ||||
|               if(this.type == 0) { | ||||
|               if (this.type == 0) { | ||||
|                 this.getTypeList() | ||||
|               } | ||||
|               if(this.type == 1) { | ||||
|               if (this.type == 1) { | ||||
|                 this.getMiniTypeList(this.typeList[this.typeIndex].id) | ||||
|               } | ||||
|               this.dialog = false | ||||
| @@ -182,7 +197,7 @@ export default { | ||||
|       this.form.showIndex = index | ||||
|       this.dialogTitle = ['宣传板块', '宣传模块', '文章分类'][e] | ||||
|       this.addLabelText = ['板块名称', '模块名称', '分类名称'][e] | ||||
|       this.rules.categoryName =  [{required: true, message: "请输入"+this.addLabelText, trigger: "change"}] | ||||
|       this.rules.categoryName = [{required: true, message: "请输入" + this.addLabelText, trigger: "change"}] | ||||
|       this.dialog = true | ||||
|     }, | ||||
|     getTypeList() { | ||||
| @@ -197,10 +212,10 @@ export default { | ||||
|       this.instance.post(`/app/apppublicitycategory/list?categoryType=1&size=100&parentId=${parentId}`).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.miniTypeList = res.data.records | ||||
|           if(res.data.records && res.data.records.length) { | ||||
|           if (res.data.records && res.data.records.length) { | ||||
|             this.miniTypeClick(0) | ||||
|           } | ||||
|            | ||||
|  | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
| @@ -261,27 +276,32 @@ export default { | ||||
| <style lang="scss" scoped> | ||||
| .List { | ||||
|   height: 100%; | ||||
|   .flex{ | ||||
|  | ||||
|   .flex { | ||||
|     display: flex; | ||||
|     .type{ | ||||
|  | ||||
|     .type { | ||||
|       width: 250px; | ||||
|       border: 1px solid #ddd; | ||||
|       box-sizing: border-box; | ||||
|       .title{ | ||||
|  | ||||
|       .title { | ||||
|         font-size: 16px; | ||||
|         line-height: 40px; | ||||
|         border-bottom: 1px solid #ddd; | ||||
|         padding: 0 16px; | ||||
|         font-weight: 600; | ||||
|         span{ | ||||
|  | ||||
|         span { | ||||
|           color: #26f; | ||||
|           font-size: 12px; | ||||
|           font-weight: 400; | ||||
|           float: right; | ||||
|         } | ||||
|       } | ||||
|       .list{ | ||||
|         .item{ | ||||
|  | ||||
|       .list { | ||||
|         .item { | ||||
|           padding: 0 16px; | ||||
|           display: flex; | ||||
|           justify-content: space-between; | ||||
| @@ -289,38 +309,51 @@ export default { | ||||
|           font-size: 14px; | ||||
|           color: #333; | ||||
|           box-sizing: border-box; | ||||
|           .text{ | ||||
|  | ||||
|           .text { | ||||
|             width: calc(100% - 70px); | ||||
|             cursor: pointer; | ||||
|           } | ||||
|           .icon{ | ||||
|  | ||||
|           .icon { | ||||
|             width: 70px; | ||||
|             text-align: right; | ||||
|             i{ | ||||
|  | ||||
|             i { | ||||
|               font-size: 14px; | ||||
|               cursor: pointer; | ||||
|               margin-left: 8px; | ||||
|             } | ||||
|             .el-icon-delete{ | ||||
|  | ||||
|             .el-icon-delete { | ||||
|               color: #f46; | ||||
|             } | ||||
|             .el-icon-circle-plus-outline{ | ||||
|  | ||||
|             .el-icon-circle-plus-outline { | ||||
|               color: #26f; | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|         .active{ | ||||
|  | ||||
|         .active { | ||||
|           // color: #26f; | ||||
|           background-color: #f3f6f9; | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     .mini-type{ | ||||
|  | ||||
|     .mini-type { | ||||
|       margin-right: 16px; | ||||
|     } | ||||
|     .content{ | ||||
|  | ||||
|     .content { | ||||
|       width: calc(100% - 516px); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   ::v-deep .ai-list__content--right-wrapper { | ||||
|     min-height: calc(100% - 6px) !important; | ||||
|     display: flex; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
| </style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user