Compare commits

...

5 Commits

Author SHA1 Message Date
peterlu14 b9b510e26a [update] recover code 2022-04-17 22:58:01 +08:00
peterlu14 47a9b5b02e [update] add developer mode 2022-04-17 22:23:04 +08:00
peterlu14 468e0d06c0 [update] get file meta info faster 2022-04-17 22:23:00 +08:00
peterlu14 4f2413b0ad [update] improve init filetable & fix delete 2022-04-17 22:22:55 +08:00
peterlu14 cd55dd1e40 [update] hide cali mode 2022-04-07 18:38:54 +08:00
8 changed files with 122 additions and 26 deletions
@@ -80,7 +80,7 @@ export default {
// [TODO] 0: not sure future UX design
const meta = this.metaList[0]
file.clearFileList()
const files = await api.meta.getByParent('folder', meta.parent.folder[0])
const files = await api.meta.getAttrByParent('folder', meta.parent.folder[0], 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
file.updateFileList(files)
const tmpFiles = file.getFileList()
for (let i = 0; i < tmpFiles.length; i++) {
+1 -1
View File
@@ -68,7 +68,7 @@ export default {
this.$refs.file_ref.currentInfo = initCollection.data[0]
const folders = await api.collection.getByParent('folder', initCollection.data[0].id)
const files = await api.meta.getByParent('folder', initCollection.data[0].id)
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
file.updateFileList(folders)
file.updateFileList(files)
+9 -21
View File
@@ -170,7 +170,7 @@
{{transTime(props.rowData.time_duration)}}
</template>
<template slot="device_info" slot-scope="props">
{{transDeviceInfo(props.rowData.configuration)}}
{{transDeviceInfo(props.rowData.device)}}
</template>
<template slot="actions" slot-scope="props" >
<va-popover :message="`sdcard ${props.rowData.name}`" placement="top">
@@ -263,8 +263,6 @@ export default {
path: '',
name: '',
metaID: '',
rawChannelAndIDArrays: [], // list of lists
miniChannelAndIDArrays: [], // list of lists
},
styleList: {
@@ -381,11 +379,11 @@ export default {
return this.GLOBAL.transTime(time)
}
},
transDeviceInfo: function (configuration) {
if (configuration === undefined) {
transDeviceInfo: function (device) {
if (device === undefined) {
return '--'
} else {
return configuration._DEVICE_NAME_ + '\n' + configuration._DEVICE_ADDR_
return device.device_name + '\n' + this.GLOBAL.transMac(device.device_address)
}
},
@@ -400,7 +398,7 @@ export default {
// call getfolder api and update
const folders = await api.collection.getByParent('folder', info.id)
const files = await api.meta.getByParent('folder', info.id)
const files = await api.meta.getAttrByParent('folder', info.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
file.updateFileList(folders)
file.updateFileList(files)
@@ -420,7 +418,7 @@ export default {
this.currentInfo = item
// call getfolder api and update
const folders = await api.collection.getByParent('folder', item.id)
const files = await api.meta.getByParent('folder', item.id)
const files = await api.meta.getAttrByParent('folder', item.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
file.updateFileList(folders)
file.updateFileList(files)
@@ -441,7 +439,7 @@ export default {
if (initCollection.data.length === 1) {
this.currentInfo = initCollection.data[0]
const folders = await api.collection.getByParent('folder', initCollection.data[0].id)
const files = await api.meta.getByParent('folder', initCollection.data[0].id)
const files = await api.meta.getAttrByParent('folder', initCollection.data[0].id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
file.updateFileList(folders)
file.updateFileList(files)
this.fileLists = file.getFileList()
@@ -566,16 +564,6 @@ export default {
this.deleteInfo.path = info.path
this.deleteInfo.name = info.name
this.deleteInfo.metaID = info.id
this.deleteInfo.rawChannelAndIDArrays = [] // list of lists
this.deleteInfo.miniChannelAndIDArrays = [] // list of lists
for (const [channel, idArray] of Object.entries(info.raw_data)) {
this.deleteInfo.rawChannelAndIDArrays.push([channel, idArray[0]])
}
for (const [channel, scaleObject] of Object.entries(info.mini_data)) {
for (const idArray of Object.values(scaleObject)) {
this.deleteInfo.miniChannelAndIDArrays.push([channel, idArray[0]])
}
}
}
},
async deleteFolder (id) {
@@ -591,7 +579,7 @@ export default {
this.showModal.deleteFile = true
},
deleteFile: async function () {
if (this.deleteInfo.metaID !== undefined) {
if (this.deleteInfo.metaID === undefined) {
await this.deleteFolder(this.deleteInfo.folderID)
} else {
await this.deleteSingleFileByDeleteInfo()
@@ -642,7 +630,7 @@ export default {
// call getfolder api and update
const folders = await api.collection.getByParent('folder', this.currentInfo.id)
const files = await api.meta.getByParent('folder', this.currentInfo.id)
const files = await api.meta.getAttrByParent('folder', this.currentInfo.id, 'id-path-name-parent-description-size-time_duration-uuid-device-channels-created_at')
file.updateFileList(folders)
file.updateFileList(files)
@@ -117,6 +117,9 @@ export default {
...mapFields('taskContent', [
'deviceList',
]),
...mapFields('', [
'developer_mode',
]),
},
data () {
return {
@@ -599,6 +602,11 @@ export default {
watch: {
},
async mounted () {
const devMode = this.$route.params.mode
if (devMode === 'dev') {
this.developer_mode = true
}
await taskInfo.updateTaskInfo(this.$route.params.taskID)
// console.log(taskInfo.getTaskInfo())
// this.screenHeight = document.documentElement.clientHeight
@@ -414,6 +414,7 @@ import ResolutionRange from '../parameter/item/ResolutionRange'
import EliteParameterRecordingElitePulseSensing from '../parameter/item/PulseSensing/EliteParameterRecordingElitePulseSensing'
import EliteParameterRecordingEliteDPV from '../parameter/item/DPV/EliteParameterRecordingEliteDPV'
import { VueFinalModal } from 'vue-final-modal'
import { mapFields } from 'vuex-map-fields'
export default {
name: 'EliteParameterRecordingElitezm15',
@@ -444,6 +445,9 @@ export default {
getImageUrl () {
return this.workingModeSelect.img_src
},
...mapFields('', [
'developer_mode',
]),
// getImageUrl () {
// if (this.workingModeSelect.img_src !== 'IV-Wire' && this.workingModeSelect.img_src !== 'FG-Wire') {
// return this.workingModeOptions[0].img_src
@@ -461,7 +465,7 @@ export default {
description: 'Init',
img_src: 'IV-Wire',
},
workingModeOptions: [
workingModeDevOptions: [
{
id: 0,
description: 'I-V Curve',
@@ -543,6 +547,79 @@ export default {
img_src: 'DPV-Wire',
},
],
workingModeNoDevOptions: [
{
id: 0,
description: 'I-V Curve',
img_src: 'IV-Wire',
},
{
id: 1,
description: 'Cycle I-V',
img_src: 'CIV-Wire',
},
{
id: 2,
description: 'Function Generator',
img_src: 'FG-Wire',
},
{
id: 3,
description: 'R-T Graph',
img_src: 'RT-Wire',
},
{
id: 4,
description: 'V-T Graph',
img_src: 'VT-Wire',
},
{
id: 5,
description: 'I-T Graph',
img_src: 'IT-Wire',
},
{
id: 6,
description: 'Constant Current',
img_src: 'CC-Wire',
},
{
id: 7,
description: 'Cyclic Voltammetry',
img_src: 'CV-Wire',
},
{
id: 8,
description: 'Linear Sweep Voltammetry',
img_src: 'LSV-Wire',
},
{
id: 9,
description: 'Chronoamperometric Graph',
img_src: 'CG-Wire',
},
{
id: 12,
description: 'Dev Mode',
img_src: 'DevM-Wire',
},
{
id: 13,
description: 'Open Circuit Potential',
img_src: 'OCP-Wire',
},
{
id: 14,
description: 'Pulse Sensing',
img_src: 'PS-Wire',
},
{
id: 15,
description: 'Differential Pulse Voltammetry (DPV)',
img_src: 'DPV-Wire',
},
],
workingModeOptions: [],
currentRangeSelect: null,
currentRangeOptions: [
{
@@ -699,7 +776,14 @@ export default {
}))
},
refresh () {
this.workingModeSelect = this.workingModeOptions[taskInfo.getDeviceInfo(this.deviceID).parameterSet.MODE]
this.workingModeSelect = this.workingModeOptions.find((ele) => ele.id === taskInfo.getDeviceInfo(this.deviceID).parameterSet.MODE)
if (!this.workingModeSelect) {
this.workingModeSelect = {
id: -1,
description: 'Init',
img_src: 'IV-Wire',
}
}
if (this.workingModeSelect != null) {
this.workingModeSelectChange(this.workingModeSelect)
}
@@ -939,6 +1023,10 @@ export default {
},
},
mounted () {
this.developer_mode === true
? this.workingModeOptions = this.workingModeDevOptions
: this.workingModeOptions = this.workingModeNoDevOptions
this.refresh()
},
watch: {
+11
View File
@@ -52,6 +52,16 @@ async function getByParent (type, parent) {
}
}
async function getAttrByParent (type, parent, attr) {
const _header = auth.getHeader()
try {
return await api.axios.get(`/api/file/meta/get_attr_by_parent/${type}/${parent}/${attr}`, { responseType: 'json', headers: _header })
} catch (e) {
console.error(e)
return false
}
}
async function getByID (id) {
const _header = auth.getHeader()
try {
@@ -77,6 +87,7 @@ const meta = {
update,
clearDel,
getByParent,
getAttrByParent,
getByParentWithLimit,
getByID,
getByName,
+1
View File
@@ -20,6 +20,7 @@ function newState () {
},
isLoading: true,
licenseCheck: true,
developer_mode: false,
}
}
+1 -1
View File
@@ -88,7 +88,7 @@ export default new Router({
},
{
name: 'Admin',
path: '/admin',
path: '/admin/:mode?',
component: AppLayout,
children: [
{