|
|
@@ -1,105 +1,97 @@
|
|
|
<template>
|
|
|
- <!-- 客户信息: 正常 -->
|
|
|
- <div class="custom-normal"
|
|
|
- :loading="loading">
|
|
|
- <filterCustomTable @search="search">
|
|
|
- <a-button class="operBtn"
|
|
|
- v-if="hasPermission('custom_info_btn_add')"
|
|
|
- @click="openAction">新增</a-button>
|
|
|
- </filterCustomTable>
|
|
|
- <contextMenu :contextMenuList="contextMenuList"
|
|
|
- :tableList="customList">
|
|
|
- <a-table :columns="columns"
|
|
|
- class="topTable"
|
|
|
- :pagination="false"
|
|
|
- rowKey="key"
|
|
|
- :data-source="customList">
|
|
|
- <template #userinfotype="{ text }">
|
|
|
- <a>{{ text === '2' ? '企业' : '个人'}}</a>
|
|
|
- </template>
|
|
|
- </a-table>
|
|
|
- </contextMenu>
|
|
|
- <!-- 详情 -->
|
|
|
- <CustomDetail />
|
|
|
- <!-- 修改 -->
|
|
|
- <ModifyCustom />
|
|
|
- <!-- 停用 -->
|
|
|
- <DisableCustom />
|
|
|
- </div>
|
|
|
+ <!-- 客户信息: 正常 -->
|
|
|
+ <div class="custom-normal" :loading="loading">
|
|
|
+ <filterCustomTable @search="search">
|
|
|
+ <a-button class="operBtn" v-if="hasPermission('custom_info_btn_add')" @click="openAction">新增</a-button>
|
|
|
+ </filterCustomTable>
|
|
|
+ <contextMenu :contextMenuList="contextMenuList" :tableList="customList">
|
|
|
+ <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :data-source="customList">
|
|
|
+ <template #userinfotype="{ text }">
|
|
|
+ <a>{{ text === '2' ? '企业' : '个人' }}</a>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </contextMenu>
|
|
|
+ <!-- 详情 -->
|
|
|
+ <CustomDetail />
|
|
|
+ <!-- 修改 -->
|
|
|
+ <ModifyCustom />
|
|
|
+ <!-- 停用 -->
|
|
|
+ <DisableCustom />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
|
|
|
+ import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
|
|
|
|
|
|
-import { initData } from '@/setup/methods/index';
|
|
|
-import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
|
|
|
-import { MenuItem } from '@/components/contextMenu/interface';
|
|
|
-import contextMenu from '@/components/contextMenu/index.vue';
|
|
|
-import { getCustomList } from '../setup';
|
|
|
-import { openModal } from '@/setup/controlModal/index';
|
|
|
-import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
|
|
|
-import ModifyCustom from '@/views/information/custom/compoments/modifyCustom/index.vue';
|
|
|
-import DisableCustom from '@/views/information/custom/compoments/disableCustom/index.vue';
|
|
|
+ import { initData } from '@/setup/methods/index';
|
|
|
+ import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
|
|
|
+ import { MenuItem } from '@/components/contextMenu/interface';
|
|
|
+ import contextMenu from '@/components/contextMenu/index.vue';
|
|
|
+ import { getCustomList } from '../setup';
|
|
|
+ import { openModal } from '@/setup/controlModal/index';
|
|
|
+ import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
|
|
|
+ import ModifyCustom from '@/views/information/custom/compoments/modifyCustom/index.vue';
|
|
|
+ import DisableCustom from '@/views/information/custom/compoments/disableCustom/index.vue';
|
|
|
|
|
|
-// 处理详情
|
|
|
-function handleDetail(contextMenuList: Ref<MenuItem[]>) {
|
|
|
- const { openAction } = openModal('customDetail');
|
|
|
- contextMenuList.value.push({ lable: '详情', callback: openAction });
|
|
|
-}
|
|
|
-// 处理修改
|
|
|
-function handleModify(contextMenuList: Ref<MenuItem[]>) {
|
|
|
- const { openAction } = openModal('modifyCustomInfo');
|
|
|
- function modifyAction() {
|
|
|
- contextMenuList.value.push({ lable: '修改', callback: openAction });
|
|
|
+ // 处理详情
|
|
|
+ function handleDetail(contextMenuList: Ref<MenuItem[]>) {
|
|
|
+ const { openAction } = openModal('customDetail');
|
|
|
+ contextMenuList.value.push({ lable: '详情', callback: openAction });
|
|
|
+ }
|
|
|
+ // 处理修改
|
|
|
+ function handleModify(contextMenuList: Ref<MenuItem[]>) {
|
|
|
+ const { openAction } = openModal('modifyCustomInfo');
|
|
|
+ function modifyAction() {
|
|
|
+ contextMenuList.value.push({ lable: '修改', callback: openAction });
|
|
|
+ }
|
|
|
+ return { modifyAction };
|
|
|
}
|
|
|
- return { modifyAction };
|
|
|
-}
|
|
|
|
|
|
-// 处理停用
|
|
|
-function handleDisable(contextMenuList: Ref<MenuItem[]>) {
|
|
|
- const { openAction } = openModal('disableCustomInfo');
|
|
|
- function disableAction() {
|
|
|
- contextMenuList.value.push({ lable: '停用', callback: openAction });
|
|
|
+ // 处理停用
|
|
|
+ function handleDisable(contextMenuList: Ref<MenuItem[]>) {
|
|
|
+ const { openAction } = openModal('disableCustomInfo');
|
|
|
+ function disableAction() {
|
|
|
+ contextMenuList.value.push({ lable: '停用', callback: openAction });
|
|
|
+ }
|
|
|
+ return { disableAction };
|
|
|
}
|
|
|
- return { disableAction };
|
|
|
-}
|
|
|
-export default defineComponent({
|
|
|
- name: 'custom-normal',
|
|
|
- components: {
|
|
|
- filterCustomTable,
|
|
|
- contextMenu,
|
|
|
- CustomDetail,
|
|
|
- ModifyCustom,
|
|
|
- DisableCustom,
|
|
|
- },
|
|
|
- setup() {
|
|
|
- const { customList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
|
|
|
- const { hasPermission } = handlePermission('custom_info_normal');
|
|
|
- const contextMenuList = ref<MenuItem[]>([]);
|
|
|
+ export default defineComponent({
|
|
|
+ name: 'custom-normal',
|
|
|
+ components: {
|
|
|
+ filterCustomTable,
|
|
|
+ contextMenu,
|
|
|
+ CustomDetail,
|
|
|
+ ModifyCustom,
|
|
|
+ DisableCustom,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ const { customList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
|
|
|
+ const { hasPermission } = handlePermission('custom_info_normal');
|
|
|
+ const contextMenuList = ref<MenuItem[]>([]);
|
|
|
|
|
|
- const { openAction } = openModal('addCustomInfo');
|
|
|
+ const { openAction } = openModal('addCustomInfo');
|
|
|
|
|
|
- handleDetail(contextMenuList);
|
|
|
- const { modifyAction } = handleModify(contextMenuList);
|
|
|
- const { disableAction } = handleDisable(contextMenuList);
|
|
|
+ handleDetail(contextMenuList);
|
|
|
+ const { modifyAction } = handleModify(contextMenuList);
|
|
|
+ const { disableAction } = handleDisable(contextMenuList);
|
|
|
|
|
|
- const stop = watchEffect(() => {
|
|
|
- hasPermission('custom_info_btn_modify') && modifyAction();
|
|
|
- hasPermission('custom_info_btn_disable') && disableAction();
|
|
|
- });
|
|
|
- onUnmounted(() => {
|
|
|
- stop();
|
|
|
- });
|
|
|
- initData(() => {
|
|
|
- actionQuery(3);
|
|
|
- getColumns();
|
|
|
- });
|
|
|
- return { customList, columns, search, loading, contextMenuList, hasPermission, openAction };
|
|
|
- },
|
|
|
-});
|
|
|
+ const stop = watchEffect(() => {
|
|
|
+ hasPermission('custom_info_btn_modify') && modifyAction();
|
|
|
+ hasPermission('custom_info_btn_disable') && disableAction();
|
|
|
+ });
|
|
|
+ onUnmounted(() => {
|
|
|
+ stop();
|
|
|
+ });
|
|
|
+ initData(() => {
|
|
|
+ actionQuery(3);
|
|
|
+ getColumns();
|
|
|
+ });
|
|
|
+ return { customList, columns, search, loading, contextMenuList, hasPermission, openAction };
|
|
|
+ },
|
|
|
+ });
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
-.custom-normal {
|
|
|
-}
|
|
|
-</style>;
|
|
|
+ .custom-normal {
|
|
|
+ }</style
|
|
|
+>;
|