|
@@ -1,97 +1,89 @@
|
|
|
<template>
|
|
<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 />
|
|
|
|
|
- <!-- 删除 -->
|
|
|
|
|
- <DeleteCustom />
|
|
|
|
|
- <!-- 恢复客户资料 -->@/common/methods
|
|
|
|
|
- <RecoverCustom />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <!-- 客户信息: 停用 -->
|
|
|
|
|
+ <div class="custom-normal"
|
|
|
|
|
+ :loading="loading">
|
|
|
|
|
+ <filterCustomTable @search="search">
|
|
|
|
|
+ <a-button class="operBtn"
|
|
|
|
|
+ v-if="hasPermission('custom_info_btn_add')"
|
|
|
|
|
+ @click="addAction">新增</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>
|
|
|
|
|
+ <!-- 新增 -->
|
|
|
|
|
+ <AddCustom />
|
|
|
|
|
+ <!-- 详情 -->
|
|
|
|
|
+ <CustomDetail />
|
|
|
|
|
+ <!-- 删除 -->
|
|
|
|
|
+ <DeleteCustom />
|
|
|
|
|
+ <!-- 恢复客户资料 -->@/common/methods
|
|
|
|
|
+ <RecoverCustom />
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
- import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
|
|
|
|
|
|
|
|
- import { initData } from '@/common/methods/index';
|
|
|
|
|
- import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
|
|
|
|
|
- import { MenuItem } from '@/common/components/contextMenu/interface';
|
|
|
|
|
- import contextMenu from '@/common/components/contextMenu/index.vue';
|
|
|
|
|
- import { getCustomList } from '../setup';
|
|
|
|
|
- import { openModal } from '@/common/setup/modal/index';
|
|
|
|
|
- import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
|
|
|
|
|
- import DeleteCustom from '@/views/information/custom/compoments/deleteCustom/index.vue';
|
|
|
|
|
- import RecoverCustom from '@/views/information/custom/compoments/recover/index.vue';
|
|
|
|
|
|
|
+import { initData } from '@/common/methods/index';
|
|
|
|
|
+import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
|
|
|
|
|
+import { MenuItem } from '@/common/components/contextMenu/interface';
|
|
|
|
|
+import contextMenu from '@/common/components/contextMenu/index.vue';
|
|
|
|
|
+import { getCustomList } from '../setup';
|
|
|
|
|
+import { openModal } from '@/common/setup/modal/index';
|
|
|
|
|
+import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
|
|
|
|
|
+import DeleteCustom from '@/views/information/custom/compoments/deleteCustom/index.vue';
|
|
|
|
|
+import RecoverCustom from '@/views/information/custom/compoments/recover/index.vue';
|
|
|
|
|
+import AddCustom from '@/views/information/custom/compoments/addCustom/index.vue';
|
|
|
|
|
+import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
|
|
|
|
|
|
|
|
- // 处理详情
|
|
|
|
|
- function handleDetail(contextMenuList: Ref<MenuItem[]>) {
|
|
|
|
|
- const { openAction } = openModal('customDetail');
|
|
|
|
|
- contextMenuList.value.push({ lable: '详情', callback: openAction });
|
|
|
|
|
- }
|
|
|
|
|
- // 处理删除
|
|
|
|
|
- function handleDelete(contextMenuList: Ref<MenuItem[]>) {
|
|
|
|
|
- const { openAction } = openModal('deleteCustomInfo');
|
|
|
|
|
- function deleteAction() {
|
|
|
|
|
- contextMenuList.value.push({ lable: '删除', callback: openAction });
|
|
|
|
|
- }
|
|
|
|
|
- return { deleteAction };
|
|
|
|
|
- }
|
|
|
|
|
- // 处理恢复
|
|
|
|
|
- function handleRecover(contextMenuList: Ref<MenuItem[]>) {
|
|
|
|
|
- const { openAction } = openModal('recoverCustomInfo');
|
|
|
|
|
- function recoverAction() {
|
|
|
|
|
- contextMenuList.value.push({ lable: '删除', callback: openAction });
|
|
|
|
|
- }
|
|
|
|
|
- return { recoverAction };
|
|
|
|
|
- }
|
|
|
|
|
|
|
+export default defineComponent({
|
|
|
|
|
+ name: 'custom-normal',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ filterCustomTable,
|
|
|
|
|
+ contextMenu,
|
|
|
|
|
+ CustomDetail,
|
|
|
|
|
+ DeleteCustom,
|
|
|
|
|
+ RecoverCustom,
|
|
|
|
|
+ AddCustom,
|
|
|
|
|
+ },
|
|
|
|
|
+ setup() {
|
|
|
|
|
+ const { customList, actionQuery, columns, getColumns, search, loading } = getCustomList();
|
|
|
|
|
+ const { hasPermission } = handlePermission('custom_info_normal');
|
|
|
|
|
+ const contextMenuList = ref<MenuItem[]>([]);
|
|
|
|
|
|
|
|
- export default defineComponent({
|
|
|
|
|
- name: 'custom-normal',
|
|
|
|
|
- components: {
|
|
|
|
|
- filterCustomTable,
|
|
|
|
|
- contextMenu,
|
|
|
|
|
- CustomDetail,
|
|
|
|
|
- DeleteCustom,
|
|
|
|
|
- RecoverCustom,
|
|
|
|
|
- },
|
|
|
|
|
- setup() {
|
|
|
|
|
- const { customList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
|
|
|
|
|
- const { hasPermission } = handlePermission('custom_info_normal');
|
|
|
|
|
- const contextMenuList = ref<MenuItem[]>([]);
|
|
|
|
|
|
|
+ const { openAction: addAction } = openModal('addCustomInfo');
|
|
|
|
|
|
|
|
- const { openAction } = openModal('addCustomInfo');
|
|
|
|
|
|
|
+ detailButton('customDetail', contextMenuList);
|
|
|
|
|
+ const { action: deleteAction } = permissionButton('deleteCustomInfo', '删除', contextMenuList);
|
|
|
|
|
+ const { action: recoverAction } = permissionButton('recoverCustomInfo', '恢复', contextMenuList);
|
|
|
|
|
|
|
|
- handleDetail(contextMenuList);
|
|
|
|
|
- const { deleteAction } = handleDelete(contextMenuList);
|
|
|
|
|
- const { recoverAction } = handleRecover(contextMenuList);
|
|
|
|
|
-
|
|
|
|
|
- const stop = watchEffect(() => {
|
|
|
|
|
- hasPermission('custom_info_btn_recover') && recoverAction();
|
|
|
|
|
- hasPermission('custom_info_btn_delete') && deleteAction();
|
|
|
|
|
- });
|
|
|
|
|
- onUnmounted(() => {
|
|
|
|
|
- stop();
|
|
|
|
|
- });
|
|
|
|
|
- initData(() => {
|
|
|
|
|
- actionQuery(4);
|
|
|
|
|
- getColumns();
|
|
|
|
|
- });
|
|
|
|
|
- return { customList, columns, search, loading, contextMenuList, hasPermission, openAction };
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const stop = watchEffect(() => {
|
|
|
|
|
+ hasPermission('custom_info_btn_recover') && recoverAction();
|
|
|
|
|
+ hasPermission('custom_info_btn_delete') && deleteAction();
|
|
|
|
|
+ });
|
|
|
|
|
+ onUnmounted(() => {
|
|
|
|
|
+ stop();
|
|
|
|
|
+ });
|
|
|
|
|
+ initData(() => {
|
|
|
|
|
+ actionQuery(4);
|
|
|
|
|
+ getColumns();
|
|
|
|
|
+ });
|
|
|
|
|
+ return { customList, columns, search, loading, contextMenuList, hasPermission, addAction };
|
|
|
|
|
+ },
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
|
- .custom-normal {
|
|
|
|
|
- }</style
|
|
|
|
|
|
|
+.custom-normal {
|
|
|
|
|
+}
|
|
|
|
|
+</style
|
|
|
>;
|
|
>;
|