diff --git a/src/api/person/person.js b/src/api/person/person.js new file mode 100644 index 0000000..452a3e5 --- /dev/null +++ b/src/api/person/person.js @@ -0,0 +1,69 @@ +import request from '@/utils/request' + +const personApi = { + addOrUpdate: 'person/addOrUpdate', + del: 'person/del', + get: 'person/get', + page: 'person/pageList', + transferOrg: 'person/transferOrg', + quit: 'person/quit', + resetPwd: 'person/resetPwd', + setAdmin: 'person/setAdmin', +} + +export function personAddOrUpdate (params) { + return request({ + url: personApi.addOrUpdate, + method: 'post', + data: params + }) +} +export function personGet (params) { + return request({ + url: personApi.get, + method: 'get', + params: params + }) +} +export function personDel (params) { + return request({ + url: personApi.del, + method: 'post', + params: params + }) +} +export function personPage (params) { + return request({ + url: personApi.page, + method: 'get', + params: params + }) +} +export function personTransferOrg (params) { + return request({ + url: personApi.transferOrg, + method: 'get', + params: params + }) +} +export function personQuit (params) { + return request({ + url: personApi.quit, + method: 'get', + params: params + }) +} +export function personResetPwd (params) { + return request({ + url: personApi.resetPwd, + method: 'get', + params: params + }) +} +export function personSetAdmin (params) { + return request({ + url: personApi.setAdmin, + method: 'get', + params: params + }) +} diff --git a/src/utils/permissions.js b/src/utils/permissions.js index 83b0bb1..c139fe1 100644 --- a/src/utils/permissions.js +++ b/src/utils/permissions.js @@ -14,8 +14,7 @@ export function actionToObject (json) { */ export function hasBtnPermission (permission) { const myBtns = store.getters.buttons - const name = store.getters.name - if (name == 'admin') { + if (myBtns.indexOf('*:*:*') > -1) { return true } return myBtns.indexOf(permission) > -1 diff --git a/src/views/org/OrgForm.vue b/src/views/org/OrgForm.vue index de7fc6a..1e65505 100644 --- a/src/views/org/OrgForm.vue +++ b/src/views/org/OrgForm.vue @@ -9,7 +9,7 @@ > - + - + { this.formLoading = false - if (!res.code === 200) { + if (!res.code === 200 || !res.data.length) { this.orgTree = [] return } @@ -189,8 +189,7 @@ }).finally((res) => { this.confirmLoading = false }) - } - + } } else { this.confirmLoading = false } diff --git a/src/views/org/OrgTree.vue b/src/views/org/OrgTree.vue new file mode 100644 index 0000000..f5d0f90 --- /dev/null +++ b/src/views/org/OrgTree.vue @@ -0,0 +1,124 @@ + + + diff --git a/src/views/person/PersonDetail.vue b/src/views/person/PersonDetail.vue new file mode 100644 index 0000000..48d48ea --- /dev/null +++ b/src/views/person/PersonDetail.vue @@ -0,0 +1,8 @@ + + + + + diff --git a/src/views/person/PersonForm.vue b/src/views/person/PersonForm.vue new file mode 100644 index 0000000..80aa59f --- /dev/null +++ b/src/views/person/PersonForm.vue @@ -0,0 +1,332 @@ + + + diff --git a/src/views/person/PersonList.vue b/src/views/person/PersonList.vue new file mode 100644 index 0000000..26aedeb --- /dev/null +++ b/src/views/person/PersonList.vue @@ -0,0 +1,347 @@ + + + diff --git a/src/views/project/ProjectList.vue b/src/views/project/ProjectList.vue index 239cf85..5b4fa5f 100644 --- a/src/views/project/ProjectList.vue +++ b/src/views/project/ProjectList.vue @@ -1,5 +1,5 @@ - - + diff --git a/src/views/project/ProjectStepForm.vue b/src/views/project/ProjectStepForm.vue index 812d0cd..a673210 100644 --- a/src/views/project/ProjectStepForm.vue +++ b/src/views/project/ProjectStepForm.vue @@ -1,32 +1,21 @@ diff --git a/src/views/project/classAdd/ClassForm.vue b/src/views/project/classAdd/ClassForm.vue index 5778689..e095bd8 100644 --- a/src/views/project/classAdd/ClassForm.vue +++ b/src/views/project/classAdd/ClassForm.vue @@ -73,26 +73,22 @@ export default { this.visible = true }, handleOk(e) { - this.$refs.ClassForm.validate((valid) => { - if (valid) { - this.confirmLoading = true - classAdd(this.form).then((res) => { - if (res.code == 200) { - this.$message.success('新增成功') - this.confirmLoading = false - this.handleCancel() - } else { - this.$message.error('新增失败:' + res.msg) - } - }) + this.confirmLoading = true + classAdd(this.form).then((res) => { + if (res.code == 200) { + this.$message.success('新增成功') + this.confirmLoading = false + this.handleCancel() } else { - return false + this.$message.error('新增失败:' + res.msg) + this.handleCancel() } }) }, handleCancel(e) { // console.log('Clicked cancel button') - this.$refs.table.refresh() + // this.$refs.table.refresh() + this.$parent.handleRefresh(false) this.visible = false }, }, diff --git a/src/views/project/classAdd/ClassList.vue b/src/views/project/classAdd/ClassList.vue index 494ea1b..2062c3f 100644 --- a/src/views/project/classAdd/ClassList.vue +++ b/src/views/project/classAdd/ClassList.vue @@ -50,15 +50,19 @@ export default { }, methods: { handledDel(record) { - console.log("delete-id",record) - classDel({ids:record.id}).then((res) => { + console.log('delete-id', record) + classDel({ ids: record.id }).then((res) => { if (res.code == 200) { this.$message.success('删除成功') - this.$refs.table.refresh(true) + this.handleRefresh(false) } }) }, getData() {}, + // 搜索按钮 + handleRefresh(bool) { + this.$refs.table.refresh(bool) + }, }, created: {}, } diff --git a/src/views/project/form/ProjectCourseSelect.vue b/src/views/project/form/ProjectCourseSelect.vue index 5d53107..722b686 100644 --- a/src/views/project/form/ProjectCourseSelect.vue +++ b/src/views/project/form/ProjectCourseSelect.vue @@ -1,24 +1,41 @@ @@ -26,6 +43,10 @@ //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等) //例如:import 《组件名称》 from '《组件路径》' +/**------------------------------------------------------------ */ + +/**----------------------------------------------------------------- */ + export default { //import引入的组件需要注入到对象中才能使用 components: {}, @@ -36,6 +57,11 @@ export default { visible: false, confirmLoading: false, current: ['mail'], + + expandedKeys: [], + searchValue: '', + autoExpandParent: true, + gData, } }, //计算属性 类似于data概念 @@ -61,6 +87,27 @@ export default { this.visible = false this.formLoading = false }, + onExpand(expandedKeys) { + this.expandedKeys = expandedKeys + this.autoExpandParent = false + }, + onChange(e) { + console.log(this.gData) + const value = e.target.value + const expandedKeys = dataList + .map((item) => { + if (item.title.indexOf(value) > -1) { + return getParentKey(item.key, gData) + } + return null + }) + .filter((item, i, self) => item && self.indexOf(item) === i) + Object.assign(this, { + expandedKeys, + searchValue: value, + autoExpandParent: true, + }) + }, }, created() {}, //生命周期 - 创建完成(可以访问当前this实例) mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素) @@ -74,24 +121,4 @@ export default { } \ No newline at end of file diff --git a/src/views/project/form/ProjectForm.vue b/src/views/project/form/ProjectForm.vue index 106ac5d..9dc747e 100644 --- a/src/views/project/form/ProjectForm.vue +++ b/src/views/project/form/ProjectForm.vue @@ -5,7 +5,7 @@ - + @@ -129,7 +129,7 @@ export default { labelCol: { span: 4 }, wrapperCol: { span: 14 }, personType: [], - form: this.$form.createForm(this, { name: 'project' }), + form: {}, modalTitle: '新增项目', visible: false, confirmLoading: false, diff --git a/src/views/project/terminalTrain/TerminalTrainList.vue b/src/views/project/terminalTrain/TerminalTrainList.vue new file mode 100644 index 0000000..99edf29 --- /dev/null +++ b/src/views/project/terminalTrain/TerminalTrainList.vue @@ -0,0 +1,135 @@ + + + + \ No newline at end of file diff --git a/src/views/security/menu/MenuForm.vue b/src/views/security/menu/MenuForm.vue index 013e5ad..1c81733 100644 --- a/src/views/security/menu/MenuForm.vue +++ b/src/views/security/menu/MenuForm.vue @@ -229,9 +229,7 @@ this.meneTypeFunc(record.type.toString()) // 默认选中的单选框 - // eslint-disable-next-line no-unused-vars const visibleDef = false - // eslint-disable-next-line eqeqeq if (record.visible == 1) { this.visibleDef = true } diff --git a/src/views/security/user/UserList.vue b/src/views/security/user/UserList.vue index 8057b68..839e614 100644 --- a/src/views/security/user/UserList.vue +++ b/src/views/security/user/UserList.vue @@ -48,7 +48,7 @@ 编辑 - + 更多 @@ -138,7 +138,7 @@ export default { }, created () { // 动态加载权限 - if (this.hasPerm('sys:user:edit') || this.hasPerm('sys:user:resetPwd') || this.hasPerm('sys:user:grantRole') || this.hasPerm('sys:user:delete')) { + if (this.hasPerm('sys:user:edit') || this.hasPerm('sys:user:resetPwd') || this.hasPerm('sys:user:grantRole') || this.hasPerm('sys:user:del')) { this.columns.push({ title: '操作', width: '150px', diff --git a/src/views/sys/dictionary/DictionaryList.vue b/src/views/sys/dictionary/DictionaryList.vue index 02c4d12..02c2509 100644 --- a/src/views/sys/dictionary/DictionaryList.vue +++ b/src/views/sys/dictionary/DictionaryList.vue @@ -1,36 +1,34 @@