大屏复制功能
This commit is contained in:
		| @@ -33,14 +33,29 @@ | ||||
|         :current.sync="search.current" | ||||
|         :size.sync="search.size" | ||||
|         @getList="getList"> | ||||
|         <el-table-column slot="options" width="120px" fixed="right" label="操作" align="center"> | ||||
|         <el-table-column slot="options" width="160px" fixed="right" label="操作" align="center"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <div class="table-options"> | ||||
|               <el-button type="text" @click="toEdit(row.id)">编辑</el-button> | ||||
|               <el-button type="text" @click="copy(row.id)">复制</el-button> | ||||
|             </div> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </ai-table> | ||||
|       <ai-dialog | ||||
|         :visible.sync="isShowAdd" | ||||
|         width="780px" | ||||
|         title="复制大屏" | ||||
|         @close="onClose" | ||||
|         @onConfirm="onConfirm"> | ||||
|         <el-form ref="form" :model="form" label-width="110px" label-position="right"> | ||||
|           <div class="ai-form" :model="form" label-width="110px" label-position="right"> | ||||
|             <el-form-item label="名称" prop="name" style="width: 100%;" :rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]"> | ||||
|               <el-input size="small" placeholder="请输入名称" v-model="form.name"></el-input> | ||||
|             </el-form-item> | ||||
|           </div> | ||||
|         </el-form> | ||||
|       </ai-dialog> | ||||
|     </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
| @@ -63,6 +78,11 @@ | ||||
|           size: 10, | ||||
|           name: '' | ||||
|         }, | ||||
|         form: { | ||||
|           name: '' | ||||
|         }, | ||||
|         id: '', | ||||
|         isShowAdd: false, | ||||
|         colConfigs: [ | ||||
|           { prop: 'name', label: '模板名称' }, | ||||
|           { prop: 'createUserName', align: 'center', label: '创建人' }, | ||||
| @@ -88,6 +108,36 @@ | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       copy (id) { | ||||
|         this.id = id | ||||
|         this.isShowAdd = true | ||||
|       }, | ||||
|  | ||||
|       onClose () { | ||||
|         this.id = '' | ||||
|         this.form.name = '' | ||||
|       }, | ||||
|  | ||||
|       onConfirm () { | ||||
|         this.$refs.form.validate((valid) => { | ||||
|           if (valid) { | ||||
|             this.instance.post(`${this.urlPrefix}/appdiylargescreen/copyLargeScreenProject`, null, { | ||||
|               params: { | ||||
|                 ...this.form, | ||||
|                 id: this.id | ||||
|               } | ||||
|             }).then(res => { | ||||
|               if (res.code === 0) { | ||||
|                 this.$message.success('复制成功') | ||||
|                 this.isShowAdd = false | ||||
|  | ||||
|                 this.getList() | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       getList () { | ||||
|         this.instance.post(`${this.urlPrefix}/appdiylargescreen/allLargeScreenProjectByPage`, null, { | ||||
|           params: { | ||||
| @@ -119,23 +169,10 @@ | ||||
|         this.$emit('change', { | ||||
|           type: 'SourceData' | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       onConfirm () { | ||||
|         this.$emit('change', { | ||||
|           type: 'add', | ||||
|           params: { | ||||
|             id: '', | ||||
|             templateType: 0, | ||||
|             type: this.currIndex | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|   .form-list { | ||||
|   } | ||||
| </style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user