Browse Source

修改合并行函数

master
YF-yuan 3 years ago
parent
commit
950422669f
9 changed files with 45 additions and 18 deletions
  1. +7
    -1
      src/utils/mixin.js
  2. +5
    -2
      src/views/assessingTarget/basicTarget.vue
  3. +4
    -2
      src/views/assessingTarget/commonquotatask.vue
  4. +4
    -2
      src/views/assessingTarget/constraint.vue
  5. +5
    -3
      src/views/assessingTarget/reward.vue
  6. +6
    -2
      src/views/basicTable/conventional.vue
  7. +5
    -2
      src/views/summary/basicTarget.vue
  8. +4
    -2
      src/views/summary/constraint.vue
  9. +5
    -2
      src/views/summary/reward.vue

+ 7
- 1
src/utils/mixin.js View File

}, },
} }


export function mergeSpan(params) {
/**
*
* @param {*} params
* [{name: 'quota, col: [1,2]}]
*/
export function mergeSpan(params) {
return { return {
methods: { methods: {
reduceData(data) { reduceData(data) {

+ 5
- 2
src/views/assessingTarget/basicTarget.vue View File

import tab from "./tab"; import tab from "./tab";
import search from "./search"; import search from "./search";
import api from "@/api/assessingTarget/basicTarget"; import api from "@/api/assessingTarget/basicTarget";
import { assessing } from "@/utils/mixin";
import { mergeSpan } from "@/utils/mixin";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect"; // 下拉树 import Treeselect from "@riophae/vue-treeselect"; // 下拉树
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
search, search,
Treeselect, Treeselect,
}, },
mixins: [assessing],
mixins: [mergeSpan([
{name: 'quota1', col: [1]},
{name: 'quota2', col: [2]},
])],
data() { data() {
return { return {
dataList: [], dataList: [],

+ 4
- 2
src/views/assessingTarget/commonquotatask.vue View File



<script> <script>
import api from "@/api/assessingTarget/commonquotatask"; import api from "@/api/assessingTarget/commonquotatask";
import { categoryName } from "@/utils/mixin";
import { mergeSpan } from "@/utils/mixin";
export default { export default {
components: {}, components: {},
data() { data() {
created() { created() {
this.getDataList(); this.getDataList();
}, },
mixins: [categoryName],
mixins: [mergeSpan([
{name: 'categoryName', col: [1]}
])],
methods: { methods: {
getDataList() { getDataList() {
this.loading = true; this.loading = true;

+ 4
- 2
src/views/assessingTarget/constraint.vue View File

import tab from "./tab"; import tab from "./tab";
import search from "./search"; import search from "./search";
import api from "@/api/assessingTarget/constraint"; import api from "@/api/assessingTarget/constraint";
import { quota } from "@/utils/mixin";
import { mergeSpan } from "@/utils/mixin";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect"; // 下拉树 import Treeselect from "@riophae/vue-treeselect"; // 下拉树
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
search, search,
Treeselect, Treeselect,
}, },
mixins: [quota],
mixins: [mergeSpan([
{name: 'quota', col: [1]}
])],
data() { data() {
return { return {
dataList: [], dataList: [],

+ 5
- 3
src/views/assessingTarget/reward.vue View File

import tab from "./tab"; import tab from "./tab";
import search from "./search"; import search from "./search";
import api from "@/api/assessingTarget/reward"; import api from "@/api/assessingTarget/reward";
import { assessing } from "@/utils/mixin";
import { mergeSpan } from "@/utils/mixin";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect"; // 下拉树 import Treeselect from "@riophae/vue-treeselect"; // 下拉树
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
search, search,
Treeselect, Treeselect,
}, },
mixins: [assessing],
mixins: [mergeSpan([
{name: 'quota1', col: [1]},
{name: 'quota2', col: [2]},
])],
data() { data() {
return { return {
dataList: [], dataList: [],
return item; return item;
}); });
this.dataList = this.reduceData(data); this.dataList = this.reduceData(data);
// this.dataList = data;
console.log(this.dataList); console.log(this.dataList);
this.count = res.data.data.total; this.count = res.data.data.total;
this.$nextTick(() => { this.$nextTick(() => {

+ 6
- 2
src/views/basicTable/conventional.vue View File

<script> <script>
import search from "./search"; import search from "./search";
import api from "@/api/basicTable/conventionl.js"; import api from "@/api/basicTable/conventionl.js";
import { base } from "@/utils/mixin";
import { mergeSpan } from "@/utils/mixin";
export default { export default {
components: { components: {
search, search,
}, },
mixins: [base],
mixins: [mergeSpan([
{name: 'year', col: [1]},
{name: 'code', col: [2,3]},
{name: 'quota1', col: [4]}
])],
data() { data() {
return { return {
dataList: [], dataList: [],

+ 5
- 2
src/views/summary/basicTarget.vue View File

<script> <script>
import search from "../assessingTarget/search"; import search from "../assessingTarget/search";
import api from "../../api/summary/basicTarget"; import api from "../../api/summary/basicTarget";
import { assessing } from "@/utils/mixin";
import { mergeSpan } from "@/utils/mixin";
export default { export default {
name: "basic-target", name: "basic-target",
data() { data() {
components: { components: {
search, search,
}, },
mixins: [assessing],
mixins: [mergeSpan([
{name: 'quota1', col: [1]},
{name: 'quota2', col: [2]},
])],
created() { created() {
this.getDataList(); this.getDataList();
this.$store.dispatch("base/getQuota1List", 1); this.$store.dispatch("base/getQuota1List", 1);

+ 4
- 2
src/views/summary/constraint.vue View File



<script> <script>
import search from "../assessingTarget/search"; import search from "../assessingTarget/search";
import { quota } from "@/utils/mixin";
import { mergeSpan } from "@/utils/mixin";
import api from "../../api/summary/constraint"; import api from "../../api/summary/constraint";
export default { export default {
name: "constraint", name: "constraint",
} }
}, },
}, },
mixins: [quota],
mixins: [mergeSpan([
{name: 'quota', col: [1]}
])],
created() { created() {
this.getDataList(); this.getDataList();
this.$store.dispatch("base/getQuota1List", 1); this.$store.dispatch("base/getQuota1List", 1);

+ 5
- 2
src/views/summary/reward.vue View File



<script> <script>
import search from "../assessingTarget/search"; import search from "../assessingTarget/search";
import { assessing } from "@/utils/mixin";
import { mergeSpan } from "@/utils/mixin";
import api from "../../api/summary/reward"; import api from "../../api/summary/reward";
export default { export default {
name: "", name: "",
components: { components: {
search, search,
}, },
mixins: [assessing],
mixins: [mergeSpan([
{name: 'quota1', col: [1]},
{name: 'quota2', col: [2]},
])],
created() { created() {
this.getDataList(); this.getDataList();
this.$store.dispatch("base/getQuota1List", 1); this.$store.dispatch("base/getQuota1List", 1);

Loading…
Cancel
Save