diff --git a/src/api/model/opl.js b/src/api/model/am.js similarity index 74% rename from src/api/model/opl.js rename to src/api/model/am.js index 145c1286..54414d7d 100644 --- a/src/api/model/opl.js +++ b/src/api/model/am.js @@ -1,13 +1,14 @@ import config from "@/config" import http from "@/utils/request" - +/*区域接口*/ export default { - rparty: { + + area: { list: { name: "获取", req: async function(data){ return await http.get( - `${config.API_URL}/opm/opl_cate/`, + `${config.API_URL}/am/area/`, data ); } @@ -16,7 +17,7 @@ export default { name: "更新", req: async function(id, data){ return await http.put( - `${config.API_URL}/opm/opl_cate/${id}/`, + `${config.API_URL}/am/area/${id}/`, data); } }, @@ -24,7 +25,7 @@ export default { name: "创建", req: async function(data){ return await http.post( - `${config.API_URL}/opm/opl_cate/`, + `${config.API_URL}/am/area/`, data); } }, @@ -32,8 +33,12 @@ export default { name: "删除", req: async function(id){ return await http.delete( - `${config.API_URL}/opm/opl_cate/${id}/`); + `${config.API_URL}/am/area/${id}/`); } } }, + + + + } \ No newline at end of file diff --git a/src/api/model/opm.js b/src/api/model/opm.js new file mode 100644 index 00000000..11b9b336 --- /dev/null +++ b/src/api/model/opm.js @@ -0,0 +1,78 @@ +import config from "@/config" +import http from "@/utils/request" +/*作业接口*/ +export default { + /*作业许可证分类*/ + oplcate: { + list: { + name: "获取", + req: async function(data){ + return await http.get( + `${config.API_URL}/opm/opl_cate/`, + data + ); + } + }, + update: { + name: "更新", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/opm/opl_cate/${id}/`, + data); + } + }, + create: { + name: "创建", + req: async function(data){ + return await http.post( + `${config.API_URL}/opm/opl_cate/`, + data); + } + }, + delete: { + name: "删除", + req: async function(id){ + return await http.delete( + `${config.API_URL}/opm/opl_cate/${id}/`); + } + } + }, + + + + /*作业*/ + operation: { + list: { + name: "获取", + req: async function(data){ + return await http.get( + `${config.API_URL}/opm/operation/`, + data + ); + } + }, + update: { + name: "更新", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/opm/operation/${id}/`, + data); + } + }, + create: { + name: "创建", + req: async function(data){ + return await http.post( + `${config.API_URL}/opm/operation/`, + data); + } + }, + delete: { + name: "删除", + req: async function(id){ + return await http.delete( + `${config.API_URL}/opm/operation/${id}/`); + } + } + }, +} \ No newline at end of file diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index 5c50b401..2b59c252 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -264,7 +264,7 @@ export default { }, //获取数据 async getData() { - debugger; + this.loading = true; var reqData = { [config.request.page]: this.currentPage, @@ -278,7 +278,7 @@ export default { // delete reqData[config.request.pageSize] } Object.assign(reqData, this.tableParams); - debugger; + try { var res = await this.apiObj.req(reqData); if (this.hidePagination) { @@ -288,7 +288,7 @@ export default { } if(this.$route.path==='/sys/dept'||this.$route.path==='/sys/perm'){ this.tableData = this.redata(res); - debugger; + console.log(this.tableData) }else{ this.tableData = res || []; @@ -316,7 +316,7 @@ export default { } if(this.$route.path==='/sys/dept'||this.$route.path==='/ops/menu'){ this.tableData = this.redata(dataList); - debugger; + console.log(this.tableData) }else{ this.tableData = dataList || []; @@ -354,7 +354,7 @@ export default { parent.children = parent.children ? parent.children : []; parent.children.push(item); } - debugger; + console.log(arr); return arr; }, diff --git a/src/utils/verificate.js b/src/utils/verificate.js index 36b7983e..51c97443 100644 --- a/src/utils/verificate.js +++ b/src/utils/verificate.js @@ -16,3 +16,30 @@ export function verifyCars(rule, value, callback) { } callback() } +export function genTree(data) { + const result = [] + if (!Array.isArray(data)) { + return result + } + data.forEach(item => { + delete item.children + }) + const map = {} + data.forEach(item => { + item.label = item.name + if(item.fullname){ + item.label = item.fullname + } + item.value = item.id + map[item.id] = item + }) + data.forEach(item => { + const parent = map[item.parent] + if (parent) { + (parent.children || (parent.children = [])).push(item) + } else { + result.push(item) + } + }) + return result + } diff --git a/src/views/hrm/ep_form.vue b/src/views/hrm/ep_form.vue index 19713e1e..d121eae5 100644 --- a/src/views/hrm/ep_form.vue +++ b/src/views/hrm/ep_form.vue @@ -226,14 +226,14 @@ }, //表单提交方法 submit() { - debugger; + //debugger; this.$refs.dialogForm.validate((valid) => { - debugger; + // debugger; if (valid) { - debugger; + // debugger; this.isSaveing = true; if (this.mode === 'add') { - debugger; + // debugger; this.$API.hrm.employee.create.req(this.form) .then(res => { this.isSaveing = false; @@ -264,7 +264,7 @@ }, //表单注入数据 setData(data) { - debugger; + //debugger; console.log(defaultForm); // this.form = defaultForm; Object.assign(this.form, data); diff --git a/src/views/opm/operation.vue b/src/views/opm/operation.vue index e09b0f44..b5a9bb6e 100644 --- a/src/views/opm/operation.vue +++ b/src/views/opm/operation.vue @@ -1,64 +1,49 @@ + + diff --git a/src/views/opm/oplcate.vue b/src/views/opm/oplcate.vue index 5277507e..24da7283 100644 --- a/src/views/opm/oplcate.vue +++ b/src/views/opm/oplcate.vue @@ -33,21 +33,25 @@ + + + diff --git a/src/views/ops/logInfo.vue b/src/views/ops/logInfo.vue index eca96198..16997aa7 100644 --- a/src/views/ops/logInfo.vue +++ b/src/views/ops/logInfo.vue @@ -32,7 +32,7 @@ methods: { setData(data){ this.data = data; - debugger; + // debugger; console.log(data); let dataStr = ''; for (let i in data) { diff --git a/src/views/ops/menu.vue b/src/views/ops/menu.vue index 6a0537b5..9e0ca46a 100644 --- a/src/views/ops/menu.vue +++ b/src/views/ops/menu.vue @@ -158,14 +158,14 @@ }, handleChange(value) { // this.menu.checked = check.checkedKeys; - debugger; + // debugger; console.log(value); console.log(this.addForm.parent); }, //加载树数据 async getGroup() { var res = await this.$API.system.permission.list.req({page: 0}); - debugger; + // debugger; let permList = res; this.permList = res; let posts = []; @@ -187,7 +187,7 @@ parent.children = parent.children ? parent.children : []; parent.children.push(item); } - debugger; + //debugger; this.group = arr; }, @@ -200,7 +200,7 @@ this.codesLimited = true; }, saveCodes(){ - debugger;console.log(this.addForm.codes); + // debugger;console.log(this.addForm.codes); this.addForm.codes.push(this.codes); this.codes = '' }, @@ -214,7 +214,7 @@ this.type = 'edit'; this.addForm.id = row.id; this.addForm.name = row.name; - debugger; + // debugger; console.log(row.codes); this.codes = row.codes.join(','); let parent = row.parent!==null?this.findParents(this.permList, row.parent):''; @@ -227,7 +227,7 @@ this.limitedVisible = true; }, findParents(arr, parent) { - debugger; + //debugger; let data = []; arr.forEach(item => { if (item.id === parent) { @@ -239,7 +239,7 @@ } } }); - debugger; + //debugger; return data }, //删除 @@ -255,15 +255,15 @@ }, submitHandle() { let that = this; - debugger; + // debugger; console.log(this.addForm.parent); - debugger; + // debugger; if (this.addForm.parent !== null) { this.addForm.parent = this.addForm.parent[this.addForm.parent.length - 1]; } else { this.addForm.parent = "" } - debugger; + // debugger; console.log(this.codes); if(this.codes.indexOf(','>-1)){ @@ -271,10 +271,10 @@ }else{ this.addForm.codes.push(this.codes) } - debugger; + // debugger; console.log(this.addForm.codes); this.$refs.addForm.validate((valid) => { - debugger; + // debugger; if (valid) { this.isSaveing = true; var res; @@ -287,7 +287,7 @@ this.limitedVisible = false; this.$refs.table.refresh(); console.log(res); - debugger; + // debugger; } }) }, diff --git a/src/views/sys/dept.vue b/src/views/sys/dept.vue index 66c073b4..d82422bb 100644 --- a/src/views/sys/dept.vue +++ b/src/views/sys/dept.vue @@ -123,7 +123,7 @@ methods: { handleChange(value) { // this.menu.checked = check.checkedKeys; - debugger; + //debugger; console.log(value); console.log(this.addForm.parent); }, @@ -165,7 +165,7 @@ }, //编辑 editDept(row){ - debugger; + // debugger; this.temp = []; this.type='edit'; this.addForm.id=row.id; @@ -203,12 +203,12 @@ }, submitHandle(){ let that = this; - debugger; + //debugger; console.log(this.addForm.parent); - debugger; + //debugger; this.addForm.parent = this.addForm.parent!==null?this.addForm.parent[0]?this.addForm.parent[0]:'':''; this.$refs.addForm.validate( (valid) => { - debugger; + // debugger; if (valid) { this.isSaveing = true; var res; @@ -221,7 +221,7 @@ this.limitedVisible = false; this.$refs.table.refresh(); console.log(res); - debugger; + // debugger; } }) }, diff --git a/src/views/sys/dict.vue b/src/views/sys/dict.vue index d0bbb3a4..35f69960 100644 --- a/src/views/sys/dict.vue +++ b/src/views/sys/dict.vue @@ -41,6 +41,7 @@ +