|
|
|
@ -1,5 +1,15 @@ |
|
|
|
|
<script setup> |
|
|
|
|
import {ref, reactive, onBeforeMount, onMounted, onUnmounted, watch, computed} from "vue"; |
|
|
|
|
import { |
|
|
|
|
ref, |
|
|
|
|
reactive, |
|
|
|
|
onBeforeMount, |
|
|
|
|
onMounted, |
|
|
|
|
onBeforeUpdate, |
|
|
|
|
onBeforeUnmount, |
|
|
|
|
onUnmounted, |
|
|
|
|
watch, |
|
|
|
|
computed |
|
|
|
|
} from "vue"; |
|
|
|
|
import Sortable from "sortablejs"; |
|
|
|
|
import {useStore, mapState} from "vuex"; |
|
|
|
|
import JsonEditorVue from "json-editor-vue3"; |
|
|
|
@ -30,7 +40,7 @@ const activeTab = ref(store.state.ecApiModule.first_tab_api_id); // 当前选项 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 表格相关的定义 |
|
|
|
|
const ApiTableRef = ref(null) // 表格的Ref |
|
|
|
|
let ApiTableRef = ref(null) // 表格的Ref |
|
|
|
|
// const multipleSelection = ref([]) // checkbox的处理 |
|
|
|
|
|
|
|
|
|
// 定义变量用于存储接口设置的数据 |
|
|
|
@ -318,6 +328,7 @@ function check_params(checked, unchecked) { |
|
|
|
|
param.is_checked = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
get_suggest() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 获取售卖类型并自动勾选字段 |
|
|
|
@ -412,7 +423,10 @@ function get_pay_type(pay_type) { |
|
|
|
|
function test() { |
|
|
|
|
console.log('store.state.ecApiModule.ec_api_data', store.state.ecApiModule.ec_api_data) |
|
|
|
|
console.log('UserApiData.value', UserApiData.value) |
|
|
|
|
// console.log('activeTab.value', activeTab.value) |
|
|
|
|
console.log('activeTab.value', activeTab.value) |
|
|
|
|
console.log('ApiTableRef.value', ApiTableRef.value) |
|
|
|
|
// store.state.ecApiModule.ec_api_data.api = [] |
|
|
|
|
store.state.ecApiModule.show_tab_area = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 计算属性用来处理场次接口获取的数据,并同步给对应的选择模块 |
|
|
|
@ -521,7 +535,6 @@ const levelList = computed(() => { |
|
|
|
|
|
|
|
|
|
// 监测ec_select_api的变化 生成新的本地数据,如果当前选中的标签被取消勾选,则选择剩下标签的第一个 |
|
|
|
|
watch(() => store.state.ecApiModule.ec_api_data.api, (oldValue, newValue) => { |
|
|
|
|
console.log('watch store.state.ecApiModule.ec_api_data.api') |
|
|
|
|
// 接口数据变化后初始化本地数据 |
|
|
|
|
initApiData() |
|
|
|
|
// 处理空标签逻辑 |
|
|
|
@ -572,6 +585,7 @@ onMounted(() => { |
|
|
|
|
ghostClass: 'dragging', |
|
|
|
|
draggable: '.el-tabs__item', |
|
|
|
|
onEnd: (evt) => { |
|
|
|
|
console.log('sortTabs-onEnd') |
|
|
|
|
store.commit('ecApiModule/handle_sort_ec_select_api', {'newIndex': evt.newIndex, 'oldIndex': evt.oldIndex}) |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
@ -608,12 +622,15 @@ const ace_options = { |
|
|
|
|
<CheckQuan v-if="api['path'] === 'seat/check-coupon'" @getQuan="get_quan_detail" @getSaleType="get_sale_type" |
|
|
|
|
:cid="UserApiData['base_info']['cinema']"></CheckQuan> |
|
|
|
|
<ApiLockBuySelector v-if="api['path'] === 'seat/lock-buy'" @getSaleType="get_sale_type" |
|
|
|
|
@getPayType="get_pay_type"></ApiLockBuySelector> |
|
|
|
|
@getPayType="get_pay_type" type="ticket"></ApiLockBuySelector> |
|
|
|
|
<ApiLockBuySelector v-if="api['path'] === 'order/buy-goods'" @getSaleType="get_sale_type" |
|
|
|
|
@getPayType="get_pay_type" type="goods"></ApiLockBuySelector> |
|
|
|
|
<el-table |
|
|
|
|
ref='ApiTableRef' |
|
|
|
|
:data="UserApiData.api[api['id']].params" |
|
|
|
|
@selection-change="handleParamsChange" |
|
|
|
|
@select="handleParamsSelect" |
|
|
|
|
:key="api['id']" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="50" :selectable="checkboxFilter"/> |
|
|
|
|
<el-table-column label="字段名" width="200"> |
|
|
|
@ -665,13 +682,17 @@ const ace_options = { |
|
|
|
|
</el-row> |
|
|
|
|
<v-ace-editor v-model:value="UserApiData.api[api['id']].response" :lang="UserApiData.api[api['id']]['format']" |
|
|
|
|
theme="chrome" :options="ace_options" class="vue-ace-editor" :wrap="true" style="width: 1200px"/> |
|
|
|
|
<MovieShow v-if="showList.length > 0" :show="showList" :data="UserApiData.api[activeTab]" :base_info="UserApiData.base_info"/> |
|
|
|
|
<SeatStatus v-if="seatList.length > 0" :seat="seatList" :data="UserApiData.api[activeTab]" :base_info="UserApiData.base_info"/> |
|
|
|
|
<CinemaGoods v-if="goodsList.length > 0" :goods="goodsList" :data="UserApiData.api[activeTab]" :base_info="UserApiData.base_info"/> |
|
|
|
|
<EcardLevel v-if="levelList.length > 0" :level="levelList" :data="UserApiData.api[activeTab]" :base_info="UserApiData.base_info"/> |
|
|
|
|
<MovieShow v-if="showList.length > 0" :show="showList" :data="UserApiData.api[activeTab]" |
|
|
|
|
:base_info="UserApiData.base_info"/> |
|
|
|
|
<SeatStatus v-if="seatList.length > 0" :seat="seatList" :data="UserApiData.api[activeTab]" |
|
|
|
|
:base_info="UserApiData.base_info"/> |
|
|
|
|
<CinemaGoods v-if="goodsList.length > 0" :goods="goodsList" :data="UserApiData.api[activeTab]" |
|
|
|
|
:base_info="UserApiData.base_info"/> |
|
|
|
|
<EcardLevel v-if="levelList.length > 0" :level="levelList" :data="UserApiData.api[activeTab]" |
|
|
|
|
:base_info="UserApiData.base_info"/> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
<el-backtop :right="100" :bottom="100" :visibility-height="200"/> |
|
|
|
|
<el-backtop :right="300" :bottom="100" :visibility-height="100"/> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|