diff --git a/src/pages/photography.vue b/src/pages/photography.vue index e1bf444..8047d4e 100644 --- a/src/pages/photography.vue +++ b/src/pages/photography.vue @@ -77,7 +77,7 @@ export default { })); this.$bus.$on("projectChange", debounce(res => { this.prj = res; - this.loadData(); + this.loadData2(); })); if (this.$root.hasInitHeader) { this.initMe(); @@ -91,7 +91,7 @@ export default { this.info=it; },400) }, - loadData() { + loadData2() { this.info=null; this.getProjectId(id => { this.$api.project.listPhotography(id).then(d => { @@ -108,9 +108,9 @@ export default { }); }, initMe() { - this.project = this.$root.project || {}; - this.prjs = this.$root.projects || []; - this.loadData(); + this.prj = this.$root.project || {}; + this.prjs = this.$root.projects || []; + this.loadData2(); }, getProjectId(cb) { let func = () => { diff --git a/src/pages/projectDetail.vue b/src/pages/projectDetail.vue index 9dc2f7c..e6dbb85 100644 --- a/src/pages/projectDetail.vue +++ b/src/pages/projectDetail.vue @@ -606,6 +606,7 @@ import projectInfoDlg from './detail/projectInfoDlg.vue' import debounce from 'lodash.debounce' import AttendanceDetailDialog from './components/AttendanceDetailDialog.vue' import JobWorkerDialog from './components/JobWorkerDialog.vue' +import { tryToJson } from '@/utils/tools' export default { components: { MonitAndWarning, projectInfoDlg, @@ -1016,8 +1017,8 @@ export default { this.prjResNav = n; if (n == '06') { this.prjResultsData = this.finishBuildNode.filter(d => d.lvl.length == 4 && d.lvl.substring(0, 2) == '06').map(it => { - if (it.files) { - it.files = JSON.parse(it.files); + if (it.files && !Array.isArray(it.files)) { + it.files = tryToJson(it.files,[]); } else { it.files = []; } @@ -1025,8 +1026,8 @@ export default { }); } else { this.prjResultsData = this.finishBuildNode.filter(d => d.lvl.length == 6 && d.lvl.substring(0, 2) == n).map(it => { - if (it.files) { - it.files = JSON.parse(it.files); + if (it.files && !Array.isArray(it.files)) { + it.files = tryToJson(it.files,[]); } else { it.files = []; }