|
|
@@ -4,8 +4,9 @@
|
|
|
:loading="loading">
|
|
|
<filterCustomTable @search="search">
|
|
|
<a-button class="operBtn"
|
|
|
- v-if="hasPermission('custom_info_btn_add')"
|
|
|
- @click="addAction">新增</a-button>
|
|
|
+ v-for="item in commonBtn"
|
|
|
+ :key="item.lable"
|
|
|
+ @click="item.callback">{{item.lable}}</a-button>
|
|
|
</filterCustomTable>
|
|
|
<contextMenu :contextMenuList="contextMenuList"
|
|
|
:tableList="customList">
|
|
|
@@ -25,25 +26,22 @@
|
|
|
<CustomDetail />
|
|
|
<!-- 删除 -->
|
|
|
<DeleteCustom />
|
|
|
- <!-- 恢复客户资料 -->@/common/methods
|
|
|
+ <!-- 恢复客户资料 -->
|
|
|
<RecoverCustom />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
|
|
|
-
|
|
|
+import { defineComponent } 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/detail/index.vue';
|
|
|
import DeleteCustom from '@/views/information/custom/compoments/delete/index.vue';
|
|
|
import RecoverCustom from '@/views/information/custom/compoments/recover/index.vue';
|
|
|
import AddCustom from '@/views/information/custom/compoments/add/index.vue';
|
|
|
-import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
|
|
|
+import { getBtnList } from '@/common/setup/contextMenu/index';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'custom-normal',
|
|
|
@@ -57,27 +55,13 @@ export default defineComponent({
|
|
|
},
|
|
|
setup() {
|
|
|
const { customList, actionQuery, columns, getColumns, search, loading } = getCustomList();
|
|
|
- const { hasPermission } = handlePermission('custom_info_normal');
|
|
|
- const contextMenuList = ref<MenuItem[]>([]);
|
|
|
-
|
|
|
- const { openAction: addAction } = openModal('custom_info_btn_add');
|
|
|
-
|
|
|
- detailButton('detail', contextMenuList);
|
|
|
- const { action: deleteAction } = permissionButton('custom_info_btn_delete', '删除', contextMenuList);
|
|
|
- const { action: recoverAction } = permissionButton('custom_info_btn_recover', '恢复', contextMenuList);
|
|
|
+ const { commonBtn, forDataBtn } = getBtnList('custom_info_disabled');
|
|
|
|
|
|
- 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 };
|
|
|
+ return { customList, columns, search, loading, commonBtn, forDataBtn };
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
|
@@ -85,5 +69,4 @@ export default defineComponent({
|
|
|
<style lang="less">
|
|
|
.custom-normal {
|
|
|
}
|
|
|
-</style
|
|
|
->;
|
|
|
+</style>;
|