实验记录缓存课程下拉

UI_2022-02-10
jialong.yu 3 years ago
parent 63a5add217
commit a7fe814641
  1. 2
      src/pages/record/details/index.vue
  2. 5
      src/pages/record/list/ass.vue
  3. 8
      src/pages/record/list/index.vue
  4. 6
      src/pages/record/list/practice.vue
  5. 10
      src/store/modules/project.js

@ -54,7 +54,6 @@
</template>
<script>
import { mapState, mapActions } from "vuex";
import axios from 'axios'
import Setting from "@/setting";
import util from "@/libs/util";
@ -126,7 +125,6 @@ export default {
}
},
toReport(row) {
// this.setSystemId(this.systemId);
this.$router.push(`/record/show?reportId=${row.reportId}`);
}
}

@ -34,6 +34,7 @@
</template>
<script>
import { mapActions } from "vuex";
export default {
props: ["curriculumId"],
data() {
@ -56,6 +57,9 @@ export default {
}
},
methods: {
...mapActions({
setCurriculum: "project/setCurriculum"
}),
tableRowStyle({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) {
return "background-color: #FFF";
@ -78,6 +82,7 @@ export default {
}).catch(err => {});
},
toReport(row) {
this.setCurriculum(this.curriculumId)
this.$router.push(`show?id=${row.id}&recordId=${row.recordid}&reportId=${row.reportId}`);
}
}

@ -84,9 +84,9 @@ export default {
};
},
computed: {
...mapState({
'lastRecordType': state => state.project.lastRecordType
})
...mapState("project", [
'lastRecordType', 'currId'
])
},
created() {
this.active = this.lastRecordType ? this.lastRecordType : "practice";
@ -103,7 +103,7 @@ export default {
this.$get(this.api.schoolCourseByAchievement).then(res => {
if (res.data && res.data.length) {
this.curriculumList = res.data;
this.curriculumId = this.curriculumList[0].cid;
this.curriculumId = this.currId || this.curriculumList[0].cid
}
}).catch(err => {
console.log(err);

@ -23,7 +23,7 @@
</template>
<script>
import { mapActions } from "vuex";
export default {
props: ["curriculumId"],
data() {
@ -46,6 +46,9 @@ export default {
}
},
methods: {
...mapActions({
setCurriculum: "project/setCurriculum"
}),
tableRowStyle({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) {
return "background-color: #FFF";
@ -68,6 +71,7 @@ export default {
}).catch(err => {});
},
toDetails(row) {
this.setCurriculum(this.curriculumId)
this.$router.push(`/record/details?curriculumId=${this.curriculumId}&projectId=${row.projectId}`);
}
}

@ -4,20 +4,20 @@
export default {
namespaced: true,
state: {
lastSystemId: 1,
currId: '',
lastRecordType: "practice"
},
mutations: {
SET_SYSTEM_ID: (state, systemId) => {
state.lastSystemId = systemId;
SET_CURRICULUM: (state, currId) => {
state.currId = currId
},
SET_RECORD: (state, type) => {
state.lastRecordType = type;
}
},
actions: {
setSystemId({ state, commit }, systemId) {
commit("SET_SYSTEM_ID", systemId);
setCurriculum({ state, commit }, currId) {
commit("SET_CURRICULUM", currId);
},
setRecord({ state, commit }, active) {
commit('SET_RECORD', active)

Loading…
Cancel
Save