|
@@ -0,0 +1,281 @@
|
|
|
+import { BasicColumn } from '/@/components/Table';
|
|
|
+import { FormSchema } from '/@/components/Table';
|
|
|
+import { rules } from '/@/utils/helper/validator';
|
|
|
+import { render } from '/@/utils/common/renderUtils';
|
|
|
+import { getWeekMonthQuarterYear } from '/@/utils';
|
|
|
+import { h } from 'vue';
|
|
|
+import { Rate, Image } from 'ant-design-vue';
|
|
|
+const arrTitle = ['待审核', '审核通过', '审核不通过'];
|
|
|
+
|
|
|
+//列表数据
|
|
|
+export const columns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: '用户昵称',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'username',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '评分',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'score',
|
|
|
+ width: 180,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const viewList = [h('div', { class: 'mr-3' }, `${record.score}.0`), h(Rate, { value: record.score, disabled: true })];
|
|
|
+ return h('div', { class: 'flex items-center' }, viewList);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '评价内容',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'evaluateContent',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '图片',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'imageList',
|
|
|
+ slots: {
|
|
|
+ customRender: 'imageList',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '审核状态',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'checkStatus',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return arrTitle[record.checkStatus];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '回复内容',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'replyContent',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return record.replyContent ? record.replyContent : '暂无回复';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '手机号码',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'phone',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '提交时间',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '回复时间',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'replyTime',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '业务类型;',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'type',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return record.type == 0 ? '场地' : '课程';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '场地/地点',
|
|
|
+
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'address',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '发布单位',
|
|
|
+ align: 'center',
|
|
|
+ dataIndex: 'departName',
|
|
|
+ },
|
|
|
+];
|
|
|
+//查询数据
|
|
|
+export const searchFormSchema: FormSchema[] = [
|
|
|
+ {
|
|
|
+ label: '评分',
|
|
|
+ field: 'score',
|
|
|
+ component: 'Select',
|
|
|
+ componentProps: {
|
|
|
+ options: [
|
|
|
+ { label: '全部', value: '' },
|
|
|
+ { label: '1分', value: 1 },
|
|
|
+ { label: '2分', value: 2 },
|
|
|
+ { label: '3分', value: 3 },
|
|
|
+ { label: '4分', value: 4 },
|
|
|
+ { label: '5分', value: 5 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '审核状态',
|
|
|
+ field: 'checkStatus',
|
|
|
+ component: 'Select',
|
|
|
+ componentProps: {
|
|
|
+ options: [
|
|
|
+ { label: '全部', value: '' },
|
|
|
+ { label: '待审核', value: 0 },
|
|
|
+ { label: '通过', value: 1 },
|
|
|
+ { label: '不通过', value: 2 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '提交时间',
|
|
|
+ field: 'time',
|
|
|
+ component: 'RangePicker',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: ['开始时间', '结束时间'],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是否回复',
|
|
|
+ field: 'replyStatus',
|
|
|
+ component: 'Select',
|
|
|
+ componentProps: {
|
|
|
+ options: [
|
|
|
+ { label: '全部', value: '' },
|
|
|
+ { label: '未回复', value: 0 },
|
|
|
+ { label: '已回复', value: 1 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|
|
|
+//表单数据
|
|
|
+export const formSchema: FormSchema[] = [
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ field: 'userId',
|
|
|
+ component: 'Input',
|
|
|
+ colSlot: 'title1',
|
|
|
+ labelWidth: 0,
|
|
|
+ colProps: {
|
|
|
+ span: 28,
|
|
|
+ xs: 28,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ // TODO 主键隐藏字段,目前写死为ID
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ field: 'id',
|
|
|
+ component: 'Input',
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '用户昵称',
|
|
|
+ field: 'username',
|
|
|
+ required: true,
|
|
|
+ component: 'Input',
|
|
|
+ span: 12,
|
|
|
+ componentProps: {
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '评分',
|
|
|
+ field: 'score',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+
|
|
|
+ span: 12,
|
|
|
+ componentProps: {
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ render: ({ model, field }) => {
|
|
|
+ const viewList = [h('div', { class: 'mr-3' }, `${model[field]}.0`), h(Rate, { value: model[field], disabled: true })];
|
|
|
+ return h('div', { class: 'flex items-center' }, viewList);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '评价内容',
|
|
|
+ field: 'evaluateContent',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ span: 12,
|
|
|
+ componentProps: {
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '图片',
|
|
|
+ field: 'imageList',
|
|
|
+ component: 'Input',
|
|
|
+ span: 12,
|
|
|
+ required: true,
|
|
|
+
|
|
|
+ componentProps: {
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ render: ({ model, field }) => {
|
|
|
+ return h(
|
|
|
+ 'div',
|
|
|
+ { class: 'flex item-center justify-around' }, // 外层容器
|
|
|
+ model[field]?.map((img, idx) =>
|
|
|
+ h(Image, {
|
|
|
+ key: idx, // 重要:为循环项添加唯一 key
|
|
|
+ src: img,
|
|
|
+ width: 80,
|
|
|
+ rootClassName: 'mr-4',
|
|
|
+ })
|
|
|
+ )
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '提交时间',
|
|
|
+ field: 'createTime',
|
|
|
+ component: 'Input',
|
|
|
+ span: 12,
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '审核状态',
|
|
|
+ field: 'checkStatus',
|
|
|
+ component: 'Input',
|
|
|
+ span: 12,
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ render: ({ model, field }) => {
|
|
|
+ return arrTitle[model[field]];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '业务类型',
|
|
|
+ field: 'type',
|
|
|
+ component: 'Input',
|
|
|
+ span: 12,
|
|
|
+ required: true,
|
|
|
+ render: ({ model, field }) => {
|
|
|
+ return model[field] == 0 ? '场地' : '课程';
|
|
|
+ },
|
|
|
+ componentProps: {
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ field: '',
|
|
|
+ component: 'Input',
|
|
|
+ colSlot: 'title2',
|
|
|
+ labelWidth: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '回复',
|
|
|
+ field: 'replyContent',
|
|
|
+ component: 'InputTextArea',
|
|
|
+ span: 12,
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+/**
|
|
|
+ * 流程表单调用这个方法获取formSchema
|
|
|
+ * @param param
|
|
|
+ */
|
|
|
+export function getBpmFormSchema(_formData): FormSchema[] {
|
|
|
+ // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
|
|
+ return formSchema;
|
|
|
+}
|