diff --git a/src/views/SQLFormatter.vue b/src/views/SQLFormatter.vue index 87206e9..0374fbf 100644 --- a/src/views/SQLFormatter.vue +++ b/src/views/SQLFormatter.vue @@ -22,12 +22,31 @@ export default { data() { return { toolData: { - data: '', + data: 'SELECT K.ID, SUM(DV.KOL*DV.TYPEMOVE) AS LK, K.TOVAR, KT.KATEGORY, K.CENAUSD, K.CENA, K.BESTBEFORE, K.KARTASER\n' + + ' FROM $f" . "KARTA K, $f" . "DVIVTOV DV, TOVARY T, KATEG KT\n' + + ' WHERE (K.SKLAD=$sklad) AND (K.TOVAR=T.TOVAR) AND (T.KATEGORY=KT.KATEGORY)\n' + + ' AND (DV.NKARTA=K.ID)\n' + + ' AND (DV.CURDATE < " . $conn->DBDate(ReversDateStrPar($operdata)) . ")\n' + + ' AND (K.ID={$rs->fields[1]})\n' + + ' GROUP BY K.ID, K.TOVAR, KT.KATEGORY, K.CENAUSD, K.CENA, K.BESTBEFORE, K.KARTASER\n' + + ' HAVING SUM(DV.KOL*DV.TYPEMOVE)>=0.000001\n' + + ' ORDER BY K.TOVAR;' + + '' + + 'SELECT\n' + + ' test\n' + + 'FROM\n' + + ' test t\n' + + 'WHERE\n' + + ' t.date <= to_date (\'" . date(\'Y-m-d\') . "\', \'YYYY-MM-DD\')\n' + + ' and t.date <= to_date (\'" . date(\'Y-m-d\') . "\', \'YYYY-MM-DD\')', minifyJson: '', }, toolResult: '', }; }, + mounted() { + this.result(); + }, methods: { result() { try { @@ -42,7 +61,7 @@ export default { custom: [ { regex: String.raw`\{\$?[\w\d\->\[\]]+\}` }, { regex: String.raw`\$[\w\d\->\[\]]+` }, - { regex: String.raw`['"]\s?\..*\.\s?['"]` }, + { regex: String.raw`['"].*['"]` }, ], positional: true, named: [':', '@'],