|
@@ -9,6 +9,7 @@
|
|
|
:title="modalTitle"
|
|
|
:modal-append-to-body="false"
|
|
|
style="text-align:left;"
|
|
|
+ @close="closeDialog"
|
|
|
>
|
|
|
<div class="user-panel" v-loading="loading">
|
|
|
<el-form ref="form" :model="formModel" :rules="ruleValidate" :label-width="'100px'">
|
|
@@ -21,7 +22,7 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="handleCancel">取 消</el-button>
|
|
|
+ <el-button @click="closeDialog">取 消</el-button>
|
|
|
<el-button type="primary" @click="handleSubmit" :loading="submitting">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
@@ -50,7 +51,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- handleCancel() {
|
|
|
+ closeDialog() {
|
|
|
this.$emit("close",false);
|
|
|
},
|
|
|
handleSubmit() {
|
|
@@ -90,32 +91,32 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted: function() {
|
|
|
- var self = this;
|
|
|
+ var self = this;
|
|
|
|
|
|
- self.loading = true;
|
|
|
+ self.loading = true;
|
|
|
|
|
|
- (function(){
|
|
|
- if(self.roleId==null || self.roleId.length==0){
|
|
|
- return roleApi.create();
|
|
|
- }
|
|
|
- else{
|
|
|
- return roleApi.edit(self.roleId);
|
|
|
- }
|
|
|
- })().then(response => {
|
|
|
- var jsonData = response.data;
|
|
|
- self.loading = false;
|
|
|
+ (function(){
|
|
|
+ if(self.roleId==null || self.roleId.length==0){
|
|
|
+ return roleApi.create();
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return roleApi.edit(self.roleId);
|
|
|
+ }
|
|
|
+ })().then(response => {
|
|
|
+ var jsonData = response.data;
|
|
|
+ self.loading = false;
|
|
|
|
|
|
- if (jsonData.result) {
|
|
|
- self.formModel = jsonData.data;
|
|
|
- } else {
|
|
|
- self.$message.error(jsonData.message + "");
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(error => {
|
|
|
- self.loading = false;
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.formModel = jsonData.data;
|
|
|
+ } else {
|
|
|
+ self.$message.error(jsonData.message + "");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ self.loading = false;
|
|
|
|
|
|
- self.$message.error(error + "");
|
|
|
- });
|
|
|
+ self.$message.error(error + "");
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
</script>
|