x-php-Admin/dist/static/js/app.9b427868.js

1 line
141 KiB
JavaScript
Raw Normal View History

2023-12-26 14:21:54 +00:00
(function(){var __webpack_modules__={654:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7658),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__),_utils_request__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4471);__webpack_exports__.Z={props:{modelValue:{type:Object,default:()=>{}},config:{type:Object,default:()=>{}},loading:{type:Boolean,default:!1}},components:{},data(){return{form:{},renderLoading:!1}},watch:{modelValue(){this.hasConfig&&this.deepMerge(this.form,this.modelValue)},config(){this.render()},form:{handler(e){this.$emit("update:modelValue",e)},deep:!0}},computed:{hasConfig(){return Object.keys(this.config).length>0},hasValue(){return Object.keys(this.modelValue).length>0}},created(){},mounted(){this.hasConfig&&this.render()},methods:{render(){this.config.column.forEach((e=>{if(e.options=e.options?e.options:[],"checkbox"==e.component)if(e.name){const t={};e.options.items.forEach((e=>{t[e.name]=e.value})),this.form[e.name]=t}else e.options.items.forEach((e=>{this.form[e.name]=e.value}));else this.form[e.name]=e.value})),this.hasValue&&(this.form=this.deepMerge(this.form,this.modelValue)),this.getData()},getData(){this.renderLoading=!0;var e=[];this.config.column.forEach((t=>{if(t.options&&t.options.remote){var a=_utils_request__WEBPACK_IMPORTED_MODULE_1__.Z.get(t.options.remote.api,t.options.remote.data).then((e=>{t.options.items=e.data}));e.push(a)}})),Promise.all(e).then((()=>{this.renderLoading=!1}))},deepMerge(e,t){let a;for(a in t)e[a]=e[a]&&"[object Object]"===e[a].toString()&&t[a]&&"[object Object]"===t[a].toString()?this.deepMerge(e[a],t[a]):e[a]=t[a];return e},validate(e,t){return this.$refs.form.validate(e,t)},scrollToField(e){return this.$refs.form.scrollToField(e)},resetFields(){return this.$refs.form.resetFields()},submit(){this.$emit("submit",this.form)},rulesHandle(item){if(item.requiredHandle){const exp=eval(item.requiredHandle.replace(/\$/g,"this.form"));var requiredRule=item.rules.find((e=>"required"in e));requiredRule.required=exp}return item.rules},hideHandle(item){if(item.hideHandle){const exp=eval(item.hideHandle.replace(/\$/g,"this.form"));return exp}return!1}}}},7877:function(e,t,a){"use strict";const l={},i=a(5855);i.keys().forEach((e=>{l[e.replace(/(\.\/|\.js)/g,"")]=i(e).default})),t.Z=l},8709:function(e,t,a){"use strict";a.r(t);var l=a(4471);t["default"]={index:{get:async function(){return await l.Z.get("/system/index")}},table:{get:async function(e="",t={}){return await l.Z.get("/system/table/get",{name:e},t)}}}},4569:function(e,t,a){"use strict";a.r(t);var l=a(4471);t["default"]={token:{post:async function(e={}){return await l.Z.post("/login",e)}}}},9811:function(e,t,a){"use strict";a.r(t);var l=a(4471);t["default"]={upload:{url:"/upload/admin/upload",post:async function(e,t={}){return await l.Z.post(this.url,e,t)}},uploadFile:{post:async function(e,t={}){return await l.Z.post("/upload/admin/upload?type=file",e,t)}}}},4539:function(e,t,a){"use strict";a.r(t);var l=a(4471);t["default"]={index:{get:async function(){return await l.Z.get("/system/index")}},table:{get:async function(e=""){return await l.Z.get("/table/get",{name:e},{cache:!0})},getUpdate:async function(e="",t=[]){return await l.Z.post("/table/getUpdate",{name:e},t)},columnSettingSave:async function(e="",t=[]){return await l.Z.post("/table/columnSettingSave",{name:e,column:t})}}}},1073:function(e,t){"use strict";const a={APP_NAME:"X-PHP",DASHBOARD_URL:"/dashboard",APP_VER:"1.6.9",CORE_VER:"1.6.9",API_URL:"/admin",TIMEOUT:1e4,THEMESETTING:!0,THEMEHEADER:!1,TOKEN_NAME:"token",SESSIONNAME:"MIUCMSSESSION",TOKEN_PREFIX:"",HEADERS:{},REQUEST_CACHE:!1,LAYOUT:"default",MENU_IS_COLLAPSE:!1,MENU_UNIQUE_OPENED:!1,LAYOUT_TAGS:!0,LANG:"zh-cn",COLOR:"",LS_ENCRYPTION:"",LS_ENCRYPTION_key:"2XNN4K8LC0ELVWN4",DEFAULT_GRID:[{name:"work",layout:24},{name:"welcome",layout:12},{name:"about",layout:12}]};"undefine