/*
 * @Company: 沈阳信诚科技
 * @Email: html_venustar@163.com
 * @Author: Liuqiming
 * @Description: 其他公共配置
 * @LastEditors: Liuqiming
 * @LastEditTime: 2024-03-19 15:25:18
 * @Date: 2024-02-01 17:05:35
 */
import { useDict } from '@/utils/dict'
import { getConfigKey, updateConfigByKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/cfhi'
import { download } from '@/utils/request'
import bus from './eventBus'
import * as echarts from 'echarts'
import htmlToPdf from '@C/utils/htmlToPdf.js'

import ElsTable from '@C/ElsTable/index.vue'
import ElsForm from '@C/ElsForm/index.vue'
import ElsIframe from '@C/iFrame/index'
import Pagination from '@/components/Pagination'
import RightToolbar from '@/components/RightToolbar'
import Editor from "@/components/Editor"
import FileUpload from "@/components/FileUpload"
import ImageUpload from "@/components/ImageUpload"
import ImagePreview from "@/components/ImagePreview"
import TreeSelect from '@/components/TreeSelect'
import DictTag from '@/components/DictTag' 
import EchartsFoldLine from '@/components/EchartsFoldLine' 
import DateTimeRange from '@/components/dateTimeRange' 
import inputRange from '@/components/inputRange' 
import contentBorder from '@C/contentBorder/index'

export default function configApp(app){
  // 全局方法挂载
  app.config.globalProperties.useDict = useDict
  app.config.globalProperties.getConfigKey = getConfigKey
  app.config.globalProperties.updateConfigByKey = updateConfigByKey
  app.config.globalProperties.download = download
  app.config.globalProperties.parseTime = parseTime
  app.config.globalProperties.resetForm = resetForm
  app.config.globalProperties.handleTree = handleTree
  app.config.globalProperties.addDateRange = addDateRange
  app.config.globalProperties.selectDictLabel = selectDictLabel
  app.config.globalProperties.selectDictLabels = selectDictLabels
  app.config.globalProperties.echarts = echarts
  app.config.globalProperties.bus = bus
  app.config.globalProperties.htmlToPdf = htmlToPdf

  // 全局组件挂载
  app.component('DictTag', DictTag) // 字典标签组件
  app.component('Pagination', Pagination) // 分页组件
  app.component('TreeSelect', TreeSelect) // 自定义树选择组件
  app.component('FileUpload', FileUpload) // 文件上传组件
  app.component('ImageUpload', ImageUpload) // 图片上传组件
  app.component('ImagePreview', ImagePreview) // 图片预览组件
  app.component('RightToolbar', RightToolbar) // 自定义表格工具组件
  app.component('Editor', Editor) // 富文本组件
  app.component('els-table', ElsTable)  // 项目统一公共表格组件
  app.component('els-form', ElsForm)  // 项目统一公共表单组件
  app.component('EchartsFoldLine', EchartsFoldLine)  // 项目统一公共表单组件
  app.component('ElsIframe', ElsIframe)  // iframe组件
  app.component('DateTimeRange', DateTimeRange)  // iframe组件
  app.component('inputRange', inputRange)  // input输入范围组件
  app.component('contentBorder', contentBorder)  // input输入范围组件
}


