# xc-common **Repository Path**: xueli233/xc-common ## Basic Information - **Project Name**: xc-common - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-05 - **Last Updated**: 2025-05-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 1.新增修改弹窗放到本目录`dialog`文件夹下,命名列表`xxx_list`,弹窗`xxxEdit`; 2.弹窗使用全局组件 ``` handleAdd() { this.row = {}; this.$refs.edit.show(); }, handleEdit(row) { this.row = row; this.$refs.edit.show() }, handleDelete(row) { var jsons = { id: row.id }; this.openConfirm('是否确定删除?', '', () => { delete(jsons).then(data => { this.search(); }); }) }, //弹窗内操作关闭 this.vm.$refs.edit.onCancel() this.vm.search() //列表请求 search() { shopQuestionnaireQuestionnaireAnswerList(this.form).then(res => { var datas = res.data; this.list = datas.data this.form.total = datas.total }) }, ``` 3.接口统一定义到当前文件夹下`xxxApi.js`文件,定义参考 ``` import request from '@/utils/request' // 问卷答卷详情 export function shopQuestionnaireQuestionnaireAnswerList(data, errorback) { return request._post('/shop/questionnaire.QuestionnaireAnswer/list', data, errorback); } ``` 4.按钮方法使用`handleXxx`的命名方式; 5.列表与新增,修改组件页面参数传递,使用 ``` provide() { vm:this } inject:['vm'] ``` 6.分页使用组件 ``` ``` 7.前端导出 ``` 导出 exportExcel() { statisticsMealStopList({ ...this.form, page: 1, //int1分页第几页 list_rows: 10000, // int 10 分页每页数量 }).then(res => { var datas = res.data export_json_to_excel2( ["学校", "班级", "停餐天数"], datas.list.data, ["school_name", "class_name", "stop_num"], "停餐统计"); }); }, import { export_json_to_excel2 } from '@/lib/vendor/Export2Excel' ``` 8.富文本 ``` import Uediter from '@/components/UE.vue'; ueditor: { text: '', config: { initialFrameWidth: '100%', initialFrameHeight: 500 } }, contentChangeFunc(e) { this.form.content = e; }, ```