1
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user