| | |
| | | facilityType: '设备类型', |
| | | createTimeView:'创建时间' |
| | | }) |
| | | |
| | | /** 获取权限列表 */ |
| | | async function getList(val) { |
| | | loading.value = true; |
| | |
| | | }) |
| | | loading.value = false; |
| | | } |
| | | |
| | | /** |
| | | * 表单相关 |
| | | */ |
| | |
| | | const searchParams = ref({ |
| | | keywords: '', |
| | | }); |
| | | |
| | | /** 新增按钮操作 */ |
| | | async function handleAdd() { |
| | | reset(); |
| | |
| | | async function handleUpdate(row) { |
| | | reset(); |
| | | // form.value = Object.assign({},row) |
| | | Object.keys(row).forEach(key => { |
| | | if (form.value.hasOwnProperty(key)) { |
| | | form.value[key] = row[key]; |
| | | } |
| | | }); |
| | | form.value.id = row.id |
| | | Object.keys(row).forEach(key => { |
| | | if (form.value.hasOwnProperty(key)) { |
| | | form.value[key] = row[key]; |
| | | } |
| | | }); |
| | | form.value.id = row.id |
| | | open.value = true; |
| | | title.value = "修改"; |
| | | } |
| | |
| | | }).then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }).catch(() => { |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | const uploadData = (data) => { |
| | | form.value.headImg = data.newFileView |
| | | } |
| | | |
| | | /** 提交按钮 */ |
| | | function submitForm() { |
| | | proxy.$refs["facilityTypeRef"].validate(valid => { |
| | |
| | | }).catch(() =>{ |
| | | open.value = false; |
| | | proxy.$modal.msgError("新增失败"); |
| | | });; |
| | | }); |
| | | ; |
| | | } |
| | | } |
| | | }); |
| | |
| | | }; |
| | | proxy.resetForm("facilityTypeRef"); |
| | | } |
| | | |
| | | getList(); |
| | | </script> |
| | | <template> |
| | |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | >新增</el-button> |
| | | >新增 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <!--表格及分页--> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" v-has="['update',route]" @click="handleUpdate(scope.row)">修改</el-button> |
| | | <el-button link type="primary" icon="Delete" v-has="['delete',route]" @click="handleDelete(scope.row)">删除</el-button> |
| | | <el-button link type="primary" icon="Edit" v-has="['update',route]" |
| | | @click="handleUpdate(scope.row)">修改 |
| | | </el-button> |
| | | <el-button link type="primary" icon="Delete" v-has="['delete',route]" |
| | | @click="handleDelete(scope.row)">删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |