diff --git a/src/api/historyCourse/index.js b/src/api/historyCourse/index.js new file mode 100644 index 0000000..b4571b5 --- /dev/null +++ b/src/api/historyCourse/index.js @@ -0,0 +1,56 @@ +import request from "@/utils/request"; +function customParamsSerializer(params) { + let result = ''; + for (let key in params) { + if (params.hasOwnProperty(key)) { + if (Array.isArray(params[key])) { + params[key].forEach((item, index) => { + if (item.key) { + result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`; + + } else { + result += `${key}[${index}]=${item}&` + } + }); + } else { + result += `${key}=${params[key]}&`; + } + } + } + return result.slice(0, -1); +} + +export function index(params, isLoading = false) { + return request({ + method: "get", + url: "/api/admin/history-courses/index", + params, + paramsSerializer: customParamsSerializer, + isLoading + }) +} + +export function show(params, isLoading = true) { + return request({ + method: "get", + url: "/api/admin/history-courses/show", + params, + isLoading + }) +} + +export function save(data) { + return request({ + method: "post", + url: "/api/admin/history-courses/save", + data + }) +} + +export function destroy(params) { + return request({ + method: "get", + url: "/api/admin/history-courses/destroy", + params + }) +} diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index dc16261..7c4942a 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -1,5 +1,6 @@ + @@ -219,6 +232,7 @@ show_txl:'', show_mobile:'', auto_schoolmate:'', + is_history:0, }, rules: { name: [{ @@ -263,6 +277,7 @@ this.form.show_txl = res.show_txl?res.show_txl:(res.show_txl==0?0:'') this.form.show_mobile = res.show_mobile?res.show_mobile:(res.show_mobile==0?0:'') this.form.auto_schoolmate = res.auto_schoolmate?res.auto_schoolmate:(res.auto_schoolmate==0?0:'') + this.form.is_history = res.is_history?res.is_history:0 }) }, @@ -294,6 +309,7 @@ show_txl:'', show_mobile:'', auto_schoolmate:'', + is_history:0, }, this.$refs['dialog'].reset() } diff --git a/src/views/course/types.vue b/src/views/course/types.vue index 4a3bb43..ec2c786 100644 --- a/src/views/course/types.vue +++ b/src/views/course/types.vue @@ -6,8 +6,27 @@
- 新增 - +
+ + + + +
+
+ + + + + + +
+
+ 查询 + 重置 +
+
+ 新增 +
@@ -27,14 +46,22 @@ - +