Browse Source

update

master
姜旭之 1 year ago
parent
commit
78da376273
  1. 42
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  2. 11
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-item.js
  3. 13
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-log.js
  4. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js
  5. 11
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js

42
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -197,9 +197,9 @@ export default {
<el-scrollbar>
<app-list
v-if="subDrawer"
:controller="subListQuery.controller"
:query="subListQuery.query"
:buttons="subListQuery.buttons"
:config="subListQuery.config"
/>
</el-scrollbar>
<template #footer>
@ -361,7 +361,7 @@ export default {
width: 100%;
}
</style>`,
props: ["modelValue", "config", "querySchema", "controller", "query", "buttons"],
props: ["modelValue", "config", "querySchema", "query", "buttons"],
emits: ["command"],
setup(props, context) {
/*变量定义*/
@ -395,7 +395,6 @@ export default {
// const buttons = ref(props.buttons ?? route.meta.children.filter((o) => o.meta.hasPermission));
// 添加下行代码暂停权限验证
const buttons = ref(props.buttons ?? route.meta.children);
const baseUrl = props.controller ?? `${route.meta.path}`;
const queryModel = ref(schemaToModel(config.query.schema));
watch(queryModel.value, async (value, oldValue, a) => {
if (config.query.autoSubmit) {
@ -632,7 +631,7 @@ export default {
editFormTitle.value = t("自定义查询");
dialogVisible.value = true;
} else {
context.emit("command", item, rows, load);
context.emit("command", item, rows, showList);
}
editFormloading.value = false;
};
@ -702,25 +701,17 @@ export default {
dialogVisible.value = false;
}
};
const showList = (value, nav) => {
const showList = (value, nav, config) => {
if (!subDrawer.value) {
const controller = nav.substr(0, nav.lastIndexOf(".")).toLowerCase();
const findRoute = (tree) => {
for (const item of tree) {
if (item.meta.controller === controller) {
return item;
}
if (item.children) {
return findRoute(item.children);
}
}
};
const targetRoute = router.getRoutes().find((o) => o.meta?.controller === controller);
subListQuery.value = {
controller,
query: { [camelCase(nav.substr(nav.lastIndexOf(".") + 1))]: value },
buttons: targetRoute.meta.buttons,
};
const targetRoute = router.getRoutes().find((o) => o.meta?.path === nav);
// subListQuery.value = {
// query: value,
// buttons: targetRoute.meta.children,
// config,
// };
subListQuery.value.query = value;
subListQuery.value.buttons = targetRoute.meta.children;
subListQuery.value.config = config;
subDrawer.value = true;
}
};
@ -819,6 +810,7 @@ export default {
queryModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize;
//
const postData = JSON.parse(JSON.stringify(queryModel.value));
Object.assign(postData, subListQuery.value.query);
postData.filters = filterList.value.filter((o) => o.column && o.action && (o.value || o.value === false));
if (postData.items) {
delete postData["items"];
@ -861,9 +853,9 @@ export default {
getSortModel(queryModel.value);
filterList.value = queryModel.value?.filters ?? [];
getColumns(config.table.schema);
if (props.query) {
Object.assign(queryModel.value.query, props.query);
}
// if (props.query) {
// Object.assign(queryModel.value.query, props.query);
// }
if (!config.query.disableQueryOnLoad) {
await load();
}

11
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-item.js

@ -21,22 +21,21 @@ const schema = {
isRunning: {
title: "运行中",
type: "boolean",
},
concurrencyStamp: {
title: "并发",
type: "boolean",
readOnly: true,
},
},
};
const queryUrl = "settleaccount/job-item/get-list";
const createUrl = "settleaccount/job-item/create";
const updateUrl = "settleaccount/job-item/update/{id}";
const updateUrl = "settleaccount/job-item/update/%s";
const deleteUrl = "settleaccount/job-item/delete-list";
const detailsUrl = "settleaccount/job-item/details/%s";
const queryMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const detailsMethod = "POST";
export default function () {
return {
@ -91,9 +90,11 @@ export default function () {
createUrl,
updateUrl,
deleteUrl,
detailsUrl,
createMethod,
updateMethod,
deleteMethod,
detailsMethod,
schema: schema,
},
};

13
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-log.js

@ -5,10 +5,12 @@ const schema = {
start: {
title: "开始",
type: "string",
input: "datetime",
},
end: {
title: "结束",
type: "string",
input: "datetime",
},
success: {
@ -54,7 +56,16 @@ export default function () {
},
},
},
default: [],
default: [
{
logic: "and",
column: "jobId",
action: "equal",
value: null,
readOnly: true,
hidden: true,
},
],
},
skipCount: {
hidden: true,

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js

@ -507,7 +507,7 @@ export default [
path: "update",
meta: {
type: "button",
title: "修改",
title: "编辑",
icon: "file",
},
},
@ -520,6 +520,14 @@ export default [
isTop: true,
},
},
{
path: "log",
meta: {
type: "button",
title: "日志",
icon: "file",
},
},
],
},
},

11
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js

@ -1,14 +1,21 @@
import AppList from "../../components/list/index.js";
import html from "html";
import useConfig from "../../models/job-item.js";
import { defineAsyncComponent, ref, reactive, onMounted, watch } from "vue";
import useConfig2 from "../../models/job-log.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
template: html`<app-list :config="config" @command="onCommand" ref="appListRef" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
const appListRef = ref(null);
const onCommand = async (item, rows, showList) => {
console.log(item.path, item, rows);
console.log(showList);
const config = useConfig2();
// config.query.schema.properties.filters.default[0].value = rows[0].id;
showList({ jobId: rows[0].id }, "/base-data/job-log", config);
};
return { config, onCommand };
},

Loading…
Cancel
Save