123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- <template>
- <div class="desc-wrap-BasicTable">
- <BasicTable @register="registerTable"> </BasicTable>
- </div>
- </template>
- <script lang="ts">
- import { defineComponent, onMounted } from 'vue';
- import {
- BasicTable,
- useTable,
- TableAction,
- BasicColumn,
- TableImg,
- FormProps,
- } from '/@/components/Table';
- import { useI18n } from '/@/hooks/web/useI18n';
- import { usePermissionStore } from '/@/store/modules/permission';
- import { dincrementList, cameraIncrementLog } from '/@/api/equity';
- export default defineComponent({
- components: {
- BasicTable,
- TableAction,
- TableImg,
- },
- setup() {
- const { t } = useI18n();
- const permissionStore = usePermissionStore();
- const { getCheckPerm } = permissionStore;
- onMounted(() => {
- // console.log(router.currentRoute.value.params.id);
- });
- const columns: BasicColumn[] = [
- {
- title: t('routes.equity.operationType'),
- dataIndex: 'operationType',
- width: 80,
- customRender: ({ record }) => {
- return t(`routes.equity.operation.${record.operationType || 0}`);
- },
- },{
- title: t('routes.device.snCode'),
- dataIndex: 'snCode',
- width: 100,
- },
- {
- title: t('routes.equity.operationUserName'),
- dataIndex: 'operationUserName',
- ellipsis: false,
- width: 120,
- customRender: ({ record }) => {
- return record.operationUserName || t('routes.equity.platform');
- },
- },
- {
- title: t('routes.equity.operationTime'),
- dataIndex: 'createTime',
- width: 180,
- },
- {
- title: t('routes.equity.Type'),
- dataIndex: 'validTimeType',
- width: 180,
- customRender({ record }) {
- return record.validTimeType==0 ?t('routes.equity.equityType.0'):record.validTimeType==1? t('routes.equity.equityType.3') : t('routes.device.NoBind');
- },
- },
- {
- title: t('routes.equity.incrementId'),
- dataIndex: 'incrementId',
- width: 180,
- // customRender({ record }) {
- // return record.userName ? record.userName : '-';
- // },
- },
- ];
- const searchForm: Partial<FormProps> = {
- labelWidth: 120,
- autoAdvancedLine: 1,
- actionColOptions: {
- span: 24,
- },
- schemas: [
- {
- field: 'operationType',
- component: 'Select',
- label: t('routes.equity.operationType'),
- colProps: {
- xl: 7,
- xxl: 7,
- },
- componentProps: {
- options: [
- {
- label: t('routes.equity.operation.0'),
- value: 0,
- key: '0',
- },{
- label: t('routes.equity.operation.1'),
- value: 1,
- key: '1',
- },{
- label: t('routes.equity.operation.2'),
- value: 2,
- key: '2',
- },{
- label: t('routes.equity.operation.3'),
- value: 3,
- key: '3',
- }
- ],
- },
- },{
- field: 'snCode',
- component: 'Input',
- label: t('routes.device.snCode'),
- colProps: {
- xl: 7,
- xxl: 7,
- },
- },
- {
- field: 'incrementTypeId',
- component: 'ApiSelect',
- label: t('routes.equity.Type'),
- componentProps: {
- maxLength: 50,
- api: async function () {
- const list = await dincrementList();
- return list.map((ele) => {
- return { name: t(`routes.finance.equityType.${ele.validTimeType}`), value: ele.id };
- });
- },
- numberToString: true,
- labelField: 'name',
- valueField: 'value',
- immediate: true,
- },
- colProps: {
- xl: 7,
- xxl: 7,
- },
- },
- {
- field: 'operationUserName',
- component: 'Input',
- label: t('routes.equity.operationUserName'),
- colProps: {
- xl: 7,
- xxl: 7,
- },
- },
- {
- field: 'timeList',
- label: t('routes.equity.operationTime'),
- component: 'RangePicker',
- componentProps: {
- maxLength: 100,
- format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD',
- showTime: true,
- },
- colProps: {
- xl: 7,
- xxl: 7,
- },
- },
- ],
- };
- const [registerTable, { reload }] = useTable({
- api: cameraIncrementLog,
- columns: columns,
- useSearchForm: true,
- formConfig: searchForm,
- showTableSetting: true,
- showIndexColumn: false,
- rowKey: 'id',
- beforeFetch: (T) => {
- if (T.ctivated) {
- T.activatedStartTime = T.ctivated[0];
- T.activatedEndTime = T.ctivated[1];
- }
- return T;
- },
- fetchSetting: {
- pageField: 'pageNum',
- sizeField: 'pageSize',
- listField: 'list',
- totalField: 'total',
- },
- canResize: false,
- });
- return {
- registerTable,
- reload,
- getCheckPerm,
- };
- },
- });
- </script>
- <style lang="less" scoped>
- .desc-wrap-BasicTable {
- background-color: #f0f2f5;
- .vben-basic-table-form-container {
- padding: 0;
- }
- }
- </style>
|