|
@@ -57,7 +57,7 @@
|
|
</template>
|
|
</template>
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
- title="确定通过该素材吗?"
|
|
|
|
|
|
+ title="确定拒审该素材吗?"
|
|
v-if="scope.row.status == 0"
|
|
v-if="scope.row.status == 0"
|
|
@confirm="changeStatus(scope.row.stuffId, 3, '拒审成功')"
|
|
@confirm="changeStatus(scope.row.stuffId, 3, '拒审成功')"
|
|
>
|
|
>
|
|
@@ -75,78 +75,18 @@
|
|
:total="pages.total"
|
|
:total="pages.total"
|
|
@current-change="page"
|
|
@current-change="page"
|
|
/>
|
|
/>
|
|
-
|
|
|
|
- <el-dialog v-model="dialogVisible" title="素材">
|
|
|
|
- <el-form ref="ruleFormRef" :rules="rules" :model="form" label-width="auto">
|
|
|
|
- <el-form-item label="素材名称" prop="stuffName">
|
|
|
|
- <el-input v-model="form.stuffName" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="选择创意" prop="creativeId">
|
|
|
|
- <el-select filterable v-model="form.creativeId" placeholder="选择创意">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in originalityList"
|
|
|
|
- :key="item.creativeId"
|
|
|
|
- :label="item.creativeName"
|
|
|
|
- :value="item.creativeId"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="落地页" prop="landingPage">
|
|
|
|
- <el-input v-model="form.landingPage" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="上传素材" prop="addr">
|
|
|
|
- <MediaComponents
|
|
|
|
- v-if="dialogVisible"
|
|
|
|
- :src="form.addr || ''"
|
|
|
|
- @change="(val: string) => (form.addr = val)"
|
|
|
|
- @getCalc="getCalc"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="宽(px)" prop="width">
|
|
|
|
- <el-input-number v-model="form.width" :min="0" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="高(px)" prop="height">
|
|
|
|
- <el-input-number v-model="form.height" :min="0" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" @click="creatMaterial(ruleFormRef)">确定</el-button>
|
|
|
|
- <el-button v-if="form.stuffId" type="primary" @click="addNewMaterial(ruleFormRef)">
|
|
|
|
- 添加到新创意
|
|
|
|
- </el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </el-dialog>
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import type { FormInstance, FormRules } from 'element-plus'
|
|
|
|
import type { Pages } from '@/types/Tool'
|
|
import type { Pages } from '@/types/Tool'
|
|
import type { OriginalityList } from '@/types/AdListPage'
|
|
import type { OriginalityList } from '@/types/AdListPage'
|
|
-import type { SourceMaterialList, ISourceMaterialProps } from '@/types/SourceMaterial'
|
|
|
|
|
|
+import type { SourceMaterialList } from '@/types/SourceMaterial'
|
|
import { formatDateSite, getStatus } from '@/tool/index'
|
|
import { formatDateSite, getStatus } from '@/tool/index'
|
|
import { ElMessage } from 'element-plus'
|
|
import { ElMessage } from 'element-plus'
|
|
-import {
|
|
|
|
- getMaterialList,
|
|
|
|
- getOriginalityList,
|
|
|
|
- createMaterial,
|
|
|
|
- updateMaterial,
|
|
|
|
- updateMaterialStatus,
|
|
|
|
-} from '@/api/index'
|
|
|
|
|
|
+import { getMaterialList, getOriginalityList, updateMaterialStatus } from '@/api/index'
|
|
import { ref, reactive } from 'vue'
|
|
import { ref, reactive } from 'vue'
|
|
|
|
|
|
-import MediaComponents from '@/components/mediaComponents.vue'
|
|
|
|
-
|
|
|
|
// vue3 获取url参数
|
|
// vue3 获取url参数
|
|
-
|
|
|
|
-const ruleFormRef = ref<FormInstance>()
|
|
|
|
-const rules = reactive<FormRules<ISourceMaterialProps>>({
|
|
|
|
- stuffName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
|
|
- landingPage: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
|
|
- creativeId: [{ required: true, message: '请选择创意', trigger: 'change' }],
|
|
|
|
- addr: [{ required: true, message: '请选择素材', trigger: 'change' }],
|
|
|
|
- width: [{ required: true, message: '请输入宽', trigger: 'change' }],
|
|
|
|
- height: [{ required: true, message: '请输入高', trigger: 'change' }],
|
|
|
|
-})
|
|
|
|
const originalityList = ref<OriginalityList>([])
|
|
const originalityList = ref<OriginalityList>([])
|
|
getOriginalityList({
|
|
getOriginalityList({
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -155,12 +95,6 @@ getOriginalityList({
|
|
originalityList.value = data.records || {}
|
|
originalityList.value = data.records || {}
|
|
})
|
|
})
|
|
|
|
|
|
-const dialogVisible = ref(false)
|
|
|
|
-const form = ref<ISourceMaterialProps>({
|
|
|
|
- width: 0,
|
|
|
|
- height: 0,
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
const pages = reactive<Pages>({
|
|
const pages = reactive<Pages>({
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -188,61 +122,11 @@ const onSubmit = () => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-const creatMaterial = (formEl: FormInstance | undefined) => {
|
|
|
|
- if (!formEl) return
|
|
|
|
- formEl.validate((valid) => {
|
|
|
|
- if (!valid) return
|
|
|
|
- if (typeof form.value.stuffId === 'number') {
|
|
|
|
- updateMaterial(form.value).then(() => {
|
|
|
|
- ElMessage({
|
|
|
|
- message: '更新成功',
|
|
|
|
- type: 'success',
|
|
|
|
- })
|
|
|
|
- onSubmit()
|
|
|
|
- dialogVisible.value = false
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- createMaterial(form.value).then(() => {
|
|
|
|
- ElMessage({
|
|
|
|
- message: '创建成功',
|
|
|
|
- type: 'success',
|
|
|
|
- })
|
|
|
|
- onSubmit()
|
|
|
|
- dialogVisible.value = false
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-const addNewMaterial = (formEl: FormInstance | undefined) => {
|
|
|
|
- if (!formEl) return
|
|
|
|
- formEl.validate((valid) => {
|
|
|
|
- if (!valid) return
|
|
|
|
- const p = {
|
|
|
|
- ...form.value,
|
|
|
|
- }
|
|
|
|
- delete p.stuffId
|
|
|
|
- createMaterial(p).then(() => {
|
|
|
|
- ElMessage({
|
|
|
|
- message: '复制成功',
|
|
|
|
- type: 'success',
|
|
|
|
- })
|
|
|
|
- onSubmit()
|
|
|
|
- dialogVisible.value = false
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
const page = (val: number) => {
|
|
const page = (val: number) => {
|
|
pages.pageNum = val
|
|
pages.pageNum = val
|
|
onSubmit()
|
|
onSubmit()
|
|
}
|
|
}
|
|
|
|
|
|
-const getCalc = (width: number, height: number) => {
|
|
|
|
- form.value.width = width
|
|
|
|
- form.value.height = height
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
const changeStatus = (id: number, status: number, text: string) => {
|
|
const changeStatus = (id: number, status: number, text: string) => {
|
|
updateMaterialStatus({ id, status }).then(() => {
|
|
updateMaterialStatus({ id, status }).then(() => {
|
|
ElMessage.success(text)
|
|
ElMessage.success(text)
|