修复:项目管理的关联工单列表增加查询条件appId
This commit is contained in:
@@ -20,18 +20,19 @@
|
||||
"
|
||||
>
|
||||
<a-form-item label="广告位类型" name="adType">
|
||||
<a-select ref="select" v-model:value="form.adType" style="width: 120px">
|
||||
<a-select
|
||||
ref="select"
|
||||
:disabled="isUpdate"
|
||||
v-model:value="form.adType"
|
||||
style="width: 120px"
|
||||
>
|
||||
<a-select-option value="图片广告">图片广告</a-select-option>
|
||||
<a-select-option value="幻灯片">幻灯片</a-select-option>
|
||||
<a-select-option value="视频广告">视频广告</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<template v-if="form.adType == '幻灯片'">
|
||||
<a-form-item
|
||||
label="广告图片"
|
||||
name="images"
|
||||
extra="请上传广告图片,最多可上传9张图"
|
||||
>
|
||||
<a-form-item label="广告图片" name="images">
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="9"
|
||||
@@ -39,35 +40,16 @@
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="9"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :accept="'image/png,image/jpeg'"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="form.adType == '图片广告'">
|
||||
<a-form-item label="广告图片" name="images" extra="请上传广告图片">
|
||||
<a-form-item label="广告图片" name="images">
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="1"
|
||||
:data="images"
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="1"-->
|
||||
<!-- :accept="'image/png,image/jpeg'"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="form.adType == '视频广告'">
|
||||
@@ -83,41 +65,44 @@
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="1"-->
|
||||
<!-- :accept="'video/mp4'"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="广告位名称" name="name">
|
||||
<a-form-item label="路由/链接地址" name="path">
|
||||
<template v-if="form.adType == '幻灯片' && images.length > 0">
|
||||
<template v-for="(item, index) in images" :key="index">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
:placeholder="`请输入地址${index + 1}`"
|
||||
v-model:value="pathList[index]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
placeholder="请输入路由/链接地址"
|
||||
v-model:value="form.path"
|
||||
/>
|
||||
</template>
|
||||
</a-form-item>
|
||||
<a-form-item label="标题" name="name">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
placeholder="请输入广告位名称"
|
||||
placeholder="请输入广告标题"
|
||||
v-model:value="form.name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="广告位描述" name="comments">
|
||||
<a-form-item label="广告描述" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入广告位描述"
|
||||
placeholder="请输入广告描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="路由/链接地址" name="path">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
placeholder="请输入路由/链接地址"
|
||||
v-model:value="form.path"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
@@ -145,10 +130,14 @@
|
||||
import { Ad } from '@/api/cms/ad/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
||||
import { FormInstance, type Rule, RuleObject } from 'ant-design-vue/es/form';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { uploadFile } from '@/api/system/file';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
import { checkExistence } from '@/api/system/company';
|
||||
import image from '@/views/cms/photo/image.vue';
|
||||
import defaultResult from 'ant-design-vue/es/_util/isMobile';
|
||||
import any = defaultResult.any;
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -173,6 +162,7 @@
|
||||
const loading = ref(false);
|
||||
// 已上传数据
|
||||
const images = ref<ItemType[]>([]);
|
||||
const pathList = ref<any[]>([]);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
@@ -200,14 +190,6 @@
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写广告位名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
adType: [
|
||||
{
|
||||
required: true,
|
||||
@@ -222,11 +204,13 @@
|
||||
type: 'string',
|
||||
message: '请上传图片或视频',
|
||||
trigger: 'blur',
|
||||
validator: async (_rule: RuleObject, value: string) => {
|
||||
if (images.value.length == 0) {
|
||||
return Promise.reject('请上传图片或视频');
|
||||
}
|
||||
return Promise.resolve();
|
||||
validator: (_rule: Rule, value: string) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (images.value.length == 0) {
|
||||
return reject('请上传图片或视频文件');
|
||||
}
|
||||
return resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -301,7 +285,9 @@
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form,
|
||||
images: JSON.stringify(images.value)
|
||||
images: JSON.stringify(images.value),
|
||||
path:
|
||||
form.adType == '幻灯片' ? JSON.stringify(pathList.value) : form.path
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateAd : addAd;
|
||||
saveOrUpdate(formData)
|
||||
@@ -326,6 +312,7 @@
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
images.value = [];
|
||||
pathList.value = [];
|
||||
if (props.data.images) {
|
||||
const arr = JSON.parse(props.data.images);
|
||||
arr.map((d) => {
|
||||
@@ -336,6 +323,12 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
if (props.data.adType == '幻灯片') {
|
||||
const arr = JSON.parse(props.data.path);
|
||||
arr.map((d) => {
|
||||
pathList.value.push(d);
|
||||
});
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
images.value = [];
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="请输入关键词"
|
||||
v-model:value="where.keywords"
|
||||
@pressEnter="search"
|
||||
@search="search"
|
||||
/>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@@ -14,6 +21,9 @@
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
import useSearch from '@/utils/use-search';
|
||||
import { UserParam } from '@/api/system/user/model';
|
||||
import { AdParam } from '@/api/cms/ad/model';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -24,7 +34,7 @@
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'search', where?: AdParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
@@ -35,6 +45,16 @@
|
||||
emit('add');
|
||||
};
|
||||
|
||||
// 表单数据
|
||||
const { where, resetFields } = useSearch<AdParam>({
|
||||
adId: undefined,
|
||||
keywords: undefined
|
||||
});
|
||||
|
||||
const search = () => {
|
||||
emit('search', where);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'adType'">
|
||||
<a-tag>{{ record.adType }}</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'images'">
|
||||
<template
|
||||
v-for="(item, index) in JSON.parse(record.images)"
|
||||
@@ -115,21 +118,34 @@
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'adType',
|
||||
key: 'adType'
|
||||
},
|
||||
{
|
||||
title: '广告位名称',
|
||||
dataIndex: 'name'
|
||||
key: 'adType',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '广告图片',
|
||||
dataIndex: 'images',
|
||||
key: 'images'
|
||||
},
|
||||
{
|
||||
title: '跳转路径',
|
||||
dataIndex: 'path',
|
||||
key: 'path',
|
||||
width: 280,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'comments',
|
||||
key: 'path',
|
||||
width: 280,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status'
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
||||
@@ -145,7 +145,6 @@
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.value = '';
|
||||
form.type = 0;
|
||||
};
|
||||
|
||||
@@ -166,7 +165,6 @@
|
||||
const saveOrUpdate = isUpdate.value
|
||||
? updateWebsiteField
|
||||
: addWebsiteField;
|
||||
console.log(isUpdate.value);
|
||||
saveOrUpdate(data)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
@@ -192,11 +190,13 @@
|
||||
if (props.data) {
|
||||
assignFields(props.data);
|
||||
form.comments = props.data.comments;
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.value,
|
||||
status: 'done'
|
||||
});
|
||||
if (form.type == 1) {
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.value,
|
||||
status: 'done'
|
||||
});
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
|
||||
@@ -296,9 +296,9 @@
|
||||
});
|
||||
});
|
||||
|
||||
listMpMenu({}).then((list) => {
|
||||
listMpMenu({ type: 4 }).then((list) => {
|
||||
server.value = list.filter((d) => d.type == 0);
|
||||
order.value = list.filter((d) => d.type == 1);
|
||||
order.value = list.filter((d) => d.rows == 0);
|
||||
scrollList.value = list.filter((d) => d.type == 2);
|
||||
});
|
||||
|
||||
|
||||
@@ -7,12 +7,23 @@
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
<a-select ref="select" v-model:value="menuType" style="width: 120px" @change="onChange">
|
||||
<a-select-option value="图片广告">图片广告</a-select-option>
|
||||
<a-select-option value="幻灯片">幻灯片</a-select-option>
|
||||
<a-select-option value="视频广告">视频广告</a-select-option>
|
||||
</a-select>
|
||||
<!-- <a-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- style="background-color: var(--orange-6); border-color: var(--orange-5)"-->
|
||||
<!-- @click="openPeriod"-->
|
||||
<!-- >导航展示方式</a-button-->
|
||||
<!-- >-->
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import { watch } from 'vue';
|
||||
import { ref, watch } from 'vue';
|
||||
import useSearch from '@/utils/use-search';
|
||||
import { MpMenu, MpMenuParam } from '@/api/cms/mp-menu/model';
|
||||
|
||||
@@ -45,6 +56,12 @@
|
||||
emit('add');
|
||||
};
|
||||
|
||||
const menuType = ref(0);
|
||||
|
||||
const onChange = () => {
|
||||
console.log(menuType.value);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
|
||||
Reference in New Issue
Block a user