|
@@ -105,18 +105,6 @@ export default {
|
|
|
customModuleName: {
|
|
|
type: String,
|
|
|
default: ''
|
|
|
- },
|
|
|
- // 默认方案
|
|
|
- defaultPlan: {
|
|
|
- type: Array,
|
|
|
- default: () => [
|
|
|
- {
|
|
|
- name: '默认方案',
|
|
|
- paramCallback: () => {
|
|
|
- return []
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -140,12 +128,52 @@ export default {
|
|
|
showTable: false,
|
|
|
codeGather: {},
|
|
|
frontCodes: [],
|
|
|
- pk: ''
|
|
|
+ pk: '',
|
|
|
+ createTimeKey: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
userid() {
|
|
|
return this.$store.getters.userid
|
|
|
+ },
|
|
|
+ defaultPlan() {
|
|
|
+ if (this.createTimeKey) {
|
|
|
+ var [y, m, d] = new Date(new Date().getTime()).toJSON().split('T').join(' ').substr(0, 10).split('-')
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ name: '默认方案',
|
|
|
+ paramCallback: () => {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '今日',
|
|
|
+ paramCallback: () => {
|
|
|
+ return [
|
|
|
+ { param: this.createTimeKey, compare: '>', value: `${y}-${m}-${Number(d) - 1} 23:59:59` },
|
|
|
+ { param: this.createTimeKey, compare: '<', value: `${y}-${m}-${Number(d) + 1} 00:00:00` }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '昨日',
|
|
|
+ paramCallback: () => {
|
|
|
+ return [
|
|
|
+ { param: this.createTimeKey, compare: '>', value: `${y}-${m}-${Number(d) - 2} 23:59:59` },
|
|
|
+ { param: this.createTimeKey, compare: '<', value: `${y}-${m}-${Number(d)} 00:00:00` }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ name: '默认方案',
|
|
|
+ paramCallback: () => {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -237,6 +265,9 @@ export default {
|
|
|
res.fieldBeans = this.fieldBeansHook(res.fieldBeans) || res.fieldBeans
|
|
|
}
|
|
|
for (var item of res.fieldBeans) {
|
|
|
+ if (item.jname === 'createTime') {
|
|
|
+ this.createTimeKey = `${item.tbName ? item.tbName + '.' : ''}${item.colName}`
|
|
|
+ }
|
|
|
if (item.pk) {
|
|
|
this.pk = item.colName
|
|
|
}
|