|
@@ -1,9 +1,9 @@
|
|
|
import {invokeServer, msg, Scope} from 'yvan-ext'
|
|
|
-import vjson from "./LzwTest.view"
|
|
|
-import model from "./LzwTest.model"
|
|
|
+import vjson from "./{{{ groovyClass }}}.view"
|
|
|
+import model from "./{{{ groovyClass }}}.model"
|
|
|
|
|
|
-export default class LzwTest extends Scope {
|
|
|
- path = '/bas/area/LzwTest/LzwTest'
|
|
|
+export default class {{{ groovyClass }}} extends Scope {
|
|
|
+ path = '{{{ invokeUrlPrefix }}}'
|
|
|
|
|
|
constructor() {
|
|
|
super({model, vjson});
|
|
@@ -16,15 +16,18 @@ export default class LzwTest extends Scope {
|
|
|
this.refs.grid1.reload()
|
|
|
}
|
|
|
|
|
|
+{{#if addButton}}
|
|
|
add() {
|
|
|
this.refs.grid1.appendEditRow({}, 1)
|
|
|
}
|
|
|
+{{/if}}
|
|
|
|
|
|
+{{#if deleteButton}}
|
|
|
remove() {
|
|
|
const grid1 = this.refs.grid1
|
|
|
const selected = grid1?.selModel?.selected?.items?.map(row => row.data)[0]
|
|
|
if (selected && grid1?.getStore().getNewRecords().map(row => row.data).indexOf(selected) < 0) {
|
|
|
- system.confirm(`真的要删除?`)
|
|
|
+ system.confirm(`{{{ deleteTips }}}`)
|
|
|
.then(() => {
|
|
|
this.setLoading(true)
|
|
|
invokeServer('/bas/area/LzwTest/LzwTest@deleteItem', selected)
|
|
@@ -37,7 +40,9 @@ export default class LzwTest extends Scope {
|
|
|
grid1?.removeEditRow()
|
|
|
}
|
|
|
}
|
|
|
+{{/if}}
|
|
|
|
|
|
+{{#if saveButton}}
|
|
|
save() {
|
|
|
let {newRows, modifyRows, removeRecords, err} = system.getGridEditRows(this.refs.grid1)
|
|
|
if (err) return
|
|
@@ -48,6 +53,7 @@ export default class LzwTest extends Scope {
|
|
|
this.refs.grid1.reload()
|
|
|
}).finally(() => this.setLoading(false))
|
|
|
}
|
|
|
+{{/if}}
|
|
|
|
|
|
grid1Select(sender, selected) {
|
|
|
this.viewModel.set('selectedRow', selected[0]?.data)
|