|
@@ -11,7 +11,7 @@ import {
|
|
Upload
|
|
Upload
|
|
} from "@element-plus/icons-vue";
|
|
} from "@element-plus/icons-vue";
|
|
import {ElMessage, ElMessageBox} from "element-plus";
|
|
import {ElMessage, ElMessageBox} from "element-plus";
|
|
-import {addRuleInfo, searchRules} from "@/http/api";
|
|
|
|
|
|
+import {addRuleInfo, deleteRule, searchRules} from "@/http/api";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "RulesTable",
|
|
name: "RulesTable",
|
|
@@ -57,12 +57,7 @@ export default {
|
|
duration_minutes: '',
|
|
duration_minutes: '',
|
|
interval_minutes: ''
|
|
interval_minutes: ''
|
|
},
|
|
},
|
|
- tableData: [{
|
|
|
|
- name: '煤炭采购规则',
|
|
|
|
- rounds: '2',
|
|
|
|
- duration_minutes: '2',
|
|
|
|
- interval_minutes: '1'
|
|
|
|
- }],
|
|
|
|
|
|
+ tableData: [],
|
|
addForm: {
|
|
addForm: {
|
|
name: '',
|
|
name: '',
|
|
rounds: '',
|
|
rounds: '',
|
|
@@ -79,6 +74,7 @@ export default {
|
|
this.searchForm.rounds = '';
|
|
this.searchForm.rounds = '';
|
|
this.searchForm.duration = '';
|
|
this.searchForm.duration = '';
|
|
this.searchForm.interval = '';
|
|
this.searchForm.interval = '';
|
|
|
|
+ this.tableData=[];
|
|
},
|
|
},
|
|
handleClose(done) {
|
|
handleClose(done) {
|
|
ElMessageBox.confirm('您确定关闭此对话框吗?')
|
|
ElMessageBox.confirm('您确定关闭此对话框吗?')
|
|
@@ -92,15 +88,18 @@ export default {
|
|
addRule() {
|
|
addRule() {
|
|
addRuleInfo(this.addForm);
|
|
addRuleInfo(this.addForm);
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
|
|
+ this.searchRules();
|
|
},
|
|
},
|
|
searchRules() {
|
|
searchRules() {
|
|
searchRules(this.searchForm).then(
|
|
searchRules(this.searchForm).then(
|
|
res => {
|
|
res => {
|
|
- console.log(res.data);
|
|
|
|
this.tableData = res.data;
|
|
this.tableData = res.data;
|
|
- ElMessage.success("搜索成功");
|
|
|
|
}
|
|
}
|
|
)
|
|
)
|
|
|
|
+ },
|
|
|
|
+ deleteRule(row){
|
|
|
|
+ deleteRule(row);
|
|
|
|
+ this.searchRules();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -165,9 +164,11 @@ export default {
|
|
<el-table-column
|
|
<el-table-column
|
|
prop="operation"
|
|
prop="operation"
|
|
label="操作">
|
|
label="操作">
|
|
- <el-link type="primary" :icon="Edit">设置提示语</el-link>
|
|
|
|
- <el-link type="primary" :icon="Edit">修改</el-link>
|
|
|
|
- <el-link type="primary" :icon="Delete">删除</el-link>
|
|
|
|
|
|
+ <template v-slot="scope">
|
|
|
|
+ <el-link type="primary" :icon="Edit">设置提示语</el-link>
|
|
|
|
+ <el-link type="primary" :icon="Edit">修改</el-link>
|
|
|
|
+ <el-link type="primary" :icon="Delete" @click="deleteRule(scope.row)">删除</el-link>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</el-row>
|
|
</el-row>
|