2024-01-08 09:16:10 +00:00
|
|
|
(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[915],{6604:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4458),core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(8311),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);__webpack_exports__.Z={name:"table_2",components:{},props:{name:{type:String,default:""}},data(){return{dialog:{save:!1,stat:!1},isselection:!0,tableexpand:!1,tableexpandtype:"",defaultExpandAll:!0,tableexpandfield:"content",selection:[],column:[],batch:[],aside:{items:[]},filter:[],api:"",operation:{},key:"id",title:"",search:{},tabs:[],stat:[],chartoption:{},tablename:this.$route.meta.tablename,tableurl:this.$route.meta.tableurl,groupFilterText:"",tabskey:""}},mounted(){if(this.name&&(this.tablename=this.name||this.$route.meta.tablename),this.tablename||this.tableurl){var e=this.tableurl?this.$http.get(this.tableurl,{},{cache:!0}):this.$api.system.table.get(this.tablename,{cache:this.$route.meta.tablecache||0});e.then((e=>{if(200==e.code){Object.assign(this.$data,e.data);for(const e in this.search)Object.prototype.hasOwnProperty.call(this.$route.query,e)&&(this.search[e]=this.$route.query[e]);this.$emit("child-loaded",Object.assign({},this.$data.aside,{search:this.search}))}}))}},computed:{getWidth(){return function(e){return e.width?e.width+"px":"auto"}},exporturl(){if(this.displayHandle()){const e=new URL(this.operation.export.url),l=new URLSearchParams(e.search);for(const t in this.search)l.append(t,this.search[t]);return e.search=l.toString(),e.href}return""},filterObj(){const e=[];return this.filter.forEach((l=>{l.component&&e.push({name:l.value,label:l.label,component:l.component,options:l.options})})),e}},watch:{groupFilterText(e){this.$refs.group.filter(e)}},methods:{displayHandle(){return!!(this.$refs.table.total&&this.operation.export&&this.operation.export.showhandle)&&eval(this.operation.export.showhandle.replace(/\$/g,"this.search"))},groupFilterNode(e,l){return!e||-1!==l.label.indexOf(e)},groupClick(e){this.search[this.aside.searchkey||"groupid"]=e[this.aside.key||"id"],this.$refs.table.reload(this.search)},filterChange(e){var l=Object.assign({},this.search,e);this.$refs.table.reload(l)},tabChange(){this.$refs.table.reload(this.search)},handleSuccess(e,l,t){"edit"==l?e?this.$refs.table.tableData.filter((l=>l[this.key]===e[this.key])).forEach((l=>{Object.assign(l,e,e)})):this.$refs.table.refresh():e?this.$refs.table.tableData.unshift(e):this.$refs.table.reload({}),this.$message.success(t||"操作成功")},plus(){this.dialog.save=!0,this.$nextTick((()=>{let e=this.operation.plus.data||{};for(const l in e)Object.prototype.hasOwnProperty.call(this.search,l)&&(e[l]=this.search[l]);this.$refs.saveDialog.open("plus").getComponentType(this.operation.plus.component).setData(e).setConfig(this.operation.plus)}))},operationEdit(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("edit").getComponentType(this.operation.edit.component).setData(e).setConfig(this.operation.edit)}))},openStat(e){this.dialog.stat=!0,this.$nextTick((()=>{this.$refs.xstatdialog.open().setData(e)}))},async operationDelete(e,l){const t="undefined"!==typeof this.operation.delete.key&&this.operation.delete.key?this.operation.delete.key:this.key;var a=await this.$http.post(this.operation.delete.url,{[t]:e[t],index:l});200!=a.code?this.$alert(a.message,"提示",{type:"error"}):this.$refs.table.refresh()},selectionChange(e){this.selection=e}}}},3995:function(e,l,t){"use strict";t.r(l),t.d(l,{urlPrefix:function(){return o}});var a=t(7043);const o="/tenement/apartment/";l["default"]={get:async function(e,l){return await a.Z.get(o+e,l)},post
|