| | |
| | | <el-input v-model.trim="form.srcUser" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="项目密码" prop="srcPassword"> |
| | | <el-input v-model.trim="form.srcPassword" autocomplete="off"></el-input> |
| | | <el-input |
| | | v-model.trim="form.srcPassword" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="项目描述" prop="desc"> |
| | | <el-input v-model.trim="form.desc" autocomplete="off"></el-input> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { doEdit } from '@/api/project' |
| | | import { doEdit } from "@/api/project"; |
| | | |
| | | export default { |
| | | name: 'ProjectEdit', |
| | | name: "ProjectEdit", |
| | | data() { |
| | | return { |
| | | activeName: 'base', |
| | | activeName: "base", |
| | | form: { |
| | | title: '', |
| | | author: '', |
| | | title: "", |
| | | author: "", |
| | | }, |
| | | rules: { |
| | | title: [{ required: true, trigger: 'blur', message: '请输入标题' }], |
| | | author: [{ required: true, trigger: 'blur', message: '请输入作者' }], |
| | | title: [{ required: true, trigger: "blur", message: "请输入标题" }], |
| | | author: [{ required: true, trigger: "blur", message: "请输入作者" }], |
| | | }, |
| | | title: '', |
| | | title: "", |
| | | dialogFormVisible: false, |
| | | } |
| | | }; |
| | | }, |
| | | created() { }, |
| | | created() {}, |
| | | methods: { |
| | | showEdit(row) { |
| | | if (!row) { |
| | | this.title = '添加' |
| | | this.title = "添加"; |
| | | } else { |
| | | this.title = '编辑' |
| | | this.form = Object.assign({}, row) |
| | | this.title = "编辑"; |
| | | this.form = Object.assign({}, row); |
| | | } |
| | | this.dialogFormVisible = true |
| | | this.dialogFormVisible = true; |
| | | }, |
| | | close() { |
| | | this.$refs['form'].resetFields() |
| | | this.form = this.$options.data().form |
| | | this.dialogFormVisible = false |
| | | this.$emit('fetch-data') |
| | | this.$refs["form"].resetFields(); |
| | | this.form = this.$options.data().form; |
| | | this.dialogFormVisible = false; |
| | | this.$emit("fetch-data"); |
| | | }, |
| | | save() { |
| | | this.$refs['form'].validate(async (valid) => { |
| | | this.$refs["form"].validate(async (valid) => { |
| | | if (valid) { |
| | | const { msg } = await doEdit(this.form) |
| | | this.$baseMessage(msg, 'success') |
| | | this.$refs['form'].resetFields() |
| | | this.dialogFormVisible = false |
| | | this.$emit('fetch-data') |
| | | this.form = this.$options.data().form |
| | | const { msg } = await doEdit(this.form); |
| | | this.$baseMessage(msg, "success"); |
| | | this.$refs["form"].resetFields(); |
| | | this.dialogFormVisible = false; |
| | | this.$emit("fetch-data"); |
| | | this.form = this.$options.data().form; |
| | | } else { |
| | | return false |
| | | return false; |
| | | } |
| | | }) |
| | | }); |
| | | }, |
| | | handleClick(tab, event) { |
| | | // console.log(tab, event) |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | </script> |