This commit is contained in:
张成
2025-10-10 00:37:30 +08:00
parent b39b206c4c
commit 81aa1d49fd
6 changed files with 58 additions and 439 deletions

View File

@@ -65,7 +65,16 @@
import Vue from 'vue'
import dayjs from 'dayjs'
import templateRender from './templateRender'
const icons = require('@/config/icons')
// 导入框架中的图标配置
let icons = []
try {
icons = require('../../config/icons.json') || []
} catch (e) {
console.warn('未找到图标配置文件,图标选择功能将不可用', e)
icons = []
}
export default {
props: ['columns', 'width'],
components: {
@@ -183,7 +192,12 @@ export default {
this.isOPen = false
},
async init(row, isgl) {
this.icons = icons.map((item) => item.trim())
// 安全处理图标数据
if (Array.isArray(icons)) {
this.icons = icons.map((item) => item.trim ? item.trim() : item)
} else {
this.icons = []
}
row = row || {}
let rules = this.curRules
if (isgl) {

View File

@@ -30,11 +30,17 @@ let headers = {
export default {
props: ['value'],
computed: {},
computed: {
actionUrl() {
// 优先使用 $config如果不存在则使用 window.framework.config
const config = this.$config || (window.framework && window.framework.config) || {}
const apiUrl = config.apiUrl || config.uploadUrl || ''
return apiUrl + 'sys_file/upload_oos_img'
}
},
data() {
return {
headers,
actionUrl: this.config.apiUrl + 'sys_file/upload_oos_img',
imgUrl: '',
visible: false,
}