1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"remainingRequest":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\phpstudy_pro\\WWW\\travel\\admin\\src\\views\\shortcut\\shortcutContent.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\src\\views\\shortcut\\shortcutContent.vue","mtime":1718761715722},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1718764957200},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\babel-loader\\lib\\index.js","mtime":1718764959024},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1718764957200},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\vue-loader\\lib\\index.js","mtime":1718764959862}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:Ly8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KCmltcG9ydCBQYWdpbmF0aW9uIGZyb20gJ0AvY29tcG9uZW50cy9QYWdpbmF0aW9uRml4ZWQnCgpleHBvcnQgZGVmYXVsdCB7CiAgbmFtZTogJ0dldFNob3J0Y3V0Q29udGVudCcsCiAgY29tcG9uZW50czogeyBQYWdpbmF0aW9uIH0sCiAgZGF0YSgpIHsKICAgIHJldHVybiB7CiAgICAgIHN0YXR1c0FycjogeyAwOiAn56aB55SoJywgMTogJ+WQr+eUqCcgfSwKICAgICAgbGlzdDogW10sCiAgICAgIHRvdGFsOiAwLAogICAgICBsb2FkaW5nOiBmYWxzZSwKICAgICAgbGlzdExvYWRpbmc6IHRydWUsCiAgICAgIGxpc3RRdWVyeTogewogICAgICAgIHBhZ2U6IDEsCiAgICAgICAgbGltaXQ6IDEwLAogICAgICAgIHN0YXR1czogbnVsbCwKICAgICAgICBjb250ZW50OiAnJwogICAgICB9LAogICAgICBkaWFsb2dDcmVhdGU6IGZhbHNlLAogICAgICBkaWFsb2dFZGl0OiBmYWxzZSwKICAgICAgaXRlbToge30sCiAgICAgIGFuY2hvcnM6IHt9CiAgICB9CiAgfSwKICBjcmVhdGVkKCkgewogICAgdGhpcy5saXN0UXVlcnkuc3RhdHVzID0gdGhpcy4kcm91dGUucXVlcnkuc3RhdHVzIHx8IG51bGwKICAgIHRoaXMubGlzdFF1ZXJ5LmNvbnRlbnQgPSB0aGlzLiRyb3V0ZS5xdWVyeS5jb250ZW50IHx8IG51bGwKICAgIHRoaXMuZ2V0U2hvcnRjdXRDb250ZW50KCkKICB9LAogIG1ldGhvZHM6IHsKICAgIGdldFNob3J0Y3V0Q29udGVudCgpIHsKICAgICAgdGhpcy5saXN0TG9hZGluZyA9IHRydWUKICAgICAgdGhpcy4kYXhpb3MuZ2V0KCcvYWRtaW4vc2hvcnRjdXRDb250ZW50L2xpc3QnLCB7IHBhcmFtczogdGhpcy5saXN0UXVlcnkgfSkudGhlbihyZXNwb25zZSA9PiB7CiAgICAgICAgdGhpcy5saXN0ID0gcmVzcG9uc2UuZGF0YS5kYXRhCiAgICAgICAgdGhpcy50b3RhbCA9IHJlc3BvbnNlLmRhdGEudG90YWwKICAgICAgICB0aGlzLmxpc3RMb2FkaW5nID0gZmFsc2UKICAgICAgfSkuY2F0Y2goKCkgPT4gewogICAgICAgIHRoaXMubGlzdExvYWRpbmcgPSBmYWxzZQogICAgICB9KQogICAgfSwKICAgIG9uQWRkKCkgewogICAgICB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YXhpb3MucG9zdCgnL2FkbWluL3Nob3J0Y3V0Q29udGVudC9lZGl0JywgeyBpZDogaXRlbS5pZCwgc29ydDogaXRlbS5zb3J0IH0pLnRoZW4oKCkgPT4gewogICAgICAgIHRoaXMuZ2V0U2hvcnRjdXRDb250ZW50KCkKICAgICAgfSkuY2F0Y2goKCkgPT4gewogICAgICB9KQogICAgfSwKICAgIHVwZGF0ZVN0YXR1cyhpdGVtKSB7CiAgICAgIHRoaXMuJGF4aW9zLnBvc3QoJy9hZG1pbi9zaG9ydGN1dENvbnRlbnQvZWRpdCcsIHsgaWQ6IGl0ZW0uaWQsIHN0YXR1czogaXRlbS5zdGF0dXMgfSkudGhlbigoKSA9PiB7CiAgICAgICAgdGhpcy5nZXRTaG9ydGN1dENvbnRlbnQoKQogICAgICB9KS5jYXRjaCgoKSA9PiB7CiAgICAgIH0pCiAgICB9CiAgfQp9Cg=="},{"version":3,"sources":["shortcutContent.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"shortcutContent.vue","sourceRoot":"src/views/shortcut","sourcesContent":["<template>\n <div class=\"app-container\">\n <div class=\"filter-container\">\n <el-input v-model=\"listQuery.content\" placeholder=\"搜索快捷内容\" style=\"width: 200px;\" class=\"filter-item\" />\n <el-select v-model=\"listQuery.status\" filterable placeholder=\"状态\" class=\"filter-item\" style=\"width: 120px;\">\n <el-option key=\"\" label=\"请选择\" value=\"\" />\n <el-option v-for=\"(v, k) in statusArr\" :key=\"k\" :label=\"v\" :value=\"k\" />\n </el-select>\n <el-button class=\"filter-item search\" type=\"primary\" icon=\"el-icon-search\" @click=\"getShortcutContent\">搜索</el-button>\n <el-button class=\"filter-item\" type=\"primary\" icon=\"el-icon-circle-plus\" @click=\"onAdd\">添加</el-button>\n </div>\n\n <el-table v-loading=\"listLoading\" :data=\"list\" border fit highlight-current-row style=\"width: 100%\">\n <el-table-column align=\"center\" fixed label=\"ID\" width=\"80\" prop=\"id\" />\n <el-table-column align=\"center\" fixed label=\"快捷内容\" width=\"380\" prop=\"content\" />\n <el-table-column align=\"center\" label=\"排序\" width=\"140\">\n <template #default=\"scope\">\n <el-input-number v-model=\"scope.row.sort\" :max=\"100\" :min=\"0\" class=\"small-input-number\" @change=\"updateSort(scope.row)\" style=\"width: 110px; height: 36px;\" />\n </template>\n </el-table-column>\n <el-table-column align=\"center\" label=\"状态\" width=\"100\">\n <template #default=\"scope\">\n <el-switch v-model=\"scope.row.status\" :active-value=\"1\" :inactive-value=\"0\" @change=\"updateStatus(scope.row)\" />\n </template>\n </el-table-column>\n <el-table-column align=\"center\" width=\"220\" label=\"操作\">\n <template #default=\"scope\">\n <el-button type=\"primary\" size=\"small\" icon=\"el-icon-edit\" @click=\"onEdit(scope.row)\">编辑</el-button>\n <el-button type=\"danger\" size=\"small\" icon=\"el-icon-delete\" @click=\"onDel(scope.row)\">删除</el-button>\n </template>\n </el-table-column>\n </el-table>\n\n <pagination v-show=\"total > 0\" :total=\"total\" :page.sync=\"listQuery.page\" :limit.sync=\"listQuery.limit\" @pagination=\"getShortcutContent\" />\n\n <el-dialog title=\"添加快捷内容\" :visible.sync=\"dialogCreate\">\n <el-form label-width=\"120px\" :model=\"anchors\">\n <el-form-item label=\"快捷内容\">\n <el-input v-model=\"anchors.content\" type=\"textarea\" placeholder=\"请输入快捷内容\" />\n </el-form-item>\n <el-form-item label=\"排序\">\n <el-input-number v-model=\"anchors.sort\" :max=\"100\" :min=\"0\" controls-position=\"right\" />\n </el-form-item>\n <el-form-item label=\"状态\">\n <el-switch v-model=\"anchors.status\" :active-value=\"1\" :inactive-value=\"0\" active-color=\"#13ce66\" inactive-color=\"#ff4949\" />\n </el-form-item>\n </el-form>\n <div slot=\"footer\" class=\"dialog-footer\">\n <el-button v-loading=\"loading\" type=\"primary\" @click=\"onSave\">保 存</el-button>\n </div>\n </el-dialog>\n\n <el-dialog title=\"编辑内容\" :visible.sync=\"dialogEdit\">\n <el-form label-width=\"120px\" :model=\"anchors\">\n <el-form-item label=\"快捷内容\">\n <el-input v-model=\"anchors.content\" type=\"textarea\" placeholder=\"请输入快捷内容\" />\n </el-form-item>\n <el-form-item label=\"排序\">\n <el-input-number class=\"aaas\" v-model=\"anchors.sort\" :max=\"100\" :min=\"0\" controls-position=\"right\" />\n </el-form-item>\n <el-form-item label=\"状态\">\n <el-switch v-model=\"anchors.status\" :active-value=\"1\" :inactive-value=\"0\" active-color=\"#13ce66\" inactive-color=\"#ff4949\" />\n </el-form-item>\n </el-form>\n <div slot=\"footer\" class=\"dialog-footer\">\n <el-button v-loading=\"loading\" type=\"primary\" @click=\"onSave\">保 存</el-button>\n </div>\n </el-dialog>\n </div>\n</template>\n\n<script>\nimport Pagination from '@/components/PaginationFixed'\n\nexport default {\n name: 'GetShortcutContent',\n components: { Pagination },\n data() {\n return {\n statusArr: { 0: '禁用', 1: '启用' },\n list: [],\n total: 0,\n loading: false,\n listLoading: true,\n listQuery: {\n page: 1,\n limit: 10,\n status: null,\n content: ''\n },\n dialogCreate: false,\n dialogEdit: false,\n item: {},\n anchors: {}\n }\n },\n created() {\n this.listQuery.status = this.$route.query.status || null\n this.listQuery.content = this.$route.query.content || null\n this.getShortcutContent()\n },\n methods: {\n getShortcutContent() {\n this.listLoading = true\n this.$axios.get('/admin/shortcutContent/list', { params: this.listQuery }).then(response => {\n this.list = response.data.data\n this.total = response.data.total\n this.listLoading = false\n }).catch(() => {\n this.listLoading = false\n })\n },\n onAdd() {\n this.anchors = { sort: 0 } // 初始化时默认排序值为0\n this.dialogCreate = true\n },\n onEdit(item) {\n this.anchors = { ...item }\n this.dialogEdit = true\n },\n onSave() {\n if (this.loading) return\n this.loading = true\n const api = this.dialogCreate ? '/admin/shortcutContent/add' : '/admin/shortcutContent/edit'\n this.$axios.post(api, this.anchors).then(() => {\n this.dialogCreate = false\n this.dialogEdit = false\n this.loading = false\n this.getShortcutContent()\n }).catch(() => {\n this.loading = false\n })\n },\n onDel(item) {\n this.$axios.post('/admin/shortcutContent/del', { id: item.id }).then(() => {\n this.getShortcutContent()\n }).catch(() => {\n })\n },\n updateSort(item) {\n this.$axios.post('/admin/shortcutContent/edit', { id: item.id, sort: item.sort }).then(() => {\n this.getShortcutContent()\n }).catch(() => {\n })\n },\n updateStatus(item) {\n this.$axios.post('/admin/shortcutContent/edit', { id: item.id, status: item.status }).then(() => {\n this.getShortcutContent()\n }).catch(() => {\n })\n }\n }\n}\n</script>\n\n<style scoped>\n.app-container {\n position: relative;\n padding-bottom: 60px; /* 分页条的高度 */\n}\n\n.filter-container,\n.el-table {\n padding-bottom: 52px; /* 分页条的高度,以避免内容重叠 */\n}\n\n.search {\n margin-left: 10px;\n}\n</style>\n"]}]} |