From 414c90c1391e5e8bc1260baabf77188ad3ed34f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com> Date: Fri, 4 Jun 2021 11:21:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/cyCourse.js | 27 +++ src/components/Crud/crud.js | 3 + src/components/material/index.vue | 1 + src/mixins/crud.js | 1 + src/views/article/addArt.vue | 205 +++++++++++++++++ src/views/article/index.vue | 189 ++++++++++++++++ src/views/course/add.vue | 3 + src/views/course/index.vue | 353 ++++++++++++++++++++++++++++++ src/views/login.vue | 4 +- 10 files changed, 785 insertions(+), 3 deletions(-) create mode 100644 src/api/cyCourse.js create mode 100644 src/views/article/addArt.vue create mode 100644 src/views/article/index.vue create mode 100644 src/views/course/add.vue create mode 100644 src/views/course/index.vue diff --git a/.env.development b/.env.development index ee1c525..5a200ae 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ ENV = 'development' # 接口地址 -VUE_APP_BASE_API = 'http://localhost:8088' +VUE_APP_BASE_API = 'http://192.168.0.109:8091' VUE_APP_WS_API = 'ws://localhost:8088' diff --git a/src/api/cyCourse.js b/src/api/cyCourse.js new file mode 100644 index 0000000..fa39a60 --- /dev/null +++ b/src/api/cyCourse.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/cyCourse', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/cyCourse/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/cyCourse', + method: 'put', + data + }) +} + +export default { add, edit, del } diff --git a/src/components/Crud/crud.js b/src/components/Crud/crud.js index a07ce92..60e0723 100644 --- a/src/components/Crud/crud.js +++ b/src/components/Crud/crud.js @@ -158,6 +158,8 @@ function CRUD(options) { * @param {*} data 数据项 */ toEdit(data) { + console.log('data', data) + console.log('data', JSON.parse(JSON.stringify(data))) crud.resetForm(JSON.parse(JSON.stringify(data))) if (!(callVmHook(crud, CRUD.HOOK.beforeToEdit, crud.form) && callVmHook(crud, CRUD.HOOK.beforeToCU, crud.form))) { return @@ -373,6 +375,7 @@ function CRUD(options) { * @param {Array} data 数据 */ resetForm(data) { + console.log(data) const form = data || (typeof crud.defaultForm === 'object' ? JSON.parse(JSON.stringify(crud.defaultForm)) : crud.defaultForm()) const crudFrom = crud.form for (const key in form) { diff --git a/src/components/material/index.vue b/src/components/material/index.vue index 6232bc0..d29e63d 100644 --- a/src/components/material/index.vue +++ b/src/components/material/index.vue @@ -458,6 +458,7 @@ export default { return isPic && isLt2M }, sureUrls() { + console.log(this.urls) this.urls.forEach(item => { this.$set(this.value, this.value.length, item) }) diff --git a/src/mixins/crud.js b/src/mixins/crud.js index 8ed7fe1..96c5cc0 100644 --- a/src/mixins/crud.js +++ b/src/mixins/crud.js @@ -292,6 +292,7 @@ export default { * 提交 */ submitMethod() { + console.log('submit') if (!this.beforeSubmitMethod()) { return } diff --git a/src/views/article/addArt.vue b/src/views/article/addArt.vue new file mode 100644 index 0000000..e68a932 --- /dev/null +++ b/src/views/article/addArt.vue @@ -0,0 +1,205 @@ + + + + + diff --git a/src/views/article/index.vue b/src/views/article/index.vue new file mode 100644 index 0000000..d86a0e5 --- /dev/null +++ b/src/views/article/index.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/src/views/course/add.vue b/src/views/course/add.vue new file mode 100644 index 0000000..8a422ca --- /dev/null +++ b/src/views/course/add.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/course/index.vue b/src/views/course/index.vue new file mode 100644 index 0000000..dfb9359 --- /dev/null +++ b/src/views/course/index.vue @@ -0,0 +1,353 @@ + + + + + diff --git a/src/views/login.vue b/src/views/login.vue index e9e0a01..f2194c8 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -1,7 +1,7 @@