fix: lint
This commit is contained in:
@@ -22,8 +22,10 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: number[] | string[] | undefined): void;
|
||||
(e: 'update:value', value: number[] | string[] | undefined): void;
|
||||
(
|
||||
e: 'update:modelValue' | 'update:value',
|
||||
value: number[] | string[] | undefined,
|
||||
): void;
|
||||
}>();
|
||||
|
||||
// 地区数据接口
|
||||
|
||||
@@ -20,9 +20,10 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'change', payload: number | string): void;
|
||||
(e: 'update:value', payload: number | string): void;
|
||||
(e: 'update:modelValue', payload: number | string): void;
|
||||
(
|
||||
e: 'change' | 'update:modelValue' | 'update:value',
|
||||
payload: number | string,
|
||||
): void;
|
||||
}>();
|
||||
|
||||
const modelValue = useVModel(props, 'modelValue', emits, {
|
||||
|
||||
@@ -3,14 +3,11 @@ import { isFunction, isObject } from '@vben/utils';
|
||||
const WILDCARD = '*';
|
||||
|
||||
function CamundaModdleExtension(eventBus) {
|
||||
// eslint-disable-next-line unicorn/no-this-assignment, @typescript-eslint/no-this-alias
|
||||
const self = this;
|
||||
|
||||
eventBus.on('moddleCopy.canCopyProperty', (context) => {
|
||||
const parent = context.parent;
|
||||
const property = context.property;
|
||||
|
||||
return self.canCopyProperty(property, parent);
|
||||
return this.canCopyProperty(property, parent);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
export function initListenerForm(listener: any) {
|
||||
let self = {
|
||||
let localSelf = {
|
||||
...listener,
|
||||
};
|
||||
if (listener.script) {
|
||||
self = {
|
||||
localSelf = {
|
||||
...listener,
|
||||
...listener.script,
|
||||
scriptType: listener.script.resource ? 'externalScript' : 'inlineScript',
|
||||
@@ -22,13 +22,13 @@ export function initListenerForm(listener: any) {
|
||||
// console.log(listener.eventDefinitions, key);
|
||||
if (key.includes('time')) {
|
||||
k = key;
|
||||
self.eventDefinitionType = key.replace('time', '').toLowerCase();
|
||||
localSelf.eventDefinitionType = key.replace('time', '').toLowerCase();
|
||||
}
|
||||
}
|
||||
// console.log(k);
|
||||
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body;
|
||||
localSelf.eventTimeDefinitions = listener.eventDefinitions[0][k].body;
|
||||
}
|
||||
return self;
|
||||
return localSelf;
|
||||
}
|
||||
|
||||
export function initListenerType(listener: any) {
|
||||
|
||||
@@ -259,14 +259,14 @@ function updateFormFieldKey(
|
||||
) {
|
||||
if (!formSetting?.updateFormFields || !newKey) return;
|
||||
const value = formSetting.updateFormFields[oldKey];
|
||||
delete formSetting.updateFormFields[oldKey];
|
||||
delete formSetting.updateFormFields.oldKey;
|
||||
formSetting.updateFormFields[String(newKey)] = value;
|
||||
}
|
||||
|
||||
/** 删除修改字段设置项 */
|
||||
function deleteFormFieldSetting(formSetting: FormTriggerSetting, key: string) {
|
||||
if (!formSetting?.updateFormFields) return;
|
||||
delete formSetting.updateFormFields[key];
|
||||
delete formSetting.updateFormFields.key;
|
||||
}
|
||||
|
||||
/** 保存配置 */
|
||||
|
||||
@@ -132,7 +132,7 @@ async function initProcessInfo(row: any, formVariables?: any) {
|
||||
if (formVariables) {
|
||||
for (const key in formVariables) {
|
||||
if (!allowedFields.has(key)) {
|
||||
delete formVariables[key];
|
||||
delete formVariables.key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
@@ -18,8 +18,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const deviceLoading = ref(false); // 设备加载状态
|
||||
|
||||
@@ -19,8 +19,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: string): void;
|
||||
(e: 'change', value: string): void;
|
||||
(e: 'change' | 'update:modelValue', value: string): void;
|
||||
}>();
|
||||
|
||||
const localValue = useVModel(props, 'modelValue', emit);
|
||||
|
||||
@@ -17,8 +17,7 @@ defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const productLoading = ref(false); // 产品加载状态
|
||||
|
||||
@@ -42,8 +42,7 @@ const props = defineProps({
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'move', direction: number): void;
|
||||
(e: 'copy'): void;
|
||||
(e: 'delete'): void;
|
||||
(e: 'copy' | 'delete'): void;
|
||||
}>();
|
||||
|
||||
type DiyComponentWithStyle = DiyComponent<any> & {
|
||||
|
||||
@@ -27,14 +27,15 @@ import RewardRule from './reward-rule.vue';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
const createDefaultFormData = (): Partial<MallRewardActivityApi.RewardActivity> => ({
|
||||
conditionType: PromotionConditionTypeEnum.PRICE.type,
|
||||
productScope: PromotionProductScopeEnum.ALL.scope,
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
rules: [],
|
||||
});
|
||||
const createDefaultFormData =
|
||||
(): Partial<MallRewardActivityApi.RewardActivity> => ({
|
||||
conditionType: PromotionConditionTypeEnum.PRICE.type,
|
||||
productScope: PromotionProductScopeEnum.ALL.scope,
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
rules: [],
|
||||
});
|
||||
|
||||
const formData = ref<Partial<MallRewardActivityApi.RewardActivity>>(
|
||||
createDefaultFormData(),
|
||||
|
||||
@@ -53,7 +53,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'input', v: null | string): void;
|
||||
(e: 'update:modelValue', v: null | string): void;
|
||||
(e: 'input' | 'update:modelValue', v: null | string): void;
|
||||
}>();
|
||||
|
||||
const content = computed({
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
const props = defineProps<{ type: UploadType }>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
uploaded: [v: void];
|
||||
uploaded: [v: Promise<void>];
|
||||
}>();
|
||||
|
||||
const accountId = inject<number>('accountId');
|
||||
|
||||
@@ -30,7 +30,7 @@ withDefaults(
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:open': [v: boolean];
|
||||
uploaded: [v: void];
|
||||
uploaded: [v: Promise<void>];
|
||||
}>();
|
||||
|
||||
const accountId = inject<number>('accountId');
|
||||
|
||||
@@ -24,7 +24,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'delete', v: void): void;
|
||||
(e: 'delete', v: Promise<void>): void;
|
||||
(e: 'update:modelValue', v: any): void;
|
||||
}>();
|
||||
|
||||
|
||||
@@ -66,9 +66,7 @@ function hasValue() {
|
||||
}
|
||||
|
||||
/** 根据编号查询用户信息(用于编辑回显) */
|
||||
async function resolveItemsById(
|
||||
value: null | number | number[] | undefined,
|
||||
) {
|
||||
async function resolveItemsById(value: null | number | number[] | undefined) {
|
||||
const ids = getSelectedIds(value);
|
||||
if (ids.length === 0) {
|
||||
selectedItems.value = [];
|
||||
@@ -89,7 +87,10 @@ async function resolveItemsById(
|
||||
.filter((item): item is SystemUserApi.User => !!item);
|
||||
}
|
||||
|
||||
watch(() => props.modelValue, resolveItemsById, { deep: true, immediate: true });
|
||||
watch(() => props.modelValue, resolveItemsById, {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
});
|
||||
|
||||
/** 清空已选用户 */
|
||||
function clearSelected() {
|
||||
|
||||
@@ -67,7 +67,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getCheckOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getMovementOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getReceiptOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getShipmentOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,10 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: number[] | string[] | undefined): void;
|
||||
(e: 'update:value', value: number[] | string[] | undefined): void;
|
||||
(
|
||||
e: 'update:modelValue' | 'update:value',
|
||||
value: number[] | string[] | undefined,
|
||||
): void;
|
||||
}>();
|
||||
|
||||
// 地区数据接口
|
||||
|
||||
@@ -20,9 +20,10 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'change', payload: number | string): void;
|
||||
(e: 'update:value', payload: number | string): void;
|
||||
(e: 'update:modelValue', payload: number | string): void;
|
||||
(
|
||||
e: 'change' | 'update:modelValue' | 'update:value',
|
||||
payload: number | string,
|
||||
): void;
|
||||
}>();
|
||||
|
||||
const modelValue = useVModel(props, 'modelValue', emits, {
|
||||
|
||||
@@ -97,11 +97,7 @@ onMounted(async () => {
|
||||
>
|
||||
<IconifyIcon icon="lucide:trash" />
|
||||
</Button>
|
||||
<Button
|
||||
class="m-0 p-2"
|
||||
type="text"
|
||||
@click="handleButtonClick('more')"
|
||||
>
|
||||
<Button class="m-0 p-2" type="text" @click="handleButtonClick('more')">
|
||||
<IconifyIcon icon="lucide:ellipsis-vertical" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -3,14 +3,11 @@ import { isFunction, isObject } from '@vben/utils';
|
||||
const WILDCARD = '*';
|
||||
|
||||
function CamundaModdleExtension(eventBus) {
|
||||
// eslint-disable-next-line unicorn/no-this-assignment, @typescript-eslint/no-this-alias
|
||||
const self = this;
|
||||
|
||||
eventBus.on('moddleCopy.canCopyProperty', (context) => {
|
||||
const parent = context.parent;
|
||||
const property = context.property;
|
||||
|
||||
return self.canCopyProperty(property, parent);
|
||||
return this.canCopyProperty(property, parent);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
export function initListenerForm(listener: any) {
|
||||
let self = {
|
||||
let localSelf = {
|
||||
...listener,
|
||||
};
|
||||
if (listener.script) {
|
||||
self = {
|
||||
localSelf = {
|
||||
...listener,
|
||||
...listener.script,
|
||||
scriptType: listener.script.resource ? 'externalScript' : 'inlineScript',
|
||||
@@ -22,13 +22,13 @@ export function initListenerForm(listener: any) {
|
||||
// console.log(listener.eventDefinitions, key);
|
||||
if (key.includes('time')) {
|
||||
k = key;
|
||||
self.eventDefinitionType = key.replace('time', '').toLowerCase();
|
||||
localSelf.eventDefinitionType = key.replace('time', '').toLowerCase();
|
||||
}
|
||||
}
|
||||
// console.log(k);
|
||||
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body;
|
||||
localSelf.eventTimeDefinitions = listener.eventDefinitions[0][k].body;
|
||||
}
|
||||
return self;
|
||||
return localSelf;
|
||||
}
|
||||
|
||||
export function initListenerType(listener: any) {
|
||||
|
||||
@@ -258,14 +258,14 @@ function updateFormFieldKey(
|
||||
) {
|
||||
if (!formSetting?.updateFormFields || !newKey) return;
|
||||
const value = formSetting.updateFormFields[oldKey];
|
||||
delete formSetting.updateFormFields[oldKey];
|
||||
delete formSetting.updateFormFields.oldKey;
|
||||
formSetting.updateFormFields[String(newKey)] = value;
|
||||
}
|
||||
|
||||
/** 删除修改字段设置项 */
|
||||
function deleteFormFieldSetting(formSetting: FormTriggerSetting, key: string) {
|
||||
if (!formSetting?.updateFormFields) return;
|
||||
delete formSetting.updateFormFields[key];
|
||||
delete formSetting.updateFormFields.key;
|
||||
}
|
||||
|
||||
/** 保存配置 */
|
||||
|
||||
@@ -141,7 +141,7 @@ async function initProcessInfo(row: any, formVariables?: any) {
|
||||
if (formVariables) {
|
||||
for (const key in formVariables) {
|
||||
if (!allowedFields.has(key)) {
|
||||
delete formVariables[key];
|
||||
delete formVariables.key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ function makeTemplate() {
|
||||
const rule = ref('')
|
||||
const option = ref('')
|
||||
const init = () => {
|
||||
rule.value = formCreate.parseJson('${formCreate.toJson(rule).replaceAll('\\', '\\\\')}')
|
||||
rule.value = formCreate.parseJson('${formCreate.toJson(rule).replaceAll('\\', String.raw`\\`)}')
|
||||
option.value = formCreate.parseJson('${JSON.stringify(opt, null, 2)}')
|
||||
}
|
||||
const onSubmit = (formData) => {
|
||||
|
||||
@@ -16,8 +16,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
@@ -18,8 +18,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const deviceLoading = ref(false); // 设备加载状态
|
||||
|
||||
@@ -19,8 +19,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: string): void;
|
||||
(e: 'change', value: string): void;
|
||||
(e: 'change' | 'update:modelValue', value: string): void;
|
||||
}>();
|
||||
|
||||
const localValue = useVModel(props, 'modelValue', emit);
|
||||
|
||||
@@ -17,8 +17,7 @@ defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const productLoading = ref(false); // 产品加载状态
|
||||
|
||||
@@ -42,8 +42,7 @@ const props = defineProps({
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'move', direction: number): void;
|
||||
(e: 'copy'): void;
|
||||
(e: 'delete'): void;
|
||||
(e: 'copy' | 'delete'): void;
|
||||
}>();
|
||||
|
||||
type DiyComponentWithStyle = DiyComponent<any> & {
|
||||
|
||||
@@ -21,9 +21,10 @@ const spuList = ref<MallSpuApi.Spu[]>([]);
|
||||
watch(
|
||||
() => props.property.spuIds,
|
||||
async () => {
|
||||
spuList.value = props.property.spuIds.length > 0
|
||||
? await getSpuDetailList(props.property.spuIds)
|
||||
: [];
|
||||
spuList.value =
|
||||
props.property.spuIds.length > 0
|
||||
? await getSpuDetailList(props.property.spuIds)
|
||||
: [];
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
|
||||
@@ -27,14 +27,15 @@ import RewardRule from './reward-rule.vue';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
const createDefaultFormData = (): Partial<MallRewardActivityApi.RewardActivity> => ({
|
||||
conditionType: PromotionConditionTypeEnum.PRICE.type,
|
||||
productScope: PromotionProductScopeEnum.ALL.scope,
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
rules: [],
|
||||
});
|
||||
const createDefaultFormData =
|
||||
(): Partial<MallRewardActivityApi.RewardActivity> => ({
|
||||
conditionType: PromotionConditionTypeEnum.PRICE.type,
|
||||
productScope: PromotionProductScopeEnum.ALL.scope,
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
rules: [],
|
||||
});
|
||||
|
||||
const formData = ref<Partial<MallRewardActivityApi.RewardActivity>>(
|
||||
createDefaultFormData(),
|
||||
|
||||
@@ -53,7 +53,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'input', v: null | string): void;
|
||||
(e: 'update:modelValue', v: null | string): void;
|
||||
(e: 'input' | 'update:modelValue', v: null | string): void;
|
||||
}>();
|
||||
|
||||
const content = computed({
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
const props = defineProps<{ type: UploadType }>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
uploaded: [v: void];
|
||||
uploaded: [v: Promise<void>];
|
||||
}>();
|
||||
|
||||
const accountId = inject<number>('accountId');
|
||||
|
||||
@@ -32,7 +32,7 @@ withDefaults(
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:open': [v: boolean];
|
||||
uploaded: [v: void];
|
||||
uploaded: [v: Promise<void>];
|
||||
}>();
|
||||
|
||||
const accountId = inject<number>('accountId');
|
||||
|
||||
@@ -16,7 +16,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'delete', v: void): void;
|
||||
(e: 'delete', v: Promise<void>): void;
|
||||
(e: 'update:modelValue', v: any): void;
|
||||
}>();
|
||||
|
||||
|
||||
@@ -63,9 +63,7 @@ function getSelectedIds(value: null | number | number[] | undefined) {
|
||||
}
|
||||
|
||||
/** 根据编号查询用户信息(用于编辑回显) */
|
||||
async function resolveItemsById(
|
||||
value: null | number | number[] | undefined,
|
||||
) {
|
||||
async function resolveItemsById(value: null | number | number[] | undefined) {
|
||||
const ids = getSelectedIds(value);
|
||||
if (ids.length === 0) {
|
||||
selectedItems.value = [];
|
||||
|
||||
@@ -67,7 +67,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getCheckOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getMovementOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getReceiptOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getShipmentOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,10 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'change', payload: number | string): void;
|
||||
(e: 'update:value', payload: number | string): void;
|
||||
(e: 'update:modelValue', payload: number | string): void;
|
||||
(
|
||||
e: 'change' | 'update:modelValue' | 'update:value',
|
||||
payload: number | string,
|
||||
): void;
|
||||
}>();
|
||||
|
||||
const modelValue = useVModel(props, 'modelValue', emits, {
|
||||
|
||||
@@ -81,11 +81,7 @@ onMounted(async () => {
|
||||
</ElButton>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<ElButton
|
||||
class="m-0 p-2"
|
||||
text
|
||||
@click="handleButtonClick('download')"
|
||||
>
|
||||
<ElButton class="m-0 p-2" text @click="handleButtonClick('download')">
|
||||
<IconifyIcon icon="lucide:download" />
|
||||
</ElButton>
|
||||
<ElButton
|
||||
@@ -95,18 +91,10 @@ onMounted(async () => {
|
||||
>
|
||||
<IconifyIcon icon="lucide:refresh-cw" />
|
||||
</ElButton>
|
||||
<ElButton
|
||||
class="m-0 p-2"
|
||||
text
|
||||
@click="handleButtonClick('delete')"
|
||||
>
|
||||
<ElButton class="m-0 p-2" text @click="handleButtonClick('delete')">
|
||||
<IconifyIcon icon="lucide:trash" />
|
||||
</ElButton>
|
||||
<ElButton
|
||||
class="m-0 p-2"
|
||||
text
|
||||
@click="handleButtonClick('more')"
|
||||
>
|
||||
<ElButton class="m-0 p-2" text @click="handleButtonClick('more')">
|
||||
<IconifyIcon icon="lucide:ellipsis-vertical" />
|
||||
</ElButton>
|
||||
</div>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
export function initListenerForm(listener: any) {
|
||||
let self = {
|
||||
let localSelf = {
|
||||
...listener,
|
||||
};
|
||||
if (listener.script) {
|
||||
self = {
|
||||
localSelf = {
|
||||
...listener,
|
||||
...listener.script,
|
||||
scriptType: listener.script.resource ? 'externalScript' : 'inlineScript',
|
||||
@@ -22,13 +22,13 @@ export function initListenerForm(listener: any) {
|
||||
// console.log(listener.eventDefinitions, key);
|
||||
if (key.includes('time')) {
|
||||
k = key;
|
||||
self.eventDefinitionType = key.replace('time', '').toLowerCase();
|
||||
localSelf.eventDefinitionType = key.replace('time', '').toLowerCase();
|
||||
}
|
||||
}
|
||||
// console.log(k);
|
||||
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body;
|
||||
localSelf.eventTimeDefinitions = listener.eventDefinitions[0][k].body;
|
||||
}
|
||||
return self;
|
||||
return localSelf;
|
||||
}
|
||||
|
||||
export function initListenerType(listener: any) {
|
||||
|
||||
@@ -258,14 +258,14 @@ function updateFormFieldKey(
|
||||
) {
|
||||
if (!formSetting?.updateFormFields || !newKey) return;
|
||||
const value = formSetting.updateFormFields[oldKey];
|
||||
delete formSetting.updateFormFields[oldKey];
|
||||
delete formSetting.updateFormFields.oldkey;
|
||||
formSetting.updateFormFields[String(newKey)] = value;
|
||||
}
|
||||
|
||||
/** 删除修改字段设置项 */
|
||||
function deleteFormFieldSetting(formSetting: FormTriggerSetting, key: string) {
|
||||
if (!formSetting?.updateFormFields) return;
|
||||
delete formSetting.updateFormFields[key];
|
||||
delete formSetting.updateFormFields.key;
|
||||
}
|
||||
|
||||
/** 保存配置 */
|
||||
|
||||
@@ -159,18 +159,20 @@ const formFieldOptions4Title = computed(() => {
|
||||
};
|
||||
});
|
||||
// 固定添加发起人 ID 字段
|
||||
cloneFormField.unshift({
|
||||
label: '流程名称',
|
||||
value: ProcessVariableEnum.PROCESS_DEFINITION_NAME,
|
||||
});
|
||||
cloneFormField.unshift({
|
||||
label: '发起时间',
|
||||
value: ProcessVariableEnum.START_TIME,
|
||||
});
|
||||
cloneFormField.unshift({
|
||||
label: '发起人',
|
||||
value: ProcessVariableEnum.START_USER_ID,
|
||||
});
|
||||
cloneFormField.unshift(
|
||||
{
|
||||
label: '发起人',
|
||||
value: ProcessVariableEnum.START_USER_ID,
|
||||
},
|
||||
{
|
||||
label: '发起时间',
|
||||
value: ProcessVariableEnum.START_TIME,
|
||||
},
|
||||
{
|
||||
label: '流程名称',
|
||||
value: ProcessVariableEnum.PROCESS_DEFINITION_NAME,
|
||||
},
|
||||
);
|
||||
return cloneFormField;
|
||||
});
|
||||
const formFieldOptions4Summary = computed(() => {
|
||||
|
||||
@@ -142,7 +142,7 @@ async function initProcessInfo(row: any, formVariables?: any) {
|
||||
if (formVariables) {
|
||||
for (const key in formVariables) {
|
||||
if (!allowedFields.has(key)) {
|
||||
delete formVariables[key];
|
||||
delete formVariables.key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,8 @@ async function initNextAssigneesFormField() {
|
||||
node.candidateStrategy) ||
|
||||
// 情况二:当前节点是审批人自选
|
||||
(isEmpty(node.candidateUsers) &&
|
||||
BpmCandidateStrategyEnum.APPROVE_USER_SELECT === node.candidateStrategy)
|
||||
BpmCandidateStrategyEnum.APPROVE_USER_SELECT ===
|
||||
node.candidateStrategy)
|
||||
) {
|
||||
nextAssigneesActivityNode.value.push(node);
|
||||
}
|
||||
@@ -407,7 +408,10 @@ function validateNextAssignees() {
|
||||
}
|
||||
// 如果需要自选审批人,则校验每个节点是否都已配置审批人
|
||||
for (const item of nextAssigneesActivityNode.value) {
|
||||
if (isEmpty(item.candidateUsers) && isEmpty(approveReasonForm.nextAssignees[item.id])) {
|
||||
if (
|
||||
isEmpty(item.candidateUsers) &&
|
||||
isEmpty(approveReasonForm.nextAssignees[item.id])
|
||||
) {
|
||||
ElMessage.warning('下一个节点的审批人不能为空!');
|
||||
return false;
|
||||
}
|
||||
@@ -797,9 +801,7 @@ function handleSignFinish(url: string) {
|
||||
|
||||
/** 判断文件是否为图片类型 */
|
||||
function isImageUrl(url: string) {
|
||||
return /\.(jpg|jpeg|png|gif|bmp|webp|svg)$/i.test(
|
||||
url.split(/[?#]/)[0] || '',
|
||||
);
|
||||
return /\.(jpg|jpeg|png|gif|bmp|webp|svg)$/i.test(url.split(/[?#]/)[0] || '');
|
||||
}
|
||||
|
||||
/** 附件图片预览 */
|
||||
|
||||
@@ -430,69 +430,67 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
|
||||
v-if="shouldShowReasonAndAttachment(task, activity.nodeType)"
|
||||
class="mt-1 w-full rounded-md bg-gray-100 p-2 text-sm text-gray-500"
|
||||
>
|
||||
<div v-if="task.reason">审批意见:{{ task.reason }}</div>
|
||||
<div
|
||||
v-if="(task.attachments?.length || 0) > 0"
|
||||
:class="{
|
||||
'mt-2 border-t border-dashed border-gray-300 pt-2':
|
||||
task.reason,
|
||||
}"
|
||||
>
|
||||
<div class="mb-1 text-xs font-semibold text-gray-400">
|
||||
附件列表:
|
||||
</div>
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<template
|
||||
v-for="(
|
||||
attachment, attachmentIndex
|
||||
) in task.attachments"
|
||||
:key="attachmentIndex"
|
||||
>
|
||||
<div class="flex items-center gap-2">
|
||||
<IconifyIcon
|
||||
:icon="
|
||||
isImageAttachment(attachment)
|
||||
? 'lucide:image'
|
||||
: 'lucide:file-text'
|
||||
"
|
||||
class="text-gray-400"
|
||||
/>
|
||||
<ElImage
|
||||
v-if="isImageAttachment(attachment)"
|
||||
style="width: 32px; height: 32px"
|
||||
class="rounded border border-solid border-gray-200 object-cover"
|
||||
:src="attachment"
|
||||
:preview-src-list="[attachment]"
|
||||
fit="cover"
|
||||
/>
|
||||
<a
|
||||
v-else
|
||||
:href="attachment"
|
||||
target="_blank"
|
||||
class="max-w-[240px] truncate text-blue-500 hover:text-blue-600 hover:underline"
|
||||
:title="getAttachmentName(attachment)"
|
||||
>
|
||||
{{ getAttachmentName(attachment) }}
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="task.reason">审批意见:{{ task.reason }}</div>
|
||||
<div
|
||||
v-if="(task.attachments?.length || 0) > 0"
|
||||
:class="{
|
||||
'mt-2 border-t border-dashed border-gray-300 pt-2':
|
||||
task.reason,
|
||||
}"
|
||||
>
|
||||
<div class="mb-1 text-xs font-semibold text-gray-400">
|
||||
附件列表:
|
||||
</div>
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<template
|
||||
v-for="(attachment, attachmentIndex) in task.attachments"
|
||||
:key="attachmentIndex"
|
||||
>
|
||||
<div class="flex items-center gap-2">
|
||||
<IconifyIcon
|
||||
:icon="
|
||||
isImageAttachment(attachment)
|
||||
? 'lucide:image'
|
||||
: 'lucide:file-text'
|
||||
"
|
||||
class="text-gray-400"
|
||||
/>
|
||||
<ElImage
|
||||
v-if="isImageAttachment(attachment)"
|
||||
style="width: 32px; height: 32px"
|
||||
class="rounded border border-solid border-gray-200 object-cover"
|
||||
:src="attachment"
|
||||
:preview-src-list="[attachment]"
|
||||
fit="cover"
|
||||
/>
|
||||
<a
|
||||
v-else
|
||||
:href="attachment"
|
||||
target="_blank"
|
||||
class="max-w-[240px] truncate text-blue-500 hover:text-blue-600 hover:underline"
|
||||
:title="getAttachmentName(attachment)"
|
||||
>
|
||||
{{ getAttachmentName(attachment) }}
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
task.signPicUrl &&
|
||||
activity.nodeType === BpmNodeTypeEnum.USER_TASK_NODE
|
||||
"
|
||||
class="mt-1 w-full rounded-md bg-gray-100 p-2 text-sm text-gray-500"
|
||||
>
|
||||
签名:
|
||||
<ElImage
|
||||
class="ml-1 h-10 w-24"
|
||||
:src="task.signPicUrl"
|
||||
:preview-src-list="[task.signPicUrl]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
task.signPicUrl &&
|
||||
activity.nodeType === BpmNodeTypeEnum.USER_TASK_NODE
|
||||
"
|
||||
class="mt-1 w-full rounded-md bg-gray-100 p-2 text-sm text-gray-500"
|
||||
>
|
||||
签名:
|
||||
<ElImage
|
||||
class="ml-1 h-10 w-24"
|
||||
:src="task.signPicUrl"
|
||||
:preview-src-list="[task.signPicUrl]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 情况二:遍历每个审批节点下的【候选的】task 任务 -->
|
||||
|
||||
@@ -104,7 +104,7 @@ function makeTemplate() {
|
||||
const rule = ref('')
|
||||
const option = ref('')
|
||||
const init = () => {
|
||||
rule.value = formCreate.parseJson('${formCreate.toJson(rule).replaceAll('\\', '\\\\')}')
|
||||
rule.value = formCreate.parseJson('${formCreate.toJson(rule).replaceAll('\\', String.raw`\\`)}')
|
||||
option.value = formCreate.parseJson('${JSON.stringify(opt, null, 2)}')
|
||||
}
|
||||
const onSubmit = (formData) => {
|
||||
|
||||
@@ -16,8 +16,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
@@ -17,8 +17,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const deviceLoading = ref(false); // 设备加载状态
|
||||
|
||||
@@ -19,8 +19,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: string): void;
|
||||
(e: 'change', value: string): void;
|
||||
(e: 'change' | 'update:modelValue', value: string): void;
|
||||
}>();
|
||||
|
||||
const localValue = useVModel(props, 'modelValue', emit);
|
||||
|
||||
@@ -17,8 +17,7 @@ defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value?: number): void;
|
||||
(e: 'change', value?: number): void;
|
||||
(e: 'change' | 'update:modelValue', value?: number): void;
|
||||
}>();
|
||||
|
||||
const productLoading = ref(false); // 产品加载状态
|
||||
|
||||
@@ -42,8 +42,7 @@ const props = defineProps({
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'move', direction: number): void;
|
||||
(e: 'copy'): void;
|
||||
(e: 'delete'): void;
|
||||
(e: 'copy' | 'delete'): void;
|
||||
}>();
|
||||
|
||||
type DiyComponentWithStyle = DiyComponent<any> & {
|
||||
|
||||
@@ -21,9 +21,10 @@ const spuList = ref<MallSpuApi.Spu[]>([]);
|
||||
watch(
|
||||
() => props.property.spuIds,
|
||||
async () => {
|
||||
spuList.value = props.property.spuIds.length > 0
|
||||
? await getSpuDetailList(props.property.spuIds)
|
||||
: [];
|
||||
spuList.value =
|
||||
props.property.spuIds.length > 0
|
||||
? await getSpuDetailList(props.property.spuIds)
|
||||
: [];
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
|
||||
@@ -27,14 +27,15 @@ import RewardRule from './reward-rule.vue';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
const createDefaultFormData = (): Partial<MallRewardActivityApi.RewardActivity> => ({
|
||||
conditionType: PromotionConditionTypeEnum.PRICE.type,
|
||||
productScope: PromotionProductScopeEnum.ALL.scope,
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
rules: [],
|
||||
});
|
||||
const createDefaultFormData =
|
||||
(): Partial<MallRewardActivityApi.RewardActivity> => ({
|
||||
conditionType: PromotionConditionTypeEnum.PRICE.type,
|
||||
productScope: PromotionProductScopeEnum.ALL.scope,
|
||||
productScopeValues: [],
|
||||
productCategoryIds: [],
|
||||
productSpuIds: [],
|
||||
rules: [],
|
||||
});
|
||||
|
||||
const formData = ref<Partial<MallRewardActivityApi.RewardActivity>>(
|
||||
createDefaultFormData(),
|
||||
|
||||
@@ -53,7 +53,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', v: null | string): void;
|
||||
(e: 'input', v: null | string): void;
|
||||
(e: 'input' | 'update:modelValue', v: null | string): void;
|
||||
}>();
|
||||
|
||||
const content = computed({
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
const props = defineProps<{ type: UploadType }>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
uploaded: [v: void];
|
||||
uploaded: [v: Promise<void>];
|
||||
}>();
|
||||
|
||||
const accountId = inject<number>('accountId');
|
||||
|
||||
@@ -31,7 +31,7 @@ withDefaults(
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:open': [v: boolean];
|
||||
uploaded: [v: void];
|
||||
uploaded: [v: Promise<void>];
|
||||
}>();
|
||||
|
||||
const accountId = inject<number>('accountId');
|
||||
|
||||
@@ -25,7 +25,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'delete', v: void): void;
|
||||
(e: 'delete', v: Promise<void>): void;
|
||||
(e: 'update:modelValue', v: any): void;
|
||||
}>();
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
};
|
||||
};
|
||||
const results = queryString
|
||||
? options.filter(createFilter(queryString))
|
||||
? options.filter(() => createFilter(queryString))
|
||||
: options;
|
||||
cb(results);
|
||||
},
|
||||
|
||||
@@ -85,7 +85,10 @@ async function resolveItemsById(value: null | number | number[] | undefined) {
|
||||
.filter((item): item is SystemUserApi.User => !!item);
|
||||
}
|
||||
|
||||
watch(() => props.modelValue, resolveItemsById, { deep: true, immediate: true });
|
||||
watch(() => props.modelValue, resolveItemsById, {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
});
|
||||
|
||||
/** 清空已选用户 */
|
||||
function clearSelected() {
|
||||
@@ -147,7 +150,11 @@ function handleSelected(rows: SystemUserApi.User[]) {
|
||||
@mouseenter="hovering = true"
|
||||
@mouseleave="hovering = false"
|
||||
>
|
||||
<ElTooltip :disabled="selectedItems.length === 0" placement="top" :show-after="500">
|
||||
<ElTooltip
|
||||
:disabled="selectedItems.length === 0"
|
||||
placement="top"
|
||||
:show-after="500"
|
||||
>
|
||||
<template #content>
|
||||
<div v-if="selectedItems.length > 0" class="flex gap-3">
|
||||
<div
|
||||
|
||||
@@ -67,7 +67,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getCheckOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getMovementOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
/** 清空展开明细缓存 */
|
||||
function clearDetailMap() {
|
||||
for (const id of Object.keys(detailMap)) {
|
||||
delete detailMap[Number(id)];
|
||||
const key = Number(id);
|
||||
delete detailMap.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ async function handleExpandChange(
|
||||
if (!expanded) {
|
||||
return;
|
||||
}
|
||||
delete detailMap[row.id!];
|
||||
const key = row.id;
|
||||
delete detailMap.key;
|
||||
detailMap[row.id!] = await getReceiptOrderDetailListByOrderId(row.id!);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user