|
|
@@ -4,7 +4,7 @@
|
|
|
<filterCustomTable @search="search">
|
|
|
<a-button class="operBtn"
|
|
|
v-if="hasPermission('spot_contract_btn_add')"
|
|
|
- @click="openAction">新增</a-button>
|
|
|
+ @click="addAction">新增</a-button>
|
|
|
</filterCustomTable>
|
|
|
<contextMenu :contextMenuList="contextMenuList"
|
|
|
:tableList="spotContractList">
|
|
|
@@ -20,11 +20,13 @@
|
|
|
</contextMenu>
|
|
|
<!-- 新增现货合同 -->
|
|
|
<AddSpotContract />
|
|
|
+ <!-- 现货合同: 详情 -->
|
|
|
+ <SpotContractDeatil />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, Ref, ref } from 'vue';
|
|
|
+import { defineComponent, onUnmounted, ref, watchEffect } from 'vue';
|
|
|
import { initData } from '@/common/methods';
|
|
|
import filterCustomTable from '@/views/information/spot-contract/components/filterTable/index.vue';
|
|
|
import { getCustomList } from '../setup';
|
|
|
@@ -32,27 +34,8 @@ import { openModal } from '@/common/setup/modal/index';
|
|
|
import contextMenu from '@/common/components/contextMenu/index.vue';
|
|
|
import { MenuItem } from '@/common/components/contextMenu/interface';
|
|
|
import AddSpotContract from '@/views/information/spot-contract/components/add/index.vue';
|
|
|
-
|
|
|
-// 处理现货合同详情
|
|
|
-function handleDetail(contextMenuList: Ref<MenuItem[]>) {
|
|
|
- const { openAction } = openModal('spotContractDetail');
|
|
|
- contextMenuList.value.push({ lable: '详情', callback: openAction });
|
|
|
-}
|
|
|
-// 重新提交现货合同
|
|
|
-function handleResubmit(contextMenuList: Ref<MenuItem[]>) {
|
|
|
- const { openAction } = openModal('resubmitSpotContract');
|
|
|
- contextMenuList.value.push({ lable: '重新提交', callback: openAction });
|
|
|
-}
|
|
|
-// 删除现货合同
|
|
|
-function handleDelete(contextMenuList: Ref<MenuItem[]>) {
|
|
|
- const { openAction } = openModal('deleteSpotContract');
|
|
|
- contextMenuList.value.push({ lable: '删除', callback: openAction });
|
|
|
-}
|
|
|
-// 修改现货合同
|
|
|
-function handleModify(contextMenuList: Ref<MenuItem[]>) {
|
|
|
- const { openAction } = openModal('modifySpotContract');
|
|
|
- contextMenuList.value.push({ lable: '修改', callback: openAction });
|
|
|
-}
|
|
|
+import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
|
|
|
+import SpotContractDeatil from '@/views/information/spot-contract/components/detail/index.vue';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'spot-contract-not-commit',
|
|
|
@@ -60,17 +43,31 @@ export default defineComponent({
|
|
|
filterCustomTable,
|
|
|
contextMenu,
|
|
|
AddSpotContract,
|
|
|
+ SpotContractDeatil,
|
|
|
},
|
|
|
setup() {
|
|
|
- const { spotContractList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
|
|
|
- const { hasPermission } = handlePermission('spot_contract_unsubmitted');
|
|
|
- const { openAction } = openModal('addSpotContract');
|
|
|
const contextMenuList = ref<MenuItem[]>([]);
|
|
|
+ const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
|
|
|
+ const { hasPermission } = handlePermission('spot_contract_unsubmitted');
|
|
|
+ const { openAction: addAction } = openModal('addSpotContract');
|
|
|
+
|
|
|
+ detailButton('spotContractDetail', contextMenuList);
|
|
|
+ const { action: modifyAction } = permissionButton('modifySpotContract', '修改', contextMenuList);
|
|
|
+ const { action: deleteAction } = permissionButton('deleteSpotContract', '删除', contextMenuList);
|
|
|
+ const { action: resubmitAction } = permissionButton('resubmitSpotContract', '重新提交', contextMenuList);
|
|
|
+ const stop = watchEffect(() => {
|
|
|
+ hasPermission('spot_contract_btn_modify') && modifyAction();
|
|
|
+ hasPermission('spot_contract_btn_delete') && deleteAction();
|
|
|
+ hasPermission('spot_contract_btn_resubmit') && resubmitAction();
|
|
|
+ });
|
|
|
+ onUnmounted(() => {
|
|
|
+ stop();
|
|
|
+ });
|
|
|
initData(() => {
|
|
|
actionQuery(2);
|
|
|
getColumns();
|
|
|
});
|
|
|
- return { spotContractList, columns, search, contextMenuList, openAction, loading, hasPermission };
|
|
|
+ return { spotContractList, columns, search, contextMenuList, addAction, loading, hasPermission };
|
|
|
},
|
|
|
});
|
|
|
</script>
|