|
@@ -1,271 +1,256 @@
|
|
|
-import { createStore } from 'vuex'
|
|
|
-
|
|
|
+import { createStore } from "vuex";
|
|
|
+import user from "@/store/modules/user";
|
|
|
+import getter from "./getters";
|
|
|
export default createStore({
|
|
|
- state: {
|
|
|
- tagsList: [],
|
|
|
- collapse: true,
|
|
|
- //stationList
|
|
|
- stationList: [],
|
|
|
- stationListAll: [],
|
|
|
- //实时报警
|
|
|
- warningList: [],
|
|
|
- //是否存在实时报警轮询
|
|
|
- warnInterval: null,
|
|
|
- //是否启用报警弹窗
|
|
|
- enableWarn: false,
|
|
|
- //报警弹窗持续时间
|
|
|
- warnTime: 0,
|
|
|
+ state: {
|
|
|
+ tagsList: [],
|
|
|
+ collapse: true,
|
|
|
+ //stationList
|
|
|
+ stationList: [],
|
|
|
+ stationListAll: [],
|
|
|
+ //实时报警
|
|
|
+ warningList: [],
|
|
|
+ //是否存在实时报警轮询
|
|
|
+ warnInterval: null,
|
|
|
+ //是否启用报警弹窗
|
|
|
+ enableWarn: false,
|
|
|
+ //报警弹窗持续时间
|
|
|
+ warnTime: 0,
|
|
|
|
|
|
- // setp 步骤条
|
|
|
- stepArray: [
|
|
|
- {
|
|
|
- title: "方案",
|
|
|
- dec: "方案选择",
|
|
|
- icon: "el-icon-edit-outline",
|
|
|
- isPass: false,
|
|
|
- },
|
|
|
- {
|
|
|
- title: "环境",
|
|
|
- dec: "环境配置",
|
|
|
- icon: "el-icon-s-promotion",
|
|
|
- isPass: false,
|
|
|
- },
|
|
|
- {
|
|
|
- title: "数据",
|
|
|
- dec: "获取数据",
|
|
|
- icon: "el-icon-upload",
|
|
|
- isPass: false,
|
|
|
- },
|
|
|
- { title: "训练", dec: "训练模型", icon: "el-icon-cpu", isPass: false },
|
|
|
- {
|
|
|
- title: "评估",
|
|
|
- dec: "评估模型",
|
|
|
- icon: "el-icon-s-opportunity",
|
|
|
- isPass: false,
|
|
|
- },
|
|
|
- {
|
|
|
- title: "模型",
|
|
|
- dec: "保存模型",
|
|
|
- icon: "el-icon-receiving",
|
|
|
- isPass: false,
|
|
|
- },
|
|
|
- ],
|
|
|
+ // setp 步骤条
|
|
|
+ stepArray: [
|
|
|
+ {
|
|
|
+ title: "方案",
|
|
|
+ dec: "方案选择",
|
|
|
+ icon: "el-icon-edit-outline",
|
|
|
+ isPass: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "环境",
|
|
|
+ dec: "环境配置",
|
|
|
+ icon: "el-icon-s-promotion",
|
|
|
+ isPass: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "数据",
|
|
|
+ dec: "获取数据",
|
|
|
+ icon: "el-icon-upload",
|
|
|
+ isPass: false,
|
|
|
+ },
|
|
|
+ { title: "训练", dec: "训练模型", icon: "el-icon-cpu", isPass: false },
|
|
|
+ {
|
|
|
+ title: "评估",
|
|
|
+ dec: "评估模型",
|
|
|
+ icon: "el-icon-s-opportunity",
|
|
|
+ isPass: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "模型",
|
|
|
+ dec: "保存模型",
|
|
|
+ icon: "el-icon-receiving",
|
|
|
+ isPass: false,
|
|
|
+ },
|
|
|
+ ],
|
|
|
|
|
|
- // 当前激活的 step 下标
|
|
|
- setpIndex: 0,
|
|
|
+ // 当前激活的 step 下标
|
|
|
+ setpIndex: 0,
|
|
|
|
|
|
- // step 1 参数
|
|
|
- setpOptions1: {
|
|
|
- id: "", // 方案 ID
|
|
|
- project: {} // 方案配置
|
|
|
- },
|
|
|
+ // step 1 参数
|
|
|
+ setpOptions1: {
|
|
|
+ id: "", // 方案 ID
|
|
|
+ project: {}, // 方案配置
|
|
|
+ },
|
|
|
|
|
|
- // step 2 参数
|
|
|
- setpOptions2: {
|
|
|
- id: "", // 配置 ID
|
|
|
- host: "", // GPU 服务器 IP
|
|
|
- configName: "", // 配置名称
|
|
|
- diskSize: "", // 磁盘大小
|
|
|
- gpu: [], // GPU
|
|
|
- totalMemory: "" // 内存大小
|
|
|
- },
|
|
|
+ // step 2 参数
|
|
|
+ setpOptions2: {
|
|
|
+ id: "", // 配置 ID
|
|
|
+ host: "", // GPU 服务器 IP
|
|
|
+ configName: "", // 配置名称
|
|
|
+ diskSize: "", // 磁盘大小
|
|
|
+ gpu: [], // GPU
|
|
|
+ totalMemory: "", // 内存大小
|
|
|
+ },
|
|
|
|
|
|
- // step 3 参数
|
|
|
- setpOptions3: {
|
|
|
- id: "0", // 模式 ID
|
|
|
- file: null, // 本地文件
|
|
|
- sqlServer: "casefault", // 选择的表名称
|
|
|
- sqlWord: "", // 手动输入的 sql
|
|
|
- useSourceData: true, // 是否使用原数据
|
|
|
- forecastRow: "", // 要预测的列
|
|
|
- inputRow: [], // 要输入的列
|
|
|
- points: [], // 使用原始数据后要输入的列
|
|
|
- faults: [], // 使用原始数据后表格数据
|
|
|
- acc: "", // 最佳模型
|
|
|
- },
|
|
|
+ // step 3 参数
|
|
|
+ setpOptions3: {
|
|
|
+ id: "0", // 模式 ID
|
|
|
+ file: null, // 本地文件
|
|
|
+ sqlServer: "casefault", // 选择的表名称
|
|
|
+ sqlWord: "", // 手动输入的 sql
|
|
|
+ useSourceData: true, // 是否使用原数据
|
|
|
+ forecastRow: "", // 要预测的列
|
|
|
+ inputRow: [], // 要输入的列
|
|
|
+ points: [], // 使用原始数据后要输入的列
|
|
|
+ faults: [], // 使用原始数据后表格数据
|
|
|
+ acc: "", // 最佳模型
|
|
|
+ },
|
|
|
|
|
|
- // step 4 参数
|
|
|
- setpOptions4: {
|
|
|
- trainBtnIcon: "", // 训练按钮 icon
|
|
|
- trainBtnTitle: "开始训练", // 训练按钮文本
|
|
|
- trainSurplusIcon: "", // 训练时间 icon
|
|
|
- trainSurplusTime: null, // 训练时间文本
|
|
|
- trainBtnDisabled: false, // 训练按钮是否禁用
|
|
|
- trainStatus: "", // 训练 icon 样式
|
|
|
- modelname: "", // 模型名称
|
|
|
- },
|
|
|
+ // step 4 参数
|
|
|
+ setpOptions4: {
|
|
|
+ trainBtnIcon: "", // 训练按钮 icon
|
|
|
+ trainBtnTitle: "开始训练", // 训练按钮文本
|
|
|
+ trainSurplusIcon: "", // 训练时间 icon
|
|
|
+ trainSurplusTime: null, // 训练时间文本
|
|
|
+ trainBtnDisabled: false, // 训练按钮是否禁用
|
|
|
+ trainStatus: "", // 训练 icon 样式
|
|
|
+ modelname: "", // 模型名称
|
|
|
+ },
|
|
|
|
|
|
- // step 5 参数
|
|
|
- setpOptions5: {
|
|
|
- exampleData: [], // 示例数据
|
|
|
- showExampleResult: false, // 显示预测结果
|
|
|
- result: "", // 预测结果
|
|
|
- },
|
|
|
+ // step 5 参数
|
|
|
+ setpOptions5: {
|
|
|
+ exampleData: [], // 示例数据
|
|
|
+ showExampleResult: false, // 显示预测结果
|
|
|
+ result: "", // 预测结果
|
|
|
+ },
|
|
|
|
|
|
- // step 6 参数
|
|
|
- setpOptions6: {
|
|
|
- data: {}, // 模型
|
|
|
- changZhan: "", // 场站
|
|
|
- modelName: "", // 模型名称
|
|
|
- },
|
|
|
+ // step 6 参数
|
|
|
+ setpOptions6: {
|
|
|
+ data: {}, // 模型
|
|
|
+ changZhan: "", // 场站
|
|
|
+ modelName: "", // 模型名称
|
|
|
+ },
|
|
|
|
|
|
- // 训练控制台信息
|
|
|
- progressArray: [],
|
|
|
- },
|
|
|
- mutations: {
|
|
|
- delTagsItem(state, data) {
|
|
|
- state
|
|
|
- .tagsList
|
|
|
- .splice(data.index, 1);
|
|
|
- },
|
|
|
- setTagsItem(state, data) {
|
|
|
- state
|
|
|
- .tagsList
|
|
|
- .push(data)
|
|
|
- },
|
|
|
- clearTags(state) {
|
|
|
- state.tagsList = []
|
|
|
- },
|
|
|
- closeTagsOther(state, data) {
|
|
|
- state.tagsList = data;
|
|
|
- },
|
|
|
- closeCurrentTag(state, data) {
|
|
|
- for (let i = 0, len = state.tagsList.length; i < len; i++) {
|
|
|
- const item = state.tagsList[i];
|
|
|
- if (item.path === data.$route.fullPath) {
|
|
|
- if (i < len - 1) {
|
|
|
- data
|
|
|
- .$router
|
|
|
- .push(state.tagsList[i + 1].path);
|
|
|
- } else if (i > 0) {
|
|
|
- data
|
|
|
- .$router
|
|
|
- .push(state.tagsList[i - 1].path);
|
|
|
- } else {
|
|
|
- data
|
|
|
- .$router
|
|
|
- .push("/");
|
|
|
- }
|
|
|
- state
|
|
|
- .tagsList
|
|
|
- .splice(i, 1);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 侧边栏折叠
|
|
|
- hadndleCollapse(state, data) {
|
|
|
- state.collapse = data;
|
|
|
- },
|
|
|
- // stationList
|
|
|
- setStationList(state, data) {
|
|
|
- state.stationList = data;
|
|
|
- },
|
|
|
- setStationListAll(state, data) {
|
|
|
- state.stationListAll = data;
|
|
|
- },
|
|
|
- // --------------------------------------------------------------------
|
|
|
- //实时报警
|
|
|
- setWarning(state, data) {
|
|
|
- state.warningList.unshift(data);
|
|
|
- },
|
|
|
- //是否存在实时报警轮询
|
|
|
- setWarnInterval(state, data) {
|
|
|
- state.warnInterval = data;
|
|
|
- },
|
|
|
- //是否启用报警弹窗
|
|
|
- setEnableWarn(state, data) {
|
|
|
- state.enableWarn = data;
|
|
|
- },
|
|
|
- setWarnTime(state, data) {
|
|
|
- state.warnTime = data;
|
|
|
- },
|
|
|
+ // 训练控制台信息
|
|
|
+ progressArray: [],
|
|
|
+ },
|
|
|
+ mutations: {
|
|
|
+ delTagsItem(state, data) {
|
|
|
+ state.tagsList.splice(data.index, 1);
|
|
|
+ },
|
|
|
+ setTagsItem(state, data) {
|
|
|
+ state.tagsList.push(data);
|
|
|
+ },
|
|
|
+ clearTags(state) {
|
|
|
+ state.tagsList = [];
|
|
|
+ },
|
|
|
+ closeTagsOther(state, data) {
|
|
|
+ state.tagsList = data;
|
|
|
+ },
|
|
|
+ closeCurrentTag(state, data) {
|
|
|
+ for (let i = 0, len = state.tagsList.length; i < len; i++) {
|
|
|
+ const item = state.tagsList[i];
|
|
|
+ if (item.path === data.$route.fullPath) {
|
|
|
+ if (i < len - 1) {
|
|
|
+ data.$router.push(state.tagsList[i + 1].path);
|
|
|
+ } else if (i > 0) {
|
|
|
+ data.$router.push(state.tagsList[i - 1].path);
|
|
|
+ } else {
|
|
|
+ data.$router.push("/");
|
|
|
+ }
|
|
|
+ state.tagsList.splice(i, 1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 侧边栏折叠
|
|
|
+ hadndleCollapse(state, data) {
|
|
|
+ state.collapse = data;
|
|
|
+ },
|
|
|
+ // stationList
|
|
|
+ setStationList(state, data) {
|
|
|
+ state.stationList = data;
|
|
|
+ },
|
|
|
+ setStationListAll(state, data) {
|
|
|
+ state.stationListAll = data;
|
|
|
+ },
|
|
|
+ // --------------------------------------------------------------------
|
|
|
+ //实时报警
|
|
|
+ setWarning(state, data) {
|
|
|
+ state.warningList.unshift(data);
|
|
|
+ },
|
|
|
+ //是否存在实时报警轮询
|
|
|
+ setWarnInterval(state, data) {
|
|
|
+ state.warnInterval = data;
|
|
|
+ },
|
|
|
+ //是否启用报警弹窗
|
|
|
+ setEnableWarn(state, data) {
|
|
|
+ state.enableWarn = data;
|
|
|
+ },
|
|
|
+ setWarnTime(state, data) {
|
|
|
+ state.warnTime = data;
|
|
|
+ },
|
|
|
|
|
|
- changeStepArray(state, data) {
|
|
|
- state.stepArray = data;
|
|
|
- },
|
|
|
+ changeStepArray(state, data) {
|
|
|
+ state.stepArray = data;
|
|
|
+ },
|
|
|
|
|
|
- changeSetpIndex(state, data) {
|
|
|
- state.setpIndex = data;
|
|
|
- },
|
|
|
+ changeSetpIndex(state, data) {
|
|
|
+ state.setpIndex = data;
|
|
|
+ },
|
|
|
|
|
|
- setOpt1(state, data) {
|
|
|
- state.setpOptions1 = data;
|
|
|
- },
|
|
|
+ setOpt1(state, data) {
|
|
|
+ state.setpOptions1 = data;
|
|
|
+ },
|
|
|
|
|
|
- setOpt2(state, data) {
|
|
|
- state.setpOptions2 = data;
|
|
|
- },
|
|
|
+ setOpt2(state, data) {
|
|
|
+ state.setpOptions2 = data;
|
|
|
+ },
|
|
|
|
|
|
- setOpt3(state, data) {
|
|
|
- state.setpOptions3 = data;
|
|
|
- },
|
|
|
+ setOpt3(state, data) {
|
|
|
+ state.setpOptions3 = data;
|
|
|
+ },
|
|
|
|
|
|
- setOpt4(state, data) {
|
|
|
- state.setpOptions4 = data;
|
|
|
- },
|
|
|
+ setOpt4(state, data) {
|
|
|
+ state.setpOptions4 = data;
|
|
|
+ },
|
|
|
|
|
|
- setOpt5(state, data) {
|
|
|
- state.setpOptions5 = data;
|
|
|
- },
|
|
|
+ setOpt5(state, data) {
|
|
|
+ state.setpOptions5 = data;
|
|
|
+ },
|
|
|
|
|
|
- setOpt6(state, data) {
|
|
|
- state.setpOptions6 = data;
|
|
|
- },
|
|
|
+ setOpt6(state, data) {
|
|
|
+ state.setpOptions6 = data;
|
|
|
+ },
|
|
|
|
|
|
- setProgressArray(state, data) {
|
|
|
- state.progressArray = data;
|
|
|
- },
|
|
|
- },
|
|
|
- actions: {
|
|
|
- actionsWarning(context, newData) {
|
|
|
- context.commit("setWarning", newData);
|
|
|
- },
|
|
|
- //stationList
|
|
|
- actionsStationList(context, newData) {
|
|
|
- context.commit("setStationList", newData);
|
|
|
- },
|
|
|
- actionsStationListAll(context, newData) {
|
|
|
- context.commit("setStationListAll", newData);
|
|
|
- },
|
|
|
- //是否存在实时报警轮询
|
|
|
- actionsWarnInterval(context, newData) {
|
|
|
- context.commit("setWarnInterval", newData);
|
|
|
- },
|
|
|
+ setProgressArray(state, data) {
|
|
|
+ state.progressArray = data;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ actions: {
|
|
|
+ actionsWarning(context, newData) {
|
|
|
+ context.commit("setWarning", newData);
|
|
|
+ },
|
|
|
+ //stationList
|
|
|
+ actionsStationList(context, newData) {
|
|
|
+ context.commit("setStationList", newData);
|
|
|
+ },
|
|
|
+ actionsStationListAll(context, newData) {
|
|
|
+ context.commit("setStationListAll", newData);
|
|
|
+ },
|
|
|
+ //是否存在实时报警轮询
|
|
|
+ actionsWarnInterval(context, newData) {
|
|
|
+ context.commit("setWarnInterval", newData);
|
|
|
+ },
|
|
|
|
|
|
- changeStepArray() {
|
|
|
- context.commit("changeStepArray", newData);
|
|
|
- },
|
|
|
+ changeStepArray() {
|
|
|
+ context.commit("changeStepArray", newData);
|
|
|
+ },
|
|
|
|
|
|
- changeSetpIndex(context, newData) {
|
|
|
- context.commit("changeSetpIndex", newData);
|
|
|
- },
|
|
|
- setOpt1(context, newData) {
|
|
|
- context.commit("setOpt1", newData);
|
|
|
- },
|
|
|
- setOpt2(context, newData) {
|
|
|
- context.commit("setOpt2", newData);
|
|
|
- },
|
|
|
- setOpt3(context, newData) {
|
|
|
- context.commit("setOpt3", newData);
|
|
|
- },
|
|
|
- setOpt4(context, newData) {
|
|
|
- context.commit("setOpt4", newData);
|
|
|
- },
|
|
|
- setOpt5(context, newData) {
|
|
|
- context.commit("setOpt5", newData);
|
|
|
- },
|
|
|
- setOpt6(context, newData) {
|
|
|
- context.commit("setOpt6", newData);
|
|
|
- },
|
|
|
- setProgressArray(context, newData) {
|
|
|
- context.commit("setProgressArray", newData);
|
|
|
- },
|
|
|
- },
|
|
|
- modules: {},
|
|
|
- getters: {
|
|
|
- isStation(state) {
|
|
|
- return state.stationList.length == 1
|
|
|
- }
|
|
|
- }
|
|
|
-})
|
|
|
+ changeSetpIndex(context, newData) {
|
|
|
+ context.commit("changeSetpIndex", newData);
|
|
|
+ },
|
|
|
+ setOpt1(context, newData) {
|
|
|
+ context.commit("setOpt1", newData);
|
|
|
+ },
|
|
|
+ setOpt2(context, newData) {
|
|
|
+ context.commit("setOpt2", newData);
|
|
|
+ },
|
|
|
+ setOpt3(context, newData) {
|
|
|
+ context.commit("setOpt3", newData);
|
|
|
+ },
|
|
|
+ setOpt4(context, newData) {
|
|
|
+ context.commit("setOpt4", newData);
|
|
|
+ },
|
|
|
+ setOpt5(context, newData) {
|
|
|
+ context.commit("setOpt5", newData);
|
|
|
+ },
|
|
|
+ setOpt6(context, newData) {
|
|
|
+ context.commit("setOpt6", newData);
|
|
|
+ },
|
|
|
+ setProgressArray(context, newData) {
|
|
|
+ context.commit("setProgressArray", newData);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ modules: { user },
|
|
|
+ getters: getter,
|
|
|
+});
|