|
@@ -51,6 +51,7 @@
|
|
|
<el-col :span="11">
|
|
|
<div class="yztitle">已选数据</div>
|
|
|
<el-table
|
|
|
+ ref="multipleTable"
|
|
|
:data="dialogData"
|
|
|
border
|
|
|
class="right-table scroll-style"
|
|
@@ -60,7 +61,7 @@
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="bsmmc" label="数据名称"> </el-table-column>
|
|
|
+ <el-table-column prop="name" label="数据名称"> </el-table-column>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -80,6 +81,10 @@ export default {
|
|
|
tableData: {
|
|
|
type: Array,
|
|
|
},
|
|
|
+ editData: {
|
|
|
+ //editData用来存储编辑的数据,用bsm判断是否为编辑,全部存储是为了防止以后新增需求
|
|
|
+ type: Object,
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
data() {
|
|
@@ -112,10 +117,14 @@ export default {
|
|
|
return data.name.indexOf(value) !== -1;
|
|
|
},
|
|
|
reset() {
|
|
|
- this.dialogData = []; //清空已选数据表单
|
|
|
+ console.log(898888);
|
|
|
+ this.$parent.templateYZ = [];
|
|
|
this.filterText = ""; //还原分析数据搜索框
|
|
|
this.fxmxmc = ""; //清空分析模型名称输入框
|
|
|
- this.getTreeList(); //重新获取分析数据
|
|
|
+ this.yzTableData = [];
|
|
|
+ this.GetFactorList(); //重新获取分析数据
|
|
|
+ this.dialogData = []; //清空已选数据表单
|
|
|
+ console.log(this.dialogData, "到货时间肯定会撒");
|
|
|
},
|
|
|
testInput(val) {
|
|
|
val = Number(val);
|
|
@@ -156,11 +165,9 @@ export default {
|
|
|
setTable(selectdata) {
|
|
|
let tableList = [];
|
|
|
selectdata.forEach((item) => {
|
|
|
- console.log(item, "itemitemitem---");
|
|
|
- // let JSONItem = JSON.parse(item.conditionInfo);
|
|
|
tableList.push({
|
|
|
id: item.id,
|
|
|
- bsmmc: item.name,
|
|
|
+ name: item.name,
|
|
|
bsm: item.bsm,
|
|
|
// conditionInfo: JSONItem,
|
|
|
});
|
|
@@ -236,31 +243,21 @@ export default {
|
|
|
let saveData = {
|
|
|
bsm: new Date().getTime(),
|
|
|
bsmmc: this.fxmxmc,
|
|
|
- gdbhMxYz: this.dialogData,
|
|
|
+ gdbhMxYzRet: this.dialogData,
|
|
|
};
|
|
|
- console.log(saveData, ":this.dialogData");
|
|
|
- this.$parent.anaModels.push(saveData);
|
|
|
- this.dialogVisible = false;
|
|
|
- // var sign = true;
|
|
|
- // let saveData = [];
|
|
|
- // this.dialogData.forEach((item) => {
|
|
|
- // item.type && item.value == "" && (sign = false);
|
|
|
- // issave &&
|
|
|
- // saveData.push({
|
|
|
- // ...item,
|
|
|
- // conditionInfo: JSON.stringify(item.conditionInfo),
|
|
|
- // });
|
|
|
- // });
|
|
|
- // if (sign) {
|
|
|
- // if (issave) {
|
|
|
- // this.save(saveData);
|
|
|
- // } else {
|
|
|
- // this.$parent.tableData = this.dialogData;
|
|
|
- // this.dialogVisible = false;
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.$message.warning("请将信息补充完整!");
|
|
|
- // }
|
|
|
+ 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();//清空勾选
|
|
|
},
|
|
|
setData(data) {
|
|
|
data.filter((item) => {
|
|
@@ -282,11 +279,15 @@ export default {
|
|
|
: (this.options[1].disabled = false);
|
|
|
},
|
|
|
resetDialogData() {
|
|
|
- if (this.tableData.length == []) {
|
|
|
+ if (!this.tableData.length) {
|
|
|
// 重置时,树的数据恢复
|
|
|
this.dialogData = [];
|
|
|
this.options = JSON.parse(JSON.stringify(this.optionsTemp));
|
|
|
this.selectdialogData = [];
|
|
|
+ } else {
|
|
|
+ // 选择模板时,生成新的树
|
|
|
+ this.dialogData = JSON.parse(JSON.stringify(this.tableData));
|
|
|
+ this.options = JSON.parse(JSON.stringify(this.optionsTemp));
|
|
|
}
|
|
|
this.dialogData.forEach((item) => {
|
|
|
this.resetTree(this.options, item);
|