93c934d53e5c4275acb1e438fe3d272f.json 7.1 KB

1
  1. {"remainingRequest":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\front\\item\\zyAdmin\\src\\pages\\setting\\cityDada\\index.vue?vue&type=style&index=0&id=ff732caa&lang=scss&scoped=true","dependencies":[{"path":"D:\\front\\item\\zyAdmin\\src\\pages\\setting\\cityDada\\index.vue","mtime":1761614939051},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\css-loader\\index.js","mtime":1761614929364},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":1761614937403},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\postcss-loader\\src\\index.js","mtime":1761614935133},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\sass-loader\\dist\\cjs.js","mtime":1761614936391},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1761614927801},{"path":"D:\\front\\item\\zyAdmin\\node_modules\\vue-loader\\lib\\index.js","mtime":1761614937402}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:DQo6OnYtZGVlcCAuaXZ1LXRhYmxlLWNlbGwtdHJlZSB7DQogIGJvcmRlcjogMDsNCiAgZm9udC1zaXplOiAxNXB4Ow0KICBiYWNrZ3JvdW5kLWNvbG9yOiB1bnNldDsNCn0NCjo6di1kZWVwIC5pdnUtdGFibGUtY2VsbC10cmVlIC5pdnUtaWNvbi1pb3MtYWRkOmJlZm9yZSB7DQogIGNvbnRlbnQ6ICdcRjExRic7DQp9DQo6OnYtZGVlcCAuaXZ1LXRhYmxlLWNlbGwtdHJlZSAuaXZ1LWljb24taW9zLXJlbW92ZTpiZWZvcmUgew0KICBjb250ZW50OiAnXEYxMTYnOw0KfQ0KLmJ1dHRvbiB7DQogIHdpZHRoOiAzMDBweDsNCn0NCg=="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";AAgLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/pages/setting/cityDada","sourcesContent":["<template>\r\n <div>\r\n <el-card :bordered=\"false\" shadow=\"never\" class=\"ivu-mt\">\r\n <div class=\"acea-row row-between-wrapper mb20\">\r\n <el-row>\r\n <el-col v-bind=\"grid\">\r\n <div class=\"button acea-row row-middle\">\r\n <el-button type=\"primary\" v-db-click @click=\"add(0)\">添加省份</el-button>\r\n <el-button v-db-click @click=\"cleanCache\">清除缓存</el-button>\r\n </div>\r\n </el-col>\r\n </el-row>\r\n </div>\r\n <el-table\r\n row-key=\"id\"\r\n :load=\"handleLoadData\"\r\n :tree-props=\"{ children: 'children', hasChildren: 'hasChildren' }\"\r\n :data=\"cityLists\"\r\n lazy\r\n >\r\n <el-table-column label=\"编号\" width=\"120\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.id }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"地区名称\" min-width=\"300\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.label }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"上级名称\" min-width=\"300\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ scope.row.parent_name }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"操作\" fixed=\"right\" width=\"170\">\r\n <template slot-scope=\"scope\">\r\n <a v-if=\"scope.row.hasOwnProperty('children')\" v-db-click @click=\"add(scope.row.city_id)\">添加</a>\r\n <el-divider direction=\"vertical\" v-if=\"scope.row.hasOwnProperty('children')\" />\r\n <a v-db-click @click=\"edit(scope.row.id)\">编辑</a>\r\n <el-divider direction=\"vertical\"></el-divider>\r\n <a v-db-click @click=\"del(scope.row, '删除城市', scope.$index)\">删除</a>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n </el-card>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { mapState } from 'vuex';\r\nimport { cityListApi, cityAddApi, cityApi, cityCleanCacheApi } from '@/api/setting';\r\nexport default {\r\n name: 'setting_dada',\r\n data() {\r\n return {\r\n grid: {\r\n xl: 7,\r\n lg: 7,\r\n md: 12,\r\n sm: 24,\r\n xs: 24,\r\n },\r\n loading: false,\r\n columns1: [\r\n {\r\n title: '编号',\r\n key: 'id',\r\n width: 80,\r\n },\r\n {\r\n title: '地区名称',\r\n key: 'label',\r\n minWidth: 300,\r\n tree: true,\r\n },\r\n {\r\n title: '上级名称',\r\n key: 'parent_name',\r\n minWidth: 300,\r\n },\r\n {\r\n title: '操作',\r\n slot: 'action',\r\n fixed: 'right',\r\n minWidth: 120,\r\n },\r\n ],\r\n cityLists: [],\r\n cityId: 0, // 城市id\r\n };\r\n },\r\n computed: {\r\n ...mapState('media', ['isMobile']),\r\n labelWidth() {\r\n return this.isMobile ? undefined : '80px';\r\n },\r\n labelPosition() {\r\n return this.isMobile ? 'top' : 'right';\r\n },\r\n },\r\n created() {\r\n this.getList(0);\r\n },\r\n methods: {\r\n // 清除缓存;\r\n cleanCache() {\r\n cityCleanCacheApi()\r\n .then((res) => {\r\n this.$message.success(res.msg);\r\n })\r\n .catch((res) => {\r\n this.$message.success(res.msg);\r\n });\r\n },\r\n // 添加\r\n add(cityId) {\r\n this.$modalForm(cityAddApi(cityId)).then(() => this.getList(0));\r\n },\r\n // 添加下级;\r\n lower(cityId) {\r\n this.cityId = cityId;\r\n this.getList(cityId);\r\n },\r\n // 城市列表\r\n getList(parentId) {\r\n let that = this;\r\n that.loading = true;\r\n cityListApi(parentId)\r\n .then(async (res) => {\r\n that.cityLists = res.data;\r\n that.loading = false;\r\n })\r\n .catch((res) => {\r\n that.loading = false;\r\n that.$message.error(res.msg);\r\n });\r\n },\r\n // 返回\r\n goBack() {\r\n this.cityId = 0;\r\n this.getList(0);\r\n },\r\n // 修改\r\n edit(id) {\r\n this.$modalForm(cityApi(id)).then(() => this.getList(this.cityId));\r\n },\r\n // 删除\r\n del(row, tit, num) {\r\n let delfromData = {\r\n title: tit,\r\n num: num,\r\n url: `setting/city/del/${row.city_id}`,\r\n method: 'DELETE',\r\n ids: '',\r\n };\r\n this.$modalSure(delfromData)\r\n .then((res) => {\r\n this.$message.success(res.msg);\r\n this.cityLists.splice(num, 1);\r\n this.getList(this.cityId);\r\n })\r\n .catch((res) => {\r\n this.$message.error(res.msg);\r\n });\r\n },\r\n handleLoadData(item, node, callback) {\r\n cityListApi(item.city_id).then((res) => {\r\n callback(res.data);\r\n });\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .ivu-table-cell-tree {\r\n border: 0;\r\n font-size: 15px;\r\n background-color: unset;\r\n}\r\n::v-deep .ivu-table-cell-tree .ivu-icon-ios-add:before {\r\n content: '\\F11F';\r\n}\r\n::v-deep .ivu-table-cell-tree .ivu-icon-ios-remove:before {\r\n content: '\\F116';\r\n}\r\n.button {\r\n width: 300px;\r\n}\r\n</style>\r\n"]}]}