feat: import export ui layout

This commit is contained in:
Zichao Lin 2024-08-07 17:07:18 +08:00
parent 0cd9c071d7
commit 38b99bf4dc
Signed by: earthjasonlin
GPG Key ID: 406D9913DE2E42FB
4 changed files with 7 additions and 5 deletions

@ -3,7 +3,7 @@
"ui.button.load": "Load data", "ui.button.load": "Load data",
"ui.button.update": "Update", "ui.button.update": "Update",
"ui.button.directUpdate": "Direct update", "ui.button.directUpdate": "Direct update",
"ui.button.files": "Export Files", "ui.button.files": "Import/Export",
"ui.button.excel": "Export Excel", "ui.button.excel": "Export Excel",
"ui.button.uigf": "Export UIGF", "ui.button.uigf": "Export UIGF",
"ui.button.import": "Import UIGF", "ui.button.import": "Import UIGF",

@ -3,7 +3,7 @@
"ui.button.load": "加载数据", "ui.button.load": "加载数据",
"ui.button.update": "更新数据", "ui.button.update": "更新数据",
"ui.button.directUpdate": "直接更新", "ui.button.directUpdate": "直接更新",
"ui.button.files": "导文件", "ui.button.files": "导入/导出",
"ui.button.excel": "导出Excel", "ui.button.excel": "导出Excel",
"ui.button.uigf":"导出UIGF", "ui.button.uigf":"导出UIGF",
"ui.button.import":"导入UIGF", "ui.button.import":"导入UIGF",

@ -3,7 +3,7 @@
"ui.button.load": "加載數據", "ui.button.load": "加載數據",
"ui.button.update": "更新數據", "ui.button.update": "更新數據",
"ui.button.directUpdate": "直接更新", "ui.button.directUpdate": "直接更新",
"ui.button.files": "導文件", "ui.button.files": "導入/匯出",
"ui.button.excel": "導出Excel", "ui.button.excel": "導出Excel",
"ui.button.uigf":"導出UIGF", "ui.button.uigf":"導出UIGF",
"ui.button.import":"導入UIGF", "ui.button.import":"導入UIGF",

@ -4,7 +4,7 @@
<div class="space-x-3"> <div class="space-x-3">
<el-button type="primary" :icon="state.status === 'init' ? 'milk-tea': 'refresh-right'" class="focus:outline-none" :disabled="!allowClick()" plain @click="fetchData()" :loading="state.status === 'loading'">{{state.status === 'init' ? ui.button.load: ui.button.update}}</el-button> <el-button type="primary" :icon="state.status === 'init' ? 'milk-tea': 'refresh-right'" class="focus:outline-none" :disabled="!allowClick()" plain @click="fetchData()" :loading="state.status === 'loading'">{{state.status === 'init' ? ui.button.load: ui.button.update}}</el-button>
<el-dropdown :disabled="!gachaData" @command="exportCommand"> <el-dropdown :disabled="!gachaData" @command="exportCommand">
<el-button :disabled="!gachaData" icon="download" class="focus:outline-none" type="success" plain> <el-button :disabled="!gachaData" icon="folder-opened" class="focus:outline-none" type="success" plain>
{{ui.button.files}} {{ui.button.files}}
<el-icon class="el-icon--right"><arrow-down /></el-icon> <el-icon class="el-icon--right"><arrow-down /></el-icon>
</el-button> </el-button>
@ -12,10 +12,10 @@
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item command="excel">{{ui.button.excel}}</el-dropdown-item> <el-dropdown-item command="excel">{{ui.button.excel}}</el-dropdown-item>
<el-dropdown-item command="uigf-json">{{ui.button.uigf}}</el-dropdown-item> <el-dropdown-item command="uigf-json">{{ui.button.uigf}}</el-dropdown-item>
<el-dropdown-item command="import-json" divided>{{ui.button.import}}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<el-button @click="importData()" icon="upload" class="focus:outline-none" type="success" plain>{{ui.button.import}}</el-button>
<el-tooltip v-if="detail && state.status !== 'loading'" :content="ui.hint.newAccount" placement="bottom"> <el-tooltip v-if="detail && state.status !== 'loading'" :content="ui.hint.newAccount" placement="bottom">
<el-button @click="newUser()" plain icon="plus" class="focus:outline-none"></el-button> <el-button @click="newUser()" plain icon="plus" class="focus:outline-none"></el-button>
</el-tooltip> </el-tooltip>
@ -290,6 +290,8 @@ const exportCommand = (type) => {
saveExcel() saveExcel()
} else if (type === 'uigf-json') { } else if (type === 'uigf-json') {
exportUIGFJSON() exportUIGFJSON()
} else if (type === 'import-json') {
importData()
} }
} }
const openCacheFolder = async () => { const openCacheFolder = async () => {