mirror of https://github.com/veops/cmdb.git
pref(cmdb-ui):batch upload for date type (#301)
This commit is contained in:
parent
2b69217136
commit
a06599ce33
|
@ -29,6 +29,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import moment from 'moment'
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import CiTypeChoice from './modules/CiTypeChoice'
|
import CiTypeChoice from './modules/CiTypeChoice'
|
||||||
import CiUploadTable from './modules/CiUploadTable'
|
import CiUploadTable from './modules/CiUploadTable'
|
||||||
|
@ -73,8 +74,21 @@ export default {
|
||||||
const _ele = {}
|
const _ele = {}
|
||||||
item.forEach((ele, j) => {
|
item.forEach((ele, j) => {
|
||||||
if (ele !== undefined && ele !== null) {
|
if (ele !== undefined && ele !== null) {
|
||||||
|
const _find = this.ciTypeAttrs.attributes.find(
|
||||||
|
(attr) => attr.alias === dataList[0][j] || attr.name === dataList[0][j]
|
||||||
|
)
|
||||||
|
if (_find?.value_type === '4') {
|
||||||
|
_ele[dataList[0][j]] = moment(Math.round((ele - 25569) * 86400 * 1000 - 28800000)).format('YYYY-MM-DD')
|
||||||
|
} else if (_find?.value_type === '3') {
|
||||||
|
_ele[dataList[0][j]] = moment(Math.round((ele - 25569) * 86400 * 1000 - 28800000)).format(
|
||||||
|
'YYYY-MM-DD HH:mm:ss'
|
||||||
|
)
|
||||||
|
} else if (_find?.value_type === '5') {
|
||||||
|
_ele[dataList[0][j]] = moment(Math.round(ele * 86400 * 1000 - 28800000)).format('HH:mm:ss')
|
||||||
|
} else {
|
||||||
_ele[dataList[0][j]] = ele
|
_ele[dataList[0][j]] = ele
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return _ele
|
return _ele
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
class="ops-stripe-table"
|
class="ops-stripe-table"
|
||||||
:max-height="200"
|
:max-height="200"
|
||||||
:data="dataSource"
|
:data="dataSource"
|
||||||
|
resizable
|
||||||
>
|
>
|
||||||
<vxe-column type="seq" width="40" />
|
<vxe-column type="seq" width="40" />
|
||||||
<vxe-column
|
<vxe-column
|
||||||
|
|
|
@ -372,7 +372,7 @@ export default {
|
||||||
},
|
},
|
||||||
async open(property, attrList) {
|
async open(property, attrList) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.getNoticeConfigAppBot()
|
await this.getNoticeConfigAppBot()
|
||||||
this.attrList = attrList
|
this.attrList = attrList
|
||||||
if (property.has_trigger) {
|
if (property.has_trigger) {
|
||||||
this.triggerId = property.trigger.id
|
this.triggerId = property.trigger.id
|
||||||
|
|
Loading…
Reference in New Issue