From 53c63ba68f69ac746b2e07bacf36196535a1369e Mon Sep 17 00:00:00 2001 From: AhJindeg Date: Thu, 7 Mar 2024 07:42:59 +0000 Subject: [PATCH 01/87] =?UTF-8?q?build(package):=20=F0=9F=94=A7=20add=20pr?= =?UTF-8?q?ettier-eslint@16.3.0=20#392=20=E4=BF=AE=E5=A4=8D=20settings.jso?= =?UTF-8?q?n=20=E6=96=87=E4=BB=B6=E4=B8=AD=E8=AE=BE=E7=BD=AE=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E6=8F=92=E4=BB=B6=20rvest.vs-code-prettier-e?= =?UTF-8?q?slint=20=E6=9C=AA=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: AhJindeg --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9bcd5c65..bafdf048 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "postcss-html": "^1.5.0", "postcss-scss": "^4.0.9", "prettier": "^3.1.0", + "prettier-eslint": "^16.3.0", "rimraf": "^5.0.5", "rollup": "^4.4.1", "sass": "^1.69.5", From d21c060903ca4fafaa36a00faa9569cfa118d195 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 9 Mar 2024 17:57:24 +0800 Subject: [PATCH 02/87] =?UTF-8?q?CRM=EF=BC=9A=E5=AE=8C=E5=96=84=E8=BD=AC?= =?UTF-8?q?=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/permission/index.ts | 4 ++-- src/views/crm/permission/components/TransferForm.vue | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts index e1f31747..4f88b14f 100644 --- a/src/api/crm/permission/index.ts +++ b/src/api/crm/permission/index.ts @@ -15,9 +15,9 @@ export interface PermissionVO { } export interface TransferReqVO { - bizId: number // 模块编号 + id: number // 模块编号 newOwnerUserId: number // 新负责人的用户编号 - oldOwnerPermissionLevel: number // 老负责人加入团队后的权限级别 + oldOwnerPermissionLevel?: number // 老负责人加入团队后的权限级别 toBizTypes?: number[] // 转移客户时,需要额外有【联系人】【商机】【合同】的 checkbox 选择 } diff --git a/src/views/crm/permission/components/TransferForm.vue b/src/views/crm/permission/components/TransferForm.vue index 0205faca..311071be 100644 --- a/src/views/crm/permission/components/TransferForm.vue +++ b/src/views/crm/permission/components/TransferForm.vue @@ -19,7 +19,7 @@ - + 移除 加入团队 @@ -86,10 +86,16 @@ const open = async (bizId: number) => { dialogVisible.value = true dialogTitle.value = getDialogTitle() resetForm() - formData.value.bizId = bizId + formData.value.id = bizId } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 - +// 老负责人负责方式 +const handleOwnerChange = (val: boolean) => { + if (!val) { + // 移除的话提交不带 oldOwnerPermissionLevel 参数 + formData.value.oldOwnerPermissionLevel = undefined + } +} /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { From b0d4c87d8e2923752a3b46b8b9563349f0856b16 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Sun, 10 Mar 2024 10:30:32 +0800 Subject: [PATCH 03/87] =?UTF-8?q?feat:=20[CRM-=E5=AE=A2=E6=88=B7=E5=88=86?= =?UTF-8?q?=E6=9E=90]=E5=A2=9E=E5=8A=A0[=E6=97=B6=E9=97=B4=E9=97=B4?= =?UTF-8?q?=E9=9A=94]=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/statistics/customer.ts | 16 ++++++++++++++++ src/views/crm/statistics/customer/index.vue | 14 +++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/api/crm/statistics/customer.ts b/src/api/crm/statistics/customer.ts index 4358db77..8d5b09f8 100644 --- a/src/api/crm/statistics/customer.ts +++ b/src/api/crm/statistics/customer.ts @@ -55,6 +55,22 @@ export interface CrmStatisticsCustomerDealCycleByUserRespVO { customerDealCount: number } +export const DATE_INTERVAL_OPTIONS = [ + { value: 1, name: '今天' }, + { value: 2, name: '昨天' }, + { value: 3, name: '本周' }, + { value: 4, name: '上周' }, + { value: 5, name: '本月' }, + { value: 6, name: '上月' }, + { value: 7, name: '本季度' }, + { value: 8, name: '上季度' }, + { value: 9, name: '本年' }, + { value: 10, name: '去年' }, + { value: 11, name: '自定义' } +] + +export const CUSTOMER_INTERVAL = 11 + // 客户分析 API export const StatisticsCustomerApi = { // 1.1 客户总量分析(按日期) diff --git a/src/views/crm/statistics/customer/index.vue b/src/views/crm/statistics/customer/index.vue index 9d804e31..64ca4534 100644 --- a/src/views/crm/statistics/customer/index.vue +++ b/src/views/crm/statistics/customer/index.vue @@ -9,7 +9,17 @@ :inline="true" label-width="68px" > - + + + + + + Date: Thu, 14 Mar 2024 00:13:40 +0800 Subject: [PATCH 04/87] =?UTF-8?q?=E9=80=82=E9=85=8D=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/imgs/diy/app-nav-bar-mp.png | Bin 0 -> 3595 bytes .../NavigationBar/components/CellProperty.vue | 90 ++++++++++++++++++ .../components/mobile/NavigationBar/config.ts | 84 ++++++++++++---- .../components/mobile/NavigationBar/index.vue | 80 +++++++++++----- .../mobile/NavigationBar/property.vue | 85 +++++++++++------ src/components/MagicCubeEditor/index.vue | 2 +- 6 files changed, 263 insertions(+), 78 deletions(-) create mode 100644 src/assets/imgs/diy/app-nav-bar-mp.png create mode 100644 src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue diff --git a/src/assets/imgs/diy/app-nav-bar-mp.png b/src/assets/imgs/diy/app-nav-bar-mp.png new file mode 100644 index 0000000000000000000000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Oxc zQOMY}D^D#%W0!yGy1qOyF|lS9AzD=jCx#ZBR-h*hSk7ggDSwvub^uy0df+2taO7!1 z$X_o0aW5}Iq_@rHe+3=5isIO=GVipB#$YlZ0$>FnF90;*N~_g+xx2dyJHRglP9`TO zvm+xT$a%$|TeR|{rfD~#su}Z=xRnPB|10PK#mXSak-plLK}KDK|!aN z&9YBEWic?t^I1PRz>*03c%?X76%PLq2kYRw<-cyo6ROZ00S4=PN7gZuFUNK ztgT&9QxwJP*=*L;HPYw3JQJr46R;34FE;e^w}!nJz5KIb=kgtIYi@jnF?Od|EFOP| zt}CL{Xf#lvxR81beC6soVAz1QE{gkT5rBc_^otyNZ5DjDW*Ekjmw&cDDS4k|_YCmH zE*&*$UJZ?{q?Kj2F33?|Vu#Y{2v`ie{z{YKj{W@PxJpiNN~n*{7%kYS9yFBXe8ycYBO zupA;_;Ir`UrJ#-NmYv;+!+s6XkAPdfW07H=g7)m$H9vmE?9X%>s(C!m;Xlt2FW+ez%dm3F{o8VtbghSe- z2<@cr7ujrfCDpb`-S*SB4hJfXc=%YYgc?=X^%bNHhS^al4QovdilFN{@@LVr33C9r z0PVZ6u`zu9F{KJ&?!tFE)&r;r^KOcwc+Zcox{0MPz*-aWdN5SQ+QWbAjIlp6nat+c z*qF&lQUHIah;(cV0L6bD92{g14-e-=QA9UNd_oBU3KOX9F-WX(EyD>SrGWrzm zA-~!R;>>wb*k~BW-|dDP@9+^bUDs +
+ + +
+ + + + + + diff --git a/src/components/DiyEditor/components/mobile/NavigationBar/config.ts b/src/components/DiyEditor/components/mobile/NavigationBar/config.ts index f722d525..36612a3f 100644 --- a/src/components/DiyEditor/components/mobile/NavigationBar/config.ts +++ b/src/components/DiyEditor/components/mobile/NavigationBar/config.ts @@ -2,22 +2,53 @@ import { DiyComponent } from '@/components/DiyEditor/util' /** 顶部导航栏属性 */ export interface NavigationBarProperty { - // 页面标题 - title: string - // 页面描述 - description: string - // 顶部导航高度 - navBarHeight: number - // 页面背景颜色 - backgroundColor: string - // 页面背景图片 - backgroundImage: string + // 背景类型 + bgType: 'color' | 'img' + // 背景颜色 + bgColor: string + // 图片链接 + bgImg: string // 样式类型:默认 | 沉浸式 - styleType: 'default' | 'immersion' + styleType: 'normal' | 'inner' // 常驻显示 alwaysShow: boolean - // 是否显示返回按钮 - showGoBack: boolean + // 小程序单元格列表 + mpCells: NavigationBarCellProperty[] + // 其它平台单元格列表 + otherCells: NavigationBarCellProperty[] + // 本地变量 + _local: { + // 预览顶部导航(小程序) + previewMp: boolean + // 预览顶部导航(非小程序) + previewOther: boolean + } +} + +/** 顶部导航栏 - 单元格 属性 */ +export interface NavigationBarCellProperty { + // 类型:文字 | 图片 | 搜索框 + type: 'text' | 'image' | 'search' + // 宽度 + width: number + // 高度 + height: number + // 顶部位置 + top: number + // 左侧位置 + left: number + // 文字内容 + text: string + // 文字颜色 + textColor: string + // 图片地址 + imgUrl: string + // 图片链接 + url: string + // 搜索框:提示文字 + placeholder: string + // 搜索框:边框圆角半径 + borderRadius: number } // 定义组件 @@ -26,13 +57,26 @@ export const component = { name: '顶部导航栏', icon: 'tabler:layout-navbar', property: { - title: '页面标题', - description: '', - navBarHeight: 35, - backgroundColor: '#fff', - backgroundImage: '', - styleType: 'default', + bgType: 'color', + bgColor: '#fff', + bgImg: '', + styleType: 'normal', alwaysShow: true, - showGoBack: true + mpCells: [ + { + type: 'text', + textColor: '#111111' + } + ], + otherCells: [ + { + type: 'text', + textColor: '#111111' + } + ], + _local: { + previewMp: true, + previewOther: false + } } } as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/NavigationBar/index.vue b/src/components/DiyEditor/components/mobile/NavigationBar/index.vue index f5cfff8c..c684aee7 100644 --- a/src/components/DiyEditor/components/mobile/NavigationBar/index.vue +++ b/src/components/DiyEditor/components/mobile/NavigationBar/index.vue @@ -1,45 +1,73 @@ diff --git a/src/components/MagicCubeEditor/index.vue b/src/components/MagicCubeEditor/index.vue index 26ea179d..9b9a43cc 100644 --- a/src/components/MagicCubeEditor/index.vue +++ b/src/components/MagicCubeEditor/index.vue @@ -189,7 +189,7 @@ const emit = defineEmits(['update:modelValue', 'hotAreaSelected']) const emitUpdateModelValue = () => emit('update:modelValue', hotAreas) // 热区选中 -const selectedHotAreaIndex = ref(-1) +const selectedHotAreaIndex = ref(0) const handleHotAreaSelected = (hotArea: Rect, index: number) => { selectedHotAreaIndex.value = index emit('hotAreaSelected', hotArea, index) From c2f98043df94ef78503cc1f25dd7eb2f3c5a7301 Mon Sep 17 00:00:00 2001 From: AhJindeg Date: Thu, 21 Mar 2024 17:20:01 +0800 Subject: [PATCH 05/87] =?UTF-8?q?fix:=20=F0=9F=90=9E=20add=20inputChange?= =?UTF-8?q?=20for=20crontab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Crontab/src/Crontab.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Crontab/src/Crontab.vue b/src/components/Crontab/src/Crontab.vue index 90b40b2f..e61fef89 100644 --- a/src/components/Crontab/src/Crontab.vue +++ b/src/components/Crontab/src/Crontab.vue @@ -503,9 +503,13 @@ const submit = () => { emit('update:modelValue', defaultValue.value) dialogVisible.value = false } + +const inputChange = () => { + emit('update:modelValue', defaultValue.value) +} diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue index 6da1d415..f3072e56 100644 --- a/src/views/bpm/processInstance/detail/index.vue +++ b/src/views/bpm/processInstance/detail/index.vue @@ -24,15 +24,15 @@ {{ processInstance?.startUser.nickname }} {{ processInstance?.startUser.deptName }}
- + @@ -91,7 +91,7 @@ - diff --git a/src/components/FormCreate/src/config/index.ts b/src/components/FormCreate/src/config/index.ts index e098ce48..5403ce0e 100644 --- a/src/components/FormCreate/src/config/index.ts +++ b/src/components/FormCreate/src/config/index.ts @@ -1,5 +1,13 @@ import { useUploadFileRule } from './useUploadFileRule' import { useUploadImgRule } from './useUploadImgRule' import { useUploadImgsRule } from './useUploadImgsRule' +import { useDictSelectRule } from './useDictSelectRule' +import { useUserSelectRule } from './useUserSelectRule' -export { useUploadFileRule, useUploadImgRule, useUploadImgsRule } +export { + useUploadFileRule, + useUploadImgRule, + useUploadImgsRule, + useDictSelectRule, + useUserSelectRule +} diff --git a/src/components/FormCreate/src/config/useDictSelectRule.ts b/src/components/FormCreate/src/config/useDictSelectRule.ts new file mode 100644 index 00000000..51cd33b7 --- /dev/null +++ b/src/components/FormCreate/src/config/useDictSelectRule.ts @@ -0,0 +1,124 @@ +import { generateUUID } from '@/utils' +import * as DictDataApi from '@/api/system/dict/dict.type' +import { localeProps, makeRequiredRule } from '@/components/FormCreate/src/utils' + +export const useDictSelectRule = () => { + const label = '字典选择器' + const name = 'DictSelect' + const dictOptions = ref<{ label: string; value: string }[]>([]) // 字典类型下拉数据 + onMounted(async () => { + const data = await DictDataApi.getSimpleDictTypeList() + if (!data || data.length === 0) { + return + } + dictOptions.value = + data?.map((item: DictDataApi.DictTypeVO) => ({ + label: item.name, + value: item.type + })) ?? [] + }) + return { + icon: 'icon-select', + label, + name, + rule() { + return { + type: name, + field: generateUUID(), + title: label, + info: '', + $required: false + } + }, + props(_, { t }) { + return localeProps(t, name + '.props', [ + makeRequiredRule(), + { + type: 'select', + field: 'dictType', + title: '字典类型', + value: '', + options: dictOptions.value + }, + { + type: 'select', + field: 'valueType', + title: '字典值类型', + value: 'str', + options: [ + { label: '数字', value: 'int' }, + { label: '字符串', value: 'str' }, + { label: '布尔值', value: 'bool' } + ] + }, + { type: 'switch', field: 'multiple', title: '是否多选' }, + { + type: 'switch', + field: 'disabled', + title: '是否禁用' + }, + { type: 'switch', field: 'clearable', title: '是否可以清空选项' }, + { + type: 'switch', + field: 'collapseTags', + title: '多选时是否将选中值按文字的形式展示' + }, + { + type: 'inputNumber', + field: 'multipleLimit', + title: '多选时用户最多可以选择的项目数,为 0 则不限制', + props: { min: 0 } + }, + { + type: 'input', + field: 'autocomplete', + title: 'autocomplete 属性' + }, + { type: 'input', field: 'placeholder', title: '占位符' }, + { + type: 'switch', + field: 'filterable', + title: '是否可搜索' + }, + { type: 'switch', field: 'allowCreate', title: '是否允许用户创建新条目' }, + { + type: 'input', + field: 'noMatchText', + title: '搜索条件无匹配时显示的文字' + }, + { + type: 'switch', + field: 'remote', + title: '其中的选项是否从服务器远程加载' + }, + { + type: 'Struct', + field: 'remoteMethod', + title: '自定义远程搜索方法' + }, + { type: 'input', field: 'noDataText', title: '选项为空时显示的文字' }, + { + type: 'switch', + field: 'reserveKeyword', + title: '多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词' + }, + { + type: 'switch', + field: 'defaultFirstOption', + title: '在输入框按下回车,选择第一个匹配项' + }, + { + type: 'switch', + field: 'popperAppendToBody', + title: '是否将弹出框插入至 body 元素', + value: true + }, + { + type: 'switch', + field: 'automaticDropdown', + title: '对于不可搜索的 Select,是否在输入框获得焦点后自动弹出选项菜单' + } + ]) + } + } +} diff --git a/src/components/FormCreate/src/config/useUserSelectRule.ts b/src/components/FormCreate/src/config/useUserSelectRule.ts new file mode 100644 index 00000000..23521134 --- /dev/null +++ b/src/components/FormCreate/src/config/useUserSelectRule.ts @@ -0,0 +1,107 @@ +import { generateUUID } from '@/utils' +import * as UserApi from '@/api/system/user' +import { localeProps, makeOptionsRule, makeRequiredRule } from '@/components/FormCreate/src/utils' + +export const useUserSelectRule = () => { + const label = 'aa选择器' + const name = 'select' + const userOptions = ref<{ label: string; value: number }[]>([]) // 用户下拉数据 + onMounted(async () => { + const data = await UserApi.getSimpleUserList() + if (!data || data.length === 0) { + return + } + userOptions.value = + data?.map((item: UserApi.UserVO) => ({ + label: item.nickname, + value: item.id + })) ?? [] + }) + return { + icon: 'icon-select', + label, + name, + rule() { + return { + type: name, + field: generateUUID(), + title: label, + info: '', + $required: false + } + }, + props(_, { t }) { + return localeProps(t, name + '.props', [ + makeRequiredRule(), + makeOptionsRule(t, 'options', userOptions.value), + { type: 'switch', field: 'multiple', title: '是否多选' }, + { + type: 'switch', + field: 'disabled', + title: '是否禁用' + }, + { type: 'switch', field: 'clearable', title: '是否可以清空选项' }, + { + type: 'switch', + field: 'collapseTags', + title: '多选时是否将选中值按文字的形式展示' + }, + { + type: 'inputNumber', + field: 'multipleLimit', + title: '多选时用户最多可以选择的项目数,为 0 则不限制', + props: { min: 0 } + }, + { + type: 'input', + field: 'autocomplete', + title: 'autocomplete 属性' + }, + { type: 'input', field: 'placeholder', title: '占位符' }, + { + type: 'switch', + field: 'filterable', + title: '是否可搜索' + }, + { type: 'switch', field: 'allowCreate', title: '是否允许用户创建新条目' }, + { + type: 'input', + field: 'noMatchText', + title: '搜索条件无匹配时显示的文字' + }, + { + type: 'switch', + field: 'remote', + title: '其中的选项是否从服务器远程加载' + }, + { + type: 'Struct', + field: 'remoteMethod', + title: '自定义远程搜索方法' + }, + { type: 'input', field: 'noDataText', title: '选项为空时显示的文字' }, + { + type: 'switch', + field: 'reserveKeyword', + title: '多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词' + }, + { + type: 'switch', + field: 'defaultFirstOption', + title: '在输入框按下回车,选择第一个匹配项' + }, + { + type: 'switch', + field: 'popperAppendToBody', + title: '是否将弹出框插入至 body 元素', + value: true + }, + { + type: 'switch', + field: 'automaticDropdown', + title: '对于不可搜索的 Select,是否在输入框获得焦点后自动弹出选项菜单' + } + ]) + } + } +} diff --git a/src/components/FormCreate/src/useFormCreateDesigner.ts b/src/components/FormCreate/src/useFormCreateDesigner.ts index b6855a99..e142970d 100644 --- a/src/components/FormCreate/src/useFormCreateDesigner.ts +++ b/src/components/FormCreate/src/useFormCreateDesigner.ts @@ -1,4 +1,10 @@ -import { useUploadFileRule, useUploadImgRule, useUploadImgsRule } from './config' +import { + useDictSelectRule, + useUploadFileRule, + useUploadImgRule, + useUploadImgsRule, + useUserSelectRule +} from './config' import { Ref } from 'vue' /** @@ -12,11 +18,19 @@ export const useFormCreateDesigner = (designer: Ref) => { const uploadFileRule = useUploadFileRule() const uploadImgRule = useUploadImgRule() const uploadImgsRule = useUploadImgsRule() + const dictSelectRule = useDictSelectRule() + const userSelectRule = useUserSelectRule() onMounted(() => { // 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代 designer.value?.removeMenuItem('upload') - const components = [uploadFileRule, uploadImgRule, uploadImgsRule] + const components = [ + uploadFileRule, + uploadImgRule, + uploadImgsRule, + dictSelectRule, + userSelectRule + ] components.forEach((component) => { // 插入组件规则 designer.value?.addComponent(component) diff --git a/src/components/FormCreate/src/utils/index.ts b/src/components/FormCreate/src/utils/index.ts index 49901b5f..e5480981 100644 --- a/src/components/FormCreate/src/utils/index.ts +++ b/src/components/FormCreate/src/utils/index.ts @@ -17,3 +17,63 @@ export const localeProps = (t, prefix, rules) => { return rule }) } + +export function upper(str) { + return str.replace(str[0], str[0].toLocaleUpperCase()) +} + +export function makeOptionsRule(t, to, userOptions) { + console.log(userOptions[0]) + const options = [ + { label: t('props.optionsType.struct'), value: 0 }, + { label: t('props.optionsType.json'), value: 1 }, + { label: '用户数据', value: 2 } + ] + + const control = [ + { + value: 0, + rule: [ + { + type: 'TableOptions', + field: 'formCreate' + upper(to).replace('.', '>'), + props: { defaultValue: [] } + } + ] + }, + { + value: 1, + rule: [ + { + type: 'Struct', + field: 'formCreate' + upper(to).replace('.', '>'), + props: { defaultValue: [] } + } + ] + }, + { + value: 2, + rule: [ + { + type: 'TableOptions', + field: 'formCreate' + upper(to).replace('.', '>'), + props: { modelValue: [] } + } + ] + } + ] + options.splice(0, 0) + control.push() + + return { + type: 'radio', + title: t('props.options'), + field: '_optionType', + value: 0, + options, + props: { + type: 'button' + }, + control + } +} diff --git a/src/plugins/formCreate/index.ts b/src/plugins/formCreate/index.ts index ffbcc010..9e083641 100644 --- a/src/plugins/formCreate/index.ts +++ b/src/plugins/formCreate/index.ts @@ -19,6 +19,7 @@ import formCreate from '@form-create/element-ui' import install from '@form-create/element-ui/auto-import' //======================= 自定义组件 ======================= import { UploadFile, UploadImg, UploadImgs } from '@/components/UploadFile' +import { DictSelect } from '@/components/DictSelect' const components = [ ElAside, @@ -35,7 +36,8 @@ const components = [ ElTabPane, UploadImg, UploadImgs, - UploadFile + UploadFile, + DictSelect ] // 参考 http://www.form-create.com/v3/element-ui/auto-import.html 文档 From d16bed4ad7e28dcda7646930e59f3292959bf69b Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 31 Mar 2024 17:58:44 +0800 Subject: [PATCH 16/87] =?UTF-8?q?form-create-designer:=20=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E7=BB=84=E4=BB=B6=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictSelect/src/DictSelect.vue | 9 +----- .../src/config/useUserSelectRule.ts | 20 ++----------- src/plugins/formCreate/index.ts | 4 ++- src/utils/dict.ts | 6 ++-- .../system/user/components/UserSelect.vue | 28 +++++++++++++++++++ 5 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 src/views/system/user/components/UserSelect.vue diff --git a/src/components/DictSelect/src/DictSelect.vue b/src/components/DictSelect/src/DictSelect.vue index c0d585ab..0b4e258a 100644 --- a/src/components/DictSelect/src/DictSelect.vue +++ b/src/components/DictSelect/src/DictSelect.vue @@ -1,5 +1,5 @@ diff --git a/src/views/infra/apiAccessLog/index.vue b/src/views/infra/apiAccessLog/index.vue index b196da11..4485b730 100644 --- a/src/views/infra/apiAccessLog/index.vue +++ b/src/views/infra/apiAccessLog/index.vue @@ -91,16 +91,16 @@ - + - + - + - + + + + + + From 283a9d05076e4bc0cd8b34b6eed56aca6940b3e5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 4 Apr 2024 09:57:25 +0800 Subject: [PATCH 22/87] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91syste?= =?UTF-8?q?m=20user=20=E5=92=8C=20role=20=E6=8E=A5=E5=85=A5=E6=96=B0?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/dict.ts | 2 +- src/views/infra/apiAccessLog/ApiAccessLogDetail.vue | 2 +- src/views/infra/apiAccessLog/index.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 2284ff13..0acf917d 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -111,7 +111,6 @@ export enum DICT_TYPE { SYSTEM_ROLE_TYPE = 'system_role_type', SYSTEM_DATA_SCOPE = 'system_data_scope', SYSTEM_NOTICE_TYPE = 'system_notice_type', - SYSTEM_OPERATE_TYPE = 'system_operate_type', SYSTEM_LOGIN_TYPE = 'system_login_type', SYSTEM_LOGIN_RESULT = 'system_login_result', SYSTEM_SMS_CHANNEL_CODE = 'system_sms_channel_code', @@ -134,6 +133,7 @@ export enum DICT_TYPE { INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type', INFRA_CODEGEN_SCENE = 'infra_codegen_scene', INFRA_FILE_STORAGE = 'infra_file_storage', + INFRA_OPERATE_TYPE = 'infra_operate_type', // ========== BPM 模块 ========== BPM_MODEL_FORM_TYPE = 'bpm_model_form_type', diff --git a/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue b/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue index ca7fa8fb..314fd260 100644 --- a/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue +++ b/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue @@ -46,7 +46,7 @@ {{ detailData.operateName }} - + diff --git a/src/views/infra/apiAccessLog/index.vue b/src/views/infra/apiAccessLog/index.vue index 4485b730..45110c41 100644 --- a/src/views/infra/apiAccessLog/index.vue +++ b/src/views/infra/apiAccessLog/index.vue @@ -118,7 +118,7 @@ From 7b84ddd35802d2446e18eb407968f48f3af738fe Mon Sep 17 00:00:00 2001 From: AhJindeg Date: Thu, 4 Apr 2024 18:54:51 +0800 Subject: [PATCH 23/87] =?UTF-8?q?perf:=20=F0=9F=8E=88=20add=20await=20for?= =?UTF-8?q?=20nextTick()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/role/RoleDataPermissionForm.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/system/role/RoleDataPermissionForm.vue b/src/views/system/role/RoleDataPermissionForm.vue index 0cdc7409..3b8c3ee6 100644 --- a/src/views/system/role/RoleDataPermissionForm.vue +++ b/src/views/system/role/RoleDataPermissionForm.vue @@ -102,8 +102,8 @@ const open = async (row: RoleApi.RoleVO) => { formData.name = row.name formData.code = row.code formData.dataScope = row.dataScope - nextTick((): void => { - row.dataScopeDeptIds?.forEach((deptId: number) => { + await nextTick((): void => { + row.dataScopeDeptIds?.forEach((deptId: number): void => { treeRef.value.setChecked(deptId, true, false) }) }) From db4795744e2ed0337f0b22a88988253631145011 Mon Sep 17 00:00:00 2001 From: AhJindeg Date: Fri, 5 Apr 2024 13:51:27 +0800 Subject: [PATCH 24/87] =?UTF-8?q?style:=20=F0=9F=8C=88=20add=20more=20read?= =?UTF-8?q?able=20for=20open?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/role/RoleDataPermissionForm.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/views/system/role/RoleDataPermissionForm.vue b/src/views/system/role/RoleDataPermissionForm.vue index 3b8c3ee6..32745e95 100644 --- a/src/views/system/role/RoleDataPermissionForm.vue +++ b/src/views/system/role/RoleDataPermissionForm.vue @@ -102,10 +102,9 @@ const open = async (row: RoleApi.RoleVO) => { formData.name = row.name formData.code = row.code formData.dataScope = row.dataScope - await nextTick((): void => { - row.dataScopeDeptIds?.forEach((deptId: number): void => { - treeRef.value.setChecked(deptId, true, false) - }) + await nextTick() + row.dataScopeDeptIds?.forEach((deptId: number): void => { + treeRef.value.setChecked(deptId, true, false) }) } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 From dcfad7a427394c1b72af3e15e44d58c0758ed2e8 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 5 Apr 2024 13:53:14 +0800 Subject: [PATCH 25/87] =?UTF-8?q?crm=EF=BC=9Acode=20review=20=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E4=B8=9A=E7=BB=A9=E7=9A=84=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictSelect/src/DictSelect.vue | 1 + .../components/ContractCountPerformance.vue | 94 +++++++++++-------- .../components/ContractPricePerformance.vue | 94 +++++++++++-------- .../components/ReceivablePricePerformance.vue | 94 +++++++++++-------- .../crm/statistics/performance/index.vue | 11 +-- 5 files changed, 165 insertions(+), 129 deletions(-) diff --git a/src/components/DictSelect/src/DictSelect.vue b/src/components/DictSelect/src/DictSelect.vue index 0b4e258a..54279cec 100644 --- a/src/components/DictSelect/src/DictSelect.vue +++ b/src/components/DictSelect/src/DictSelect.vue @@ -1,3 +1,4 @@ +