Approved departure from the port's byte-faithful rule (docs/ADMIN-PORT-PLAN.md
bug rows 4-6), fixed and logged rather than silently changed:
- farsi.less: bold/700 @font-face blocks now load iran-yekan-700.woff2
instead of the 400 file, so bold text actually renders bold. No source
file exists for weight 300, so that face is dropped rather than faked.
- format("woff") corrected to format("woff2") on all faces.
- Removed 'font-weight: inherit' from the body,* reset, which was flattening
every heading's weight.
Also deduped 24 view files that each redeclared .grid-2/.grid-3/.grid-4 in
a scoped <style> block with drifted minmax values, though utilities.less
already defines all three globally. Removed the scoped copies; kept
PromotionForm's genuinely different 0.5rem gap as a small .grid-4--tight
modifier instead of a full redeclaration.
Verified: pnpm build passes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
91 lines
2.4 KiB
Vue
91 lines
2.4 KiB
Vue
<template>
|
|
<!--
|
|
Ported from legacy henza_admin/src/views/statics/index.vue — the customer
|
|
activity log ("آمار"). Pick a customer, see their recent actions.
|
|
-->
|
|
<a-spin :spinning="loading">
|
|
<a-card title="آمار">
|
|
<a-form layout="vertical">
|
|
<div class="grid-2">
|
|
<a-form-item label="مشتری">
|
|
<a-select
|
|
v-model:value="customer"
|
|
show-search
|
|
allow-clear
|
|
placeholder="انتخاب کنید"
|
|
:filter-option="filterOption"
|
|
@change="load"
|
|
>
|
|
<a-select-option v-for="c in customers" :key="c.id" :value="c.id">
|
|
{{ c.name }} - {{ c.mobile }}
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-form-item>
|
|
</div>
|
|
</a-form>
|
|
|
|
<a-table
|
|
:data-source="logs"
|
|
:columns="columns"
|
|
:pagination="{ pageSize: 20 }"
|
|
size="small"
|
|
row-key="id"
|
|
>
|
|
<template #bodyCell="{ column, record }">
|
|
<template v-if="column.dataIndex === 'caj'">
|
|
{{ jdateTime(record.caj) }}
|
|
</template>
|
|
</template>
|
|
</a-table>
|
|
</a-card>
|
|
</a-spin>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { onMounted, ref } from 'vue';
|
|
import { jdateTime } from '../../utils/filters';
|
|
import api from '../../api/client';
|
|
|
|
const loading = ref(false);
|
|
const customers = ref<{ id: string; name: string; mobile: string }[]>([]);
|
|
const customer = ref<string | undefined>(undefined);
|
|
const logs = ref<Record<string, any>[]>([]);
|
|
|
|
const columns = [
|
|
{ title: 'عملیات', dataIndex: 'action' },
|
|
{ title: 'جزئیات', dataIndex: 'detail' },
|
|
{ title: 'تاریخ', dataIndex: 'caj' },
|
|
];
|
|
|
|
function filterOption(input: string, option: any) {
|
|
return String(option?.children?.[0]?.children ?? '').includes(input);
|
|
}
|
|
|
|
async function load() {
|
|
if (!customer.value) {
|
|
logs.value = [];
|
|
return;
|
|
}
|
|
try {
|
|
loading.value = true;
|
|
const { data } = await api.get(`log/ago/${customer.value}`);
|
|
logs.value = data;
|
|
} catch (e) {
|
|
console.log(e);
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
}
|
|
|
|
onMounted(async () => {
|
|
try {
|
|
const { data } = await api.get('log/list/customer');
|
|
customers.value = data;
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<!-- .grid-2 now comes from the global utilities.less (dedup) -->
|