Browse Source

update

master
wanggang 1 year ago
parent
commit
cecb7dad95
  1. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  2. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html
  3. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/main.css
  4. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
  5. 31
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/centralized-control.js
  6. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js

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

@ -5,9 +5,7 @@ import { useRoute, useRouter } from "vue-router";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { listToTree, schemaToModel, importFunction, format } from "../../utils/index.js"; import { listToTree, schemaToModel, importFunction, format } from "../../utils/index.js";
import qs from "../../lib/qs/shim.js"; import qs from "../../lib/qs/shim.js";
import VueOfficeExcel from "@vue-office/excel";
import { camelCase, capitalize } from "lodash"; import { camelCase, capitalize } from "lodash";
import { useAppStore } from "../../store/index.js";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
export default { export default {
@ -17,7 +15,6 @@ export default {
AppFormInput: defineAsyncComponent(() => import("../../components/form/form-input.js")), AppFormInput: defineAsyncComponent(() => import("../../components/form/form-input.js")),
SvgIcon: defineAsyncComponent(() => import("../../components/icon/index.js")), SvgIcon: defineAsyncComponent(() => import("../../components/icon/index.js")),
AppFormInput: defineAsyncComponent(() => import("../form/form-input.js")), AppFormInput: defineAsyncComponent(() => import("../form/form-input.js")),
VueOfficeExcel,
}, },
template: html` template: html`
<div v-loading="tableLoading"> <div v-loading="tableLoading">
@ -639,7 +636,7 @@ export default {
editFormTitle.value = t("自定义查询"); editFormTitle.value = t("自定义查询");
dialogVisible.value = true; dialogVisible.value = true;
} else { } else {
context.emit("command", item, rows, showList); context.emit("command", item, rows, load, showList);
} }
editFormloading.value = false; editFormloading.value = false;
}; };

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html

@ -66,7 +66,6 @@
"vue-echarts": "./lib/vue-echarts/index.esm.min.js", "vue-echarts": "./lib/vue-echarts/index.esm.min.js",
"xe-echarts": "./lib/vue-echarts/index.esm.min.js", "xe-echarts": "./lib/vue-echarts/index.esm.min.js",
"resize-detector": "./lib/resize-detector/index.js", "resize-detector": "./lib/resize-detector/index.js",
"@vue-office/excel": "./lib/@vue-office/excel/vue-office-excel.mjs",
"@vue/devtools-api": "./lib/@vue/devtools-api/shim.js", "@vue/devtools-api": "./lib/@vue/devtools-api/shim.js",
"vue-demi": "./lib/vue-demi/shim.js" "vue-demi": "./lib/vue-demi/shim.js"
} }

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/main.css

@ -3,6 +3,5 @@
@import url("./lib/element-plus/theme-chalk/dark/css-vars.css"); @import url("./lib/element-plus/theme-chalk/dark/css-vars.css");
@import url("./lib/github-markdown-css/github-markdown.min.css"); @import url("./lib/github-markdown-css/github-markdown.min.css");
@import url("./lib/highlightjs/highlight.css"); @import url("./lib/highlightjs/highlight.css");
@import url("./lib/@vue-office/excel/index.css");
@import url("./lib/tailwindcss/tailwind.min.css"); @import url("./lib/tailwindcss/tailwind.min.css");
@import url("./styles/site.css"); @import url("./styles/site.css");

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js

@ -43,12 +43,13 @@ const getResult = async (response) => {
[401, "未登录"], [401, "未登录"],
[403, "权限不足"], [403, "权限不足"],
[500, "服务器异常"], [500, "服务器异常"],
[503, "服务不可用"],
]); ]);
const result = { const result = {
status: response.status, status: response.status,
message: messages.get(response.status), message: messages.get(response.status),
}; };
if (response.status === 200 || response.status === 204) { if (response.status === 200 || response.status === 201 || response.status === 204) {
const contentType = response.headers.get("Content-Type"); const contentType = response.headers.get("Content-Type");
if (contentType.indexOf("application/json") > -1) { if (contentType.indexOf("application/json") > -1) {
result.data = await response.json(); result.data = await response.json();
@ -58,10 +59,13 @@ const getResult = async (response) => {
result.data = await response.blob(); result.data = await response.blob();
result.filename = getFileName(response.headers.get("Content-Disposition")); result.filename = getFileName(response.headers.get("Content-Disposition"));
} }
} /*if (response.status === 400 || response.status === 500) */ else { } else {
result.errors = await response.json(); result.errors = await response.json();
if (result.errors) { if (result.errors) {
ElMessageBox.alert(`错误:${result.errors?.error?.message}`, `代码:${result.errors?.error?.code}`); ElMessageBox.alert(
`错误:${result.errors?.error?.message ?? messages.get(response.status)}`,
`代码:${result.errors?.error?.code}`
);
} }
} }
return result; return result;

31
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/centralized-control.js

@ -3,6 +3,8 @@ import { ref } from "vue";
import request from "../../request/index.js"; import request from "../../request/index.js";
import AppList from "../../components/list/index.js"; import AppList from "../../components/list/index.js";
import useConfig from "../../models/centralized-control.js"; import useConfig from "../../models/centralized-control.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { format } from "../../utils/index.js";
export default { export default {
components: { AppList }, components: { AppList },
@ -12,14 +14,27 @@ export default {
const config = useConfig(); const config = useConfig();
const onCommand = async (item, rows, load) => { const onCommand = async (item, rows, load) => {
if (item.path === "open-version" || item.path === "closed-version") { if (item.path === "open-version" || item.path === "closed-version") {
const url = `${config.baseUrl}/${item.path}`; try {
await request( await ElMessageBox.confirm("删除", "提示", {
url, type: "warning",
rows.map((o) => o.id), message: format(`确认${item.path === "open-version" ? "启用" : "停用"}选中的%s行数据吗?`, rows.length),
{ method: "POST" } });
); const url = `${config.baseUrl}/${item.path}`;
console.log(context); await request(
await load(); url,
rows.map((o) => o.id),
{ method: "POST" }
);
console.log(context);
await load();
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "操作取消",
});
}
}
} }
}; };
return { config, onCommand }; return { config, onCommand };

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

@ -9,7 +9,7 @@ export default {
template: html`<app-list v-if="refresh" :config="config" @command="onCommand" />`, template: html`<app-list v-if="refresh" :config="config" @command="onCommand" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
const onCommand = async (item, rows, showList) => { const onCommand = async (item, rows, load, showList) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
console.log(showList); console.log(showList);
const config = useConfig2(); const config = useConfig2();

Loading…
Cancel
Save