package.json
- {
- "name": "jxkh",
- "version": "3.8.1",
- "description": "绩效管理系统",
- "author": "绩效",
- "license": "MIT",
- "scripts": {
- "dev": "vite",
- "build:prod": "vite build",
- "build:stage": "vite build --mode staging",
- "preview": "vite preview"
- },
- "repository": {
- "type": "git",
- "url": "https://gitee.com/y_project/RuoYi-Vue.git"
- },
- "dependencies": {
- "@antv/g6": "^4.5.5",
- "@element-plus/icons-vue": "1.1.4",
- "@grapecity/spread-excelio": "^16.1.0",
- "@grapecity/spread-sheets": "^16.1.0",
- "@grapecity/spread-sheets-barcode": "^16.1.0",
- "@grapecity/spread-sheets-charts": "^16.1.0",
- "@grapecity/spread-sheets-designer": "^16.1.0",
- "@grapecity/spread-sheets-designer-resources-cn": "^16.1.0",
- "@grapecity/spread-sheets-designer-vue": "^16.1.0",
- "@grapecity/spread-sheets-languagepackages": "^16.1.0",
- "@grapecity/spread-sheets-pdf": "^16.1.0",
- "@grapecity/spread-sheets-pivot-addon": "^16.1.0",
- "@grapecity/spread-sheets-print": "^16.1.0",
- "@grapecity/spread-sheets-resources-zh": "^16.1.0",
- "@grapecity/spread-sheets-shapes": "^16.1.0",
- "@grapecity/spread-sheets-tablesheet": "^16.1.0",
- "animate.css": "^4.1.1",
- "axios": "0.26.1",
- "echarts": "5.3.2",
- "element-plus": "~2.1.11",
- "file-saver": "^2.0.5",
- "font-awesome": "^4.7.0",
- "fuse.js": "6.5.3",
- "js-cookie": "3.0.1",
- "jsencrypt": "3.2.1",
- "lodash": "4.17.21",
- "mitt": "^3.0.0",
- "moment": "^2.29.1",
- "nprogress": "0.2.0",
- "sortablejs": "1.14.0",
- "sweetalert2": "^11.4.19",
- "uuid": "^9.0.0",
- "vue": "3.2.31",
- "vue-cropper": "1.0.3",
- "vue-json-viewer": "3",
- "vue-router": "4.0.14",
- "vue-sweetalert2": "^5.0.5",
- "vue3-treeselect-ts": "^0.0.3",
- "vuex": "4.0.2",
- "xlsx": "^0.18.5"
- },
- "devDependencies": {
- "@vitejs/plugin-vue": "2.3.1",
- "@vue/compiler-sfc": "3.2.31",
- "sass": "1.50.0",
- "unplugin-auto-import": "0.6.9",
- "vite": "2.6.14",
- "vite-plugin-compression": "0.5.1",
- "vite-plugin-optimize-persist": "^0.1.2",
- "vite-plugin-package-config": "^0.1.1",
- "vite-plugin-svg-icons": "1.0.5",
- "vite-plugin-vue-setup-extend": "0.4.0",
- "typescript": "^4.5.4",
- "vue-tsc": "^0.34.7"
- },
- "vite": {
- "optimizeDeps": {
- "include": [
- "@antv/g6",
- "@element-plus/icons-vue",
- "@vueuse/core",
- "axios",
- "echarts",
- "element-plus",
- "element-plus/lib/locale/lang/zh-cn",
- "file-saver",
- "fuse.js",
- "js-cookie",
- "jsencrypt/bin/jsencrypt.min",
- "lodash",
- "lodash-es",
- "mitt",
- "moment",
- "nprogress",
- "sweetalert2",
- "vue",
- "vue-cropper",
- "vue-json-viewer",
- "vue-router",
- "vue3-treeselect-ts",
- "vuex"
- ]
- }
- }
- }
复制代码
main.js
- import { createApp } from 'vue'
- import Cookies from 'js-cookie'
- import ElementPlus from 'element-plus'
- import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言
- import '@/assets/styles/index.scss' // global css
- import 'font-awesome/css/font-awesome.min.css'
- import App from './App'
- // SpreadJS
- // import { GcSpreadSheets, GcWorksheet, GcColumn } from '@grapecity/spread-sheets-vue'
- import Designer from "@grapecity/spread-sheets-designer-vue"
- import store from './store'
- import router from './router'
- import directive from './directive' // directive
- import _ from "lodash";
- import moment from "moment"
- // 注册指令
- import plugins from './plugins' // plugins
- import { download } from '@/utils/request'
- // svg图标
- import 'virtual:svg-icons-register'
- import SvgIcon from '@/components/SvgIcon'
- import elementIcons from '@/components/SvgIcon/svgicon'
- import './permission' // permission control
- import { useDict, getDict, getDictRefs } from '@/utils/dict'
- import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectCategoryName, independentCodeFormat } from '@/utils/ruoyi'
- // 分页组件
- import Pagination from '@/components/Pagination'
- // 自定义表格工具组件
- import RightToolbar from '@/components/RightToolbar'
- // 文件上传组件
- 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'
- // 部门树传id标签显示name组件
- import TreeTag from '@/components/TreeTag'
- // import the component
- import Treeselect from "vue3-treeselect-ts";
- // import the styles
- import "vue3-treeselect-ts/dist/style.css";
- // 懒加载部门树组件
- import DeptElTree from '@/components/DeptElTree'
- // 事件总线
- import mitt from "mitt"
- const app = createApp(App)
- // 全局方法挂载
- app.config.globalProperties.useDict = useDict
- app.config.globalProperties.getDict = getDict
- app.config.globalProperties.getDictRefs = getDictRefs
- 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.selectCategoryName = selectCategoryName
- app.config.globalProperties.independentCodeFormat = independentCodeFormat
- app.config.globalProperties._ = _
- app.config.globalProperties.moment = moment
- app.config.globalProperties.$bus = new mitt()
- // 全局组件挂载
- app.component('DictTag', DictTag)
- app.component('TreeTag', TreeTag)
- 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('Treeselect', Treeselect)// 第三方树组件
- app.component('DeptElTree', DeptElTree)
- // SpreadJS
- // app.component('gc-spread-sheets', GcSpreadSheets);
- // app.component('gc-worksheet', GcWorksheet);
- // app.component('gc-column', GcColumn);
- app.component("gc-spread-sheets-designer",Designer);
- app.use(router)
- app.use(store)
- app.use(plugins)
- app.use(elementIcons)
- app.component('svg-icon', SvgIcon)
- directive(app)
- // 使用element-plus 并且设置全局的大小
- app.use(ElementPlus, {
- locale: locale,
- // 支持 large、default、small
- size: Cookies.get('size') || 'default'
- })
- app.mount('#app')
复制代码
页面代码
- <template>
- <div id="gc-designer-container">
- <gc-spread-sheets-designer
- :styleInfo="styleInfo"
- :spreadOptions="spreadOptions"
- @designerInitialized="designerInitialized"/>
- </div>
- </template>
- <script setup>
- import '@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css';
- import "@grapecity/spread-sheets-designer/styles/gc.spread.sheets.designer.min.css";
- import * as GC from "@grapecity/spread-sheets";
- import "@grapecity/spread-sheets-print";
- import "@grapecity/spread-sheets-shapes";
- import "@grapecity/spread-sheets-pivot-addon";
- import "@grapecity/spread-sheets-tablesheet";
- import "@grapecity/spread-sheets-designer-resources-cn";
- import * as GcDesigner from "@grapecity/spread-sheets-designer";
- import {reactive, toRefs} from 'vue'
- // interface IData{
- // designer:GcDesigner.Spread.Sheets.Designer.Designer|null,
- // spread: GC.Spread.Sheets.Workbook|null
- // }
- const data = reactive({
- designer: GcDesigner.Spread.Sheets.Designer.Designer | null,
- spread: GC.Spread.Sheets.Workbook | null,
- })
- const refData = toRefs(data)
- const styleInfo={height: '98vh'}
- const spreadOptions={sheetCount:2}
- const designerInitialized = (entity) => {
- data.designer = entity || GcDesigner.Spread.Sheets.Designer.Designer;
- let spread = data.designer.getWorkbook() // as GC.Spread.Sheets.Workbook
- let sheet = spread.getActiveSheet()
- sheet.setValue(0,0,'Grapecity')
- }
- </script>
复制代码 |