|
@@ -9,7 +9,7 @@
|
|
|
:tableEvents="{ ...defaultTableEvents, ...tableEvents }"
|
|
|
:columnParsing="columnParsing"
|
|
|
:reduction="reduction"
|
|
|
- :plan="[...defaultPlan, ...morePlan]"
|
|
|
+ :plan="[...defaultPlan, ...timePlan, ...paramList, ...morePlan]"
|
|
|
:operation="operationShow ? caozuojl : operation"
|
|
|
:operationColumnWidth="(operation ? operationColumnWidth : 0) + (operationShow ? 70 : 0)"
|
|
|
:showTable="showTable"
|
|
@@ -120,10 +120,6 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
- // 菜单id
|
|
|
- moduleId: this.$route.meta.moduleId,
|
|
|
- // 菜单名
|
|
|
- moduleName: this.customModuleName || this.$route.meta.title,
|
|
|
// 搜索的参数
|
|
|
parameter: {},
|
|
|
// 按钮集合
|
|
@@ -140,59 +136,29 @@ export default {
|
|
|
codeGather: {},
|
|
|
frontCodes: [],
|
|
|
pk: '',
|
|
|
- createTimeKey: '',
|
|
|
- zfireParamList: [],
|
|
|
planItem: null,
|
|
|
- inputText: ''
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- userid() {
|
|
|
- return this.$store.getters.userid
|
|
|
- },
|
|
|
- defaultPlan() {
|
|
|
- var ps = [
|
|
|
+ inputText: '',
|
|
|
+ defaultPlan: [
|
|
|
{
|
|
|
name: '默认方案',
|
|
|
paramCallback: () => {
|
|
|
return []
|
|
|
}
|
|
|
}
|
|
|
- ]
|
|
|
- if (this.createTimeKey) {
|
|
|
- var [y, m, d] = new Date(new Date().getTime()).toJSON().split('T').join(' ').substr(0, 10).split('-')
|
|
|
- ps.push({
|
|
|
- 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` }
|
|
|
- ]
|
|
|
- }
|
|
|
- })
|
|
|
- ps.push({
|
|
|
- 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` }
|
|
|
- ]
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- if (this.zfireParamList.length) {
|
|
|
- this.zfireParamList.map(item => {
|
|
|
- ps.push({
|
|
|
- name: item.name,
|
|
|
- id: item.id,
|
|
|
- closable: true,
|
|
|
- paramCallback: () => {
|
|
|
- return item.items.map(dav => ({ param: dav.param, compare: dav.compare, value: dav.value }))
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- return ps
|
|
|
+ ],
|
|
|
+ paramList: [],
|
|
|
+ timePlan: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ userid() {
|
|
|
+ return this.$store.getters.userid
|
|
|
+ },
|
|
|
+ moduleId() {
|
|
|
+ return this.$route.meta.moduleId
|
|
|
+ },
|
|
|
+ moduleName() {
|
|
|
+ return this.customModuleName || this.$route.meta.title
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -210,6 +176,33 @@ export default {
|
|
|
this.getZfireParamList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ setDefaultPlan(createTimeKey) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (createTimeKey) {
|
|
|
+ var [y, m, d] = new Date(new Date().getTime()).toJSON().split('T').join(' ').substr(0, 10).split('-')
|
|
|
+ this.timePlan = [
|
|
|
+ {
|
|
|
+ name: '今日',
|
|
|
+ paramCallback: () => {
|
|
|
+ return [
|
|
|
+ { param: createTimeKey, compare: '>', value: `${y}-${m}-${Number(d) - 1} 23:59:59` },
|
|
|
+ { param: createTimeKey, compare: '<', value: `${y}-${m}-${Number(d) + 1} 00:00:00` }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '昨日',
|
|
|
+ paramCallback: () => {
|
|
|
+ return [
|
|
|
+ { param: createTimeKey, compare: '>', value: `${y}-${m}-${Number(d) - 2} 23:59:59` },
|
|
|
+ { param: createTimeKey, compare: '<', value: `${y}-${m}-${Number(d)} 00:00:00` }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 关闭方案命名弹窗
|
|
|
handleClose() {
|
|
|
this.planItem = null
|
|
@@ -221,7 +214,16 @@ export default {
|
|
|
zfireParamList({
|
|
|
moduleId: this.moduleId
|
|
|
}).then(res => {
|
|
|
- this.zfireParamList = res.data
|
|
|
+ this.paramList = res.data.map(item => {
|
|
|
+ return {
|
|
|
+ name: item.name,
|
|
|
+ id: item.id,
|
|
|
+ closable: true,
|
|
|
+ paramCallback: () => {
|
|
|
+ return item.items.map(dav => ({ param: dav.param, compare: dav.compare, value: dav.value }))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
// 点击获取保存方案数据
|
|
@@ -343,9 +345,9 @@ export default {
|
|
|
if (this.fieldBeansHook) {
|
|
|
res.fieldBeans = this.fieldBeansHook(res.fieldBeans) || res.fieldBeans
|
|
|
}
|
|
|
- for (var item of res.fieldBeans) {
|
|
|
- if (!this.createTimeKey && item.jname === 'createTime') {
|
|
|
- this.createTimeKey = `${item.tbName ? item.tbName + '.' : ''}${item.colName}`
|
|
|
+ for (let item of res.fieldBeans) {
|
|
|
+ if (item.jname === 'createTime') {
|
|
|
+ this.setDefaultPlan(`${item.tbName ? item.tbName + '.' : ''}${item.colName}`)
|
|
|
}
|
|
|
if (item.pk) {
|
|
|
this.pk = item.colName
|