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 +1 -1
- package/src/App.vue +10 -4
- package/src/Table/Table.vue +5 -2
- package/src/Table/TableLoadParams.ts +1 -1
package/package.json
CHANGED
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
|
|
package/src/Table/Table.vue
CHANGED
|
@@ -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];
|