Browse Source

新增三个页面JS

master
zhouhongjun 12 months ago
parent
commit
7a19a78844
  1. 43
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/bei-jian-show.js
  2. 44
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/xiao-shou-show.js
  3. 44
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/yin-du-jian-show.js

43
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/bei-jian-show.js

@ -0,0 +1,43 @@
import html from "html";
import { ref } from "vue";
import request from "../../request/index.js";
import AppList from "../../components/list/index.js";
import useConfig from "../../models/base-data/jia-ge-dan.js";
export default {
components: { AppList },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() {
const appListRef = ref(null);
const config = useConfig("price-list-app-service-bj");
const onCommand = async (item, rows) => {
if (item.path === "enable" || item.path === "disable") {
await appListRef.value.onClick(
async () => await request(config.edit.updateUrl, { id: rows[0].id, isCancel: item.path === "enable" ? false : true }, { method: "POST" }, true),
`确认${item.path === "enable" ? "启用" : "停用"}选中的${rows.length}行数据吗?`,
true
);
}
if (item.path === "enable-all") {
await appListRef.value.onClick(
async () => await request("settleaccount/price-list-app-service-bj/update-list", { guids: rows.map((o) => o.id), isCancel: false }, { method: "POST" }, true),
`确认${"启用"}选中的${rows.length}行数据吗?`,
true
);
}
if (item.path === "disable-all") {
await appListRef.value.onClick(
async () => await request("settleaccount/price-list-app-service-bj/update-list", { guids: rows.map((o) => o.id), isCancel: true }, { method: "POST" }, true),
`确认${"停用"}选中的${rows.length}行数据吗?`,
true
);
}
};
return { appListRef, config, onCommand };
},
};

44
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/xiao-shou-show.js

@ -0,0 +1,44 @@
import html from "html";
import { ref } from "vue";
import request from "../../request/index.js";
import AppList from "../../components/list/index.js";
import useConfig from "../../models/base-data/xiao-shou.js";
export default {
components: { AppList },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() {
const appListRef = ref(null);
const config = useConfig();
const onCommand = async (item, rows) => {
const url = `${config.baseUrl}/${item.path}`;
if (item.path === "enable" || item.path === "disable") {
await appListRef.value.onClick(
async () => await request("settleaccount/price-list/update", { id: rows[0].id, isCancel: item.path === "enable" ? false : true }, { method: "POST" }, true),
`确认${item.path === "enable" ? "启用" : "停用"}选中的${rows.length}行数据吗?`,
true
);
}
if (item.path === "enable-all") {
await appListRef.value.onClick(
async () => await request("settleaccount/price-list/update-list", { guids: rows.map((o) => o.id), isCancel: false }, { method: "POST" }, true),
`确认${"启用"}选中的${rows.length}行数据吗?`,
true
);
}
if (item.path === "disable-all") {
await appListRef.value.onClick(
async () => await request("settleaccount/price-list/update-list", { guids: rows.map((o) => o.id), isCancel: true }, { method: "POST" }, true),
`确认${"停用"}选中的${rows.length}行数据吗?`,
true
);
}
};
return { appListRef, config, onCommand };
},
};

44
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/yin-du-jian-show.js

@ -0,0 +1,44 @@
import html from "html";
import { ref } from "vue";
import request from "../../request/index.js";
import AppList from "../../components/list/index.js";
import useConfig from "../../models/base-data/jia-ge-dan.js";
export default {
components: { AppList },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() {
const appListRef = ref(null);
const config = useConfig("price-list-app-service-yin-du");
const onCommand = async (item, rows) => {
if (item.path === "enable" || item.path === "disable") {
await appListRef.value.onClick(
async () => await request(config.edit.updateUrl, { id: rows[0].id, isCancel: item.path === "enable" ? false : true }, { method: "POST" }, true),
`确认${item.path === "enable" ? "启用" : "停用"}选中的${rows.length}行数据吗?`,
true
);
}
if (item.path === "enable-all") {
await appListRef.value.onClick(
async () => await request("settleaccount/price-list-app-service-yin-du/update-list", { guids: rows.map((o) => o.id), isCancel: false }, { method: "POST" }, true),
`确认${"启用"}选中的${rows.length}行数据吗?`,
true
);
}
if (item.path === "disable-all") {
await appListRef.value.onClick(
async () => await request("settleaccount/price-list-app-service-yin-du/update-list", { guids: rows.map((o) => o.id), isCancel: true }, { method: "POST" }, true),
`确认${"停用"}选中的${rows.length}行数据吗?`,
true
);
}
};
return { appListRef, config, onCommand };
},
};
Loading…
Cancel
Save