提交 6711988e 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

test results page and data

上级 bd3ce53a
......@@ -78,6 +78,7 @@ func LoadSiteProduct(currSite serverDomain.ZentaoSite, currProductId int) (
products []serverDomain.ZentaoProduct, currProduct serverDomain.ZentaoProduct, err error) {
if currSite.Id == 0 {
products = []serverDomain.ZentaoProduct{}
return
}
config := commDomain.WorkspaceConf{
......@@ -142,6 +143,7 @@ func loadProduct(config commDomain.WorkspaceConf) (products []serverDomain.Zenta
return
}
products = []serverDomain.ZentaoProduct{}
for _, item := range items {
productMap, _ := item.(map[string]interface{})
......
......@@ -18,14 +18,16 @@ func NewTestExecCtrl() *TestExecCtrl {
// List 分页列表
func (c *TestExecCtrl) List(ctx iris.Context) {
workspacePath := ctx.URLParam("currWorkspace")
currSiteId, _ := ctx.URLParamInt("currSiteId")
currProductId, _ := ctx.URLParamInt("currProductId")
if workspacePath == "" {
ctx.JSON(c.SuccessResp(make([]serverDomain.TestReportSummary, 0)))
var req serverDomain.ReqPaginate
if err := ctx.ReadQuery(&req); err != nil {
ctx.JSON(c.ErrResp(commConsts.CommErr, err.Error()))
return
}
data, err := c.TestExecService.List(workspacePath)
data, err := c.TestExecService.Paginate(currSiteId, currProductId, req)
if err != nil {
ctx.JSON(c.ErrResp(commConsts.CommErr, err.Error()))
return
......
......@@ -24,5 +24,5 @@ func (m *TestExecModule) Party() module.WebModule {
index.Get("/{seq:string}", m.TestExecCtrl.Get).Name = "执行详情"
index.Delete("/{seq:string}", m.TestExecCtrl.Delete).Name = "删除执行"
}
return module.NewModule("/exec", handler)
return module.NewModule("/results", handler)
}
......@@ -63,6 +63,7 @@ func (s *SiteService) LoadSites(currSiteId int) (sites []serverDomain.ZentaoSite
pos := pageData.Result.([]*model.Site)
sites = []serverDomain.ZentaoSite{}
var first serverDomain.ZentaoSite
for idx, item := range pos {
site := serverDomain.ZentaoSite{
......
......@@ -4,6 +4,7 @@ import (
commConsts "github.com/aaronchen2k/deeptest/internal/comm/consts"
commDomain "github.com/aaronchen2k/deeptest/internal/comm/domain"
analysisUtils "github.com/aaronchen2k/deeptest/internal/comm/helper/analysis"
"github.com/aaronchen2k/deeptest/internal/pkg/domain"
fileUtils "github.com/aaronchen2k/deeptest/internal/pkg/lib/file"
serverDomain "github.com/aaronchen2k/deeptest/internal/server/modules/v1/domain"
"github.com/aaronchen2k/deeptest/internal/server/modules/v1/repo"
......@@ -19,22 +20,47 @@ func NewTestExecService() *TestExecService {
return &TestExecService{}
}
func (s *TestExecService) List(workspacePath string) (ret []serverDomain.TestReportSummary, err error) {
reportFiles := analysisUtils.ListReport(workspacePath)
func (s *TestExecService) Paginate(siteId, productId int, req serverDomain.ReqPaginate) (
data domain.PageData, err error) {
for _, seq := range reportFiles {
var summary serverDomain.TestReportSummary
reports := []serverDomain.TestReportSummary{}
report, err1 := analysisUtils.ReadReportByWorkspaceSeq(workspacePath, seq)
if err1 != nil { // ignore wrong json result
workspaces, _ := s.WorkspaceRepo.ListWorkspacesByProduct(siteId, productId)
pageNo := req.Page
pageSize := req.PageSize
jumpNo := pageNo * pageSize
count := 0
for _, workspace := range workspaces {
if workspace.Type != commConsts.ZTF {
continue
}
copier.Copy(&summary, report)
summary.Seq = seq
ret = append(ret, summary)
reportFiles := analysisUtils.ListReport(workspace.Path)
for _, seq := range reportFiles {
if count < jumpNo || len(reports) >= pageSize {
count += 1
continue
}
var summary serverDomain.TestReportSummary
report, err1 := analysisUtils.ReadReportByWorkspaceSeq(workspace.Path, seq)
if err1 != nil { // ignore wrong json result
continue
}
copier.Copy(&summary, report)
summary.Seq = seq
reports = append(reports, summary)
count += 1
}
}
data.Populate(reports, int64(count), req.Page, req.PageSize)
return
}
......
......@@ -28,16 +28,18 @@ func (s *TestScriptService) LoadTestScriptsBySiteProduct(
// load scripts from disk
root = serverDomain.TestAsset{Path: "", Title: "测试脚本", Type: commConsts.Root, Slots: iris.Map{"icon": "icon"}}
for _, workspace := range workspaces {
if workspace.Type == commConsts.ZTF {
if filerType == string(commConsts.FilterWorkspace) &&
(filerValue > 0 && uint(filerValue) != workspace.ID) { // filter by workspace
continue
}
scriptsInDir, _ := scriptUtils.LoadScriptTree(workspace.Path, scriptIdsFromZentao)
if workspace.Type != commConsts.ZTF {
continue
}
root.Children = append(root.Children, &scriptsInDir)
if filerType == string(commConsts.FilterWorkspace) &&
(filerValue > 0 && uint(filerValue) != workspace.ID) { // filter by workspace
continue
}
scriptsInDir, _ := scriptUtils.LoadScriptTree(workspace.Path, scriptIdsFromZentao)
root.Children = append(root.Children, &scriptsInDir)
}
if filerType == string(commConsts.FilterWorkspace) || filerValue == 0 {
......
import {getInitStatus} from "@/utils/cache";
/**
* 站点配置
......@@ -23,6 +24,7 @@ export interface SettingsType {
*/
siteTokenKey: string;
initStatus: string;
currSiteId: string;
currProductId: string;
currProductIdBySite: string;
......@@ -52,6 +54,7 @@ const settings: SettingsType = {
headFixed: true,
siteTokenKey: 'admin_antd_vue_token',
initStatus: 'initStatus',
currSiteId: 'currSiteId',
currProductId: 'currProductId',
currProductIdBySite: 'currProductIdBySite',
......
......@@ -53,6 +53,7 @@ import {useStore} from "vuex";
import IconSvg from "@/components/IconSvg/index";
import {useI18n} from "vue-i18n";
import {ZentaoData} from "@/store/zentao";
import {getInitStatus} from "@/utils/cache";
interface TopSiteProductSetupData {
t: (key: string | number) => string;
......@@ -70,9 +71,7 @@ export default defineComponent({
components: {IconSvg},
setup(): TopSiteProductSetupData {
const { t } = useI18n();
const router = useRouter();
const needLoadScript = false // router.currentRoute.value.path === '/script/index'
const store = useStore<{ zentao: ZentaoData }>();
......@@ -84,6 +83,19 @@ export default defineComponent({
store.dispatch('zentao/fetchSitesAndProduct', {})
watch(currSite, ()=> {
console.log(`watch currSite id = ${currSite.value.id}`)
if (currSite.value.id <= 0) {
getInitStatus().then((initStatus) => {
console.log('initStatus', initStatus)
if (!initStatus) {
router.push(`/site/list`)
}
})
}
})
onMounted(() => {
console.log('onMounted')
})
......
......@@ -19,32 +19,32 @@ const IndexLayoutRoutes: Array<RoutesDataItem> = [
},
{
icon: 'execution',
title: 'execution',
path: '/exec',
redirect: '/exec/history',
icon: 'result',
title: 'result',
path: '/result',
redirect: '/result/list',
component: BlankLayout,
children: [
{
title: 'execution.history',
path: 'history',
component: () => import('@/views/exec/history/index.vue'),
title: 'exec_result',
path: 'list',
component: () => import('@/views/result/index.vue'),
hidden: true,
},
{
title: 'execution.result.func',
path: 'history/func/:seq',
component: () => import('@/views/exec/history/result-func.vue'),
component: () => import('@/views/result/result-func.vue'),
hidden: true,
},
{
title: 'execution.result.unit',
path: 'history/unit/:seq',
component: () => import('@/views/exec/history/result-unit.vue'),
component: () => import('@/views/result/result-unit.vue'),
hidden: true,
},
{
/* {
title: 'execution',
path: 'run',
component: BlankLayout,
......@@ -81,24 +81,10 @@ const IndexLayoutRoutes: Array<RoutesDataItem> = [
hidden: true,
},
]
},
},*/
],
},
{
icon: 'config',
title: 'zentao_config',
path: '/config',
component: () => import('@/views/config/index.vue'),
},
{
icon: 'sync',
title: 'sync',
path: '/sync',
component: () => import('@/views/sync/index.vue'),
},
{
icon: 'empty',
title: 'workspace',
......
......@@ -13,7 +13,8 @@ export default {
'create_time': 'Create Time',
'start_time': 'Start Time',
'end_time': 'End Time',
'result': 'Result',
'result': 'Result',
'exec_result': 'Test Result',
'opt': 'opt',
'title': 'Title',
'category': 'Category',
......
......@@ -13,7 +13,8 @@ export default {
'create_time': '创建时间',
'start_time': '开始时间',
'end_time': '结束时间',
'result': '结果',
'result': '结果',
'exec_result': '执行结果',
'opt': '操作',
'title': '标题',
'category': '分类',
......
......@@ -2,6 +2,14 @@
import {getCache, setCache} from './localCache';
import settings from '@/config/settings';
export const getInitStatus = async () => {
const initStatus = await getCache(settings.initStatus);
return initStatus
}
export const setInitStatus = async () => {
await setCache(settings.initStatus, true);
}
export const getCurrSiteId = async () => {
const currSiteId = await getCache(settings.currSiteId);
return currSiteId
......
export interface WsMsg {
msg: string
isRunning: string
category: string
conn: string
}
<template>
<div v-if="!currWorkspace.path">
<a-empty :image="simpleImage" :description="t('pls_create_workspace')"/>
</div>
<div v-if="currWorkspace.path" class="indexlayout-main-conent">
<div class="indexlayout-main-conent">
<a-card :bordered="false">
<template #title>
{{ t('test_exec') }}
{{ t('exec_result') }}
</template>
<template #extra>
<div class="opt">
<template v-if="currWorkspace.type === 'func'">
<a-button @click="execCase" type="primary" class="exec-button">
<span class="exec-icon"><icon-svg type="exec"></icon-svg></span>
<span class="exec-text">{{ t('exec') }}{{ t('case') }}</span>
</a-button>
<a-dropdown>
<a-button type="primary" class="exec-button">
<span class="button-text">
<span class="exec-icon"><icon-svg type="exec"></icon-svg></span>
<span class="exec-text">{{ t('exec') }}</span>
</span>
<icon-svg type="down"></icon-svg>
</a-button>
<template #overlay>
<a-menu class="menu">
<a-menu-item @click="execModule" class="t-link">
<span class="t-link">{{ t('module') }}</span>
</a-menu-item>
<a-menu-item @click="execSuite" class="t-link">
<span class="t-link">{{ t('suite') }}</span>
</a-menu-item>
<a-menu-item @click="execTask" class="t-link">
<span class="t-link">{{ t('task') }}</span>
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</template>
<template v-if="currWorkspace.type === 'unit'">
<a-button @click="execUnit" type="primary">{{ t('execute_unit_or_automated') }}</a-button>
</template>
</div>
</template>
<div>
......@@ -54,7 +13,16 @@
:columns="columns"
:data-source="models"
:loading="loading"
:pagination="false"
:pagination="{
...pagination,
onChange: (page) => {
getList(page);
},
onShowSizeChange: (page, size) => {
pagination.pageSize = size
getList(page);
},
}"
>
<template #seq="{ text }">
{{ text }}
......@@ -63,7 +31,7 @@
{{ execBy(record) }}
</template>
<template #startTime="{ record }">
<span v-if="record.startTime">{{ momentTime(record.startTime) }}</span>
<span v-if="record.startTime">{{ momentUtc(record.startTime) }}</span>
</template>
<template #duration="{ record }">
{{ record.duration }}
......@@ -86,9 +54,9 @@
</span>
</template>
<template #action="{ record }">
<a-button @click="() => viewResult(record)" type="link" size="small">{{ t('view') }}</a-button>
<a-button @click="() => deleteExec(record)" type="link" size="small"
:loading="deleteLoading.includes(record.seq)">{{ t('delete') }}
<a-button @click="() => view(record)" type="link" size="small">{{ t('view') }}</a-button>
<a-button @click="() => remove(record)" type="link" size="small"
:loading="removeLoading.includes(record.seq)">{{ t('remove') }}
</a-button>
</template>
......@@ -100,60 +68,59 @@
<script lang="ts">
import {computed, ComputedRef, defineComponent, onMounted, ref, Ref, watch} from "vue";
import {Execution} from '../data.d';
import {useStore} from "vuex";
import {Empty, Form, message, Modal} from "ant-design-vue";
import {StateType} from "../store";
import {StateType} from "./store";
import {useRouter} from "vue-router";
import {momentUnixDef, percentDef} from "@/utils/datetime";
import {momentUnixDef, momentUtcDef, percentDef} from "@/utils/datetime";
import {execByDef} from "@/utils/testing";
import {WorkspaceData} from "@/store/workspace";
import {hideMenu} from "@/utils/dom";
import throttle from "lodash.throttle";
import {useI18n} from "vue-i18n";
import IconSvg from "@/components/IconSvg/index";
import {PaginationConfig, QueryParams} from "@/types/data";
import {disableStatusMap} from "@/utils/const";
import debounce from "lodash.debounce";
import {disableStatusDef} from "@/utils/decorator";
const useForm = Form.useForm;
interface ListExecSetupData {
interface ListResultSetupData {
t: (key: string | number) => string;
currWorkspace: ComputedRef;
statusArr: Ref,
queryParams: Ref,
pagination: ComputedRef<PaginationConfig>;
columns: any;
models: ComputedRef<Execution[]>;
models: ComputedRef<any[]>;
loading: Ref<boolean>;
list: () => void
viewResult: (item) => void;
deleteLoading: Ref<string[]>;
deleteExec: (item) => void;
list: (v) => void
view: (item) => void;
removeLoading: Ref<string[]>;
remove: (id) => void;
execCase: () => void;
execModule: () => void;
execSuite: () => void;
execTask: () => void;
execUnit: () => void;
onSearch: () => void;
disableStatus: (val) => string;
momentUtc: (tm) => string;
execBy: (item) => string;
momentTime: (tm) => string;
percent: (numb, total) => string;
simpleImage: any
}
export default defineComponent({
name: 'ExecListPage',
name: 'ResultListPage',
components: {
IconSvg,
},
setup(): ListExecSetupData {
setup(): ListResultSetupData {
const {t} = useI18n();
const workspaceStore = useStore<{ workspace: WorkspaceData }>();
const currWorkspace = computed<any>(() => workspaceStore.state.workspace.currWorkspace);
const momentUtc = momentUtcDef
const disableStatus = disableStatusDef
const execBy = execByDef
const momentTime = momentUnixDef
const percent = percentDef
const columns = [
......@@ -189,95 +156,82 @@ export default defineComponent({
},
];
const statusArr = ref(disableStatusMap);
const router = useRouter();
const store = useStore<{ History: StateType }>();
const store = useStore<{ result: StateType }>();
const models = computed<any[]>(() => store.state.result.queryResult.result)
const pagination = computed<PaginationConfig>(() => store.state.result.queryResult.pagination);
const queryParams = ref<QueryParams>({
keywords: '', enabled: '1', page: pagination.value.page, pageSize: pagination.value.pageSize
});
const models = computed<any[]>(() => store.state.History.items);
const loading = ref<boolean>(true);
const list = throttle(async () => {
const list = (page: number) => {
loading.value = true;
await store.dispatch('History/list', {});
store.dispatch('result/list', {
keywords: queryParams.value.keywords,
enabled: queryParams.value.enabled,
pageSize: pagination.value.pageSize,
page: page});
loading.value = false;
}, 600)
list();
}
list(1);
watch(currWorkspace, (newWorkspace, oldVal) => {
console.log('watch currWorkspace', newWorkspace)
list()
}, {deep: true})
const onSearch = debounce(() => {
list(1)
}, 500);
onMounted(() => {
console.log('onMounted')
hideMenu(currWorkspace.value) // jump from not available page for unittest
})
// 查看
const viewResult = (item) => {
const view = (item) => {
router.push(`/exec/history/${item.testType}/${item.seq}`)
}
// 删除
const deleteLoading = ref<string[]>([]);
const deleteExec = (item) => {
const removeLoading = ref<string[]>([]);
const remove = (item) => {
Modal.confirm({
title: t('confirm_to_delete_result'),
title: t('confirm_to_remove_result'),
okText: t('confirm'),
cancelText: t('cancel'),
onOk: async () => {
deleteLoading.value = [item.seq];
const res: boolean = await store.dispatch('History/delete', item.seq);
removeLoading.value = [item.seq];
const res: boolean = await store.dispatch('History/remove', item.seq);
if (res === true) {
message.success(t('delete_success'));
await list();
message.success(t('remove_success'));
await list(1);
}
deleteLoading.value = [];
removeLoading.value = [];
}
});
}
const execCase = () => {
console.log("execCase")
router.push(`/exec/run/case/-/-`)
}
const execModule = () => {
console.log("execModule")
router.push(`/exec/run/module/0/0/-/-`)
}
const execSuite = () => {
console.log("execSuite")
router.push(`/exec/run/suite/0/0/-/-`)
}
const execTask = () => {
console.log("execSuite")
router.push(`/exec/run/task/0/0/-/-`)
}
const execUnit = () => {
console.log("execUnit")
router.push(`/exec/run/unit`)
}
return {
t,
currWorkspace,
statusArr,
queryParams,
pagination,
columns,
models,
loading,
list,
viewResult,
deleteLoading,
deleteExec,
view,
removeLoading,
remove,
execCase,
execModule,
execSuite,
execTask,
execUnit,
onSearch,
disableStatus,
momentUtc,
execBy,
momentTime,
percent,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
}
......
......@@ -140,10 +140,10 @@ import {StateType as ListStateType} from "@/views/exec/store";
import {useRouter} from "vue-router";
import {momentUnixDef, percentDef} from "@/utils/datetime";
import {execByDef, resultStatusDef, testEnvDef, testTypeDef} from "@/utils/testing";
import {submitResultToZentao, submitBugToZentao} from "@/views/exec/service";
import {submitResultToZentao, submitBugToZentao} from "./service";
import {notification} from "ant-design-vue";
import ResultForm from "@/views/exec/history/component/result.vue";
import BugForm from "@/views/exec/history/component/bug.vue";
import ResultForm from "./component/result.vue";
import BugForm from "./component/bug.vue";
import {useI18n} from "vue-i18n";
import IconSvg from "@/components/IconSvg/index";
......
......@@ -113,7 +113,7 @@ import {momentUnixDef, percentDef} from "@/utils/datetime";
import {execByDef, resultStatusDef, testEnvDef, testTypeDef} from "@/utils/testing";
import {jsonStrDef} from "@/utils/dom";
import {notification} from "ant-design-vue";
import {submitResultToZentao} from "@/views/exec/service";
import {submitResultToZentao} from "./service";
import ResultForm from './component/result.vue'
import {useI18n} from "vue-i18n";
import IconSvg from "@/components/IconSvg/index";
......
import request from '@/utils/request';
import {WsMsg} from "@/views/result/data";
const apiPath = 'results';
export async function list(params: any): Promise<any> {
return request({
url: `/${apiPath}`,
method: 'get',
params,
});
}
export async function get(seq: string): Promise<any> {
return request({
url: `/${apiPath}/${seq}`
});
}
export async function remove(seq: string): Promise<any> {
return request({
url: `/${apiPath}/${seq}`,
method: 'delete',
});
}
export function getCaseIdsFromReport(report: any, scope: string): string[] {
const ret = new Array<string>()
report.funcResult.forEach(item => {
const path = item.path
const status = item.status
const selected = scope === 'all' || scope === status
if (path && selected) ret.push(path)
})
return ret
}
export function genExecInfo(jsn: WsMsg, i: number): string {
let msg = jsn.msg.replace(/^"+/,'').replace(/"+$/,'')
msg = SetWidth(i + '. ', 40) + `<span>${msg}</span>`;
let sty = ''
if (jsn.category === 'exec') {
sty = 'color: #68BB8D;'
} else if (jsn.category === 'error') {
sty = 'color: #FC2C25;'
}
msg = `<div style="${sty}"> ${msg} </div>`
return msg
}
export function SetWidth(content: string, width: number): string{
return `<span style="display: inline-block; width: ${width}px; text-align: right; padding-right: 6px;">${content}</span>`;
}
export function submitResultToZentao(data: any): Promise<any> {
return request({
url: `/result`,
method: 'post',
data: data,
});
}
export function submitBugToZentao(data: any): Promise<any> {
return request({
url: `/bug`,
method: 'post',
data: data,
});
}
import { Mutation, Action } from 'vuex';
import { StoreModuleType } from "@/utils/store";
import { ResponseData } from '@/utils/request';
import { QueryParams, QueryResult } from '@/types/data.d';
import {
list, get, remove,
} from './service';
export interface StateType {
queryResult: QueryResult;
detailResult: any;
}
export interface ModuleType extends StoreModuleType<StateType> {
state: StateType;
mutations: {
setQueryResult: Mutation<StateType>;
setDetailResult: Mutation<StateType>;
};
actions: {
list: Action<StateType, StateType>;
get: Action<StateType, StateType>;
delete: Action<StateType, StateType>;
};
}
const initState: StateType = {
queryResult: {
result: [],
pagination: {
total: 0,
page: 1,
pageSize: 10,
showSizeChanger: true,
showQuickJumper: true,
},
},
detailResult: {},
};
const StoreModel: ModuleType = {
namespaced: true,
name: 'result',
state: {
...initState
},
mutations: {
setQueryResult(state, payload) {
state.queryResult = payload;
},
setDetailResult(state, payload) {
state.detailResult = payload;
},
},
actions: {
async list({ commit }, params: QueryParams ) {
try {
const response: ResponseData = await list(params);
if (response.code != 0) {
return;
}
const data = response.data;
commit('setQueryResult', data);
return true;
} catch (error) {
return false;
}
},
async get({ commit }, seq: string ) {
let data = {}
if (seq) {
const response: ResponseData = await get(seq);
data = response.data;
}
commit('setDetailResult',data);
return true;
},
async delete({ commit }, seq: string ) {
try {
await remove(seq);
await this.dispatch('Site/list', {})
return true;
} catch (error) {
return false;
}
},
}
};
export default StoreModel;
<template>
<div>
<div class="site-main">
<a-card :bordered="false">
<template #title>
<div class="t-card-toolbar">
......@@ -31,13 +31,14 @@
:pagination="{
...pagination,
onChange: (page) => {
getList(page);
list(page);
},
onShowSizeChange: (page, size) => {
pagination.pageSize = size
getList(page);
list(page);
},
}"
:locale="localeConf"
>
<template #status="{ record }">
{{ disableStatus(record.disabled) }}
......@@ -75,6 +76,7 @@ import debounce from "lodash.debounce";
import {ZentaoData} from "@/store/zentao";
import {disableStatusDef} from "@/utils/decorator";
import {disableStatusMap} from "@/utils/const";
import {getInitStatus, setInitStatus} from "@/utils/cache";
const useForm = Form.useForm;
......@@ -88,7 +90,7 @@ interface SiteListSetupData {
columns: any;
models: ComputedRef<any[]>;
loading: Ref<boolean>;
getList: (curr) => void
list: (curr) => void
create: () => void;
edit: (id) => void;
......@@ -99,6 +101,7 @@ interface SiteListSetupData {
disableStatus: (val) => string;
momentUtc: (tm) => string;
simpleImage: any
localeConf: any
}
export default defineComponent({
......@@ -111,12 +114,20 @@ export default defineComponent({
const momentUtc = momentUtcDef
const disableStatus = disableStatusDef
const onSearch = debounce(() => {
getList(1)
}, 500);
const localeConf = {} as any
getInitStatus().then((initStatus) => {
console.log('initStatus', initStatus)
if (!initStatus) {
localeConf.emptyText = '初次使用,请点击右上按钮新建禅道站点。'
setTimeout(() => {
setInitStatus()
}, 1000)
}
})
onMounted(() => {
getList(1);
console.log('onMounted')
})
const columns = [
......@@ -168,7 +179,7 @@ export default defineComponent({
});
const loading = ref<boolean>(true);
const getList = (page: number) => {
const list = (page: number) => {
loading.value = true;
store.dispatch('Site/list', {
keywords: queryParams.value.keywords,
......@@ -177,7 +188,11 @@ export default defineComponent({
page: page});
loading.value = false;
}
getList(1);
list(1);
const onSearch = debounce(() => {
list(1)
}, 500);
onMounted(() => {
console.log('onMounted')
......@@ -203,7 +218,7 @@ export default defineComponent({
store.dispatch('Site/delete', id).then((success) => {
zentaoStore.dispatch('zentao/fetchSitesAndProduct').then((success) => {
message.success(t('delete_success'));
getList(pagination.value.page)
list(pagination.value.page)
removeLoading.value = [];
})
})
......@@ -221,7 +236,7 @@ export default defineComponent({
columns,
models,
loading,
getList,
list,
create,
edit,
removeLoading,
......@@ -231,15 +246,21 @@ export default defineComponent({
disableStatus,
momentUtc,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
localeConf,
}
}
})
</script>
<style lang="less" scoped>
.ant-card-extra {
<style lang="less">
.site-main {
.ant-table-placeholder {
color: #000c17;
}
}
</style>
<style lang="less" scoped>
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册