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. 15
      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 { listToTree, schemaToModel, importFunction, format } from "../../utils/index.js";
import qs from "../../lib/qs/shim.js";
import VueOfficeExcel from "@vue-office/excel";
import { camelCase, capitalize } from "lodash";
import { useAppStore } from "../../store/index.js";
import { ElMessage, ElMessageBox } from "element-plus";
export default {
@ -17,7 +15,6 @@ export default {
AppFormInput: defineAsyncComponent(() => import("../../components/form/form-input.js")),
SvgIcon: defineAsyncComponent(() => import("../../components/icon/index.js")),
AppFormInput: defineAsyncComponent(() => import("../form/form-input.js")),
VueOfficeExcel,
},
template: html`
<div v-loading="tableLoading">
@ -639,7 +636,7 @@ export default {
editFormTitle.value = t("自定义查询");
dialogVisible.value = true;
} else {
context.emit("command", item, rows, showList);
context.emit("command", item, rows, load, showList);
}
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",
"xe-echarts": "./lib/vue-echarts/index.esm.min.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-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/github-markdown-css/github-markdown.min.css");
@import url("./lib/highlightjs/highlight.css");
@import url("./lib/@vue-office/excel/index.css");
@import url("./lib/tailwindcss/tailwind.min.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, "未登录"],
[403, "权限不足"],
[500, "服务器异常"],
[503, "服务不可用"],
]);
const result = {
status: 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");
if (contentType.indexOf("application/json") > -1) {
result.data = await response.json();
@ -58,10 +59,13 @@ const getResult = async (response) => {
result.data = await response.blob();
result.filename = getFileName(response.headers.get("Content-Disposition"));
}
} /*if (response.status === 400 || response.status === 500) */ else {
} else {
result.errors = await response.json();
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;

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

Loading…
Cancel
Save