@@ -79,7 +93,7 @@
style="float: right;padding: 4px 10px"
type="primary"
icon="el-icon-plus"
- @click="$refs.dictDetail.$refs.form.dialog = true;$refs.dictDetail.isAdd = true"
+ @click="$refs.dictDetail.showAddFormDialog"
>新增
@@ -90,23 +104,27 @@
diff --git a/src/views/system/dictDetail/form.vue b/src/views/system/dictDetail/form.vue
deleted file mode 100644
index f6e20ce..0000000
--- a/src/views/system/dictDetail/form.vue
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/system/job/index.vue b/src/views/system/job/index.vue
index 912ed69..4e2ceee 100644
--- a/src/views/system/job/index.vue
+++ b/src/views/system/job/index.vue
@@ -160,17 +160,21 @@ export default {
})
},
methods: {
+ // 获取数据前设置好接口地址
beforeInit() {
this.url = 'api/job'
return true
},
+ // 打开新增弹窗前做的操作
beforeShowAddForm() {
this.getDepts()
},
+ // 打开编辑弹窗前做的操作
beforeShowEditForm(data) {
this.getDepts()
this.form.enabled = data.enabled.toString()
},
+ // 提交前的验证
beforeSubmitMethod() {
if (!this.form.dept.id) {
this.notify('所属部门不能为空', 'warning')
diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index cfa388d..f72e9b0 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -83,7 +83,7 @@
-
+
@@ -91,10 +91,10 @@
-
+
-
+
@@ -200,6 +200,7 @@ export default {
})
},
methods: {
+ // 获取数据前设置好接口地址
beforeInit() {
this.url = 'api/menus'
return true
@@ -212,9 +213,11 @@ export default {
beforeShowEditForm() {
this.getMenus()
},
+ // 选中图标
selected(name) {
this.form.icon = name
},
+ // 获取所有菜单
getMenus() {
this.crudMethod.getMenusTree().then(res => {
this.menus = []
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index 85ffa0c..70364a1 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -190,6 +190,7 @@ export default {
})
},
methods: {
+ // 获取数据前设置好接口地址
beforeInit() {
this.showButton = false
this.url = 'api/roles'
@@ -227,11 +228,13 @@ export default {
}
return true
},
+ // 获取所有菜单
getMenus() {
getMenusTree().then(res => {
this.menus = res
})
},
+ // 触发单选
handleCurrentChange(val) {
if (val) {
const _this = this
@@ -249,6 +252,7 @@ export default {
})
}
},
+ // 保存菜单
saveMenu() {
this.menuLoading = true
const role = { id: this.currentId, menus: [] }
@@ -271,6 +275,7 @@ export default {
console.log(err.response.data.message)
})
},
+ // 改变数据
update() {
// 无刷新更新 表格数据
this.crudMethod.get(this.currentId).then(res => {
@@ -282,11 +287,13 @@ export default {
}
})
},
+ // 获取部门数据
getDepts() {
getDepts({ enabled: true }).then(res => {
this.depts = res.content
})
},
+ // 如果数据权限为自定义则获取部门数据
changeScope() {
if (this.form.dataScope === '自定义') {
this.getDepts()