1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const state = {
  list1 = [],
  list2 = [
    {
      id: "001",
      name: "任务1",
      child: [
        {
          id: "1",
          sdk_name: "人脸检测",
          isSelect: false
        },
        {
          id: "2",
          sdk_name: "人脸对比",
          isSelect: false
        }
      ],
      isSetting: false,
      isShowSetAlgo: false
    }
  ],
  argsList : [],
  baseObject : {
    id: '',
    algoId: '',
    options1: [],
    options2: [],
    options3: [],
    value1: '',
    value2: '',
    value3: '',
    unit: ''
  },
  currentAlgoId : '',
  currentTaskId : ''
};
 
const getters = {};
 
const mutations = {
  findAllSdk(state, data){
    state.list1 = data;
  },
  findByType(state, data){
    state.baseObject.options2 = data;
  }
};
const actions = {
  findAllSdk({commit},params) {
    let res = await findAllSdk({});
    if (res && res.success) {
      commit('findAllSdk',res.data)
    }
  },
 
  findByType({commit},params) {
    let res = await findByType({});
    console.log(res,'findByType')
    if (res && res.success) {
      let list = res.data.RULECOMPUTEBETWEEN.map((i) => {
        let obj = {}
        obj.name = i.name
        obj.value = i.value
        return obj
      })
      //this.baseObject.options2 = [...list]
      commit('findByType',[...list]);
    }
  },
 
  
};
export default{
  state,
  getters,
  actions,
  mutations
}