-
+
diff --git a/src/frontend/admin/src/components/sc-table/index.vue b/src/frontend/admin/src/components/sc-table/index.vue
index 7f59da55..ff495264 100644
--- a/src/frontend/admin/src/components/sc-table/index.vue
+++ b/src/frontend/admin/src/components/sc-table/index.vue
@@ -7,7 +7,7 @@
:data="tableData"
:default-expand-all="config.defaultExpandAll"
:default-sort="defaultSort"
- :height="height === 'auto' ? null : '100%'"
+ :height="height === `auto` ? null : `100%`"
:key="toggleIndex"
:row-key="rowKey"
:size="config.size"
@@ -64,18 +64,18 @@
-
+
-
+
-
+
- {{ $t('大') }}
- {{ $t('正常') }}
- {{ $t('小') }}
+ {{ $t(`大`) }}
+ {{ $t(`正常`) }}
+ {{ $t(`小`) }}
-
-
-
+
+
+
@@ -127,44 +127,44 @@
:command="menu"
:key="index"
:title="`${menu}`">
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ :command="`${menu}^|^order-descending^|^${tool.getNestedProperty(current.row, menu) ?? ``}`"
+ :title="$t(`倒序排序`)" />
-
+
-
-
-
+
+
+
-
-
+
+
@@ -186,7 +186,6 @@ const scContextmenuItem = defineAsyncComponent(() => import('@/components/sc-con
const scContextmenu = defineAsyncComponent(() => import('@/components/sc-context-menu'))
const fieldFilter = defineAsyncComponent(() => import('./field-filter'))
-import { h } from 'vue'
import tool from '@/utils/tool'
import iframe from '@/store/modules/iframe'
@@ -205,7 +204,7 @@ export default {
contextOpers: { type: Array, default: [] },
contextAdvs: { type: Array, default: [] },
contextExtra: { type: Object },
- tableName: { type: String, default: '' },
+ tableName: { type: String, default: `` },
beforePost: {
type: Function,
},
@@ -222,14 +221,14 @@ export default {
type: Object,
default: () => {},
},
- height: { type: [String, Number], default: '100%' },
- size: { type: String, default: 'default' },
+ height: { type: [String, Number], default: `100%` },
+ size: { type: String, default: `default` },
border: { type: Boolean, default: false },
stripe: { type: Boolean, default: false },
defaultExpandAll: { type: Boolean, default: false },
pageSize: { type: Number, default: config.pageSize },
pageSizes: { type: Array, default: config.pageSizes },
- rowKey: { type: String, default: '' },
+ rowKey: { type: String, default: `` },
summaryMethod: { type: Function, default: null },
filterMethod: { type: Function, default: null },
cellClickMethod: { type: Function, default: null },
@@ -273,10 +272,10 @@ export default {
return tool
},
_height() {
- return Number(this.height) ? Number(this.height) + 'px' : this.height
+ return Number(this.height) ? Number(this.height) + `px` : this.height
},
_table_height() {
- return this.hidePagination && this.hideDo ? '100%' : 'calc(100% - 4rem)'
+ return this.hidePagination && this.hideDo ? `100%` : `calc(100% - 4rem)`
},
},
data() {
@@ -289,7 +288,7 @@ export default {
},
scPageSize: this.pageSize,
isActivate: true,
- emptyText: '暂无数据',
+ emptyText: `暂无数据`,
toggleIndex: 0,
tableData: [],
total: 0,
@@ -297,7 +296,7 @@ export default {
prop: null,
order: null,
loading: false,
- tableHeight: '100%',
+ tableHeight: `100%`,
tableParams: this.params,
userColumn: [],
customColumnShow: false,
@@ -336,68 +335,68 @@ export default {
},
methods: {
dbClick(row) {
- if (this.dblClickDisable) {
+ if (this.dblClickDisable || !this.contextOpers.includes(`view`)) {
return
}
if (this.vue.dialog) {
- this.vue.dialog.detail = { mode: 'view', row: { id: row.id } }
+ this.vue.dialog.detail = { mode: `view`, row: { id: row.id } }
}
},
async contextMenuCommand(command) {
- if (typeof command === 'object') {
+ if (typeof command === `object`) {
return command.action(this.vue, this.current.row)
}
- if (command === 'refresh') {
+ if (command === `refresh`) {
this.vue.reload()
return
}
- if (command === 'copy') {
+ if (command === `copy`) {
let data = tool.getNestedProperty(this.current.row, this.current.column?.property)
if (!data) return
- const textarea = document.createElement('textarea')
+ const textarea = document.createElement(`textarea`)
textarea.readOnly = true
- textarea.style.position = 'absolute'
- textarea.style.left = '-9999px'
+ textarea.style.position = `absolute`
+ textarea.style.left = `-9999px`
textarea.value = data
document.body.appendChild(textarea)
textarea.select()
textarea.setSelectionRange(0, textarea.value.length)
- const result = document.execCommand('Copy')
+ const result = document.execCommand(`Copy`)
if (result) {
- this.$message.success(this.$t('复制成功'))
+ this.$message.success(this.$t(`复制成功`))
}
document.body.removeChild(textarea)
return
}
- if (command === 'view') {
+ if (command === `view`) {
await this.vue.onViewClick(this.current.row)
return
}
- if (command === 'export') {
+ if (command === `export`) {
await this.exportData()
return
}
- if (command === 'add') {
+ if (command === `add`) {
await this.vue.onAddClick()
return
}
- if (command === 'edit') {
+ if (command === `edit`) {
await this.vue.onEditClick(this.current.row)
return
}
- if (command === 'del') {
+ if (command === `del`) {
await this.vue.onDeleteClick(this.current.row)
return
}
- const kv = command.split('^|^')
- if (kv[1].indexOf('order-') === 0) {
+ const kv = command.split(`^|^`)
+ if (kv[1].indexOf(`order-`) === 0) {
this.vue.query.prop = kv[0]
this.vue.query.order = kv[1].substring(6)
await this.upData()
} else {
this.$refs.fieldFilterDialog.open({ field: kv[0], operator: kv[1], value: kv[2] }, (data) => {
- const value = data.value?.split('\n') ?? ['']
+ const value = data.value?.split(`\n`) ?? [``]
this.vue.query.dynamicFilter.filters.push({
field: data.field,
operator: data.operator,
@@ -445,8 +444,8 @@ export default {
if (ids.length > 0) {
reqData.dynamicFilter = {
filters: [reqData.dynamicFilter],
- field: 'id',
- operator: 'Any',
+ field: `id`,
+ operator: `Any`,
value: ids,
}
}
@@ -473,7 +472,7 @@ export default {
} catch (error) {
this._clearData()
this.loading = false
- this.emptyText = '数据格式错误'
+ this.emptyText = `数据格式错误`
return false
}
if (response.code !== config.successCode) {
@@ -481,7 +480,7 @@ export default {
this.loading = false
this.emptyText = response.msg
} else {
- this.emptyText = '暂无数据'
+ this.emptyText = `暂无数据`
if (this.hidePagination) {
this.tableData = response.data || []
} else {
@@ -495,7 +494,7 @@ export default {
return res
})()
- this.$emit('dataChange', ret, this.tableData)
+ this.$emit(`dataChange`, ret, this.tableData)
},
//清空数据
_clearData() {
@@ -519,8 +518,8 @@ export default {
async exportData() {
this.loading = true
try {
- await this.exportApi.post(this.getQueryParams(), { responseType: 'blob' })
- this.$message.success(this.$t('数据已导出(上限 {n} 条)', { n: 50000 }))
+ await this.exportApi.post(this.getQueryParams(), { responseType: `blob` })
+ this.$message.success(this.$t(`数据已导出(上限 {n} 条)`, { n: 50000 }))
} catch {}
this.loading = false
},
@@ -551,10 +550,10 @@ export default {
try {
await config.columnSettingSave(this.tableName, userColumn)
} catch (error) {
- this.$message.error('保存失败')
+ this.$message.error(`保存失败`)
this.$refs.columnSetting.isSave = false
}
- this.$message.success('保存成功')
+ this.$message.success(`保存成功`)
this.$refs.columnSetting.isSave = false
},
//自定义列重置
@@ -564,7 +563,7 @@ export default {
this.userColumn = await config.columnSettingReset(this.tableName, this.column)
this.$refs.columnSetting.userColumn = JSON.parse(JSON.stringify(this.userColumn || []))
} catch (error) {
- this.$message.error('重置失败')
+ this.$message.error(`重置失败`)
this.$refs.columnSetting.isSave = false
}
this.$refs.columnSetting.isSave = false
@@ -597,7 +596,7 @@ export default {
return this.filterMethod(filters)
}
Object.keys(filters).forEach((key) => {
- filters[key] = filters[key].join(',')
+ filters[key] = filters[key].join(`,`)
})
this.upData(filters)
},
@@ -607,14 +606,14 @@ export default {
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
- sums[index] = '合计'
+ sums[index] = `合计`
return
}
const values = this.summary[column.property]
if (values) {
sums[index] = values
} else {
- sums[index] = ''
+ sums[index] = ``
}
})
return sums
diff --git a/src/frontend/admin/src/layout/index.vue b/src/frontend/admin/src/layout/index.vue
index b9a8f2e8..9a713347 100644
--- a/src/frontend/admin/src/layout/index.vue
+++ b/src/frontend/admin/src/layout/index.vue
@@ -220,7 +220,8 @@
import { defineAsyncComponent } from 'vue'
const sideM = defineAsyncComponent(() => import('./components/side-m'))
const topbar = defineAsyncComponent(() => import('./components/topbar'))
-const tags = defineAsyncComponent(() => import('./components/tags'))
+// 这里直接import避免闪烁
+import tags from '@/layout/components/tags.vue'
const navMenu = defineAsyncComponent(() => import('./components/nav-menu'))
const userBar = defineAsyncComponent(() => import('./components/user-bar'))
const iframeView = defineAsyncComponent(() => import('./components/iframe-view'))
diff --git a/src/frontend/admin/src/style/app.scss b/src/frontend/admin/src/style/app.scss
index d811537a..5efc1843 100644
--- a/src/frontend/admin/src/style/app.scss
+++ b/src/frontend/admin/src/style/app.scss
@@ -576,7 +576,6 @@ textarea {
.el-table-column-avatar {
justify-content: center;
align-items: center;
- cursor: pointer;
display: flex;
gap: 0.5rem;
diff --git a/src/frontend/admin/src/views/sys/template/index.vue b/src/frontend/admin/src/views/sys/template/index.vue
index 68264fd7..bee35345 100644
--- a/src/frontend/admin/src/views/sys/template/index.vue
+++ b/src/frontend/admin/src/views/sys/template/index.vue
@@ -91,18 +91,4 @@
entity-name="sys_codetemplate" />
-
-
\ No newline at end of file