|
@@ -42,23 +42,16 @@
|
|
<el-input v-model.trim="form.linkUrl"></el-input>
|
|
<el-input v-model.trim="form.linkUrl"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="上架时间" v-if="type == 5">
|
|
|
|
|
|
+ <el-form-item label="上架时间" v-if="type == 5" prop="actionTime" :rules="[{required: true, message: '请选择上架时间范围', trigger: 'change'}]">
|
|
<el-date-picker style="width:400px;"
|
|
<el-date-picker style="width:400px;"
|
|
- v-model="actionTime"
|
|
|
|
|
|
+ v-model="form.actionTime"
|
|
|
|
+ :clearable="false"
|
|
type="datetimerange"
|
|
type="datetimerange"
|
|
range-separator="至"
|
|
range-separator="至"
|
|
:picker-options="{ firstDayOfWeek: 1 }"
|
|
:picker-options="{ firstDayOfWeek: 1 }"
|
|
start-placeholder="上架开始日期"
|
|
start-placeholder="上架开始日期"
|
|
end-placeholder="上架结束日期">
|
|
end-placeholder="上架结束日期">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
- <!-- <el-date-picker v-model.trim="actionTime"
|
|
|
|
- style="width:400px;"
|
|
|
|
- type="daterange"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
- range-separator="至"
|
|
|
|
- :picker-options="{ firstDayOfWeek: 1 }"
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
- end-placeholder="结束日期"></el-date-picker> -->
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<!-- 广告管理才有类型 -->
|
|
<!-- 广告管理才有类型 -->
|
|
<el-form-item label="广告类型"
|
|
<el-form-item label="广告类型"
|
|
@@ -426,6 +419,7 @@ export default {
|
|
content: null,
|
|
content: null,
|
|
tenantId: null,
|
|
tenantId: null,
|
|
subType: null,
|
|
subType: null,
|
|
|
|
+ actionTime: null,
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
title: [
|
|
title: [
|
|
@@ -438,7 +432,6 @@ export default {
|
|
tenantId: [{ required: true, message: "请选择适用范围", trigger: "change" }],
|
|
tenantId: [{ required: true, message: "请选择适用范围", trigger: "change" }],
|
|
},
|
|
},
|
|
imageSize: null,
|
|
imageSize: null,
|
|
- actionTime: null,
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created () { },
|
|
created () { },
|
|
@@ -467,9 +460,9 @@ export default {
|
|
status: 1,
|
|
status: 1,
|
|
content: null,
|
|
content: null,
|
|
tenantId: null,
|
|
tenantId: null,
|
|
- subType: null
|
|
|
|
|
|
+ subType: null,
|
|
|
|
+ actionTime: null
|
|
};
|
|
};
|
|
- this.actionTime = null
|
|
|
|
this.$refs["form"].clearValidate();
|
|
this.$refs["form"].clearValidate();
|
|
|
|
|
|
this.dialogForm = {
|
|
this.dialogForm = {
|
|
@@ -585,11 +578,14 @@ export default {
|
|
this.$refs[formName].validate(valid => {
|
|
this.$refs[formName].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
let form = Object.assign({}, this.form)
|
|
let form = Object.assign({}, this.form)
|
|
- let actionTime = this.actionTime
|
|
|
|
|
|
+ let actionTime = form.actionTime
|
|
console.log(actionTime)
|
|
console.log(actionTime)
|
|
if(actionTime && actionTime.length > 0) {
|
|
if(actionTime && actionTime.length > 0) {
|
|
form.onlineTime = dayjs(actionTime[0]).format('YYYY-MM-DD HH:mm:ss')
|
|
form.onlineTime = dayjs(actionTime[0]).format('YYYY-MM-DD HH:mm:ss')
|
|
form.offlineTime = dayjs(actionTime[1]).format('YYYY-MM-DD HH:mm:ss')
|
|
form.offlineTime = dayjs(actionTime[1]).format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
+ } else {
|
|
|
|
+ form.onlineTime = null
|
|
|
|
+ form.offlineTime = null
|
|
}
|
|
}
|
|
if (this.pageType == "create") {
|
|
if (this.pageType == "create") {
|
|
if (form.id) {
|
|
if (form.id) {
|
|
@@ -668,9 +664,9 @@ export default {
|
|
status: 1,
|
|
status: 1,
|
|
content: null,
|
|
content: null,
|
|
tenantId: null,
|
|
tenantId: null,
|
|
- subType: null
|
|
|
|
|
|
+ subType: null,
|
|
|
|
+ actionTime: null
|
|
};
|
|
};
|
|
- this.actionTime = null
|
|
|
|
this.$refs[formName].resetFields();
|
|
this.$refs[formName].resetFields();
|
|
},
|
|
},
|
|
onLook () {
|
|
onLook () {
|
|
@@ -726,9 +722,9 @@ export default {
|
|
subType: result.subType ? result.subType : null
|
|
subType: result.subType ? result.subType : null
|
|
};
|
|
};
|
|
if(result.onlineTime && result.offlineTime) {
|
|
if(result.onlineTime && result.offlineTime) {
|
|
- this.actionTime = [result.onlineTime, result.offlineTime]
|
|
|
|
|
|
+ this.form.actionTime = [result.onlineTime, result.offlineTime]
|
|
} else {
|
|
} else {
|
|
- this.actionTime = null
|
|
|
|
|
|
+ this.form.actionTime = null
|
|
}
|
|
}
|
|
this.dataInfo.updateTime = result.updateTime
|
|
this.dataInfo.updateTime = result.updateTime
|
|
}
|
|
}
|