diff --git a/code/.gitignore b/code/.gitignore index 07d8289e..4e191f0f 100644 --- a/code/.gitignore +++ b/code/.gitignore @@ -1,24 +1,5 @@ -<<<<<<< HEAD -################################################################################ -# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。 -################################################################################ - -/src/.vs/SettleAccount/DesignTimeBuild/.dtbcache.v2 -/.vs/slnx.sqlite -/src/.vs/SmartFactorySuite/DesignTimeBuild/.dtbcache.v2 -/src/.vs/SmartFactorySuite/v16/.suo -/src/.vs/SettleAccount/v16/.suo - - -/*.rar -/src/Shared -/.vs/Win.Sfs.SmartSettlementSystem.PG/v17/.suo -/src/.vs/SettleAccount/v17/.suo -/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220226.txt -/src/.vs/SettleAccount/v17/.futdcache.v1 -/src/.vs/SettleAccount/v17/fileList.bin -======= *.bak +*.log #fe node_modules/ @@ -28,10 +9,11 @@ dist/ .vs/ bin/ obj/ +[Ll]og/ +[Ll]ogs/ *.suo *.user *.db *.db-shm *.db-wal ->>>>>>> c0f08a7ed0ffc663a2852d4c0da54a983f033a2f diff --git a/code/WebApp/vanilla/api/user.js b/code/WebApp/vanilla/api/user.js index e830bbdd..d245865a 100644 --- a/code/WebApp/vanilla/api/user.js +++ b/code/WebApp/vanilla/api/user.js @@ -1,5 +1,5 @@ import router from "../router/index.js"; -import { get, post } from "../request/index.js"; +import request, { get, post } from "../request/index.js"; import jwt_decode from "../lib/jwt-decode/jwt-decode.esm.js"; import qs from "../lib/qs/shim.js"; import { useAppStore } from "../store/index.js"; @@ -46,7 +46,9 @@ const logout = () => { }; const getUser = async () => { - const result = await get("abp/application-configuration"); + const result = await request("abp/application-configuration", null, { + method: "GET", + }); const data = result.data; const user = {}; user.id = data.currentUser.id; diff --git a/code/WebApp/vanilla/app.js b/code/WebApp/vanilla/app.js index 9f35eb2c..34b69c72 100644 --- a/code/WebApp/vanilla/app.js +++ b/code/WebApp/vanilla/app.js @@ -6,12 +6,11 @@ import { Suspense, reactive, onMounted } from "vue"; export default { components: { ElConfigProvider, Suspense }, - template: html` + template: html` - - `, + `, setup() { const localeMap = reactive( new Map([ diff --git a/code/WebApp/vanilla/components/form/form-input.js b/code/WebApp/vanilla/components/form/form-input.js index a99cc6c0..87d16b3d 100644 --- a/code/WebApp/vanilla/components/form/form-input.js +++ b/code/WebApp/vanilla/components/form/form-input.js @@ -1,15 +1,16 @@ import html from "html"; -import { ref, reactive, watch } from "vue"; +import { ref, reactive, watch, onMounted } from "vue"; import { dayjs } from "element-plus"; -import { post } from "../../request/index.js"; +import request, { post } from "../../request/index.js"; export default { template: html` @@ -55,28 +56,25 @@ export default { v-model="model[prop]" type="password" show-password - v-if="schema.format==='password'" + v-if="schema.input==='password'" /> `, - props: ["modelValue", "schema", "prop", "isReadOnly"], + props: ["modelValue", "schema", "prop", "isReadOnly", "mode"], emit: ["update:modelValue"], - async setup(props, context) { + setup(props, context) { const model = reactive(props.modelValue); watch(model, (value) => { context.emit("update:modelValue", value); }); /*start*/ const getDisabled = () => { - if (props.isReadOnly && props.isReadOnly === true) { + if (props.mode === "details") { return true; } - if (props.schema.displayOnly) { - return true; - } - if (props.mode === "update" && props.schema.addOnly) { + if (props.mode === "update" && props.schema.readOnly) { return true; } return false; @@ -89,20 +87,22 @@ export default { const selectProps = ref({}); const selectValues = ref([]); const options = ref([]); - if (props.schema.options) { - options.value = props.schema.options; - } else if (props.schema.url) { - try { - const url = `${props.schema.url}`; - const result = await post(url, { queryAll: true, query: { isReadonly: null, isDisabled: null, order: null } }); - options.value = result.data?.items.map((o) => ({ - value: o[props.schema.value], - label: o[props.schema.label], - })); - } catch (error) { - console.log(error); + onMounted(async () => { + if (props.schema.options) { + options.value = props.schema.options; + } else if (props.schema.url) { + try { + const url = `${props.schema.url}`; + const result = await request(url, null, { method: "GET" }); + options.value = result.data?.items.map((o) => ({ + value: o[props.schema.value], + label: o[props.schema.label], + })); + } catch (error) { + console.log(error); + } } - } + }); return { model, getDisabled, diff --git a/code/WebApp/vanilla/components/form/form-item.js b/code/WebApp/vanilla/components/form/form-item.js index ae49e013..1616337b 100644 --- a/code/WebApp/vanilla/components/form/form-item.js +++ b/code/WebApp/vanilla/components/form/form-item.js @@ -1,11 +1,13 @@ import html from "html"; import { defineAsyncComponent, ref, reactive, watch } from "vue"; +import { format } from "../../utils/index.js"; +import { messages } from "../../utils/validation.js"; export default { name: "formItem", components: { AppFormInput: defineAsyncComponent(() => import("./form-input.js")) }, template: html` -