【VUE
<el-buttonplainsize="mini"type="primary"@click="editBtn(scope.row)">编辑</el-button><el-dialog:visible.sync="dialogVisible"width="800px"center:show-close="false"><el-divider><h3>编辑</h3></el-divider><div style="flex: 1"><el-formlabel-width="130px"label-position="right"size="mini":model="editForm"><el-row><el-col :span="14"><el-form-item label="章名称"><el-input v-model="editForm.str23"></el-input> </el-form-item></el-col><el-col :span="8"><el-form-item label="备注"><el-input v-model="editForm.str3"></el-input></el-form-item></el-col></el-row><el-row><el-col :span="14"><el-form-item label="节名称"><el-input v-model="editForm.str24"></el-input> </el-form-item></el-col><el-col :span="8"><el-form-item label="视频时长"><el-input v-model="editForm.str2"></el-input> </el-form-item></el-col></el-row><el-row><el-col :span="14"><el-form-item label="视频标题"><el-input v-model="editForm.str21"></el-input> </el-form-item></el-col><el-col :span="8"><el-form-item label="学时"><el-input v-model="editForm.str4"></el-input> </el-form-item></el-col></el-row><el-row><el-col :span="14"><el-form-item label="视频分类"><el-cascaderref="cascader02"v-model="editForm.str15":options="optionIds2":props="{ expandTrigger: 'hover' }":show-all-levels="false"@change="handleChanges2"clearable></el-cascader></el-form-item></el-col><el-col :span="8"><el-form-item label="标签"><el-selectv-model.trim="editForm.str30"filterableremotemultipleplaceholder="请选择标签":remote-method="getOption"@change="tagsChange2":loading="loading"><el-optionv-for="item in tagOptions2":key="item.code.toString()":label="item.tagTitle":value="item.code.toString()"></el-option></el-select> </el-form-item></el-col></el-row><el-row><el-col :span="12"><el-form-item label="讲师"><el-input v-model="editForm.str28"></el-input> </el-form-item></el-col><el-col :span="12"><el-form-item label="服务器ip"><el-input v-model="editForm.str7"></el-input> </el-form-item></el-col></el-row><el-row><el-col :span="12"><el-form-item label="分辨率"><el-input v-model="editForm.str17"></el-input> </el-form-item></el-col><el-col :span="12"><el-form-item label="用于"><el-selectv-model="editForm.str16"placeholder="用于"style="width: 80px !important"><el-option key="01" label="PC" value="01"> </el-option><el-option key="02" label="移动端" value="02"> </el-option></el-select> </el-form-item></el-col></el-row><el-row><el-col :span="12"><el-form-item label="片头"><el-selectv-model="editForm.str25"placeholder="片头"style="width: 80px !important"><el-option key="02" label="是" value="02"> </el-option><el-option key="01" label="否" value="01"> </el-option></el-select> </el-form-item></el-col><el-col :span="12"><el-form-item label="片尾"><el-selectv-model="editForm.str26"placeholder="片尾"style="width: 80px !important"><el-option key="02" label="是" value="02"> </el-option><el-option key="01" label="否" value="01"> </el-option></el-select> </el-form-item></el-col></el-row><el-row><el-col :span="12"></el-col><el-col :span="12"></el-col></el-row><el-form-item label="录制时间"><el-input v-model="editForm.str5"></el-input></el-form-item><el-form-item label="视频路径"><el-input v-model="editForm.str27"></el-input></el-form-item><el-form-item label="视频切片索引路径"><el-input v-model="editForm.str29"></el-input></el-form-item></el-form></div><div class="btns flex jcc"><el-button type="primary" @click="editSave">保存</el-button><el-button @click="cancel">取消</el-button></div></el-dialog>
editForm: {str2: "",str3: "",str4: "",str5: "",str7: "",str15: "",str16: "",str17: "",str21: "",str23: "",str24: "",str25: "",str26: "",str27: "",str28: "",str29: "",str30: [],},//注意:一定要初始化里面的字段,不然当数据里面的字段是null,则由于回显值没有初始化,就位默认回显为nulleditBtn(item) {//编辑this.getOption();this.editForm.str23 = item.str23this.editForm.str3 = item.str3this.editForm.str24 = item.str24this.editForm.str2 = item.str2this.editForm.str21 = item.str21this.editForm.str4 = item.str4this.editForm.str15 = item.str15this.editForm.str30 = item.str30.toString().split(",")this.editForm.str28 = item.str28this.editForm.str7 = item.str7this.editForm.str17 = item.str17this.editForm.str16 = item.str16this.editForm.str25 = item.str25this.editForm.str26 = item.str26this.editForm.str5 = item.str5this.editForm.str27 = item.str27this.editForm.str29 = item.str29this.dialogVisible = true;this.isTagCode = item.str30.toString().split(",")this.isClassifyCode = this.editForm.str15},//里面复制需要用哪些就直接复制给哪些,如果直接等于对象,则会有问题
【VUE
<el-buttonplainsize="mini"type="primary"@click="editBtn(scope.row)">编辑</el-button><el-dialog:visible.sync="dialogVisible"width="800px"center:show-close="false"><el-divider><h3>编辑</h3></el-divider><div style="flex: 1"><el-formlabel-width="130px"label-position="right"size="mini":model="editForm"><el-row><el-col :span="14"><el-form-item label="章名称"><el-input v-model="editForm.str23"></el-input> </el-form-item></el-col><el-col :span="8"><el-form-item label="备注"><el-input v-model="editForm.str3"></el-input></el-form-item></el-col></el-row><el-row><el-col :span="14"><el-form-item label="节名称"><el-input v-model="editForm.str24"></el-input> </el-form-item></el-col><el-col :span="8"><el-form-item label="视频时长"><el-input v-model="editForm.str2"></el-input> </el-form-item></el-col></el-row><el-row><el-col :span="14"><el-form-item label="视频标题"><el-input v-model="editForm.str21"></el-input> </el-form-item></el-col><el-col :span="8"><el-form-item label="学时"><el-input v-model="editForm.str4"></el-input> </el-form-item></el-col></el-row><el-row><el-col :span="14"><el-form-item label="视频分类"><el-cascaderref="cascader02"v-model="editForm.str15":options="optionIds2":props="{ expandTrigger: 'hover' }":show-all-levels="false"@change="handleChanges2"clearable></el-cascader></el-form-item></el-col><el-col :span="8"><el-form-item label="标签"><el-selectv-model.trim="editForm.str30"filterableremotemultipleplaceholder="请选择标签":remote-method="getOption"@change="tagsChange2":loading="loading"><el-optionv-for="item in tagOptions2":key="item.code.toString()":label="item.tagTitle":value="item.code.toString()"></el-option></el-select> </el-form-item></el-col></el-row><el-row><el-col :span="12"><el-form-item label="讲师"><el-input v-model="editForm.str28"></el-input> </el-form-item></el-col><el-col :span="12"><el-form-item label="服务器ip"><el-input v-model="editForm.str7"></el-input> </el-form-item></el-col></el-row><el-row><el-col :span="12"><el-form-item label="分辨率"><el-input v-model="editForm.str17"></el-input> </el-form-item></el-col><el-col :span="12"><el-form-item label="用于"><el-selectv-model="editForm.str16"placeholder="用于"style="width: 80px !important"><el-option key="01" label="PC" value="01"> </el-option><el-option key="02" label="移动端" value="02"> </el-option></el-select> </el-form-item></el-col></el-row><el-row><el-col :span="12"><el-form-item label="片头"><el-selectv-model="editForm.str25"placeholder="片头"style="width: 80px !important"><el-option key="02" label="是" value="02"> </el-option><el-option key="01" label="否" value="01"> </el-option></el-select> </el-form-item></el-col><el-col :span="12"><el-form-item label="片尾"><el-selectv-model="editForm.str26"placeholder="片尾"style="width: 80px !important"><el-option key="02" label="是" value="02"> </el-option><el-option key="01" label="否" value="01"> </el-option></el-select> </el-form-item></el-col></el-row><el-row><el-col :span="12"></el-col><el-col :span="12"></el-col></el-row><el-form-item label="录制时间"><el-input v-model="editForm.str5"></el-input></el-form-item><el-form-item label="视频路径"><el-input v-model="editForm.str27"></el-input></el-form-item><el-form-item label="视频切片索引路径"><el-input v-model="editForm.str29"></el-input></el-form-item></el-form></div><div class="btns flex jcc"><el-button type="primary" @click="editSave">保存</el-button><el-button @click="cancel">取消</el-button></div></el-dialog>
editForm: {str2: "",str3: "",str4: "",str5: "",str7: "",str15: "",str16: "",str17: "",str21: "",str23: "",str24: "",str25: "",str26: "",str27: "",str28: "",str29: "",str30: [],},//注意:一定要初始化里面的字段,不然当数据里面的字段是null,则由于回显值没有初始化,就位默认回显为nulleditBtn(item) {//编辑this.getOption();this.editForm.str23 = item.str23this.editForm.str3 = item.str3this.editForm.str24 = item.str24this.editForm.str2 = item.str2this.editForm.str21 = item.str21this.editForm.str4 = item.str4this.editForm.str15 = item.str15this.editForm.str30 = item.str30.toString().split(",")this.editForm.str28 = item.str28this.editForm.str7 = item.str7this.editForm.str17 = item.str17this.editForm.str16 = item.str16this.editForm.str25 = item.str25this.editForm.str26 = item.str26this.editForm.str5 = item.str5this.editForm.str27 = item.str27this.editForm.str29 = item.str29this.dialogVisible = true;this.isTagCode = item.str30.toString().split(",")this.isClassifyCode = this.editForm.str15},//里面复制需要用哪些就直接复制给哪些,如果直接等于对象,则会有问题