|
@@ -1,64 +1,37 @@
|
|
|
<template>
|
|
|
<div class="dialog">
|
|
|
- <el-dialog
|
|
|
- title="自定义模型"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="40%"
|
|
|
- :before-close="close"
|
|
|
- :modal-append-to-body="false"
|
|
|
- :close-on-click-modal="false"
|
|
|
- >
|
|
|
- <div class="modelTitle">
|
|
|
- <div class="siteCon">
|
|
|
+ <el-dialog title="自定义模型" :visible.sync="dialogVisible" width="40%" :before-close="close"
|
|
|
+ :modal-append-to-body="false" :close-on-click-modal="false">
|
|
|
+ <!-- <div class="modelTitle"> -->
|
|
|
+ <!-- <div class="siteCon">
|
|
|
<span>分析模型名称:</span>
|
|
|
</div>
|
|
|
- <el-input
|
|
|
- v-model="fxmxmc"
|
|
|
- size="mini"
|
|
|
- placeholder="请输入项目名称"
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
+ <el-input v-model="fxmxmc" size="mini" placeholder="请输入项目名称"></el-input> -->
|
|
|
+ <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="110px" class="demo-ruleForm">
|
|
|
+ <el-form-item label="分析模型名称:" prop="fxmxmc">
|
|
|
+ <el-input v-model="ruleForm.fxmxmc" size="mini" placeholder="请输入项目名称"></el-input></el-form-item></el-form>
|
|
|
+ <!-- </div> -->
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="11">
|
|
|
<div class="yztitle">请选择分析数据</div>
|
|
|
<el-scrollbar class="left-tree">
|
|
|
<el-input placeholder="输入查询内容" v-model="filterText" clearable>
|
|
|
</el-input>
|
|
|
- <el-tree
|
|
|
- :data="options"
|
|
|
- :props="defaultProps"
|
|
|
- highlight-current
|
|
|
- show-checkbox
|
|
|
- node-key="id"
|
|
|
- ref="tree"
|
|
|
- :default-checked-keys="defaultArr"
|
|
|
- :filter-node-method="filterNode"
|
|
|
- ></el-tree>
|
|
|
+ <el-tree :data="options" :props="defaultProps" highlight-current show-checkbox node-key="id" ref="tree"
|
|
|
+ :default-checked-keys="defaultArr" :filter-node-method="filterNode"></el-tree>
|
|
|
</el-scrollbar>
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
|
<div class="grid-content bg_purple">
|
|
|
- <el-button
|
|
|
- icon="el-icon-d-arrow-right"
|
|
|
- @click="turnLeftToRight"
|
|
|
- ></el-button>
|
|
|
- <el-button
|
|
|
- icon="el-icon-d-arrow-left"
|
|
|
- @click="turnRightToLeft"
|
|
|
- ></el-button>
|
|
|
+ <el-button icon="el-icon-d-arrow-right" @click="turnLeftToRight"></el-button>
|
|
|
+ <el-button icon="el-icon-d-arrow-left" @click="turnRightToLeft"></el-button>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="11">
|
|
|
<div class="yztitle">已选数据</div>
|
|
|
- <el-table
|
|
|
- ref="multipleTable"
|
|
|
- :data="dialogData"
|
|
|
- border
|
|
|
- class="right-table scroll-style"
|
|
|
- size="small"
|
|
|
- style="width: 100%"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- >
|
|
|
+ <el-table ref="multipleTable" :data="dialogData" border class="right-table scroll-style" size="small"
|
|
|
+ style="width: 100%" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="name" label="数据名称"> </el-table-column>
|
|
@@ -68,7 +41,7 @@
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="reset">重置</el-button>
|
|
|
- <el-button type="primary" @click="submit">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submit('ruleForm')">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -89,12 +62,21 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
- fxmxmc: "", //分析模型名称
|
|
|
+ // fxmxmc: "", //分析模型名称
|
|
|
filterText: "", //树结构搜索关键字
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
label: "name",
|
|
|
},
|
|
|
+ ruleForm: {
|
|
|
+ fxmxmc: ""
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ fxmxmc: [
|
|
|
+ { required: true, message: '请输入活动名称', trigger: 'blur' },
|
|
|
+ { min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
dialogVisible: false,
|
|
|
options: [],
|
|
|
kxyzList: [],
|
|
@@ -117,14 +99,17 @@ export default {
|
|
|
return data.name.indexOf(value) !== -1;
|
|
|
},
|
|
|
reset() {
|
|
|
- console.log(898888);
|
|
|
this.$parent.templateYZ = [];
|
|
|
this.filterText = ""; //还原分析数据搜索框
|
|
|
- this.fxmxmc = ""; //清空分析模型名称输入框
|
|
|
+ this.ruleForm.fxmxmc = ""; //清空分析模型名称输入框
|
|
|
this.yzTableData = [];
|
|
|
this.GetFactorList(); //重新获取分析数据
|
|
|
this.dialogData = []; //清空已选数据表单
|
|
|
- console.log(this.dialogData, "到货时间肯定会撒");
|
|
|
+ this.$nextTick(() =>{
|
|
|
+ this.$refs['ruleForm'].resetFields();
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
testInput(val) {
|
|
|
val = Number(val);
|
|
@@ -239,25 +224,41 @@ export default {
|
|
|
handleSelectionChange(val) {
|
|
|
this.selectdialogData = val;
|
|
|
},
|
|
|
- submit() {
|
|
|
- let saveData = {
|
|
|
- bsm: new Date().getTime(),
|
|
|
- bsmmc: this.fxmxmc,
|
|
|
- gdbhMxYzRet: this.dialogData,
|
|
|
- };
|
|
|
- if (this.editData.bsm) {
|
|
|
- //判断是否为编辑状态
|
|
|
- this.$parent.anaModels.forEach((item) => {
|
|
|
- if (item.bsm == this.editData.bsm) {
|
|
|
- this.$parent.anaModels[item] = saveData; //替换数据
|
|
|
+ submit(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ // alert('submit!');
|
|
|
+ if (this.dialogData.length) {
|
|
|
+ let saveData = {
|
|
|
+ bsm: new Date().getTime(),
|
|
|
+ bsmmc: this.ruleForm.fxmxmc,
|
|
|
+ gdbhMxYzRet: this.dialogData,
|
|
|
+ };
|
|
|
+ if (this.editData.bsm) {
|
|
|
+ //判断是否为编辑状态
|
|
|
+ this.$parent.anaModels.forEach((item) => {
|
|
|
+ if (item.bsm == this.editData.bsm) {
|
|
|
+ this.$parent.anaModels[item] = saveData; //替换数据
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.dialogVisible = false;
|
|
|
+ } else {
|
|
|
+ this.$parent.anaModels.push(saveData);
|
|
|
+ this.dialogVisible = false;
|
|
|
+ }
|
|
|
+ this.$refs.multipleTable.clearSelection(); //清空勾选
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '请选择分析数据',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
- this.dialogVisible = false;
|
|
|
- } else {
|
|
|
- this.$parent.anaModels.push(saveData);
|
|
|
- this.dialogVisible = false;
|
|
|
- }
|
|
|
- this.$refs.multipleTable.clearSelection();//清空勾选
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
setData(data) {
|
|
|
data.filter((item) => {
|
|
@@ -357,7 +358,7 @@ export default {
|
|
|
justify-content: center;
|
|
|
height: 400px;
|
|
|
|
|
|
- .el-button + .el-button {
|
|
|
+ .el-button+.el-button {
|
|
|
margin-left: 0;
|
|
|
margin-top: 20px;
|
|
|
}
|