guhongwei %!s(int64=4) %!d(string=hai) anos
pai
achega
abab548478

+ 0 - 50
src/components/frame/filter-page-table.md

@@ -1,50 +0,0 @@
-## filter-page-table.vue
-#### prop
-|参数|类型|默认值|是否必填|说明|
-|:-:|:-:|:-:|:-:|:-:|
-|fields|Array|`-`|是|字段列表(下文会说明如何使用)|
-|data|Array|`-`|是|数据列表|
-|opera|Array|[ ]|否|操作列的列表(下文会说明如何使用)|
-|toFormat|Function|`-`|否|如果fields中的format不是function类型,则会走toFormat的方法,需要自己写过滤规则,多个的情况需要区分|
-|select|Boolean|false|否|需要选择就变成true|
-|total|NUmber|0|否|分页的总数据|
-|usePage|Boolean|true|否|是否使用分页|
-|options|Object|null|否|加些属性,不知道能加啥,反正我把合计加上好使了|
-|useSum|Boolean|false|否|使用合计|
-|filter|Array|`[]`|否|额外查询|
-|operaWidth|Number|200|否|操作栏宽度|
-
->fields
->>
-|参数|类型|默认值|是否必填|说明|
-|:-:|:-:|:-:|:-:|:-:|
-|label|String|`-`|是|列名称|
-|prop|String|`-`|是|字段名称|
-|format|Function/String|`-`|否|Function类型:数据需要过滤则将过滤方法写在这;String类型:走toFormat方法,参数位(model=>字段名,value=>值)|
-|custom|Boolean|false|否|自定义输出|
-|options|Object|`-`|否|添加额外属性,比如说样式之类的|
-|filter|String|`-`|否|如果填写,则这个字段会查询,这里只填写类型,input/select,select的选项在options插槽中使用|
-|selected|Array|`-`|false|多选选项的数据|
-|showTip|Boolean|false|否|是否使用tooltip显示过长内容|
-|filterReturn|Boolean|`-`|否|针对这个选项需要在选择后就做些逻辑处理时,改成true,然后再使用filterReturn方法处理,(例如二级联动的情况)|
-|notable|Boolean|false/undefined|否|不需要在表格中显示|
-|selected|Array|`-`|false|多选选项的数据|
-
->opera
->>
-|参数|类型|默认值|是否必填|说明|
-|:-:|:-:|:-:|:-:|:-:|
-|label|String|`-`|是|操作按钮提示文字|
-|icon|String|`-`|否|图标|
-|method|String|`-`|是|此按钮连接的父级方法($emit)|
-|confirm|Boolean|`-`|否|是否需要确认提示|
-|methodZh|String/Function|label|否|确认提示的操作文字,1,Function参数为这条数据,自己随意组合;2,String为纯自定义字符串,需要自己写整个提示语;3,默认,使用label字段提示|
-|display|Function|`-`|否|控制按钮是否显示(目前为简单版,只是根据此条数据中的内容判断,以后要是有需求会修改成toFormat的形式)|
-
->methods
->>
-|方法名|参数|说明|
-|:-:|:-:|:-:|
-|handleSelect|Array[object]|返回选择的内容|
-|query|{skip,limit,...info}|分页查询,及条件查询|
-|filterReturn|{data,prop}|查询条件栏过滤条件中filterReturn字段为true的回调方法|

+ 0 - 299
src/components/frame/filter-page-table.vue

@@ -1,299 +0,0 @@
-<template>
-  <div id="data-table">
-    <el-form :model="searchInfo" :inline="true" style="padding:0.9rem 1.875rem ;" size="mini" v-if="useFilter">
-      <el-form-item v-for="(item, index) in filterList" :key="index">
-        <template v-if="item.filter === 'select'">
-          <el-select
-            v-model="searchInfo[item.prop]"
-            size="mini"
-            clearable
-            filterable
-            :placeholder="`请选择${item.label}`"
-            @clear="toClear(item.prop)"
-            @change="data => filterReturn(data, item)"
-          >
-            <slot name="options" v-bind="{ item }"></slot>
-          </el-select>
-        </template>
-        <template v-else-if="item.filter === 'date'">
-          <el-date-picker
-            v-model="searchInfo[item.prop]"
-            value-format="yyyy-MM-dd"
-            format="yyyy-MM-dd"
-            type="daterange"
-            range-separator="-"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-            clearable
-          >
-          </el-date-picker>
-        </template>
-        <template v-else>
-          <el-input v-model="searchInfo[item.prop]" clearable size="mini" :placeholder="`请输入${item.label}`" @clear="toClear(item.prop)"></el-input>
-        </template>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" size="mini" @click="filterSearch">查询</el-button>
-      </el-form-item>
-    </el-form>
-    <el-table
-      ref="table"
-      row-key="id"
-      :data="data"
-      border
-      stripe
-      size="mini"
-      :max-height="height !== null ? height : ''"
-      @select="handleSelectionChange"
-      @select-all="handleSelectAll"
-      v-bind="options"
-      :show-summary="useSum"
-      @row-click="rowClick"
-    >
-      <el-table-column type="selection" width="55" v-if="select" prop="id" :reserve-selection="true"> </el-table-column>
-      <template v-for="(item, index) in fields">
-        <template v-if="!item.notable">
-          <template v-if="item.custom">
-            <el-table-column :key="index" align="center" :label="item.label" v-bind="item.options">
-              <template v-slot="{ row }">
-                <slot name="custom" v-bind="{ item, row }"></slot>
-              </template>
-            </el-table-column>
-          </template>
-          <template v-else>
-            <el-table-column
-              :key="index"
-              align="center"
-              :label="item.label"
-              :prop="item.prop"
-              :formatter="toFormatter"
-              sortable
-              v-bind="item.options"
-              :show-overflow-tooltip="item.showTip"
-            >
-            </el-table-column>
-          </template>
-        </template>
-      </template>
-      <template v-if="opera.length > 0">
-        <el-table-column label="操作" align="center" :width="operaWidth">
-          <template v-slot="{ row, $index }">
-            <template v-for="(item, index) in opera">
-              <template v-if="display(item, row)">
-                <el-tooltip v-if="item.icon" :key="index" effect="dark" :content="item.label" placement="bottom">
-                  <el-button
-                    :key="index"
-                    type="text"
-                    :icon="item.icon || ''"
-                    size="mini"
-                    @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
-                  ></el-button>
-                </el-tooltip>
-                <el-button v-else :key="index" type="text" size="mini" @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)">
-                  {{ item.label }}
-                </el-button>
-              </template>
-            </template>
-          </template>
-        </el-table-column>
-      </template>
-    </el-table>
-    <el-row type="flex" align="middle" justify="end" style="padding-top:1rem" v-if="usePage">
-      <el-col :span="24" style="text-align:right;">
-        <el-pagination
-          background
-          layout="total, prev, pager, next"
-          :page-sizes="[10, 15, 20, 50, 100]"
-          :total="total"
-          :page-size="limit"
-          :current-page.sync="currentPage"
-          @current-change="changePage"
-          @size-change="sizeChange"
-        >
-        </el-pagination>
-        <!-- sizes -->
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import _ from 'lodash';
-export default {
-  name: 'data-table',
-  props: {
-    fields: { type: Array, required: true },
-    data: { type: Array, required: true },
-    opera: { type: Array, default: () => [] },
-    toFormat: null,
-    height: null,
-    select: { type: Boolean, default: false },
-    selected: { type: Array, default: () => [] },
-    usePage: { type: Boolean, default: true },
-    total: { type: Number, default: 0 },
-    options: null,
-    useSum: { type: Boolean, default: false },
-    filter: { type: Array, default: () => [] },
-    operaWidth: { type: Number, default: 200 },
-  },
-  components: {},
-  data: () => ({
-    pageSelected: [],
-    currentPage: 1,
-    limit: _.get(this, `$limit`, undefined) !== undefined ? this.$limit : process.env.VUE_APP_LIMIT * 1 || 10,
-    searchInfo: {},
-    useFilter: true,
-    filterList: [],
-  }),
-  created() {},
-  computed: {},
-  methods: {
-    toFormatter(row, column, cellValue, index) {
-      let this_fields = this.fields.filter(fil => fil.prop === column.property);
-      if (this_fields.length > 0) {
-        let format = _.get(this_fields[0], `format`, false);
-        if (format) {
-          let res;
-          if (_.isFunction(format)) {
-            res = format(cellValue);
-          } else {
-            res = this.toFormat({
-              model: this_fields[0].prop,
-              value: cellValue,
-            });
-          }
-          return res;
-        } else return cellValue;
-      }
-    },
-    handleOpera(data, method, confirm = false, methodZh, label, index) {
-      let self = true;
-      if (_.isFunction(methodZh)) {
-        methodZh = methodZh(data);
-      } else if (!_.isString(methodZh)) {
-        methodZh = label;
-        self = false;
-      }
-      if (confirm) {
-        this.$confirm(self ? methodZh : `您确认${methodZh}该数据?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning',
-        })
-          .then(() => {
-            this.$emit(method, { data, index });
-          })
-          .catch(() => {});
-      } else {
-        this.$emit(method, { data, index });
-      }
-    },
-    handleSelectionChange(selection, row) {
-      // console.log(selection);
-      // console.log(row);
-      //根据row是否再pageSelected中,判断是添加还是删除
-      let res = [];
-      if (this.pageSelected.find(i => i.id === row.id)) {
-        res = this.pageSelected.filter(f => f.id !== row.id);
-      } else {
-        this.pageSelected.push(row);
-        res = this.pageSelected;
-      }
-      this.$set(this, `pageSelected`, res);
-      this.$emit(`handleSelect`, _.uniqBy(res, 'id'));
-    },
-    handleSelectAll(selection) {
-      //处于没全选状态,选择之后一定是全选,只有处于全选状态时,才会反选(全取消)
-      // console.log(selection);
-      let res = [];
-      if (selection.length > 0) {
-        //全选
-        res = _.uniqBy(this.pageSelected.concat(selection), 'id');
-      } else {
-        //全取消
-        res = _.differenceBy(this.pageSelected, this.data, 'id');
-      }
-      this.$set(this, `pageSelected`, res);
-      this.$emit(`handleSelect`, res);
-    },
-    initSelection() {
-      this.$nextTick(() => {
-        this.$refs.table.clearSelection();
-        this.selected.forEach(info => {
-          let d = this.data.filter(p => p.id === info.id);
-          if (d.length > 0) this.$refs.table.toggleRowSelection(d[0]);
-        });
-      });
-    },
-    selectReset() {
-      this.$refs.table.clearSelection();
-    },
-    display(item, row) {
-      let display = _.get(item, `display`, true);
-      if (display === true) return true;
-      else {
-        let res = display(row);
-        return res;
-      }
-    },
-    //
-    changePage(page = this.currentPage) {
-      this.$emit('query', { skip: (page - 1) * this.limit, limit: this.limit, ...this.searchInfo });
-    },
-    sizeChange(limit) {
-      this.limit = limit;
-      this.currentPage = 1;
-      this.$emit('query', { skip: 0, limit: this.limit, ...this.searchInfo });
-    },
-    getFilterList() {
-      let res = this.fields.filter(f => _.get(f, 'filter', false));
-      this.$set(this, `useFilter`, res.length > 0);
-      res.map(i => {
-        if (i.filter === 'date' && this.searchInfo[i.porp] === undefined) this.$set(this.searchInfo, i.prop, []);
-      });
-      res = [...res, ...this.filter];
-      this.$set(this, `filterList`, res);
-    },
-    filterSearch() {
-      this.currentPage = 1;
-      this.$emit('query', { skip: 0, limit: this.limit, ...this.searchInfo });
-    },
-    rowClick(row, column, event) {
-      this.$emit(`rowClick`, row);
-    },
-    toClear(prop) {
-      delete this.searchInfo[prop];
-    },
-    filterReturn(data, item) {
-      let { prop, filterReturn } = item;
-      if (filterReturn) this.$emit('filterReturn', { data, prop });
-    },
-  },
-  watch: {
-    selected: {
-      handler(val) {
-        if (val.length > 0) {
-          this.pageSelected = val;
-          this.initSelection();
-        }
-      },
-      immediate: true,
-    },
-    data: {
-      handler(val, oval) {
-        if (this.select) {
-          this.initSelection();
-        }
-      },
-    },
-    fields: {
-      handler(val, oval) {
-        if (val) this.getFilterList();
-      },
-      immediate: true,
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped></style>

+ 0 - 82
src/components/frame/form.md

@@ -1,82 +0,0 @@
-# 组件说明文档
-### form.vue
-### props
-
-|参数|类型|默认值|是否必填|说明|
-|:-:|:-:|:-:|:-:|:-:|
-|fields|Array|`-`|是|字段相关都在这里,用来自动输出,详情见下面|
-|submitText|String|`保存`|否|默认保存按钮的文字|
-|rules|Object|`-`|否|校验规则,不会找el-form的例子,不过使用的async-validator这个依赖为基础,会写这个也可以~~(那就厉害了,反正我是不行)~~|
-|isNew|Boolean|`-`|是|修改还是添加的提示|
-|data|Object|`-`|否|修改传来的数据|
-|needSave|Boolean|false|否|是否禁用保存按钮|
-|useEnter|Boolean|true|否|使用回车提交|
-|reset|Boolean|true|否|提交后是否重置表单|
-
-
-### fields
->Array类型 必填
->>
-|参数|类型|默认值|是否必填|说明|
-|:-:|:-:|:-:|:-:|:-:|
-|label|String|`-`|是|显示的字段中文|
-|type|String|input|否|这个字段要用什么类型来输出 input的基本类型可选值:date,datetime,radio,checkbox,select,text(只显示值),editor(富文本编辑器),password|
-|required|Boolean|`-`|否|是否必须输入|
-|model|String|`-`|是|字段名|
-|placeholder|String|`-`|否|占位,正常用,只是个透传|
-|options|object|`-`|否|标签的属性设置,例如:textarea 需要显示剩余字数,或者input限制长度,都往这里写,key-value形式(键值对,json的基本了解,不知道百度,具体属性看你具体用那个组件,那个组件有什么属性,瞎写不一定好使)|
-|custom|Boolean|`-`|否|是否使用自定义插槽|
-|tip|String|`-`|否|提示语,例如:请输入11位电话号码|
-|labelWidth|String|`120px`|否|表单label宽度,element的,默认120px|
-|format|Function|`-`|否|当type = text 时需要将该字段内容转换,可以使用format|
-
-
-
-
-
-
-
-### slot
->
-|插槽名|说明|
-|:-:|:-:|
-|options|fields中type为select的,选项都写在这个插槽中,多个select则需要区分options所属问题|
-|radios|fields中type为radio的,选项都写在这个插槽中,多个radio则需要区分radios所属问题|
-|checkbox|fields中type为checkbox的,选项都写在这个插槽中,多个checkbox则需要区分checkboxs所属问题|
-|custom|自定义插槽,完全自己去写|
-|submit|提交按钮部分,当needSave为false时才可以使用|
->>关于自定义的用法:
->>在fields中,custom:true的情况即需要自定义,写法如下
-
->>`<template #custom="{ item, form, fieldChange }"> ... </template>`
->>
-|参数名|说明|
-|:-:|:-:|
-|item|fields循环出来的每一项|
-|form|组件内部的表单|
-|fieldChange|组件内部的修改方法,此方法不一定必须使用,看情况来;参数:{model:xxx,value:XXX}(model:字段名,value:值)|
->>在使用时,此插槽内的v-model可以写成form[item.model],也可以写成form.字段名
-
->>例如`<el-input v-model="form[item.model]">`或者`<el-input v-model="form.xxx">`
-
->> **如果有多处需要自定义,请区分开去写**
-
-
-***
-### upload
-|参数|类型|默认值|是否必填|说明|
-|:-:|:-:|:-:|:-:|:-:|
-|url|String|`-`|是|上传地址|
-|limit|Number|`-`|是|限制上传数量|
-|data|any|`-`|否|上传数据|
-|type|String|`-`|否|上传返回的字段|
-|isBtn|Boolean|false|否|是否只显示按钮|
-|showList|Boolean|true|否|是否显示上传列表|
-|accept|String|`-`|否|可以上传的文件类型,不写就没限制|
-|tip|String|`-`|否|提示信息|
-|listType|String|picture-card|否|上传文件列表显示类型|
-
->### method
->|方法名|返回参数|说明|
-|:-:|:-:|:-:|
-|upload|{type,data}|上传成功返回

+ 0 - 211
src/components/frame/form.vue

@@ -1,211 +0,0 @@
-<template>
-  <div id="add">
-    <el-form
-      ref="form"
-      :model="form"
-      :rules="rules"
-      :label-width="labelWidth"
-      class="form"
-      size="small"
-      @submit.native.prevent
-      :style="styles"
-      :inline="inline"
-    >
-      <template v-for="(item, index) in fields">
-        <template v-if="!loading">
-          <el-form-item v-if="display(item)" :key="'form-field-' + index" :label="getField('label', item)" :prop="item.model" :required="item.required">
-            <template v-if="!item.custom">
-              <template v-if="item.type !== 'text'">
-                <el-tooltip class="item" effect="dark" :content="item.tip" placement="top-start" :disabled="!item.tip">
-                  <template v-if="item.type === `date` || item.type === `datetime`">
-                    <el-date-picker
-                      v-model="form[item.model]"
-                      :type="item.type"
-                      placeholder="选择择"
-                      format="yyyy-MM-dd"
-                      value-format="yyyy-MM-dd"
-                      v-bind="item.options"
-                    >
-                    </el-date-picker>
-                  </template>
-                  <template v-else-if="item.type === `year` || item.type === `week` || item.type === `day`">
-                    <el-date-picker
-                      v-model="form[item.model]"
-                      :type="item.type"
-                      placeholder="选择择"
-                      :format="`${item.type === 'year' ? 'yyyy' : item.type === 'week' ? 'MM' : 'dd'}`"
-                      :value-format="`${item.type === 'year' ? 'yyyy' : item.type === 'week' ? 'MM' : 'dd'}`"
-                      v-bind="item.options"
-                    >
-                    </el-date-picker>
-                  </template>
-                  <template v-else-if="item.type === 'time'">
-                    <el-time-picker v-model="form[item.model]" placeholder="请选择时间" format="HH:mm" value-format="HH:mm"></el-time-picker>
-                  </template>
-                  <template v-else-if="item.type === 'radio'">
-                    <el-radio-group v-model="form[item.model]" size="mini" v-bind="item.options">
-                      <slot name="radios" v-bind="{ item, form, fieldChange }"></slot>
-                    </el-radio-group>
-                  </template>
-                  <template v-else-if="item.type === 'checkbox'">
-                    <el-checkbox-group v-model="form[item.model]" v-bind="item.options">
-                      <slot name="checkboxs" v-bind="{ item, form, fieldChange }"></slot>
-                    </el-checkbox-group>
-                  </template>
-                  <template v-else-if="item.type === 'select'">
-                    <el-select v-model="form[item.model]" v-bind="item.options" filterable clearable>
-                      <slot name="options" v-bind="{ item, form, fieldChange }"></slot>
-                    </el-select>
-                  </template>
-                  <template v-else-if="item.type === 'textarea'">
-                    <el-input clearable v-model="form[item.model]" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }"></el-input>
-                  </template>
-                  <template v-else-if="item.type === 'editor'">
-                    <wang-editor v-model="form[item.model]"></wang-editor>
-                  </template>
-                  <template v-else>
-                    <el-input
-                      clearable
-                      v-model="form[item.model]"
-                      :type="getField('type', item)"
-                      :placeholder="getField('placeholder', item)"
-                      :show-password="getField('type', item) === 'password'"
-                      v-bind="item.options"
-                    ></el-input>
-                  </template>
-                </el-tooltip>
-              </template>
-              <template v-else>
-                <template v-if="item.format">
-                  {{ item.format(form[item.model]) }}
-                </template>
-                <template v-else>
-                  {{ form[item.model] }}
-                </template>
-              </template>
-            </template>
-            <template v-else>
-              <slot name="custom" v-bind="{ item, form, fieldChange }"></slot>
-            </template>
-          </el-form-item>
-        </template>
-      </template>
-      <el-form-item label="" v-if="needSave" class="btn">
-        <el-row type="flex" align="middle" justify="start">
-          <el-col :span="6">
-            <el-button type="primary" @click="save">{{ submitText }}</el-button>
-          </el-col>
-        </el-row>
-      </el-form-item>
-      <el-form-item v-else>
-        <slot name="submit"></slot>
-      </el-form-item>
-    </el-form>
-  </div>
-</template>
-
-<script>
-import _ from 'lodash';
-import wangEditor from '@/components/frame/wang-editor.vue';
-export default {
-  name: 'add',
-  props: {
-    fields: { type: Array, default: () => [] },
-    rules: { type: Object, default: () => {} },
-    isNew: { type: Boolean, default: true },
-    data: null,
-    styles: { type: Object, default: () => {} },
-    needSave: { type: Boolean, default: true },
-    labelWidth: { type: String, default: '120px' },
-    useEnter: { type: Boolean, default: true },
-    submitText: { type: String, default: '保存' },
-    inline: { type: Boolean, default: false },
-    reset: { type: Boolean, default: true },
-  },
-  components: {
-    wangEditor,
-  },
-  data: () => ({
-    form: {},
-    show: false,
-    dateShow: false,
-    loading: true,
-  }),
-  created() {
-    if (this.useEnter) {
-      document.onkeydown = () => {
-        let key = window.event.keyCode;
-        if (key == 13) {
-          this.save();
-        }
-      };
-    }
-  },
-  computed: {},
-  mounted() {},
-  watch: {
-    fields: {
-      handler(val) {
-        this.checkType();
-      },
-      immediate: true,
-    },
-    data: {
-      handler(val) {
-        this.loading = true;
-        if (val) this.$set(this, `form`, this.data);
-        this.loading = false;
-      },
-      immediate: true,
-      deep: true,
-    },
-  },
-  methods: {
-    getField(item, data) {
-      let res = _.get(data, item, null);
-      if (item === 'type') res = res === null ? `text` : res;
-      if (item === 'placeholder') res = res === null ? `请输入${data.label}` : res;
-      if (item === 'required') res = res === null ? false : res;
-      if (item === `error`) res = res === null ? `${data.label}错误` : res;
-      return res;
-    },
-    save() {
-      this.$refs['form'].validate(valid => {
-        if (valid) {
-          this.$emit(`save`, { isNew: this.isNew, data: JSON.parse(JSON.stringify(this.form)) });
-          if (this.reset) this.$refs.form.resetFields();
-        } else {
-          console.warn('form validate error!!!');
-        }
-      });
-    },
-    fieldChange({ model, value }) {
-      this.$set(this.form, model, value);
-    },
-    checkType() {
-      let arr = this.fields.filter(fil => fil.type === 'checkbox');
-      if (arr.length > 0 && this.isNew) {
-        for (const item of arr) {
-          this.$set(this.form, `${item.model}`, []);
-        }
-      }
-    },
-    display(field) {
-      let dis = _.get(field, `display`);
-      if (!_.isFunction(dis)) return true;
-      else return dis(field, this.form);
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.form {
-  padding: 2rem 1rem;
-  background: #fff;
-  border-radius: 20px;
-}
-// /deep/.btn .el-form-item__content {
-//   margin-left: 0 !important;
-// }
-</style>

+ 0 - 11
src/components/frame/pagination.md

@@ -1,11 +0,0 @@
-# pagination.vue 分页组件
-#### props
-|参数|类型|默认值|是否必填|说明|
-|:-:|:-:|:-:|:-:|:-:|
-|position|String|'right'|否|组件的布局位置,默认为靠右侧|
-|total|Number|0|是|分页的总数据数,用来计算页码|
-|limit|Number|10|否|每页的数量|  
-#### methods
-|方法名|参数|说明|
-|:-:|:-:|:-:|
-|query|{skip,limit,...info}|分页查询|

+ 0 - 51
src/components/frame/pagination.vue

@@ -1,51 +0,0 @@
-<template>
-  <div id="pagination">
-    <el-row type="flex" align="middle" style="padding-top:1rem">
-      <el-col :span="24" :style="`text-align:${position};`">
-        <el-pagination
-          background
-          layout=" total, prev, pager, next"
-          :total="total"
-          :page-size="limit"
-          :current-page.sync="currentPage"
-          @current-change="changePage"
-        >
-        </el-pagination>
-        <!-- 
-          :page-sizes="[5, 10, 15, 20, 50, 100]"
-          @size-change="sizeChange"
-         -->
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import _ from 'lodash';
-export default {
-  name: 'pagination',
-  props: {
-    position: { type: String, default: 'right' },
-    total: { type: Number, default: 0 },
-    limit: { type: Number, default: 10 },
-  },
-  components: {},
-  data: () => {
-    return {
-      currentPage: 1,
-    };
-  },
-  created() {},
-  methods: {
-    changePage(page) {
-      this.$emit('query', { skip: (page - 1) * this.limit, limit: this.limit });
-    },
-    sizeChange(limit) {
-      this.limit = limit;
-      this.$emit('query', { skip: 0, limit: this.limit });
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped></style>

+ 0 - 54
src/components/frame/qrcode.vue

@@ -1,54 +0,0 @@
-<template>
-  <div id="qrcode">
-    <img :src="dataUrl" />
-  </div>
-</template>
-
-<script>
-import Vue from 'vue';
-import QRCode from 'qrcode';
-export default {
-  name: 'qrcode',
-  props: {
-    qrcode: null,
-  },
-  components: {},
-  data: () => ({
-    dataUrl: null,
-    token: null,
-  }),
-  async mounted() {
-    await this.initQrcode();
-  },
-  created() {},
-  computed: {},
-  methods: {
-    async initQrcode() {
-      // 创建二维码
-      if (!this.qrcode) return;
-      let uri = `${Vue.config.weixin.baseUrl}/qrcode/${this.qrcode}/scan`;
-      if (uri.startsWith('/')) {
-        uri = `${location.protocol}//${location.host}${uri}`;
-      }
-      this.dataUrl = await QRCode.toDataURL(uri);
-      this.$stomp({
-        [`/exchange/qrcode.login/${this.qrcode}`]: this.onMessage,
-      });
-    },
-    onMessage(message) {
-      console.log('receive a message: ', message.body);
-      if (message.body == 'scaned') {
-        try {
-          this.$emit('toReturn', message);
-          console.log('扫码登录成功');
-        } catch (err) {
-          console.log('扫码登录失败');
-          console.error(err);
-        }
-      }
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped></style>

+ 0 - 106
src/components/frame/uploadone.vue

@@ -1,106 +0,0 @@
-<template>
-  <div id="upload">
-    <el-upload
-      v-if="url"
-      ref="upload"
-      :action="url"
-      :list-type="listType"
-      :file-list="fileList"
-      :limit="limit"
-      :on-exceed="outLimit"
-      :before-remove="handleRemove"
-      :on-success="onSuccess"
-      :before-upload="beforeUpload"
-      :show-file-list="showList"
-      :accept="accept"
-    >
-      <el-button size="small" type="primary" v-if="isBtn">点击上传</el-button>
-      <template v-else-if="uploadBtn">
-        <el-button type="primary">选择文件</el-button>
-      </template>
-      <template v-else>
-        <i class="el-icon-plus"></i>
-      </template>
-      <template #tip v-if="tip">
-        {{ tip }}
-      </template>
-    </el-upload>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'upload',
-  props: {
-    url: { type: null },
-    limit: { type: Number },
-    data: { type: null },
-    type: { type: String },
-    isBtn: { type: Boolean, default: false },
-    uploadBtn: { type: Boolean, default: false },
-    showList: { type: Boolean, default: true },
-    accept: { type: String, default: '' },
-    tip: { type: String, default: undefined },
-    listType: { type: String, default: 'picture-card' },
-    fileType: { type: String, default: '1' },
-  },
-  components: {},
-  data: () => ({
-    fileList: [],
-  }),
-  created() {
-    if (this.data) {
-      this.defalutProcess(this.data);
-    }
-  },
-  watch: {
-    data: {
-      handler(val) {
-        this.defalutProcess(val);
-      },
-    },
-  },
-  computed: {},
-  methods: {
-    handleRemove(file, fileList) {
-      if (this.fileType == '1') {
-        this.$emit('onedelete', file);
-        return true;
-      } else {
-        let index = fileList.findIndex(f => _.isEqual(f, file));
-        this.$emit('delete', index);
-      }
-    },
-    outLimit() {
-      this.$message.error(`只允许上传${this.limit}个文件`);
-    },
-    onSuccess(response, file, fileList) {
-      //将文件整理好传回父组件
-      this.$emit('upload', { type: this.type, data: { ...response, name: file.name } });
-    },
-    beforeUpload(file) {
-      const sizeLimit = file.size / 1024 / 1024 < 10;
-      if (sizeLimit) return true;
-      else {
-        this.$message.error('文件超出10M!');
-        return false;
-      }
-    },
-    defalutProcess(val) {
-      if (_.isArray(val)) {
-        let newArr = val.map(item => {
-          let object = {};
-          // object.name = item.name;
-          object.url = item ? item.url : null;
-          return object;
-        });
-        this.$set(this, `fileList`, newArr);
-      } else if (typeof val === 'string') {
-        this.$set(this, `fileList`, [{ name: '视频', url: val }]);
-      }
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped></style>

+ 0 - 77
src/components/frame/wang-editor.vue

@@ -1,77 +0,0 @@
-<template>
-  <div ref="editor" style="text-align:left"></div>
-</template>
-<script>
-import E from 'wangeditor';
-
-const menus = [
-  'head', // 标题
-  'bold', // 粗体
-  'fontSize', // 字号
-  'fontName', // 字体
-  'italic', // 斜体
-  'underline', // 下划线
-  'strikeThrough', // 删除线
-  'foreColor', // 文字颜色
-  'backColor', // 背景颜色
-  'link', // 插入链接
-  'list', // 列表
-  'justify', // 对齐方式
-  'quote', // 引用
-  // 'emoticon', // 表情
-  'table', // 表格
-  // 'video', // 插入视频
-  // 'code', // 插入代码
-  'undo', // 撤销
-  'redo', // 重复
-];
-
-export default {
-  name: 'wang-editor',
-  model: {
-    prop: 'value',
-    event: 'change', // 默认为input时间,此处改为change
-  },
-  props: {
-    value: { type: String, required: false, default: '' },
-  },
-  data() {
-    return {
-      editorContent: this.value,
-    };
-  },
-  mounted() {
-    var editor = new E(this.$refs.editor);
-    editor.customConfig.onchange = html => {
-      this.editorContent = html;
-      this.$emit('change', html);
-    };
-    // 自定义菜单配置
-    editor.customConfig.menus = menus;
-    editor.customConfig.zIndex = 0;
-    editor.customConfig.uploadImgServer = '/files/cms/images/upload';
-    editor.customConfig.uploadImgMaxLength = 1;
-    editor.customConfig.uploadImgHooks = {
-      // 如果服务器端返回的不是 {errno:0, data: [...]} 这种格式,可使用该配置
-      // (但是,服务器端返回的必须是一个 JSON 格式字符串!!!否则会报错)
-      customInsert: function(insertImg, result, editor) {
-        // 图片上传并返回结果,自定义插入图片的事件(而不是编辑器自动插入图片!!!)
-        // insertImg 是插入图片的函数,editor 是编辑器对象,result 是服务器端返回的结果
-
-        // 举例:假如上传图片成功后,服务器端返回的是 {url:'....'} 这种格式,即可这样插入图片:
-        var url = result.uri;
-        insertImg(url);
-
-        // result 必须是一个 JSON 格式字符串!!!否则报错
-      },
-    };
-    editor.create();
-    editor.txt.html(this.value);
-  },
-  methods: {
-    getContent: function() {
-      return this.editorContent;
-    },
-  },
-};
-</script>

+ 2 - 0
src/store/index.js

@@ -3,6 +3,7 @@ import Vuex from 'vuex';
 import * as ustate from './user/state';
 import * as umutations from './user/mutations';
 import login from './login';
+import place from '@common/src/store/place';
 
 Vue.use(Vuex);
 
@@ -12,5 +13,6 @@ export default new Vuex.Store({
   actions: {},
   modules: {
     login,
+    place,
   },
 });

+ 8 - 3
src/views/test/index.vue

@@ -30,9 +30,10 @@
 <script>
 import { iconmenu } from '@/util/iconmenu';
 import breadcrumb from '@c/common/breadcrumb.vue';
-import dataTable from '@/components/frame/filter-page-table.vue';
-import dataForm from '@/components/frame/form.vue';
+import dataTable from '@common/src/components/frame/filter-page-table.vue';
+import dataForm from '@common/src/components/frame/form.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: place } = createNamespacedHelpers('place');
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -86,8 +87,12 @@ export default {
     this.search();
   },
   methods: {
+    ...place({ palcequery: 'query', palcefetch: 'fetch' }),
     // 查询列表
-    async search({ skip = 0, limit = 10, ...info } = {}) {},
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      let res = await this.palcequery({ level: 1 });
+      console.log(res.data);
+    },
     // 修改
     toEdit({ data }) {
       console.log(data);