|
|
@@ -39,17 +39,21 @@
|
|
|
@confirm="handleSubmit"
|
|
|
@close="handleClose"
|
|
|
/>
|
|
|
- <PlusDialog
|
|
|
- v-model="detailsVisible"
|
|
|
- title="接口配置"
|
|
|
- :hasFooter="false"
|
|
|
- width="500"
|
|
|
- >
|
|
|
+ <PlusDialog v-model="detailsVisible" title="接口配置" width="500">
|
|
|
<PlusDescriptions
|
|
|
:column="24"
|
|
|
:columns="descriptionsColumns"
|
|
|
:data="descriptionsData"
|
|
|
/>
|
|
|
+ <template #footer>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="handleCopy(descriptionsData)"
|
|
|
+ >
|
|
|
+ 一键复制
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
</PlusDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -208,7 +212,18 @@ const state = reactive<State>({
|
|
|
isCreate: false,
|
|
|
form: {},
|
|
|
rules: {
|
|
|
- accNo: [{ required: true, message: "请输入账户号", trigger: "blur" }]
|
|
|
+ interfaceName: [
|
|
|
+ { required: true, message: "请输入接口名称", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ interfaceNo: [
|
|
|
+ { required: true, message: "请输入接口编码", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ manufacturer: [
|
|
|
+ { required: true, message: "请输入接口厂商", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ interfaceConfig: [
|
|
|
+ { required: true, message: "请输入接口配置", trigger: "blur" }
|
|
|
+ ]
|
|
|
},
|
|
|
descriptionsData: {}
|
|
|
});
|
|
|
@@ -329,6 +344,21 @@ const handleClose = () => {
|
|
|
console.log(dialogForm.value.formInstance);
|
|
|
};
|
|
|
|
|
|
+const handleCopy = (params: any) => {
|
|
|
+ console.log(params);
|
|
|
+ copy(JSON.stringify(params.interfaceConfig));
|
|
|
+ ElMessage.success("复制成功");
|
|
|
+};
|
|
|
+
|
|
|
+const copy = (text: string) => {
|
|
|
+ let input = document.createElement("input");
|
|
|
+ input.value = text;
|
|
|
+ document.body.appendChild(input);
|
|
|
+ input.select();
|
|
|
+ document.execCommand("Copy");
|
|
|
+ document.body.removeChild(input);
|
|
|
+};
|
|
|
+
|
|
|
// 参数预期管理
|
|
|
const normalizeParams = (params: Record<string, any>) => {
|
|
|
return {
|