flameresttable 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flameresttable",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "main": "./src/plugin.ts",
5
5
  "repository": {
6
6
  "type": "git",
package/src/App.vue CHANGED
@@ -26,15 +26,21 @@ opts.set('dt1', { title: 'Дата 1' });
26
26
  opts.set('dt2', { title: 'Дата 2' });
27
27
  opts.set('id', { title: 'Дата 2', Filter: { isShow: false } });
28
28
  opts.set('file', { title: 'файл', Filter: { isShow: false } });
29
+ opts.set("name", {
30
+ title: 'Название', Table:
31
+ {
32
+ isRawValue: true,
33
+ isShow: true,
34
+ value: (row, column) => '<a href="https://4h.notion.site/' + row[column.name].replace('-', '') + '">Notion</a>'
35
+ },
36
+ Popup: { isShow: true }
37
+ });
29
38
  opts.Add.can = true;
30
39
  opts.Remove.can = true;
31
40
 
32
41
  opts.onRowClickOpenSlot = true;
33
42
 
34
- // Загружаем первичные данные
35
- Model.all({ sort: ['id'] }).then(r =>
36
- TableComponent.value?.Table.load(r)
37
- )
43
+ opts.LoadParams.sort = ['-dt1'];
38
44
 
39
45
  </script>
40
46
 
@@ -58,8 +58,9 @@
58
58
  <div v-for="column in Table.columns" v-show="column.Table.isShow" :key="'tc_' + column"
59
59
  class="table-cell border-r border-r-slate-100 px-2 last:border-r-0 last:pr-0"
60
60
  @click="columnClick(row, column)">
61
- <span>{{
61
+ <span v-if="!column.Table.isRawValue">{{
62
62
  column.Table.value(row, column) }}</span>
63
+ <span v-else v-html="column.Table.value(row, column)"></span>
63
64
  </div>
64
65
  <div v-if="opts.Edit.can" class="table-cell border-r border-r-slate-100 px-2 text-center">
65
66
  <button class="px-2 py-1 bg-green-600 text-white my-1" @click="edit(row)">
@@ -320,10 +321,12 @@ export default defineComponent({
320
321
 
321
322
  // Автозагрузка первичной версии
322
323
  if (props.opts.autoload === true) {
324
+ /**
323
325
  const tModel = (props.model as any)
324
326
  tModel.all().then((r: any) => {
325
327
  Table.load(r);
326
- })
328
+ })*/
329
+ Table.update();
327
330
  }
328
331
 
329
332
  const primaryKey = (Table.model as any).constructor.primaryKeys[0];
@@ -3,7 +3,7 @@ export default interface ITableLoadParams {
3
3
  where?: any
4
4
  fields?: any,
5
5
  expand?: any,
6
- sortfields?: Array<string>,
6
+ sort?: Array<string>,
7
7
  page?: number,
8
8
  perPage?: number
9
9