|
@@ -60,13 +60,13 @@
|
|
<el-form ref="formInit" label-width="60px">
|
|
<el-form ref="formInit" label-width="60px">
|
|
<el-row v-for="(row, index) in tabData.initList" :key="row.id" class="form-init-row">
|
|
<el-row v-for="(row, index) in tabData.initList" :key="row.id" class="form-init-row">
|
|
<el-col :span="9">
|
|
<el-col :span="9">
|
|
- <el-form-item label="动作" required>
|
|
|
|
- <el-input v-model="row.actionJs" :autosize="{ minRows: 1, maxRows: 3 }" type="textarea" placeholder="Please input"></el-input>
|
|
|
|
|
|
+ <el-form-item label="动作" required class="pointer-input">
|
|
|
|
+ <el-input v-model="row.actionJs" readonly placeholder="click to input" @click="showEditActionCodeDialog(row, 'actionJs')"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="9">
|
|
<el-col :span="9">
|
|
- <el-form-item label="检查">
|
|
|
|
- <el-input v-model="row.checkJs" :autosize="{ minRows: 1, maxRows: 3 }" type="textarea" placeholder="Please input"></el-input>
|
|
|
|
|
|
+ <el-form-item label="检查" class="pointer-input">
|
|
|
|
+ <el-input v-model="row.checkJs" readonly placeholder="click to input" @click="showEditActionCodeDialog(row, 'checkJs')"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="3">
|
|
<el-col :span="3">
|
|
@@ -227,6 +227,7 @@
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button type="primary" :disabled="savaButtonDisabled" @click="handleSave">保 存</el-button>
|
|
<el-button type="primary" :disabled="savaButtonDisabled" @click="handleSave">保 存</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
+ <CodeEditor v-model:show="codeEditorShow" ref="codeEditor" @save="onCodeEditorSave" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
@@ -239,7 +240,10 @@ import { USER_ROLE_ADMIN, USER_ROLE_DEVELOPER, USER_ROLE_REVIEWER } from '../../
|
|
import { getRandomString } from '../../utils'
|
|
import { getRandomString } from '../../utils'
|
|
import { ServerActionCurrentOpenTab } from "../../../wailsjs/go/main/App"
|
|
import { ServerActionCurrentOpenTab } from "../../../wailsjs/go/main/App"
|
|
import { RemoveFilled, CirclePlusFilled } from '@element-plus/icons-vue'
|
|
import { RemoveFilled, CirclePlusFilled } from '@element-plus/icons-vue'
|
|
|
|
+import CodeEditor from './CodeEditor.vue';
|
|
|
|
|
|
|
|
+const codeEditor =ref(null)
|
|
|
|
+const codeEditorShow = ref(false)
|
|
|
|
|
|
const emit = defineEmits(['custom-event', 'data-tag', 'form-change']);
|
|
const emit = defineEmits(['custom-event', 'data-tag', 'form-change']);
|
|
let originData = {}
|
|
let originData = {}
|
|
@@ -578,6 +582,19 @@ const handleDataTag = () => {
|
|
emit('data-tag', originData)
|
|
emit('data-tag', originData)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+let currentCodeEditingRow = {}
|
|
|
|
+const showEditActionCodeDialog = (row, key) => {
|
|
|
|
+ codeEditorShow.value = true
|
|
|
|
+ currentCodeEditingRow = row
|
|
|
|
+ const text = row[key]
|
|
|
|
+ codeEditor.value.setPageData({ text, key })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const onCodeEditorSave = ({ text, key }) => {
|
|
|
|
+ console.log(text, key, currentCodeEditingRow)
|
|
|
|
+ currentCodeEditingRow[key] = text
|
|
|
|
+}
|
|
|
|
+
|
|
// 根据编辑弹窗的内容,获取cssMark
|
|
// 根据编辑弹窗的内容,获取cssMark
|
|
const getMarkWithEditDialogInfo = info => {
|
|
const getMarkWithEditDialogInfo = info => {
|
|
const { value, _originData } = info
|
|
const { value, _originData } = info
|
|
@@ -699,4 +716,15 @@ defineExpose({
|
|
.rollback-reason-container {
|
|
.rollback-reason-container {
|
|
color: var(--el-color-danger);
|
|
color: var(--el-color-danger);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.demo-tabs {
|
|
|
|
+ .pointer-input {
|
|
|
|
+ ::v-deep {
|
|
|
|
+ .el-input__wrapper,
|
|
|
|
+ .el-input__inner {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|