优化体验

main
roger_mac 11 months ago
parent 4740477210
commit b43fe84326
  1. 10
      src/views/mock/index.vue

@ -306,6 +306,7 @@ const json_data = computed(
// //
const running = ref(false) const running = ref(false)
const disableAll= ref(false)
const startBtn_disable = ref(false) const startBtn_disable = ref(false)
const startBtn_loading = ref(false) const startBtn_loading = ref(false)
@ -328,17 +329,20 @@ const handleStart = () => {
mock_config[item]= checkedMockConfig.value.indexOf(item) >= 0 mock_config[item]= checkedMockConfig.value.indexOf(item) >= 0
}) })
console.log(mock_config) console.log(mock_config)
const data = JSON.stringify({mock_config: mock_config}) const data = JSON.stringify({mock_config: mock_config, json_data: allJsonData.value})
console.log(data) console.log(data)
start_mock(params, data).then(res => { start_mock(params, data).then(res => {
}).catch(err => { }).catch(err => {
}) })
//
disableAll.value = true
} }
const handleEnd = () => { const handleEnd = () => {
running.value = false running.value = false
startBtn_disable.value = false startBtn_disable.value = false
startBtn_loading.value = false startBtn_loading.value = false
disableAll.value = false
const params = {ip: selectIp.value} const params = {ip: selectIp.value}
end_mock(params).then(res => { end_mock(params).then(res => {
}).catch(err => { }).catch(err => {
@ -362,7 +366,7 @@ onMounted(
> >
<el-row justify="start"> <el-row justify="start">
<el-col :span="4"> <el-col :span="4">
<el-select v-model="selectIp" class="m-2" placeholder="选择要模拟的影院IP" @change="handleIpChange"> <el-select v-model="selectIp" class="m-2" placeholder="选择要模拟的影院IP" @change="handleIpChange" :disabled="disableAll">
<el-option <el-option
v-for="item in cinema_items.value" v-for="item in cinema_items.value"
:key="item.value" :key="item.value"
@ -395,6 +399,7 @@ onMounted(
v-model="checkAll" v-model="checkAll"
:indeterminate="isIndeterminate" :indeterminate="isIndeterminate"
@change="handleCheckAllChange" @change="handleCheckAllChange"
:disabled="disableAll"
> >
全选 全选
</el-checkbox> </el-checkbox>
@ -403,6 +408,7 @@ onMounted(
<el-checkbox-group <el-checkbox-group
v-model="checkedMockConfig" v-model="checkedMockConfig"
@change="handleCheckedMockChange" @change="handleCheckedMockChange"
:disabled="disableAll"
> >
<template v-for="api_items in mockConfig"> <template v-for="api_items in mockConfig">
<el-divider content-position="left"> <el-divider content-position="left">

Loading…
Cancel
Save