|
@@ -2,8 +2,11 @@
|
|
|
<!-- 客户信息: 正常 -->
|
|
<!-- 客户信息: 正常 -->
|
|
|
<div class="custom-normal"
|
|
<div class="custom-normal"
|
|
|
:loading="loading">
|
|
:loading="loading">
|
|
|
- <filterCustomTable @add="add"
|
|
|
|
|
- @search="search" />
|
|
|
|
|
|
|
+ <filterCustomTable @search="search">
|
|
|
|
|
+ <a-button class="operBtn"
|
|
|
|
|
+ v-if="hasPermission('custom_info_btn_add')"
|
|
|
|
|
+ @click="openAction">新增</a-button>
|
|
|
|
|
+ </filterCustomTable>
|
|
|
<contextMenu :contextMenuList="contextMenuList"
|
|
<contextMenu :contextMenuList="contextMenuList"
|
|
|
:tableList="customList">
|
|
:tableList="customList">
|
|
|
<a-table :columns="columns"
|
|
<a-table :columns="columns"
|
|
@@ -16,23 +19,49 @@
|
|
|
</template>
|
|
</template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
</contextMenu>
|
|
</contextMenu>
|
|
|
|
|
+ <!-- 详情 -->
|
|
|
|
|
+ <CustomDetail />
|
|
|
|
|
+ <!-- 删除 -->
|
|
|
|
|
+ <DeleteCustom />
|
|
|
|
|
+ <!-- 恢复客户资料 -->
|
|
|
|
|
+ <RecoverCustom />
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, Ref, ref, watchEffect } from 'vue';
|
|
|
|
|
|
|
|
import { initData } from '@/setup/methods/index';
|
|
import { initData } from '@/setup/methods/index';
|
|
|
-import { QueryCustomInfoType } from '@/goServiceAPI/ermcp/customInfo/interface';
|
|
|
|
|
import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
|
|
import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
|
|
|
import { MenuItem } from '@/components/contextMenu/interface';
|
|
import { MenuItem } from '@/components/contextMenu/interface';
|
|
|
import contextMenu from '@/components/contextMenu/index.vue';
|
|
import contextMenu from '@/components/contextMenu/index.vue';
|
|
|
import { getCustomList } from '../setup';
|
|
import { getCustomList } from '../setup';
|
|
|
|
|
+import { openModal } from '@/setup/controlModal/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';
|
|
|
|
|
|
|
|
-// 处理新增资料
|
|
|
|
|
-
|
|
|
|
|
-function add() {
|
|
|
|
|
- console.log('add');
|
|
|
|
|
|
|
+// 处理详情
|
|
|
|
|
+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({
|
|
export default defineComponent({
|
|
@@ -40,25 +69,30 @@ export default defineComponent({
|
|
|
components: {
|
|
components: {
|
|
|
filterCustomTable,
|
|
filterCustomTable,
|
|
|
contextMenu,
|
|
contextMenu,
|
|
|
|
|
+ CustomDetail,
|
|
|
|
|
+ DeleteCustom,
|
|
|
|
|
+ RecoverCustom,
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
- const { customList, actionQuery, columns, getColumns, search, loading } = getCustomList();
|
|
|
|
|
|
|
+ const { customList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
|
|
|
|
|
+ const { hasPermission } = handlePermission('custom_info_normal');
|
|
|
|
|
+ const contextMenuList = ref<MenuItem[]>([]);
|
|
|
|
|
|
|
|
- const contextMenuList = ref<MenuItem[]>([
|
|
|
|
|
- {
|
|
|
|
|
- lable: '修改',
|
|
|
|
|
- callback: (data: QueryCustomInfoType) => {
|
|
|
|
|
- console.log('data', data);
|
|
|
|
|
- console.log('lll');
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+ const { openAction } = openModal('addCustomInfo');
|
|
|
|
|
+
|
|
|
|
|
+ handleDetail(contextMenuList);
|
|
|
|
|
+ const { deleteAction } = handleDelete(contextMenuList);
|
|
|
|
|
+ const { recoverAction } = handleRecover(contextMenuList);
|
|
|
|
|
+
|
|
|
|
|
+ watchEffect(() => {
|
|
|
|
|
+ hasPermission('custom_info_btn_recover') && recoverAction();
|
|
|
|
|
+ hasPermission('custom_info_btn_delete') && deleteAction();
|
|
|
|
|
+ });
|
|
|
initData(() => {
|
|
initData(() => {
|
|
|
actionQuery(4);
|
|
actionQuery(4);
|
|
|
getColumns();
|
|
getColumns();
|
|
|
- // 加载数据在这里
|
|
|
|
|
});
|
|
});
|
|
|
- return { customList, columns, search, loading, add, contextMenuList };
|
|
|
|
|
|
|
+ return { customList, columns, search, loading, contextMenuList, hasPermission, openAction };
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|