|
@@ -8,17 +8,54 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="right">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="primary">编辑</el-button>
|
|
|
+ <el-button type="primary" @click="openDetil(scope.row)">编辑</el-button>
|
|
|
+ <el-button style="margin-right:10px" type="danger" @click="deleteRow(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <el-dialog title="详情" custom-class="windLifeDialog" v-model="dialogVisible" width="1000px"
|
|
|
+ :close-on-click-modal="false">
|
|
|
+ <div class="periodFrom">
|
|
|
+ <div style="margin-bottom: 12px">
|
|
|
+ <el-input v-model="scriptname" style="width: 500px">
|
|
|
+ <template #prepend>输入脚本名称:</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" @click="saveJson" style="margin-left: 10px">保存脚本</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="editTable" :height="listHeight">
|
|
|
+ <el-table-column type="index" width="30" />
|
|
|
+ <el-table-column label="脚本步骤">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input v-model="scope.row.beforeText" v-if="scope.row.before && scope.row.before !==''"
|
|
|
+ style="width: 419px">
|
|
|
+ <template #prepend>{{ scope.row.before }}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-input v-model="scope.row.behindText" v-if="scope.row.behind && scope.row.behind !==''"
|
|
|
+ style="width: 250px">
|
|
|
+ <template #prepend>{{ scope.row.behind }}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button v-if="scope.row.scriptName !==''" type="warning" round>{{ scope.row.scriptName}}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="right" width="80">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="danger" @click="handleDelete(scope.$index)">删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- read
|
|
|
+ read,
|
|
|
+ save,
|
|
|
+ updateScript,
|
|
|
+ deleteScript
|
|
|
} from "@/api/report";
|
|
|
-
|
|
|
export default {
|
|
|
props: {
|
|
|
height: {
|
|
@@ -30,9 +67,12 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ listHeight: document.documentElement.clientHeight - 220,
|
|
|
tableData2: [],
|
|
|
childCurrentRow: {},
|
|
|
-
|
|
|
+ dialogVisible: false,
|
|
|
+ scriptname: '',
|
|
|
+ editTable: []
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -58,7 +98,55 @@
|
|
|
},
|
|
|
tableRow() {
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ handleDelete(index) {
|
|
|
+ this.editTable.splice(index, 1)
|
|
|
+ },
|
|
|
+ openDetil(row) {
|
|
|
+ this.scriptObj = row
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.scriptname = row.scriptName
|
|
|
+ this.editTable = row.scripts
|
|
|
+ },
|
|
|
+ deleteRow(row) {
|
|
|
+ this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let that = this
|
|
|
+ let params = {
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ deleteScript(params).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ that.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ that.getData()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saveJson() {
|
|
|
+ let that = this
|
|
|
+ let params = {
|
|
|
+ id: that.scriptObj.id,
|
|
|
+ scriptName: that.scriptname,
|
|
|
+ scripts: that.editTable
|
|
|
+ }
|
|
|
+ updateScript(params).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ that.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ that.dialogVisible = false
|
|
|
+ that.getData()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -66,5 +154,28 @@
|
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
+ .el-overlay {
|
|
|
+ .startToDia {
|
|
|
+ .el-dialog__body {
|
|
|
+ padding: 30px 60px 30px 20px !important;
|
|
|
+
|
|
|
+ .periodFrom {
|
|
|
+
|
|
|
+ .el-select,
|
|
|
+ .el-input {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-input {
|
|
|
+ height: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ .flowSty {
|
|
|
+ width: 100%;
|
|
|
+ height: 70vh;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|