Bladeren bron

clean up code

tanlie 1 maand geleden
bovenliggende
commit
f5e0a5e062

+ 0 - 153
wishing-admin/src/components/Chart/BarChart/BarChart.vue

@@ -1,153 +0,0 @@
-<template>
-  <!-- <el-empty v-if="isSeriesEmpty" description="暂无数据"></el-empty> -->
-  <div class="chart"></div>
-</template>
-
-<script>
-import * as Echarts from 'echarts';
-// import ResizeListener from 'element-resize-detector';
-import { isEmpty } from 'lodash';
-import { basicOption } from './defaultOption.js';
-import { pieChartColor } from '../color.js';
-
-export default {
-  name: 'PieChart',
-  props: {
-    // 正常的业务数据,对应echarts饼图配置中series[0].data
-    seriesData: {
-      type: Object,
-      required: true,
-      default: () => []
-    },
-    // 表示需要特殊定制的配置
-    // 一般UI会规定一个统一的设计规范(比如颜色,字体,图例格式,位置等)
-    // 但不排除某个图标会和设计规范不同,需要特殊定制样式,所以开放这个配置,增强灵活性
-    extraOption: {
-      type: Object,
-      default: () => ({})
-    }
-  },
-  data() {
-    return {
-      chart: null
-    };
-  },
-
-  computed: {
-    isSeriesEmpty() {
-      return isEmpty(this.seriesData) || this.seriesData.length <= 0;
-    }
-  },
-
-  // 监听数据变化,更新图表
-  watch: {
-    seriesData: {
-      deep: true,
-      handler() {
-        this.updateChartView();
-      }
-    }
-  },
-
-  mounted() {
-    this.chart = Echarts.init(this.$el);
-    this.chart.getZr().off('click');
-    this.chart.getZr().on('click', (params) => {
-      // 柱形图点击事件
-      var pointInPixel = [params.offsetX, params.offsetY];
-      // 判断给定的点是否在指定的坐标系
-      if (this.chart.containPixel('grid', pointInPixel)) {
-        const xIndex = this.chart.convertFromPixel({ seriesIndex: 0 }, [params.offsetX, params.offsetY])[0];
-        const option = this.chart.getOption();
-        const xAxis = option.xAxis;
-        const name = xAxis[0].data[xIndex];
-        this.$emit('xIndexClick', { name, xIndex });
-      }
-    });
-    this.updateChartView();
-    window.addEventListener('resize', this.handleWindowResize);
-    // this.addChartResizeListener();
-  },
-
-  beforeDestroy() {
-    window.removeEventListener('resize', this.handleWindowResize);
-  },
-
-  methods: {
-    /* 合并配置项和数据 */
-    assembleDataToOption() {
-      let series = [];
-      let legendData = [];
-      for (let i = 0; i < this.seriesData.series.length; i++) {
-        series.push({
-          type: 'bar',
-          barGap: 0,
-          emphasis: {
-            focus: 'series'
-          },
-          barWidth: 14, // 柱图宽度
-          ...this.seriesData.series[i]
-        });
-        legendData.push(this.seriesData.series[i].name);
-      }
-      let xAxis = this.extraOption.xAxis ? this.extraOption.xAxis : basicOption.xAxis;
-      if (this.seriesData.xAxisData.length > 0) xAxis[0].data = this.seriesData.xAxisData;
-      return {
-        ...basicOption,
-        color: pieChartColor,
-        legend: {
-          data: legendData,
-          show: true,
-          bottom: -5,
-          itemWidth: 10, // 标签宽度为20px
-          itemHeight: 10, // 标签高度为10px
-          textStyle: {
-            color: '#5E74A7' // Y轴内容文字颜色
-          }
-        },
-        xAxis,
-        series: series,
-        ...this.extraOption
-      };
-    },
-    /**
-     * 对chart元素尺寸进行监听,当发生变化时同步更新eChart视图
-     */
-    addChartResizeListener() {
-      const instance = ResizeListener({
-        strategy: 'scroll',
-        callOnAdd: true
-      });
-
-      instance.listenTo(this.$el, () => {
-        if (!this.chart) return;
-        this.chart.resize();
-      });
-    },
-
-    /**
-     * 更新eChart视图
-     */
-    updateChartView() {
-      if (!this.chart) return;
-      const fullOption = this.assembleDataToOption();
-      this.chart.setOption(fullOption, true);
-    },
-
-    /**
-     * 当窗口缩放时,eChart动态调整自身大小
-     */
-    handleWindowResize() {
-      if (!this.chart) return;
-      this.chart.resize();
-    }
-  }
-};
-</script>
-
-<style scoped="scoped" lang="scss">
-.chart {
-  width: 100%;
-  height: 100%;
-}
-</style>

+ 0 - 34
wishing-admin/src/components/Chart/BarChart/defaultOption.js

@@ -1,34 +0,0 @@
-export const basicOption = {
-  tooltip: {
-    trigger: 'axis'
-  },
-  yAxis: [
-    {
-      type: 'value'
-    }
-  ],
-  xAxis: [
-    {
-      type: 'category',
-      axisTick: { show: false },
-      axisLine: {
-        lineStyle: {
-          color: '#E1E4ED' // x轴轴线颜色
-        }
-      },
-      axisLabel: {
-        textStyle: {
-          fontSize: 12,
-          color: '#5E74A7'
-        },
-        interval: 0
-      }
-    }
-  ],
-  grid: {
-    top: '10px',
-    bottom: '45px',
-    right: '15px',
-    left: '40px'
-  }
-};

+ 0 - 26
wishing-admin/src/components/Chart/BarChart/index.vue

@@ -1,26 +0,0 @@
-<template>
-  <el-empty v-if="isSeriesEmpty" :image-size="80" description="暂无数据"></el-empty>
-  <bar-chart v-else v-bind="$props" @xIndexClick="xIndexClick" />
-</template>
-
-<script>
-import { isEmpty } from 'lodash';
-import BarChart from './BarChart.vue';
-
-export default {
-  name: 'EchartBar',
-  components: { BarChart },
-  props: BarChart.props,
-  computed: {
-    // 针对饼图数据是不是无效的判断
-    isSeriesEmpty() {
-      return isEmpty(this.seriesData);
-    }
-  },
-  methods: {
-    xIndexClick(params) {
-      this.$emit('xIndexClick', params);
-    }
-  }
-};
-</script>

+ 0 - 181
wishing-admin/src/components/Chart/LineChart/LineChart.vue

@@ -1,181 +0,0 @@
-<template>
-  <!-- <el-empty  description="暂无数据"></el-empty> -->
-  <div class="chart"></div>
-</template>
-
-<script>
-import * as Echarts from 'echarts';
-// import ResizeListener from 'element-resize-detector';
-import { isEmpty } from 'lodash';
-import { basicOption } from './defaultOption.js';
-import { pieChartColor } from '../color.js';
-import object from 'element-resize-detector/src/detection-strategy/object';
-
-export default {
-  name: 'LineChart',
-  props: {
-    // 正常的业务数据,对应echarts饼图配置中series[0].data
-    seriesData: {
-      type: object,
-      required: true,
-      default: () => []
-    },
-    // 表示需要特殊定制的配置
-    // 一般UI会规定一个统一的设计规范(比如颜色,字体,图例格式,位置等)
-    // 但不排除某个图标会和设计规范不同,需要特殊定制样式,所以开放这个配置,增强灵活性
-    extraOption: {
-      type: Object,
-      default: () => ({})
-    },
-    opacity: {
-      type: Number,
-      default: 1
-    }
-  },
-  data() {
-    return {
-      chart: null
-    };
-  },
-
-  computed: {
-    isSeriesEmpty() {
-      return isEmpty(this.seriesData) || this.seriesData.length <= 0;
-    }
-  },
-
-  // 监听数据变化,更新图表
-  watch: {
-    seriesData: {
-      deep: true,
-      handler() {
-        this.updateChartView();
-      }
-    }
-  },
-
-  mounted() {
-    this.chart = Echarts.init(this.$el);
-    this.updateChartView();
-    window.addEventListener('resize', this.handleWindowResize);
-    // this.addChartResizeListener();
-  },
-  beforeDestroy() {
-    window.removeEventListener('resize', this.handleWindowResize);
-  },
-
-  methods: {
-    /* 合并配置项和数据 */
-    assembleDataToOption() {
-      let series = [];
-      let legendData = [];
-      for (let i = 0; i < this.seriesData.series.length; i++) {
-        let areaStyle = {
-          color: new Echarts.graphic.LinearGradient(0, 1, 0, 0, [
-            {
-              offset: 0,
-              color: '#fff'
-            },
-            {
-              offset: 1,
-              color: this.hexToRgba(pieChartColor[i], 0.1)
-            }
-          ])
-        };
-        series.push({
-          smooth: true, // 是否平滑
-          showAllSymbol: true,
-          symbol: 'circle',
-          areaStyle,
-          axisLabel: {
-            interval: 0
-          },
-          ...this.seriesData.series[i]
-        });
-        legendData.push(this.seriesData.series[i].name);
-      }
-      if (this.extraOption.xAxis?.length > 0) {
-        for (let i = 0; i < this.extraOption.xAxis.length; i++) {
-          this.extraOption.xAxis[i].data = this.seriesData.xAxisData;
-        }
-      }
-      return {
-        color: pieChartColor,
-        legend: {
-          data: legendData
-        },
-        xAxis: [
-          {
-            type: 'category',
-            axisTick: { show: false },
-            axisLine: {
-              lineStyle: {
-                color: '#E1E4ED' // x轴轴线颜色
-              }
-            },
-            axisLabel: {
-              textStyle: {
-                color: '#5E74A7'
-              },
-              interval: 0
-            },
-            data: this.seriesData.xAxisData
-          }
-        ],
-        series: series,
-        ...basicOption,
-        ...this.extraOption
-      };
-    },
-
-    /**
-     * 对chart元素尺寸进行监听,当发生变化时同步更新eChart视图
-     */
-    addChartResizeListener() {
-      const instance = ResizeListener({
-        strategy: 'scroll',
-        callOnAdd: true
-      });
-
-      instance.listenTo(this.$el, () => {
-        if (!this.chart) return;
-        this.chart.resize();
-      });
-    },
-
-    /**
-     * 更新eChart视图
-     */
-    updateChartView() {
-      if (!this.chart) return;
-      const fullOption = this.assembleDataToOption();
-      this.chart.setOption(fullOption, true);
-    },
-
-    /**
-     * 当窗口缩放时,eChart动态调整自身大小
-     */
-    handleWindowResize() {
-      if (!this.chart) return;
-      this.chart.resize();
-    },
-    hexToRgba(bgColor, alpha = 1) {
-      let color = bgColor.slice(1); // 去掉'#'号
-      let rgba = [
-        parseInt('0x' + color.slice(0, 2)),
-        parseInt('0x' + color.slice(2, 4)),
-        parseInt('0x' + color.slice(4, 6)),
-        alpha
-      ];
-      return 'rgba(' + rgba.toString() + ')';
-    }
-  }
-};
-</script>
-
-<style scoped="scoped" lang="scss">
-.chart {
-  width: 100%;
-  height: 100%;
-}
-</style>

+ 0 - 26
wishing-admin/src/components/Chart/LineChart/defaultOption.js

@@ -1,26 +0,0 @@
-export const basicOption = {
-  tooltip: {
-    trigger: 'axis'
-  },
-  legend: {
-    show: true,
-    bottom: -5,
-    itemWidth: 15, // 标签宽度为20px
-    itemHeight: 10 // 标签高度为10px
-  },
-  yAxis: {
-    type: 'value',
-    axisLabel: {
-      // y轴文字的配置
-      textStyle: {
-        color: '#5E74A7' // Y轴内容文字颜色
-      }
-    }
-  },
-  grid: {
-    right: 10,
-    left: 30,
-    top: '5%',
-    bottom: 45
-  }
-};

+ 0 - 21
wishing-admin/src/components/Chart/LineChart/index.vue

@@ -1,21 +0,0 @@
-<template>
-  <el-empty v-if="isSeriesEmpty" :image-size="80" description="暂无数据"></el-empty>
-  <line-chart v-else v-bind="$props" />
-</template>
-
-<script>
-import { isEmpty } from 'lodash';
-import LineChart from './LineChart.vue';
-
-export default {
-  name: 'EchartLine',
-  components: { LineChart },
-  props: LineChart.props,
-  computed: {
-    // 针对饼图数据是不是无效的判断
-    isSeriesEmpty() {
-      return isEmpty(this.seriesData);
-    }
-  }
-};
-</script>

+ 0 - 114
wishing-admin/src/components/Chart/PieChart/PieChart.vue

@@ -1,114 +0,0 @@
-<template>
-  <div class="chart"></div>
-</template>
-
-<script>
-import * as Echarts from 'echarts';
-// import ResizeListener from 'element-resize-detector';
-import { merge, isEmpty } from 'lodash';
-import { basicOption } from './defaultOption.js';
-import { pieChartColor } from './../color.js';
-
-export default {
-  name: 'PieChart',
-  props: {
-    // 正常的业务数据,对应echarts饼图配置中series[0].data
-    seriesData: {
-      type: Array,
-      required: true,
-      default: () => []
-    },
-    // 表示需要特殊定制的配置
-    // 一般UI会规定一个统一的设计规范(比如颜色,字体,图例格式,位置等)
-    // 但不排除某个图标会和设计规范不同,需要特殊定制样式,所以开放这个配置,增强灵活性
-    extraOption: {
-      type: Object,
-      default: () => ({})
-    }
-  },
-  data() {
-    return {
-      chart: null
-    };
-  },
-
-  computed: {
-    isSeriesEmpty() {
-      return isEmpty(this.seriesData) || this.seriesData.every((item) => !item.value);
-    }
-  },
-
-  // 监听数据变化,更新图表
-  watch: {
-    seriesData: {
-      deep: true,
-      handler() {
-        this.updateChartView();
-      }
-    }
-  },
-
-  mounted() {
-    this.chart = Echarts.init(this.$el);
-    this.updateChartView();
-    window.addEventListener('resize', this.handleWindowResize);
-    // this.addChartResizeListener();
-  },
-  beforeDestroy() {
-    window.removeEventListener('resize', this.handleWindowResize);
-  },
-
-  methods: {
-    /* 合并配置项和数据 */
-    assembleDataToOption() {
-      return merge(
-        {},
-        basicOption,
-        { color: pieChartColor },
-        {
-          series: [{ data: this.seriesData }]
-        },
-        this.extraOption
-      );
-    },
-    /**
-     * 对chart元素尺寸进行监听,当发生变化时同步更新eChart视图
-     */
-    addChartResizeListener() {
-      const instance = ResizeListener({
-        strategy: 'scroll',
-        callOnAdd: true
-      });
-
-      instance.listenTo(this.$el, () => {
-        if (!this.chart) return;
-        this.chart.resize();
-      });
-    },
-
-    /**
-     * 更新eChart视图
-     */
-    updateChartView() {
-      if (!this.chart) return;
-      const fullOption = this.assembleDataToOption();
-      this.chart.setOption(fullOption, true);
-    },
-
-    /**
-     * 当窗口缩放时,eChart动态调整自身大小
-     */
-    handleWindowResize() {
-      if (!this.chart) return;
-      this.chart.resize();
-    }
-  }
-};
-</script>
-
-<style scoped="scoped" lang="scss">
-.chart {
-  width: 100%;
-  height: 100%;
-}
-</style>

+ 0 - 27
wishing-admin/src/components/Chart/PieChart/defaultOption.js

@@ -1,27 +0,0 @@
-export const basicOption = {
-  tooltip: {
-    trigger: 'item'
-  },
-  legend: {
-    orient: 'horizontal',
-    y: 'bottom', // 延Y轴居中
-    x: 'center', // 居右显示
-    itemWidth: 8,
-    itemHeight: 8,
-    itemGap: 12,
-    textStyle: {
-      color: '#9BA9C9',
-      fontSize: '12px'
-    }
-  },
-  series: [
-    {
-      type: 'pie',
-      radius: ['35%', '65%'],
-      label: {
-        show: true
-      },
-      center: ['50%', '50%']
-    }
-  ]
-};

+ 0 - 21
wishing-admin/src/components/Chart/PieChart/index.vue

@@ -1,21 +0,0 @@
-<template>
-  <el-empty :image-size="80" v-if="isSeriesEmpty" description="暂无数据"></el-empty>
-  <pie-chart v-else v-bind="$props" />
-</template>
-
-<script>
-import { isEmpty } from 'lodash';
-import PieChart from './PieChart.vue';
-
-export default {
-  name: 'EchartPie',
-  components: { PieChart },
-  props: PieChart.props,
-  computed: {
-    // 针对饼图数据是不是无效的判断
-    isSeriesEmpty() {
-      return isEmpty(this.seriesData);
-    }
-  }
-};
-</script>

+ 0 - 1
wishing-admin/src/components/Chart/color.js

@@ -1 +0,0 @@
-export const pieChartColor = ['#4A7DFC ', '#FF9972', '#ED6666', '#F6CA69', '#6DC7EC', '#7585A1'];

+ 0 - 3
wishing-admin/src/components/Chart/index.js

@@ -1,3 +0,0 @@
-export { default as PieChart } from './PieChart/PieChart.vue';
-export { default as BarChart } from './BarChart/BarChart.vue';
-export { default as LineChart } from './LineChart/LineChart.vue';

+ 0 - 155
wishing-admin/src/components/ImportPerson.vue

@@ -1,155 +0,0 @@
-<template>
-  <el-dialog :visible.sync='show' title='导入数据' @on-ok='submit' width='800px'>
-    <div>
-      <div style='display: flex; justify-content: flex-end'>
-        <el-button icon='ios-cloud-download-outline' type='default' @click='downloadTemplate'><i
-          class='el-icon-upload el-icon--left'></i>模板下载
-        </el-button>
-      </div>
-      <div style='display: flex; justify-content: center'>
-        <el-upload
-          ref='upload'
-          show-upload-list
-          :action='action'
-          :data='uploadParams'
-          :accept='upload.format'
-          :headers='upload.headers'
-          :on-success='handleSuccess'
-          :on-error='handleError'
-          :on-remove='handleRemove'
-        >
-          <div style='text-align: center'>
-            <el-button icon='ios-cloud-upload-outline' type='primary'><i class='el-icon-upload el-icon--left'></i>数据上传
-            </el-button>
-            <div style='color: #ff0000; margin-top: 10px'>
-              点击数据上传按钮导入模板(如没有模板,请点击右上角模板下载),上传成功后点击确定完成添加操作
-            </div>
-          </div>
-        </el-upload>
-      </div>
-      <div style='margin-top: 10px'>
-        <el-table :data='errorInfo' border>
-          <el-table-column
-            type='index'
-            label='序号'
-            width='80'>
-          </el-table-column>
-          <el-table-column
-            prop='msg'
-            label='出错信息'
-          >
-          </el-table-column>
-        </el-table>
-      </div>
-    </div>
-    <div slot='footer'>
-      <el-button type='primary' @click='submit'>
-        确认
-      </el-button>
-      <el-button @click='cancelFn'>取消</el-button>
-    </div>
-  </el-dialog>
-</template>
-
-<script>
-import { getStore } from '@utils/store';
-import { downloadPermissionExplain, permissionExplain } from '@api/api-common';
-import { download } from '@api/api';
-
-export default {
-  name: 'ImportPerson',
-  props: {
-    customAction: {
-      type: String,
-      default: null
-    },
-    sampleAddress: {
-      type: String,
-      default: null
-    },
-    params: {
-      type: Object,
-      default: () => {
-      }
-    }
-  },
-  data() {
-    return {
-      action: permissionExplain,
-      uploadParams: {},
-      show: false,
-      upload: {
-        format: 'xlsx',
-        headers: { Authorization: 'Bearer ' + getStore('accessToken') },
-        extraData: {},
-        maxSize: 10240
-      },
-      batchData: null,
-      isHaveFile: false,
-      errorHeader: [
-        { title: '序号', width: 80, type: 'index', align: 'center' },
-        { title: '校验出错信息', key: 'msg', align: 'left' }
-      ],
-      errorInfo: [],
-      successData: []
-    };
-  },
-  created() {
-    if (this.customAction) {
-      this.action = this.customAction;
-      this.uploadParams = this.params;
-    }
-  },
-  methods: {
-    open() {
-      this.show = true;
-      this.errorInfo = [];
-      this.successData = [];
-      this.$nextTick(() => {
-        this.$refs.upload.clearFiles();
-      });
-    },
-    handleSuccess(res, file) {
-      if (res.code === 200) {
-        this.errorInfo = res.data.fail.map((v, i) => {
-          return { msg: v };
-        });
-        this.successData = res.data.success || [];
-      } else {
-        this.$message.error(res.msg);
-      }
-    },
-    handleError(error) {
-      this.$message.error(error);
-      this.isHaveFile = false;
-    },
-
-    handleRemove(file, fileList) {
-      this.isHaveFile = false;
-      this.batchData = null;
-      this.$emit('input', this.isHaveFile);
-    },
-    downloadTemplate() {
-      if (this.sampleAddress) {
-        download({ url: this.sampleAddress });
-      } else {
-        downloadPermissionExplain();
-      }
-    },
-    submit() {
-      this.$emit('success', this.successData);
-      this.show = false;
-    },
-    cancelFn() {
-      this.show = false;
-      this.errorInfo = [];
-      this.successData = [];
-      this.$nextTick(() => {
-        this.$refs.upload.clearFiles();
-      });
-    }
-  }
-};
-</script>
-
-<style scoped></style>

+ 0 - 139
wishing-admin/src/components/editor.vue

@@ -1,139 +0,0 @@
-<template>
-  <div class="editor-wrapper">
-    <Toolbar class="editor-toolbar" :editor="editor" :defaultConfig="toolbarConfig" :mode="mode" />
-    <Editor
-      class="editor-main"
-      :defaultConfig="editorConfig"
-      v-model="content"
-      :mode="mode"
-      @onCreated="onCreated"
-      @onChange="onChange"
-    />
-  </div>
-</template>
-
-<script>
-import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
-import '@wangeditor/editor/dist/css/style.css';
-import { getStore } from '@utils/store';
-import { uuid } from '@utils/util';
-
-export default {
-  name: 'WEditor',
-  components: {
-    Editor,
-    Toolbar
-  },
-  props: {
-    value: {
-      type: String,
-      default: ''
-    },
-    readOnly: {
-      type: Boolean,
-      default: false
-    },
-    uploadConfig: {
-      type: Object,
-      default: null
-    }
-  },
-  watch: {
-    value(val) {
-      if (val) {
-        this.content = val;
-      }
-    },
-    readOnly(val) {
-      val ? this.editor.disable() : this.editor.enable();
-    }
-  },
-  mounted() {
-    this.content = this.value;
-  },
-  data() {
-    return {
-      content: '',
-      isDetail: false,
-      editor: null,
-      toolbarConfig: {
-        excludeKeys: ['group-video', 'insertImage', 'codeBlock', 'emotion']
-      },
-      editorConfig: {
-        readOnly: false,
-        placeholder: '请输入内容...',
-        MENU_CONF: {
-          uploadImage: this.uploadImageConfigFn(this.uploadConfig)
-        }
-      },
-      requestId: '',
-      timestamp: 0,
-      mode: 'default'
-    };
-  },
-  methods: {
-    uploadImageConfigFn(uploadConfig) {
-      let config = {
-        // 服务端地址
-        server: `${process.env.VUE_APP_API_PREFIX + this.uploadConfig.url || ''}`,
-        // 字段名
-        fieldName: 'file',
-        // 单个文件的最大体积限制,默认为 2M
-        maxFileSize: 10 * 1024 * 1024, // 10M
-        // 最多可上传几个文件,默认为 100
-        maxNumberOfFiles: 3,
-        // 选择文件时的类型限制,默认为 ['image/*'] 。如不想限制,则设置为 []
-        allowedFileTypes: ['image/*'],
-        // 自定义上传参数,例如传递验证的 token 等。参数会被添加到 formData 中,一起上传到服务端。
-        meta: uploadConfig.extraData || {},
-        headers: {
-          Authorization: 'Bearer ' + getStore('accessToken'),
-          'x-upload-type': uploadConfig.uploadType
-        },
-        // 超时时间,默认为 10 秒
-        timeout: 30 * 1000,
-        onBeforeUpload(files) {
-          config.headers['x-requestId'] = uuid();
-          config.headers['x-timestamp'] = new Date().getTime();
-          return files;
-        },
-        customInsert(res, insertFn) {
-          // 从 res 中找到 url alt href ,然后插入图片
-          let data = res.data;
-          let url = `${process.env.VUE_APP_API_PREFIX}/recruit-common/attachment/rich/${data.fileSpace}/${data.fileId}`;
-          insertFn(url, data.fileName);
-        }
-      };
-      return config;
-    },
-    onCreated(editor) {
-      let vm = this;
-      vm.editor = Object.seal(editor);
-      editor.setHtml(this.content);
-      this.readOnly ? this.editor.disable() : this.editor.enable();
-    },
-    onChange(editor) {
-      this.$emit('setText', this.content);
-    }
-  },
-  beforeDestroy() {
-    const editor = this.editor;
-    if (editor == null) return;
-    editor.destroy(); // 组件销毁时,及时销毁编辑器
-  }
-};
-</script>
-
-<style lang="less" scoped>
-.editor-wrapper * {
-  z-index: 100 !important;
-  border: 1px solid #ccc;
-}
-.editor-toolbar {
-  border-bottom: 1px solid #ccc;
-}
-.editor-main {
-  height: 450px;
-  overflow-y: hidden;
-}
-</style>

+ 0 - 62
wishing-admin/src/components/table-errors.vue

@@ -1,62 +0,0 @@
-<template>
-  <div>
-    <el-dialog :visible.sync="show" title="导入情况详情" width="800px" :close-on-click-modal="false" @close="closeFn">
-      <el-table ref="errorTable" stripe border :height="500" :data="data" tooltip-effect="dark">
-        <el-table-column type="index" label="序号" align="center" width="50" />
-        <el-table-column prop="errorPosition" label="错误位置" align="left" width="300" />
-        <el-table-column prop="errorMessage" label="错误信息" align="left" />
-      </el-table>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-export default {
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    data: {
-      type: Array,
-      default: () => {
-        return [];
-      }
-    }
-  },
-  data() {
-    return {
-      show: false,
-      columns: [
-        {
-          type: 'index',
-          width: 60,
-          align: 'center'
-        },
-        {
-          title: '错误位置',
-          width: 300,
-          key: 'errorPosition'
-        },
-        {
-          title: '错误信息',
-          tooltip: true,
-          key: 'errorMessage'
-        }
-      ]
-    };
-  },
-  methods: {
-    closeFn() {
-      this.$emit('closeErrorFn', false);
-    }
-  },
-  watch: {
-    visible(val) {
-      this.show = val;
-    }
-  }
-};
-</script>
-
-<style></style>

+ 0 - 136
wishing-admin/src/components/upload-file.vue

@@ -1,136 +0,0 @@
-<template>
-  <div>
-    <el-upload
-      ref="upload"
-      list-type="text"
-      v-bind="upload"
-      :disabled="disabled"
-      :class="['uploader', uploadDisabled ? 'disabled' : '']"
-      :on-success="handleSuccess"
-      :on-error="handleError"
-      :on-remove="handleRemove"
-      :on-preview="handlePreview"
-      :before-remove="handleBeforeRemove"
-      :before-upload="handleBeforeUpload"
-    >
-      <el-button size="small" type="primary" :disabled="uploadDisabled">
-        {{ uploadDisabled ? '上传数量已达上制' : '上传文件' }} <i class="el-icon-upload el-icon--right"></i
-      ></el-button>
-    </el-upload>
-  </div>
-</template>
-
-<script>
-import { getStore } from '@utils/store';
-import { uuid } from '@utils/util';
-import { removeAttachment } from '@api/api-login';
-
-export default {
-  name: 'uploadPic',
-  props: {
-    disabled: {
-      type: Boolean,
-      default: false
-    },
-    uploadParams: {
-      type: Object,
-      default: () => {
-        return {};
-      }
-    }
-  },
-  computed: {
-    uploadDisabled() {
-      return this.files.length >= this.upload.limit;
-    }
-  },
-  data() {
-    return {
-      files: [],
-      upload: {
-        action: `${process.env.VUE_APP_API_PREFIX + this.uploadParams.url || ''}`,
-        headers: {
-          Authorization: 'Bearer ' + getStore('accessToken'),
-          'x-upload-type': this.uploadParams.uploadType
-        },
-        data: this.uploadParams.data || {},
-        name: this.uploadParams.name || 'file',
-        fileList: this.uploadParams.fileList || [],
-        limit: this.uploadParams.limit || 1,
-        accept: this.uploadParams.accept || ''
-      }
-    };
-  },
-  watch: {
-    uploadParams(val) {
-      this.files = [];
-      this.upload.fileList = [];
-      if (val?.fileList.length > 0) {
-        this.files.push(...val.fileList);
-        this.upload.fileList = val.fileList;
-      }
-    }
-  },
-  methods: {
-    handleBeforeUpload(file) {
-      let vm = this;
-      vm.upload.headers['x-requestId'] = uuid();
-      vm.upload.headers['x-timestamp'] = new Date().getTime();
-    },
-    handleSuccess(res, file, fileList) {
-      let params = {
-        id: res.data.id,
-        name: res.data.name,
-        url: res.data.url,
-        virtualName: res.data.virtualName
-      };
-      this.files.push(params);
-      this.$emit('uploadFiles', this.files);
-    },
-    handleError(e, file, fileList) {
-      this.$message.error(JSON.parse(e.message).data);
-    },
-    handleRemove(file, fileList) {
-      let params = {
-        id: file.id || file.response.data.id
-      };
-      removeAttachment(params, { 'x-upload-type': this.uploadParams.uploadType }).then(() => {
-        this.files = this.files.filter((o) => o.id !== params.id);
-        this.$emit('uploadFiles', this.files);
-      });
-    },
-    handleBeforeRemove(file, fileList) {
-      return this.$confirm(`此操作将删除${file.name}, 是否继续?`, '提示', { type: 'warning' });
-    },
-    handlePreview(file) {
-      if (!file) return this.$message.error('无法获取文件信息,无法下载');
-      const url = file.url; // 文件的 URL 地址
-      const link = document.createElement('a');
-      link.href = url;
-      link.setAttribute('download', file.name); // 设置文件属性为下载
-      link.setAttribute('target', '_blank');
-      document.body.appendChild(link); // 将元素插入到 DOM 中
-      link.click(); // 模拟点击下载链接进行下载
-      document.body.removeChild(link); // 下载完成后移除元素
-    }
-  },
-  created() {
-    // this.files = [];
-    // this.files.push(...this.upload.fileList);
-  }
-};
-</script>
-
-<style lang="less">
-.uploader .el-upload:hover {
-  border-color: #409eff;
-}
-.disabled .el-upload--picture-card {
-  display: none;
-}
-
-.el-upload-list--picture-card .el-upload-list__item {
-  width: 187px;
-  height: 187px;
-}
-</style>