chore: upgrade element-plugin to 2.9.6

This commit is contained in:
rick 2025-03-09 21:28:51 +08:00
parent 66b2f1eade
commit 7b8a5bbce2
No known key found for this signature in database
GPG Key ID: 260A80C757EC6783
4 changed files with 35 additions and 20 deletions

View File

@ -11,7 +11,7 @@
"@vueuse/core": "^10.11.0", "@vueuse/core": "^10.11.0",
"codemirror": "^5.65.17", "codemirror": "^5.65.17",
"diff-match-patch": "^1.0.5", "diff-match-patch": "^1.0.5",
"element-plus": "^2.9.1", "element-plus": "^2.9.6",
"intro.js": "^7.0.1", "intro.js": "^7.0.1",
"jsonlint-mod": "^1.7.6", "jsonlint-mod": "^1.7.6",
"jsonpath-plus": "^10.0.7", "jsonpath-plus": "^10.0.7",
@ -4799,9 +4799,9 @@
"dev": true "dev": true
}, },
"node_modules/element-plus": { "node_modules/element-plus": {
"version": "2.9.1", "version": "2.9.6",
"resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.9.1.tgz", "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.9.6.tgz",
"integrity": "sha512-9Agqf/jt4Ugk7EZ6C5LME71sgkvauPCsnvJN12Xid2XVobjufxMGpRE4L7pS4luJMOmFAH3J0NgYEGZT5r+NDg==", "integrity": "sha512-D9zU28Ce0s/9O/Vp3ewemikxzFVA6gdZyMwmWijHijo+t5/9H3sHRTIm1WlfeNpFW2Yq0y8nHXD0fU5YxU6qlQ==",
"dependencies": { "dependencies": {
"@ctrl/tinycolor": "^3.4.1", "@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
@ -15666,9 +15666,9 @@
"dev": true "dev": true
}, },
"element-plus": { "element-plus": {
"version": "2.9.1", "version": "2.9.6",
"resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.9.1.tgz", "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.9.6.tgz",
"integrity": "sha512-9Agqf/jt4Ugk7EZ6C5LME71sgkvauPCsnvJN12Xid2XVobjufxMGpRE4L7pS4luJMOmFAH3J0NgYEGZT5r+NDg==", "integrity": "sha512-D9zU28Ce0s/9O/Vp3ewemikxzFVA6gdZyMwmWijHijo+t5/9H3sHRTIm1WlfeNpFW2Yq0y8nHXD0fU5YxU6qlQ==",
"requires": { "requires": {
"@ctrl/tinycolor": "^3.4.1", "@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",

View File

@ -19,7 +19,7 @@
"@vueuse/core": "^10.11.0", "@vueuse/core": "^10.11.0",
"codemirror": "^5.65.17", "codemirror": "^5.65.17",
"diff-match-patch": "^1.0.5", "diff-match-patch": "^1.0.5",
"element-plus": "^2.9.1", "element-plus": "^2.9.6",
"intro.js": "^7.0.1", "intro.js": "^7.0.1",
"jsonlint-mod": "^1.7.6", "jsonlint-mod": "^1.7.6",
"jsonpath-plus": "^10.0.7", "jsonpath-plus": "^10.0.7",

View File

@ -1,17 +1,19 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue' import { ref, watch } from 'vue'
import { API } from './net' import { API } from './net'
import type { Store } from './store'
import type { Pair } from './types'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { Codemirror } from 'vue-codemirror' import { Codemirror } from 'vue-codemirror'
import HistoryInput from '../components/HistoryInput.vue' import HistoryInput from '../components/HistoryInput.vue'
const stores = ref([]) const stores = ref([] as Store[])
const kind = ref('') const kind = ref('')
const store = ref('') const store = ref('')
const sqlQuery = ref('') const sqlQuery = ref('')
const queryResult = ref([]) const queryResult = ref([] as any[])
const queryResultAsJSON= ref('') const queryResultAsJSON= ref('')
const columns = ref([]) const columns = ref([] as string[])
const queryTip = ref('') const queryTip = ref('')
const databases = ref([]) const databases = ref([])
const tables = ref([]) const tables = ref([])
@ -33,7 +35,15 @@ watch(store, (s) => {
sqlQuery.value = '' sqlQuery.value = ''
executeQuery() executeQuery()
}) })
const queryDataFromTable = (data) => {
interface QueryData {
items: any[]
data: any[]
label: string
meta: any
}
const queryDataFromTable = (data: QueryData) => {
sqlQuery.value = `select * from ${data.label} limit 10` sqlQuery.value = `select * from ${data.label} limit 10`
executeQuery() executeQuery()
} }
@ -66,13 +76,13 @@ API.GetStores((data) => {
loadingStores.value = false loadingStores.value = false
}) })
const ormDataHandler = (data) => { const ormDataHandler = (data: QueryData) => {
const result = [] const result = [] as any[]
const cols = new Set() const cols = new Set()
data.items.forEach(e => { data.items.forEach(e => {
const obj = {} const obj = {}
e.data.forEach(item => { e.data.forEach((item: Pair) => {
obj[item.key] = item.value obj[item.key] = item.value
cols.add(item.key) cols.add(item.key)
}) })
@ -98,12 +108,12 @@ const ormDataHandler = (data) => {
}) })
} }
const keyValueDataHandler = (data) => { const keyValueDataHandler = (data: QueryData) => {
queryResult.value = [] queryResult.value = []
data.data.forEach(e => { data.data.forEach(e => {
const obj = {} const obj = new Map<string, string>();
obj['key'] = e.key obj.set('key', e.key)
obj['value'] = e.value obj.set('value', e.value)
queryResult.value.push(obj) queryResult.value.push(obj)
columns.value = ['key', 'value'] columns.value = ['key', 'value']

View File

@ -15,9 +15,14 @@ limitations under the License.
*/ */
import type { Pair } from './types' import type { Pair } from './types'
interface Store { export interface Store {
name: string; name: string;
link: string; link: string;
ready: boolean;
kind: {
name: string;
description: string;
};
params: Pair[]; params: Pair[];
} }