From 86e35bcb3590a55079c1efa21c387265af07ee1e Mon Sep 17 00:00:00 2001 From: lzh <52725224+Yourdaylight@users.noreply.github.com> Date: Sun, 4 Apr 2021 22:14:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E6=8B=A9=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B/=E6=95=B0=E6=8D=AE=E6=B8=85=E6=B4=97=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 348 +++++++++++++++++++++++-------------- src/views/Login.vue | 37 ++-- src/views/nav1/Clean.vue | 61 ++++++- src/views/nav1/MLmodel.vue | 26 ++- 4 files changed, 319 insertions(+), 153 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ca846dc..5b2788c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,18 +2,10 @@ - - - - - - - - - - + + @@ -269,7 +331,7 @@ - + @@ -354,7 +416,17 @@ - + + + + + + + + + + + 1601387458948 @@ -412,17 +484,25 @@ - - - + + - - + + @@ -435,7 +515,7 @@ - + @@ -495,10 +575,10 @@ - + @@ -506,9 +586,6 @@ - - - @@ -526,9 +603,6 @@ - - - @@ -545,20 +619,6 @@ - - - - - - - - - - - - - - @@ -592,13 +652,6 @@ - - - - - - - @@ -622,15 +675,7 @@ - - - - - - - - @@ -639,6 +684,7 @@ + @@ -659,32 +705,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @@ -692,31 +713,44 @@ - - + + + + + + - + - + + + + + + + - - - - - - + + + + + + + + + - - + + @@ -726,18 +760,70 @@ - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/Login.vue b/src/views/Login.vue index f64e8fa..29708a4 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -39,8 +39,10 @@ - 取 消 - 立即注册 + 取 消 + 立即注册 + 立即运行 + @@ -71,7 +73,7 @@ if (value===''){ callback(new Error("输入不能为空!")) } - axios.post("/api/check_exist",{ + axios.post("/api/user_authority/check_exist",{ "query_dict":{"username":value} }).then((response)=>{ var data=response.data @@ -88,7 +90,7 @@ if (value===''){ callback(new Error("输入不能为空!")) } - axios.post("/api/check_exist",{ + axios.post("/api/user_authority/check_exist",{ "query_dict":{"email":value} }).then((response)=>{ var data=response.data @@ -158,36 +160,40 @@ handleReset2() { this.$refs.ruleForm2.resetFields(); }, - handleSubmit2(ev) { + handleSubmit2: function (ev) { var _this = this; this.$refs.ruleForm2.validate((valid) => { if (valid) { //_this.$router.replace('/table'); this.logining = true; - axios.post("/api/login",{ + axios.post("/api/user_authority/login", { username: this.ruleForm2.account, password: Base64.encode(this.ruleForm2.checkPass) - }).then((response)=>{ - var data=response.data - if (data.msg===true) { + }).then((response) => { + var data = response.data + if (data.msg === true) { this.logining = false; - var user =this.ruleForm2.account + var user = this.ruleForm2.account console.log(user) sessionStorage.setItem('user', JSON.stringify(user)); sessionStorage.setItem('dataset_name', '') this.$router.push({path: '/table'}); this.$message.success("登录成功") - }else { + } else { this.logining = false; this.$message.error("用户名或密码错误,登录失败") } + }).catch((error) => { + this.logining = false; + this.$message.error("登录失败!") }) } else { console.log('error submit!!'); this.$message.error("用户名或密码错误,登录失败") return false; } - })}, + }) + }, handleRegistSubmit(){ var _this = this; @@ -196,7 +202,7 @@ if (valid) { console.log("表单校验通过!") flag=true - axios.post('/api/regist',{ + axios.post('/api/user_authority/regist',{ username:this.registform.username, password:Base64.encode(this.registform.password), email:this.registform.email, @@ -217,10 +223,13 @@ }) }, + runCode(){ + this.$message.info("按钮测试") + }, getCode(){ let me = this; this.isDiabled=true - axios.post('api/send_code',{ + axios.post('api/user_authority/send_code',{ "email":this.registform.email }) var totalTime=60 diff --git a/src/views/nav1/Clean.vue b/src/views/nav1/Clean.vue index 70fe544..079fcb1 100644 --- a/src/views/nav1/Clean.vue +++ b/src/views/nav1/Clean.vue @@ -44,7 +44,7 @@ 添加步骤 -
    +
    • {{item.columns.join(",")}}列进行 @@ -54,6 +54,28 @@
    + + 生成新的数据 + 生成数据清洗代码 + + + + + 清洗规则校验通过,是否保存清洗后的新数据 + + + + + + + + + 清洗规则校验通过,是否保存清洗后的新数据 + + + + + @@ -83,7 +105,9 @@ method_choice: [], clean_methods: {},//后端传的清洗方法(部分方法可能会有子方法需要动态生成输入框) show_sub_method: false, - condition_html: "" + condition_html: "", + saveDataDialogVisible: false, + generateCodeDialogVisible: false } }, created() { @@ -106,7 +130,7 @@ } }, get_clean_methods() { - axios.get('api/get_clean_methods').then( + axios.get('api/model_selection/get_methods?type=clean').then( (response) => { var methods = response.data.data console.log(methods) @@ -156,7 +180,6 @@ this.cols = columns this.cols.unshift("全部") - }) }, //数据集发生变化,获取对应数据列 @@ -184,6 +207,31 @@ }) }, + //校验清洗条件 + clean_data(){ + axios.post("/api/engine/check_clean_condition",{ + "conditions":this.cleanCondition, + "dataset":this.value, + "user_name":JSON.parse(sessionStorage.getItem("user")) + }).then((response)=>{ + var data = response.data + data.code === 200 ? this.$message.info(data.msg):this.$message.error(data.msg) + this.saveDataDialogVisible = true + }).catch((error)=>{ + this.$message.error("错误") + }) + }, + save_clean_data(){ + axios.post("/api/engine/save_clean_data", { + "conditions":this.cleanCondition, + "dataset":this.value, + "user_name":JSON.parse(sessionStorage.getItem("user")) + }).then((response)=>{ + var data = response.data + data.code === 200 ? this.$message.info(data.msg):this.$message.error(data.msg) + this.$router.push({path: '/table'}); + }) + } } } @@ -196,6 +244,11 @@ cursor: pointer; } + .clean_conditions{ + display: block; + margin-top: 50px; + font-size: 20px; + } .column_style { color: orangered; diff --git a/src/views/nav1/MLmodel.vue b/src/views/nav1/MLmodel.vue index 04a097f..124e189 100644 --- a/src/views/nav1/MLmodel.vue +++ b/src/views/nav1/MLmodel.vue @@ -38,7 +38,7 @@ - + @@ -106,7 +106,6 @@ models: [], metrics:[], desc:'' - }, models:{ "分类":['朴素贝叶斯','支持向量机','神经网络','逻辑回归','决策树',"KNN"], @@ -130,8 +129,8 @@ if (datasetName!='') { this.form.dataset_name=datasetName this.get_dataset_cols(datasetName) - } + this.get_methods() }, methods: { onSubmit() { @@ -144,7 +143,6 @@ this.original_code=code this.dialogVisible=true; - }) }, get_datasets(){ @@ -180,6 +178,21 @@ }) }, + // 获取数据建模方法 + get_methods(){ + axios.get('api/model_selection/get_methods?type=ml').then( + (response) => { + var methods = response.data.data + this.models = methods + } + ) + axios.get('api/model_selection/get_methods?type=metrics').then( + (response) => { + var methods = response.data.data + this.metrics = methods + } + ) + }, //选择完数据集后动态生成特征列、目标列下拉框 onDatasetChange(){ this.form={ @@ -207,6 +220,11 @@ } }, + //模型类型发生变化时,清空模型选择,模型评估的内容 + onModelTypeChange(){ + this.form.models = [] + this.form.metrics = [] + }, //导出代码文件 onExportCode(){ axios.get('/api/export_code',{