wanggang
1 year ago
5 changed files with 53 additions and 20 deletions
@ -0,0 +1,24 @@ |
|||
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 === "open-version" ? "启用" : "停用"}选中的${rows.length}行数据吗?`, |
|||
true |
|||
); |
|||
} |
|||
}; |
|||
return { appListRef, config, onCommand }; |
|||
}, |
|||
}; |
Loading…
Reference in new issue