diff --git a/.github/ISSUE_TEMPLATE/bug-report_cn.yaml b/.github/ISSUE_TEMPLATE/bug-report_cn.yaml new file mode 100644 index 00000000..b1de7e61 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report_cn.yaml @@ -0,0 +1,90 @@ +name: 🐞 Bug提交 +description: 在使用软件或功能的过程中遇到了错误 +title: '[Bug]: ' +labels: [ "bug?" ] + +body: + - type: markdown + attributes: + value: | + ## 请按照以下要求进行提交 + ### 1. 提交后需要指定标签和截止时间。 + --- + + - type: markdown + attributes: + value: | + ## 环境信息 + 请根据实际使用环境修改以下信息。 + + - type: input + id: env-program-ver + attributes: + label: 软件版本 + validations: + required: true + + - type: dropdown + id: env-vm-ver + attributes: + label: 运行环境 + description: 选择运行软件的系统版本 + options: + - Windows (64) + - Windows (32/x84) + - MacOS + - Linux + - Ubuntu + - CentOS + - ArchLinux + - UNIX (Android) + - 其它(请在下方说明) + validations: + required: true + + - type: dropdown + id: env-vm-arch + attributes: + label: 运行架构 + description: (可选) 选择运行软件的系统架构 + options: + - AMD64 + - x86 + - ARM [32] (别名:AArch32 / ARMv7) + - ARM [64] (别名:AArch64 / ARMv8) + - 其它 + + - type: textarea + id: reproduce-steps + attributes: + label: 重现步骤 + description: | + 我们需要执行哪些操作才能让 bug 出现? + 简洁清晰的重现步骤能够帮助我们更迅速地定位问题所在。 + validations: + required: true + + - type: textarea + id: expected + attributes: + label: 期望的结果是什么? + validations: + required: true + + - type: textarea + id: actual + attributes: + label: 实际的结果是什么? + validations: + required: true + + - type: textarea + id: logging + attributes: + label: 日志记录(可选) + render: golang + + - type: textarea + id: extra-desc + attributes: + label: 补充说明(可选) diff --git a/.github/ISSUE_TEMPLATE/bug-report_en.yaml b/.github/ISSUE_TEMPLATE/bug-report_en.yaml new file mode 100644 index 00000000..a3a2f124 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report_en.yaml @@ -0,0 +1,90 @@ +name: 🐞 Bug Report +description: Encountered an error while using the software or feature +title: '[Bug]: ' +labels: [ "bug?" ] + +body: + - type: markdown + attributes: + value: | + ## Please submit according to the following requirements + ### 1. After submission, you need to specify the label and deadline. + --- + + - type: markdown + attributes: + value: | + ## Environment Information + Please modify the following information according to the actual usage environment. + + - type: input + id: env-program-ver + attributes: + label: Software Version + validations: + required: true + + - type: dropdown + id: env-vm-ver + attributes: + label: Operating Environment + description: Select the system version on which the software is running + options: + - Windows (64) + - Windows (32/x84) + - MacOS + - Linux + - Ubuntu + - CentOS + - ArchLinux + - UNIX (Android) + - Other (please specify below) + validations: + required: true + + - type: dropdown + id: env-vm-arch + attributes: + label: Operating Architecture + description: (Optional) Select the system architecture on which the software is running + options: + - AMD64 + - x86 + - ARM [32] (Alias:AArch32 / ARMv7) + - ARM [64] (Alias:AArch64 / ARMv8) + - Other + + - type: textarea + id: reproduce-steps + attributes: + label: Reproduce Steps + description: | + What operations do we need to perform to make the bug appear? + The concise and clear reproduction steps can help us locate the problem more quickly. + validations: + required: true + + - type: textarea + id: expected + attributes: + label: What is the expected result? + validations: + required: true + + - type: textarea + id: actual + attributes: + label: What is the actual result? + validations: + required: true + + - type: textarea + id: logging + attributes: + label: Logging (Optional) + render: golang + + - type: textarea + id: extra-desc + attributes: + label: Additional Description (Optional) diff --git a/.github/ISSUE_TEMPLATE/feature_request_cn.yaml b/.github/ISSUE_TEMPLATE/feature_request_cn.yaml new file mode 100644 index 00000000..c98162f5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request_cn.yaml @@ -0,0 +1,48 @@ +--- +name: 🚀 功能请求 +description: 提出一个想法以帮助我们改进W&B +title: "[功能]: " +labels: + - "功能请求" + +body: + - type: markdown + attributes: + value: | + **感谢 :heart: 您花时间填写此功能请求报告!** + 我们恳请您搜索看看您的功能是否[已经存在](https://github.com/soybeanjs/soybean-admin/issues?q=is%3Aissue+sort%3Acreated-desc+)。 + + 我们也很乐意接受用户的贡献。有关更多详细信息,请参阅[此处](https://github.com/soybeanjs/soybean-admin/blob/main/README.zh_CN.md#%E5%A6%82%E4%BD%95%E8%B4%A1%E7%8C%AE)。 + + - type: textarea + attributes: + label: 描述 + description: | + 对您感兴趣的功能的清晰简洁的描述。 + validations: + required: true + + - type: textarea + attributes: + label: 建议的解决方案 + description: | + 描述您想要的解决方案。对您希望发生的事情的清晰简洁的描述。 + validations: + required: true + + - type: textarea + attributes: + label: 替代方案 + description: | + 描述您考虑过的替代方案。 + 对您考虑过的任何替代解决方案或功能的清晰简洁的描述。 + validations: + required: false + + - type: textarea + attributes: + label: 额外的上下文 + description: | + 在此处添加有关问题的其他上下文。 + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request_en.yaml b/.github/ISSUE_TEMPLATE/feature_request_en.yaml new file mode 100644 index 00000000..07fc41c0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request_en.yaml @@ -0,0 +1,48 @@ +--- +name: 🚀 Feature Request +description: Suggest an idea to help us improve W&B +title: "[Feature]: " +labels: + - "feature_request" + +body: + - type: markdown + attributes: + value: | + **Thanks :heart: for taking the time to fill out this feature request report!** + We kindly ask that you search to see if an issue [already exists](https://github.com/soybeanjs/soybean-admin/issues?q=is%3Aissue+sort%3Acreated-desc+) for your feature. + + We are also happy to accept contributions from our users. For more details see [here](https://github.com/soybeanjs/soybean-admin/blob/main/README.md#how-to-contribute). + + - type: textarea + attributes: + label: Description + description: | + A clear and concise description of the feature you're interested in. + validations: + required: true + + - type: textarea + attributes: + label: Suggested Solution + description: | + Describe the solution you'd like. A clear and concise description of what you want to happen. + validations: + required: true + + - type: textarea + attributes: + label: Alternatives + description: | + Describe alternatives you've considered. + A clear and concise description of any alternative solutions or features you've considered. + validations: + required: false + + - type: textarea + attributes: + label: Additional Context + description: | + Add any other context about the problem here. + validations: + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE/pr_cn.md b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md new file mode 100644 index 00000000..05514b2e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md @@ -0,0 +1,50 @@ +首先,感谢你的贡献! 😄 + +提交至 dev 分支。在一个维护者审核通过后合并。请确保填写以下 pull request 的信息,谢谢!~ + +[[English Template / 英文模板](./pr_en.md)] + +### 这个变动的性质是 + +- [ ] 新特性提交 +- [ ] 日常 bug 修复 +- [ ] 站点、文档改进 +- [ ] 组件样式改进 +- [ ] TypeScript 定义更新 +- [ ] 重构 +- [ ] 代码风格优化 +- [ ] 分支合并 +- [ ] 其他改动(是关于什么的改动?) + +### 需求背景 + +> 1. 描述相关需求的来源。 +> 2. 要解决的问题。 +> 3. 相关的 issue 讨论链接。 + +### 实现方案和 API(非新功能可选) + +> 1. 基本的解决思路和其他可选方案。 +> 2. 列出最终的 API 实现和用法。 +> 3. 涉及 UI/交互变动需要有截图或 GIF。 + +### 对用户的影响和可能的风险(非新功能可选) + +> 1. 这个改动对用户端是否有影响?影响的方面有哪些? +> 2. 是否有可能隐含的 break change 和其他风险? + +### Changelog 描述(非新功能可选) + +> 1. 英文描述 +> 2. 中文描述(可选) + +### 请求合并前的自查清单 + +- [ ] 文档已补充或无须补充 +- [ ] 代码演示已提供或无须提供 +- [ ] TypeScript 定义已补充或无须补充 +- [ ] Changelog 已提供或无须提供 + +### 后续计划(非新功能可选) + +> 如果这个提交后面还有相关的其他提交和跟进信息,可以写在这里。 diff --git a/.github/PULL_REQUEST_TEMPLATE/pr_en.md b/.github/PULL_REQUEST_TEMPLATE/pr_en.md new file mode 100644 index 00000000..e9bc8559 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pr_en.md @@ -0,0 +1,51 @@ +First of all, thank you for your contribution! 😄 + +Please send pull request to dev branch. Pull request will be merged after one of collaborators approve. Please makes sure that these form are filled before submitting your pull request, thank you! + +[[中文版模板 / Chinese template](./pr_cn.md)] + +### This is a ... + +- [ ] New feature +- [ ] Bug fix +- [ ] Site / document update +- [ ] Component style update +- [ ] TypeScript definition update +- [ ] Refactoring +- [ ] Code style optimization +- [ ] Branch merge +- [ ] Other (about what?) + +### What's the background? + +> 1. Describe the source of requirement. +> 2. Resolve what problem. +> 3. Related issue link. + +### API Realization (Optional if not new feature) + +> 1. Basic thought of solution and other optional proposal. +> 2. List final API realization and usage sample. +> 3. GIF or snapshot should be provided if includes UI/interactive modification. + +### What's the effect? (Optional if not new feature) + +> 1. Does this PR affect user? Which part will be affected? +> 2. What will say in changelog? +> 3. Does this PR contains potential break change or other risk? + +### Changelog description (Optional if not new feature) + +> 1. English description +> 2. Chinese description (optional) + +### Self Check before Merge + +- [ ] Doc is updated/provided or not needed +- [ ] Demo is updated/provided or not needed +- [ ] TypeScript definition is updated/provided or not needed +- [ ] Changelog is provided or not needed + +### Additional Plan? (Optional if not new feature) + +> If this PR related with other PR or following info. You can type here. diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 00000000..450ec865 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,30 @@ +--- +name: Lint Code + +permissions: + contents: write + +on: + pull_request: + branches: [main] + +jobs: + lint: + name: Lint All Code + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: main + # To change branch master or main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FILTER_REGEX_EXCLUDE: (docs|.github) + VALIDATE_MARKDOWN: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..0bf7c92d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release + +permissions: + contents: write + +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v3 + with: + node-version: 18.x + + - run: npx githublogen + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/src/components/custom/tenant-select.vue b/src/components/custom/tenant-select.vue index a23d31a5..7f9dbcb6 100644 --- a/src/components/custom/tenant-select.vue +++ b/src/components/custom/tenant-select.vue @@ -25,7 +25,7 @@ const { clearTabs } = useTabStore(); const { toHome } = useRouterPush(); const tenantId = defineModel('tenantId', { required: false, default: undefined }); -const enabled = defineModel('enabled', { required: false, default: true }); +const enabled = defineModel('enabled', { required: false, default: false }); const lastSelected = ref(); @@ -71,12 +71,14 @@ async function handleFetchTenantList() { const { data, error } = await fetchTenantList(); if (error) return; enabled.value = data.tenantEnabled; - tenantOption.value = data.voList.map(tenant => { - return { - label: tenant.companyName, - value: tenant.tenantId - }; - }); + if (data.tenantEnabled) { + tenantOption.value = data.voList.map(tenant => { + return { + label: tenant.companyName, + value: tenant.tenantId + }; + }); + } endLoading(); } onMounted(async () => { diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 22af8894..f7cd578a 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -396,13 +396,18 @@ const local: App.I18n.Schema = { dept: { empty: 'No department information', title: 'Department List', + parentId: 'Parent Department', deptName: 'Department Name', + orderNum: 'Order Num', + deptCategory: 'Department Category', leader: 'Leader', phone: 'Phone', email: 'Email', status: 'Status', sort: 'Sort', createTime: 'Create Time', + expandAll: 'Expand All', + collapseAll: 'Collapse All', form: { parentId: { required: 'Please select Parent Department', @@ -412,6 +417,14 @@ const local: App.I18n.Schema = { required: 'Please enter Department Name', invalid: 'Department Name cannot be empty' }, + orderNum: { + required: 'Please enter Order Num', + invalid: 'Order num cannot be empty' + }, + deptCategory: { + required: 'Please enter Department Category', + invalid: 'Department category cannot be empty' + }, leader: { required: 'Please enter Leader', invalid: 'Leader cannot be empty' @@ -431,8 +444,21 @@ const local: App.I18n.Schema = { sort: { required: 'Please enter Sort', invalid: 'Sort cannot be empty' + }, + deptId: { + required: 'Please enter deptId', + invalid: 'Dept Id cannot be empty' } }, + error: { + getDeptDataFail: 'Get dept data fail', + getDeptUserDataFail: 'Get dept user data fail' + }, + placeholder: { + defaultLeaderPlaceHolder: 'Please select leader', + addDataLeaderPlaceHolder: 'Department leader can be selected only when updating', + deptUserIsEmptyLeaderPlaceHolder: 'Current dept no leader' + }, addDept: 'Add Department', editDept: 'Edit Department' }, diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 9b7b9e4c..e751d6e0 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -396,13 +396,18 @@ const local: App.I18n.Schema = { dept: { empty: '暂无部门信息', title: '部门列表', + parentId: '上级部门', deptName: '部门名称', + orderNum: '排序', + deptCategory: '类别编码', leader: '负责人', phone: '联系电话', email: '邮箱', status: '状态', sort: '排序', createTime: '创建时间', + expandAll: '全部展开', + collapseAll: '全部收起', form: { parentId: { required: '请选择上级部门', @@ -412,6 +417,14 @@ const local: App.I18n.Schema = { required: '请输入部门名称', invalid: '部门名称不能为空' }, + orderNum: { + required: '请输入排序', + invalid: '排序不能为空' + }, + deptCategory: { + required: '请输入类别编码', + invalid: '类别编码不能为空' + }, leader: { required: '请输入负责人', invalid: '负责人不能为空' @@ -431,8 +444,21 @@ const local: App.I18n.Schema = { sort: { required: '请输入排序', invalid: '排序不能为空' + }, + deptId: { + required: '请输入部门id', + invalid: '部门id不能为空' } }, + error: { + getDeptDataFail: '获取部门用户数据失败', + getDeptUserDataFail: '获取部门用户数据失败' + }, + placeholder: { + defaultLeaderPlaceHolder: '请选择负责人', + addDataLeaderPlaceHolder: '仅在更新时可选择部门负责人', + deptUserIsEmptyLeaderPlaceHolder: '该部门没有负责人' + }, addDept: '新增部门', editDept: '编辑部门' }, diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index f06d1535..6ac7af3f 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -568,21 +568,38 @@ declare namespace App { dept: { empty: string; title: string; + parentId: string; deptName: string; + orderNum: string; + deptCategory: string; leader: string; phone: string; email: string; status: string; sort: string; createTime: string; + expandAll: string; + collapseAll: string; form: { parentId: FormMsg; deptName: FormMsg; + orderNum: FormMsg; + deptCategory: FormMsg; leader: FormMsg; phone: FormMsg; email: FormMsg; status: FormMsg; sort: FormMsg; + deptId: FormMsg; + }; + error: { + getDeptDataFail: string; + getDeptUserDataFail: string; + }; + placeholder: { + defaultLeaderPlaceHolder: string; + addDataLeaderPlaceHolder: string; + deptUserIsEmptyLeaderPlaceHolder: string; }; addDept: string; editDept: string; diff --git a/src/views/_builtin/login/modules/pwd-login.vue b/src/views/_builtin/login/modules/pwd-login.vue index 7763a25e..7bc337a7 100644 --- a/src/views/_builtin/login/modules/pwd-login.vue +++ b/src/views/_builtin/login/modules/pwd-login.vue @@ -20,11 +20,11 @@ const { loading: codeLoading, startLoading: startCodeLoading, endLoading: endCod const { loading: tenantLoading, startLoading: startTenantLoading, endLoading: endTenantLoading } = useLoading(); const codeUrl = ref(); -const captchaEnabled = ref(true); +const captchaEnabled = ref(false); const registerEnabled = ref(false); const remberMe = ref(false); -const tenantEnabled = ref(true); +const tenantEnabled = ref(false); const tenantOption = ref([]); diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 8acb7c4e..46e47842 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -44,25 +44,25 @@ const { columns: () => [ { key: 'deptName', - title: '部门名称', + title: $t('page.system.dept.deptName'), align: 'center', minWidth: 120 }, { key: 'deptCategory', - title: '类别编码', + title: $t('page.system.dept.deptCategory'), align: 'center', minWidth: 120 }, { key: 'orderNum', - title: '排序', + title: $t('page.system.dept.sort'), align: 'center', minWidth: 60 }, { key: 'status', - title: '部门状态', + title: $t('page.system.dept.status'), align: 'center', minWidth: 120, render(row) { @@ -71,7 +71,7 @@ const { }, { key: 'createTime', - title: '创建时间', + title: $t('page.system.dept.createTime'), align: 'center', minWidth: 120 }, @@ -163,7 +163,7 @@ async function addInRow(row: TableDataWithIndex) {