|
@@ -11,7 +11,7 @@ import {
|
|
|
Upload
|
|
|
} from "@element-plus/icons-vue";
|
|
|
import {ElMessage, ElMessageBox} from "element-plus";
|
|
|
-import {addRuleInfo, searchRules} from "@/http/api";
|
|
|
+import {addRuleInfo, deleteRule, searchRules} from "@/http/api";
|
|
|
|
|
|
export default {
|
|
|
name: "RulesTable",
|
|
@@ -57,12 +57,7 @@ export default {
|
|
|
duration_minutes: '',
|
|
|
interval_minutes: ''
|
|
|
},
|
|
|
- tableData: [{
|
|
|
- name: '煤炭采购规则',
|
|
|
- rounds: '2',
|
|
|
- duration_minutes: '2',
|
|
|
- interval_minutes: '1'
|
|
|
- }],
|
|
|
+ tableData: [],
|
|
|
addForm: {
|
|
|
name: '',
|
|
|
rounds: '',
|
|
@@ -79,6 +74,7 @@ export default {
|
|
|
this.searchForm.rounds = '';
|
|
|
this.searchForm.duration = '';
|
|
|
this.searchForm.interval = '';
|
|
|
+ this.tableData=[];
|
|
|
},
|
|
|
handleClose(done) {
|
|
|
ElMessageBox.confirm('您确定关闭此对话框吗?')
|
|
@@ -92,15 +88,18 @@ export default {
|
|
|
addRule() {
|
|
|
addRuleInfo(this.addForm);
|
|
|
this.dialogVisible = false;
|
|
|
+ this.searchRules();
|
|
|
},
|
|
|
searchRules() {
|
|
|
searchRules(this.searchForm).then(
|
|
|
res => {
|
|
|
- console.log(res.data);
|
|
|
this.tableData = res.data;
|
|
|
- ElMessage.success("搜索成功");
|
|
|
}
|
|
|
)
|
|
|
+ },
|
|
|
+ deleteRule(row){
|
|
|
+ deleteRule(row);
|
|
|
+ this.searchRules();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -165,9 +164,11 @@ export default {
|
|
|
<el-table-column
|
|
|
prop="operation"
|
|
|
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>
|
|
|
</el-row>
|