zhengyiming
3 天以前 206fc12a937f65e4b58fbb10a5dc916cecef7625
fix: bug
2个文件已添加
5个文件已修改
44364 ■■■■ 已修改文件
package.json 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pnpm-lock-v8.9.2.yaml 17554 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pnpm-lock.yaml 26553 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/style/element/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/EnterpriseManage/EnterpriseManageList.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/EnterpriseManage/Test.vue 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tsconfig.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -30,7 +30,7 @@
    "@chenfengyuan/vue-qrcode": "^2.0.0",
    "@ctrl/tinycolor": "^3.4.1",
    "@element-plus/icons-vue": "^2.3.1",
    "@muaitu/fabric-editor-core": "^1.0.4",
    "@muaitu/fabric-editor-core": "1.0.4",
    "@tanstack/vue-query": "^4.37.1",
    "@tencentcloud/call-uikit-vue": "^3.1.5",
    "@tencentcloud/chat-uikit-vue": "^2.0.0",
@@ -49,8 +49,8 @@
    "echarts": "^5.5.1",
    "element-plus": "^2.8.4",
    "element-resize-detector": "^1.2.4",
    "fabric": "^5.3.0",
    "fabric-history": "^1.6.0",
    "fabric": "5.3.0",
    "fabric-history": "1.6.0",
    "file-saver": "^2.0.5",
    "fuse.js": "^6.6.2",
    "js-base64": "^3.7.2",
@@ -79,36 +79,36 @@
    "vue-echarts": "^7.0.3",
    "vue-router": "^4.4.5",
    "vue-types": "^5.1.3",
    "xlsx": "^0.18.5",
    "xlsx-style": "^0.8.13"
    "xlsx": "0.18.5",
    "xlsx-style": "0.8.13"
  },
  "devDependencies": {
    "@commitlint/cli": "^17.1.2",
    "@commitlint/config-conventional": "^17.1.0",
    "@eslint/create-config": "^0.3.1",
    "@iconify-icons/ep": "^1.2.8",
    "@iconify-icons/ri": "^1.2.3",
    "@iconify/vue": "^4.0.0",
    "@release-it/conventional-changelog": "^8.0.2",
    "@types/ali-oss": "^6.16.11",
    "@types/fabric": "^5.3.10",
    "@types/file-saver": "^2.0.5",
    "@commitlint/cli": "17.1.2",
    "@commitlint/config-conventional": "17.1.0",
    "@eslint/create-config": "0.3.1",
    "@iconify-icons/ep": "1.2.8",
    "@iconify-icons/ri": "1.2.3",
    "@iconify/vue": "4.0.0",
    "@release-it/conventional-changelog": "8.0.2",
    "@types/ali-oss": "6.16.11",
    "@types/fabric": "5.3.10",
    "@types/file-saver": "2.0.5",
    "@types/js-cookie": "^3.0.2",
    "@types/lodash": "^4.14.186",
    "@types/node": "18.7.18",
    "@types/video.js": "^7.3.47",
    "@typescript-eslint/eslint-plugin": "^5.37.0",
    "@typescript-eslint/parser": "^5.37.0",
    "@typescript-eslint/eslint-plugin": "5.37.0",
    "@typescript-eslint/parser": "5.37.0",
    "@vitejs/plugin-legacy": "^5.4.2",
    "@vitejs/plugin-vue": "^5.1.4",
    "@vitejs/plugin-vue-jsx": "^4.0.1",
    "@vue/eslint-config-prettier": "^10.0.0",
    "@vue/eslint-config-typescript": "^14.0.0",
    "@vue/eslint-config-prettier": "10.0.0",
    "@vue/eslint-config-typescript": "14.0.0",
    "autoprefixer": "^10.4.11",
    "cross-env": "^7.0.3",
    "eslint": "^8.23.1",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-vue": "^9.4.0",
    "eslint": "8.23.1",
    "eslint-plugin-prettier": "4.2.1",
    "eslint-plugin-vue": "9.4.0",
    "husky": "^8.0.1",
    "lint-staged": "^13.0.3",
    "npm-run-all": "^4.1.5",
@@ -119,19 +119,19 @@
    "postcss-preset-env": "^10.0.0",
    "postcss-px-to-viewport": "^1.1.1",
    "postcss-scss": "^4.0.5",
    "prettier": "^2.7.1",
    "release-it": "^17.8.2",
    "prettier": "2.7.1",
    "release-it": "17.8.2",
    "rimraf": "^6.0.1",
    "rollup-plugin-visualizer": "^5.8.1",
    "sass": "^1.54.9",
    "stylelint": "^14.11.0",
    "stylelint-config-html": "^1.1.0",
    "stylelint-config-recommended": "^9.0.0",
    "stylelint-config-standard": "^28.0.0",
    "stylelint-order": "^5.0.0",
    "stylelint-scss": "^4.3.0",
    "sass": "1.92.1",
    "stylelint": "14.11.0",
    "stylelint-config-html": "1.1.0",
    "stylelint-config-recommended": "9.0.0",
    "stylelint-config-standard": "28.0.0",
    "stylelint-order": "5.0.0",
    "stylelint-scss": "4.3.0",
    "terser": "^5.34.1",
    "typescript": "^4.6.4",
    "typescript": "4.6.4",
    "unplugin-auto-import": "^19.3.0",
    "unplugin-icons": "^0.14.10",
    "unplugin-vue-components": "^0.27.4",
@@ -154,7 +154,8 @@
      "xlsx-style@0.8.13": "patches/xlsx-style@0.8.13.patch"
    },
    "overrides": {
      "vue": "3.5.11"
      "vue": "3.5.11",
      "@bole-core/components": "link:../boledocs-vue/packages/components"
    }
  }
}
pnpm-lock-v8.9.2.yaml
New file
Diff too large
pnpm-lock.yaml
Diff too large
src/style/element/index.scss
@@ -1,4 +1,5 @@
/* stylelint-disable */
@use 'sass:map';
@use '../var.scss' as *;
// @forward 'element-plus/theme-chalk/src/mixins/config.scss' with (
@@ -8,13 +9,13 @@
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
  $colors: (
    'primary': (
      'base': map-get($bole-colors, 'primary', 'base'),
      'base': map.get($bole-colors, 'primary', 'base'),
    ),
  ),
  $text-color: (
    'primary': map-get($bole-text-color, 'primary'),
    'regular': map-get($bole-text-color, 'regular'),
    'secondary': map-get($bole-text-color, 'secondary'),
    'primary': map.get($bole-text-color, 'primary'),
    'regular': map.get($bole-text-color, 'regular'),
    'secondary': map.get($bole-text-color, 'secondary'),
  )
);
src/views/EnterpriseManage/EnterpriseManageList.vue
@@ -1,5 +1,5 @@
<template>
  <LoadingLayout :loading="state.loading">
  <LoadingLayout :loading="isInitialLoading">
    <AppContainer>
      <ProTableQueryFilterBar @on-reset="reset">
        <template #query>
@@ -9,7 +9,6 @@
              :value-enum="IsConfiguredText"
              buttonStyle
              showAllBtn
              @change="getList()"
            />
          </QueryFilterItem>
          <QueryFilterItem>
@@ -18,7 +17,6 @@
              style="width: 300px"
              placeholder="企业名称/法人/联系人"
              @on-click-search="getList"
              @keyup.enter="getList()"
            >
            </SearchInput>
          </QueryFilterItem>
@@ -53,6 +51,7 @@
  useFormDialog,
  FieldRadio,
  UploadUserFile,
  useTableV2,
} from '@bole-core/components';
import { useAccess, useGlobalEventContext } from '@/hooks';
import { EnterpriseConfigureType, IsConfiguredText } from '@/constants';
@@ -88,40 +87,7 @@
const router = useRouter();
const BaseState = {
  loading: true,
};
const state = reactive({ ...BaseState });
const { invalidateQueries } = useEnabledElectronSignSettings();
onMounted(async () => {
  await getList();
  state.loading = false;
});
onMounted(() => {
  if (typeof window !== 'undefined' && window.addEventListener) {
    console.log('onMounted');
    window.addEventListener('visibilitychange', handleFocus);
    // window.addEventListener('focus', handleFocus2);
  }
});
onUnmounted(() => {
  console.log('onUnmounted');
  window.removeEventListener('visibilitychange', handleFocus);
  // window.removeEventListener('focus', handleFocus2);
});
function handleFocus() {
  console.log('handleFocus1');
}
function handleFocus2() {
  console.log('handleFocus2');
}
const {
  getDataSource: getList,
@@ -129,8 +95,9 @@
  paginationState,
  extraParamState,
  reset,
} = useTable(
  async ({ pageIndex, pageSize }, extraParamState) => {
  isInitialLoading,
} = useTableV2(
  async ({ pageIndex, pageSize, isInitialLoading }, extraParamState) => {
    try {
      let params: API.GetEnterprisesQuery = {
        pageModel: {
@@ -143,7 +110,7 @@
      };
      let res = await enterpriseServices.getEnterprises(params, {
        showLoading: !state.loading,
        showLoading: !isInitialLoading,
      });
      return res;
    } catch (error) {
src/views/EnterpriseManage/Test.vue
New file
@@ -0,0 +1,132 @@
<template>
  <LoadingLayout :loading="isInitialLoading">
    <AppContainer>
      <ProTableQueryFilterBar @on-reset="reset">
        <template #query>
          <!-- SearchInput如果需要 必须放在所有的query的最后面 -->
          <QueryFilterItem>
            <SearchInput
              v-model="extraParamState.keyword"
              style="width: 200px"
              placeholder="角色名称"
              @on-click-search="getList"
            >
            </SearchInput>
          </QueryFilterItem>
        </template>
        <template #btn>
          <el-button
            v-if="checkSubModuleItemShow('pageButton', 'addBtn')"
            @click="openDialog()"
            icon="Plus"
            type="primary"
            >新增</el-button
          >
        </template>
      </ProTableQueryFilterBar>
      <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns">
        <template #columns="{ row, column }">
          <template v-if="column.property === 'roleType'">
            <div class="pre">{{ row[column.property] }}</div>
          </template>
          <template v-else-if="column.property === 'note'">
            <div class="pre">{{ row[column.property] }}</div>
          </template>
        </template>
      </ProTableV2>
    </AppContainer>
  </LoadingLayout>
</template>
<script setup lang="ts">
import {
  ProTableQueryFilterBar,
  OperationBtnType,
  ProTableV2,
  SearchInput,
  LoadingLayout,
  AppContainer,
  QueryFilterItem,
  useTableV2,
  useFormDialog,
} from '@bole-core/components';
import { useAccess } from '@/hooks';
defineOptions({
  name: 'Test',
});
const operationBtnMap: Record<string, OperationBtnType> = {
  /**
   * 键值名为encode
   */
  editBtn: { emits: { onClick: (role) => openDialog(role) } },
};
const { checkSubModuleItemShow, column, operationBtns } = useAccess({
  operationBtnMap,
});
const {
  //记得改方法名(选择方法名按f2) 改了删掉注释
  getDataSource: getList,
  proTableProps,
  paginationState,
  extraParamState,
  reset,
  isInitialLoading,
} = useTableV2(
  async ({ pageIndex, pageSize, isInitialLoading }, extraParamState) => {
    try {
      let params = {
        pageModel: {
          rows: pageSize,
          page: pageIndex,
        },
        keyword: extraParamState.keyword,
      };
      let res = await new Promise((resolve) => {
        setTimeout(
          () =>
            resolve({
              id: 'id',
              name: 'name',
            }),
          1000
        );
      });
      return res;
    } catch (error) {}
  },
  {
    defaultExtraParams: {
      keyword: '',
    },
    queryKey: ['getList'],
  }
);
function openDialog(row?: any) {
  console.log('row: ', row);
  if (row) {
    handleEdit({
      id: row.id,
    });
  } else {
    handleAdd();
  }
}
const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({
  onConfirm: handleAddOrEdit,
  defaultFormParams: {
    id: '',
  },
});
function handleAddOrEdit() {}
</script>
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
</style>
tsconfig.json
@@ -34,8 +34,8 @@
      "node",
      "vite/client",
      "vite-svg-loader",
      "element-plus/global",
      "@bole-core/components/global"
      "element-plus/global"
      // "@bole-core/components/global"
    ]
    // "typeRoots": ["./node_modules/@types/", "./types"]
  },