Commit 8923e9da by cen

fix: 修复样式

1 parent 5e899daf
......@@ -174,6 +174,36 @@ export const rangePickertwoMonthOptions = {
}
/**
* 时间控件-限制时间跨度不超过93天,且结束时间不能小于开始时间,且结束时间不能大于当前时间
*/
export var selectDate2 = ""
export const rangePickertwoMonthOptionsWithCurrentLimit = {
onPick({ maxDate, minDate }) {
selectDate2 = minDate ? minDate.getTime() : ""
if (maxDate) {
selectDate2 = ""
}
},
disabledDate(time) {
const currentTime = Date.now() // 当前时间
// 限制所有大于当前时间的日期不可选
if (time.getTime() > currentTime) {
return true
}
if (selectDate2 !== "") {
const ninetyThreeDays = 93 * 24 * 3600 * 1000
const minTime = selectDate2 // 开始时间即为最小时间
const maxTime = Math.min(selectDate2 + ninetyThreeDays, currentTime) // 开始时间+93天与当前时间取较小值作为最大时间
return time.getTime() < minTime || time.getTime() > maxTime
} else {
return false
}
}
}
/**
* 时间控件-限制选择30天时间范围,且不大于当前时间
*/
export var pickerMinDate = "" // 获取开始选择时间
......
......@@ -172,7 +172,8 @@ import {
yesterdayPicker,
rangePickerOptions_30day2,
todayEndPickerOptions,
rangePickertwoMonthOptions
rangePickertwoMonthOptions,
rangePickertwoMonthOptionsWithCurrentLimit
} from "@/common/format"
export default {
name: "D2Search",
......@@ -183,7 +184,9 @@ export default {
yesterdayPicker: yesterdayPicker,
rangePickerOptions_30day2: rangePickerOptions_30day2,
todayEndPickerOptions: todayEndPickerOptions,
rangePickertwoMonthOptions: rangePickertwoMonthOptions
rangePickertwoMonthOptions: rangePickertwoMonthOptions,
rangePickertwoMonthOptionsWithCurrentLimit:
rangePickertwoMonthOptionsWithCurrentLimit
}
}
},
......
......@@ -47,7 +47,6 @@
:style="{ 'margin-bottom': '22px' }"
>
<el-select
@change="clearTableFn(1)"
:style="{ width: '432px' }"
v-model="formData.sceneType"
placeholder="请选择"
......@@ -65,10 +64,7 @@
label="品牌类型:"
prop="category"
>
<el-checkbox-group
@change="changeChannelFn"
v-model="formData.category"
>
<el-checkbox-group v-model="formData.category">
<el-checkbox label="1">问界</el-checkbox>
<el-checkbox label="0">鸿蒙</el-checkbox>
<el-checkbox label="3">通用</el-checkbox>
......@@ -145,7 +141,7 @@ import { SCENETYPE_OPTIONS } from "../constant"
import preview from "../components/preview"
import { getList, getAccountMerchantList } from "@/api/merchant"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
import textBox from "@/components/glsx-combi-form/textBox"
import { addActivity, editActivity } from "@api/contentManager"
function debounce(func, delay) {
......@@ -159,6 +155,7 @@ function debounce(func, delay) {
}
export default {
name: "ActivityAdd",
mixins: [reportTrackPageMixin],
components: {
glsxPreview: preview,
textBox
......@@ -197,7 +194,10 @@ export default {
category: [],
activityCover: [],
selectionRule: "",
dateTime: [new Date(), new Date()]
dateTime: [
new Date(),
new Date(new Date().getTime() + 3600 * 1000 * 24 * 30)
]
},
rules: {
name: [
......@@ -220,6 +220,41 @@ export default {
required: true,
message: "请选择日期",
trigger: "change"
},
{
validator: (rule, value, callback) => {
if (value && value.length === 2) {
const startTime = new Date(value[0]).getTime()
const endTime = new Date(value[1]).getTime()
const now = new Date().getTime()
const diffMinutes = (endTime - startTime) / (1000 * 60)
// 验证结束时间必须大于开始时间
if (endTime <= startTime) {
callback(new Error("结束时间必须大于开始时间"))
return
}
// 验证结束时间不能早于当前时间
if (endTime <= now) {
callback(new Error("结束时间不能早于当前时间"))
return
}
// 验证时间间隔必须大于等于60分钟
if (diffMinutes < 60) {
callback(
new Error("开始时间和结束时间间隔必须大于等于60分钟")
)
return
}
callback()
} else {
callback()
}
},
trigger: ["change", "blur"]
}
]
},
......@@ -290,6 +325,7 @@ export default {
},
created() {},
mounted() {
this.setReportTrackData(0, "activity_management_edit", {})
console.log(this.$route)
// 编辑
const { id } = this.$route.query.info
......@@ -352,6 +388,10 @@ export default {
console.log(valid, "valid")
this.$refs.channelForm.validate((cvalid) => {
if (valid && cvalid) {
if (this.formData.selectionRule.length > 5000) {
this.$message.error("评选规则内容不能超过5000个字符")
return
}
this.commitFn(type)
}
})
......@@ -391,7 +431,9 @@ export default {
},
// 获取富文本框内容
handleTextBoxChange(val, targetItem) {
console.log(val)
this.$set(this.formData, "selectionRule", val)
this.$refs.channelForm.validateField("selectionRule")
},
handleTextBoxFocus() {
this.$refs.TextBox.setEdit(this.formData.selectionRule)
......
......@@ -108,8 +108,10 @@
<script>
import { mapActions, mapState } from "vuex"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
export default {
name: "ActivityDetails",
mixins: [reportTrackPageMixin],
data() {
return {
noDataImg: require("@/assets/empty-5.png"),
......@@ -176,6 +178,7 @@ export default {
},
mounted() {
this.setReportTrackData(0, "activity_management_detail", {})
const info = this.$route.query.info
console.log(info)
this.formData = info
......@@ -198,7 +201,7 @@ export default {
params.method =
"dj.api.script.activity.award.winner.import.template.export.async"
params.moduleName = "script"
params.activityId = this.activeName
params.activityId = this.formData.id
const list = [
...this.dowloadList,
{
......
......@@ -55,16 +55,35 @@
</div>
</div>
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="jumpDetail(scope.scope)">
<el-button
type="text"
@click="jumpDetail(scope.scope)"
data-event-code="activity_management_detail"
>
查看
</el-button>
<el-button type="text" @click="jumpEdit(scope.scope)">
<el-button
type="text"
@click="jumpEdit(scope.scope)"
:disabled="scope.scope.status == 1"
data-event-code="activity_management_edit"
>
编辑
</el-button>
<el-button type="text" @click="handleAccountConfirm(scope.scope)">
<el-button
type="text"
@click="handleAccountConfirm(scope.scope)"
:disabled="scope.scope.status == 1 && scope.scope.status == 2"
data-event-code="activity_management_import"
>
导入名单
</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">
<el-button
type="text"
@click="handleDelete(scope.scope)"
:disabled="scope.scope.status == 1"
data-event-code="activity_management_del"
>
删除
</el-button>
</template>
......@@ -98,11 +117,11 @@
:rules="fileRules"
label-width="120px"
>
<el-form-item label="评选周期:" prop="periodList">
<el-form-item label="评选周期:" prop="currentPeriod">
<div style="margin-bottom: 10px">
<el-select v-model="currentPeriod" placeholder="请选择">
<el-select v-model="fileForm.currentPeriod" placeholder="请选择">
<el-option
v-for="item in fileForm.periodList"
v-for="item in periodList"
:key="item.id"
:label="item.cycleName"
:value="item.id"
......@@ -182,8 +201,23 @@
个错误,请根据以下提示修改后重新上传:
</div>
<div class="err-list">
<div v-for="(item, index) in fileForm.errors" :key="item">
{{ index + 1 }} {{ item }}
<div v-if="fileForm.errors && fileForm.errors.length > 0">
<div
v-for="(item, index) in fileForm.errors"
:key="item"
v-if="index < 3"
>
{{ index + 1 }} {{ item }}
</div>
<div v-if="fileForm.errors.length > 3" style="color: #909399">
...
</div>
<el-button
type="text"
@click="exportError(fileForm.errorFileUrl)"
>
下载错误报告
</el-button>
</div>
</div>
</div></el-form-item
......@@ -207,11 +241,13 @@ import {
addActivityCycle,
importWinner
} from "@api/contentManager"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
import { mapActions, mapState } from "vuex"
import dayjs from "dayjs"
import { ACTIVITY_STATUS_OPTIONS } from "../constant"
import { Util, deepClone } from "@/common/util"
export default {
mixins: [reportTrackPageMixin],
data() {
return {
ACTIVITY_STATUS_OPTIONS,
......@@ -220,7 +256,7 @@ export default {
currentRow: null,
fileForm: {
fileName: "",
periodList: []
currentPeriod: ""
},
fileRules: {
fileName: [
......@@ -230,22 +266,11 @@ export default {
trigger: "blur"
}
],
periodList: [
currentPeriod: [
{
required: true,
validator: (rule, value, callback) => {
console.log(value)
// 检查是否所有周期都有值
const hasEmpty = value.some(
(item) => !item.cycleName || item.cycleName.trim() === ""
)
if (hasEmpty) {
callback(new Error("请填写所有评选周期"))
} else {
callback()
}
},
trigger: "blur"
message: "请选择活动周期",
trigger: "change"
}
]
},
......@@ -254,6 +279,7 @@ export default {
status: "",
searchdate: [new Date(), new Date()]
},
periodList: [],
searchFormSearch: {},
showFormData: [
{
......@@ -300,7 +326,7 @@ export default {
],
getListApi: getActivityPage,
addPeriodFlag: false,
currentPeriod: "",
track_event_code: "activity_management",
cycleName: "",
tableParams: {
listName: "list",
......@@ -422,16 +448,17 @@ export default {
this.addPeriodFlag = false
this.notice.okTips()
await this.activityCyclePage()
this.currentPeriod = this.fileForm.periodList[0].id
this.fileForm.currentPeriod = this.periodList[0].id
})
},
// 添加删除周期方法
removePeriod(index) {
this.fileForm.periodList.splice(index, 1)
this.periodList.splice(index, 1)
},
// 上传文件,转码为base64
importFile(e) {
this.fileForm.errorFileUrl = ""
const size = e.target.files[0].size / 1024 / 1024
if (size < 5) {
this.$set(this.fileForm, "fileName", e.target.files[0].name)
......@@ -492,7 +519,7 @@ export default {
getActivityCyclePage({ activityId: this.currentRow.id }).then((res) => {
console.log(res)
this.fileForm.periodList = res || []
this.periodList = res || []
})
},
handleNameBlur(index) {},
......@@ -500,7 +527,7 @@ export default {
this.$refs.fileRuleForm.validate((valid) => {
if (valid) {
importWinner({
cycleActivityId: this.currentPeriod,
cycleActivityId: this.fileForm.currentPeriod,
file: this.fileInfo
}).then((res) => {
this.notice.okTips()
......@@ -517,6 +544,9 @@ export default {
},
removeFile() {
this.fileForm = {}
},
exportError(errorFileUrl) {
errorFileUrl && window.open(errorFileUrl)
}
}
}
......
......@@ -198,12 +198,17 @@ export default {
padding: 0px 20px 30px;
}
::v-deep .el-timeline {
width: calc(100% - 40px);
box-sizing: border-box;
.el-timeline-item {
}
}
::v-deep .el-timeline-item__node--normal {
width: 8px;
height: 8px;
background-color: #2a58ad;
}
::v-deep .el-timeline-item__tail {
left: 2px;
}
.reject-dialog {
max-height: 70vh;
......
......@@ -18,13 +18,28 @@
</div>
<div class="d2-container-content">
<d2-table-header title="审核列表">
<el-button size="small" type="primary" @click="handleBatchExamine(1)">
<el-button
size="small"
type="primary"
@click="handleBatchExamine(1)"
data-event-code="failure_to_report_reception_pass"
>
批量通过
</el-button>
<el-button size="small" type="primary" @click="handleBatchExamine(2)">
<el-button
size="small"
type="primary"
@click="handleBatchExamine(2)"
data-event-code="failure_to_report_reception_all_reject"
>
批量驳回
</el-button>
<el-button size="small" type="primary" @click="exportList">
<el-button
size="small"
type="primary"
@click="exportList"
data-event-code="failure_to_report_reception_export"
>
导出
</el-button>
</d2-table-header>
......@@ -54,10 +69,20 @@
</div>
</div>
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleAudits(scope.scope)">
<el-button
type="text"
@click="handleAudits(scope.scope)"
data-event-code="failure_to_report_reception_audit"
v-if="scope.scope.auditStatus == '0'"
>
审核
</el-button>
<el-button type="text" @click="handleReject(scope.scope)">
<el-button
type="text"
@click="handleReject(scope.scope)"
data-event-code="failure_to_report_reception_reject"
v-if="scope.scope.auditStatus != '0'"
>
重新审核
</el-button>
</template>
......@@ -90,6 +115,7 @@
</div>
</template>
<script>
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
import examineDialog from "./components/examineDialog"
import auditsDialog from "./components/auditsDialog"
import rejectDialog from "./components/rejectDialog"
......@@ -120,6 +146,7 @@ const STATUS_OPTIONS = [
}
]
export default {
mixins: [reportTrackPageMixin],
name: "FailureToReportReception",
components: {
examineDialog,
......@@ -129,6 +156,7 @@ export default {
data() {
return {
STATUS_OPTIONS,
track_event_code: "failure_to_report_reception",
examineVisible: false,
auditsVisible: false,
infos: [],
......@@ -206,7 +234,7 @@ export default {
type: "datePicker",
isClear: true,
dateType: "datetimerange",
pickerOptions: "rangePickerOptions"
pickerOptions: "rangePickertwoMonthOptionsWithCurrentLimit"
},
{
label: "创建日期",
......@@ -214,7 +242,7 @@ export default {
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
pickerOptions: "rangePickertwoMonthOptionsWithCurrentLimit"
}
],
pageInfo: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!