Commit c6976609385f482e189ea14e5f520e71737c625b
1 parent
b73391c1
update formDetails to formRecords
Showing
4 changed files
with
8 additions
and
8 deletions
back-end/h5-api/api/work/controllers/Work.js
| ... | ... | @@ -44,14 +44,14 @@ module.exports = { |
| 44 | 44 | |
| 45 | 45 | // learn the query from: https://github.com/strapi/foodadvisor/blob/master/api/api/restaurant/controllers/Restaurant.js#L40 |
| 46 | 46 | // eslint-disable-next-line no-undef |
| 47 | - let formDetails = await Workform.query(qb => { | |
| 47 | + let formRecords = await Workform.query(qb => { | |
| 48 | 48 | qb.where('work', '=', work.id); |
| 49 | 49 | }).fetchAll(); |
| 50 | - formDetails = formDetails.toJSON(); | |
| 50 | + formRecords = formRecords.toJSON(); | |
| 51 | 51 | |
| 52 | 52 | const uuidMap2Name = getUuidMap2Name(work); |
| 53 | 53 | // eslint-disable-next-line require-atomic-updates |
| 54 | - return ctx.body = { uuidMap2Name, formDetails }; | |
| 54 | + return ctx.body = { uuidMap2Name, formRecords }; | |
| 55 | 55 | }, |
| 56 | 56 | setAsTemplate: async (ctx) => { |
| 57 | 57 | let work = await strapi.services.work.findOne(ctx.params); | ... | ... |
front-end/h5/src/store/modules/editor.js
front-end/h5/src/store/modules/work.js
front-end/h5/src/views/work-manager/form-stat/detail.vue
| ... | ... | @@ -38,7 +38,7 @@ export default { |
| 38 | 38 | /** |
| 39 | 39 | * rows demo: [{"title":"姓名","key":"1565596393441"},{"title":"学校","key":"1565596397671"}] |
| 40 | 40 | * |
| 41 | - * formDetails example: <[{ | |
| 41 | + * formRecords example: <[{ | |
| 42 | 42 | "id": 4, |
| 43 | 43 | "form": { |
| 44 | 44 | "1565595388440": "ddd", |
| ... | ... | @@ -50,8 +50,8 @@ export default { |
| 50 | 50 | }]> |
| 51 | 51 | */ |
| 52 | 52 | rows () { |
| 53 | - const { formDetails, uuidMap2Name } = this.formDetailOfWork | |
| 54 | - const rows = formDetails.map(({ form, id }) => { | |
| 53 | + const { formRecords, uuidMap2Name } = this.formDetailOfWork | |
| 54 | + const rows = formRecords.map(({ form, id }) => { | |
| 55 | 55 | const row = {} |
| 56 | 56 | Object.entries(form).forEach(([uuid, inputValue = '-']) => { |
| 57 | 57 | if (uuidMap2Name[uuid]) { | ... | ... |