865f9050 by 任超

style:menu

1 parent f264811e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 overflow: hidden; 2 overflow: hidden;
3 background: url("~@/image/dialogBg.png") no-repeat !important; 3 background: url("~@/image/dialogBg.png") no-repeat !important;
4 background-size: 100% 100% !important; 4 background-size: 100% 100% !important;
5 min-height: 90vh; 5 // min-height: 90vh;
6 6
7 .dialog_title { 7 .dialog_title {
8 display: flex; 8 display: flex;
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
98 color: #B5D6DC; 98 color: #B5D6DC;
99 border-radius: 2px; 99 border-radius: 2px;
100 border: 1px solid #224C7C; 100 border: 1px solid #224C7C;
101
101 span { 102 span {
102 display: inline-block; 103 display: inline-block;
103 padding: 3px; 104 padding: 3px;
...@@ -155,7 +156,7 @@ ...@@ -155,7 +156,7 @@
155 .el-dialog__body { 156 .el-dialog__body {
156 padding-top: 0; 157 padding-top: 0;
157 padding-bottom: 0; 158 padding-bottom: 0;
158 height: 95vh; 159 // height: 95vh;
159 } 160 }
160 161
161 .el-dialog__headerbtn { 162 .el-dialog__headerbtn {
......
...@@ -43,19 +43,23 @@ class data extends filter { ...@@ -43,19 +43,23 @@ class data extends filter {
43 // }, 43 // },
44 { 44 {
45 label: "查封机关", 45 label: "查封机关",
46 prop: "cfjg" 46 prop: "cfjg",
47 minWidth: 150,
47 }, 48 },
48 { 49 {
49 label: "查封文号", 50 label: "查封文号",
50 prop: "cfwh" 51 prop: "cfwh",
52 minWidth: 130,
51 }, 53 },
52 { 54 {
53 label: "解封机关", 55 label: "解封机关",
54 prop: "jfjg" 56 prop: "jfjg",
57 width: 150,
55 }, 58 },
56 { 59 {
57 label: "解封文号", 60 label: "解封文号",
58 prop: "jfwh" 61 prop: "jfwh",
62 minWidth: 130,
59 }, 63 },
60 64
61 { 65 {
......
1 <template> 1 <template>
2 <div> 2 <dialogBox class="modifydialog" :isMain="true" :title="2222" @closeDialog="close" @submitForm="submitForm" v-model="myValue">
3 <Dialog class="modifydialog" :title="title" :show.sync="visible" :width="'767px'" @close="close()"> 3 <div class="modifydialog-con">
4 <template slot="content"> 4 <el-form ref="form" :model="form" :rules="rules">
5 <el-form ref="form" :model="form" :rules="rules"> 5 <el-row :gutter="24">
6 <el-row :gutter="24"> 6 <el-col :span="12">
7 <el-col :span="12"> 7 <el-form-item label="菜单名称:" prop="name" label-width="124px">
8 <el-form-item label="菜单名称:" prop="name" label-width="124px"> 8 <el-input v-model="form.name" placeholder="请输入菜单名称" />
9 <el-input v-model="form.name" placeholder="请输入菜单名称" /> 9 </el-form-item>
10 </el-form-item> 10 </el-col>
11 </el-col> 11 </el-row>
12 </el-row> 12 <el-row :gutter="24">
13 <el-row :gutter="24"> 13 <el-col :span="12">
14 <el-col :span="12"> 14 <el-form-item label="上级菜单:" label-width="124px">
15 <el-form-item label="上级菜单:" label-width="124px"> 15 <el-cascader :key="menuKey" v-model="form.parentId" :options="parentMenuList" :props="setProps"
16 <el-cascader :key="menuKey" v-model="form.parentId" :options="parentMenuList" :props="setProps" 16 placeholder="请选择上级菜单" clearable @change="handleChange" />
17 placeholder="请选择上级菜单" clearable @change="handleChange" /> 17 </el-form-item>
18 </el-form-item> 18 </el-col>
19 </el-col>
20 19
21 </el-row> 20 </el-row>
22 <el-row :gutter="24"> 21 <el-row :gutter="24">
23 <el-col :span="24"> 22 <el-col :span="24">
24 <el-form-item label="代码:" prop="code" label-width="124px"> 23 <el-form-item label="代码:" prop="code" label-width="124px">
25 <el-input v-model="codeComputed" placeholder="请输入菜单代码" :disabled="type === 1" /> 24 <el-input v-model="codeComputed" placeholder="请输入菜单代码" :disabled="type === 1" />
26 </el-form-item> 25 </el-form-item>
27 </el-col> 26 </el-col>
28 </el-row> 27 </el-row>
29 <el-row :gutter="24"> 28 <el-row :gutter="24">
30 <el-col :span="24"> 29 <el-col :span="24">
31 <el-form-item label="链接路径:" label-width="124px"> 30 <el-form-item label="链接路径:" label-width="124px">
32 <el-input v-model="form.uri" placeholder="请输入链接路径" /> 31 <el-input v-model="form.uri" placeholder="请输入链接路径" />
33 </el-form-item> 32 </el-form-item>
34 </el-col> 33 </el-col>
35 </el-row> 34 </el-row>
36 <el-row :gutter="24"> 35 <el-row :gutter="24">
37 <el-col :span="24"> 36 <el-col :span="24">
38 <el-form-item label="浏览器跳转模式:" label-width="124px"> 37 <el-form-item label="浏览器跳转模式:" label-width="124px">
39 <el-select v-model="form.jumpMode" placeholder="请选择浏览器跳转模式"> 38 <el-select v-model="form.jumpMode" placeholder="请选择浏览器跳转模式">
40 <el-option v-for="item in jumpModeList" :key="item.value" :label="item.name" :value="item.value" /> 39 <el-option v-for="item in jumpModeList" :key="item.value" :label="item.name" :value="item.value" />
41 </el-select> 40 </el-select>
42 </el-form-item> 41 </el-form-item>
43 </el-col> 42 </el-col>
44 </el-row> 43 </el-row>
45 <el-row :gutter="24"> 44 <el-row :gutter="24">
46 <el-col :span="24"> 45 <el-col :span="24">
47 <el-form-item label="配置参数:" label-width="124px" class="form-item-mb0"> 46 <el-form-item label="配置参数:" label-width="124px" class="form-item-mb0">
48 <!-- 配置参数 --> 47 <!-- 配置参数 -->
49 <JsonEditor :result-infos="form.metadata" @getJsonString="getJsonString" /> 48 <JsonEditor :result-infos="form.metadata" @getJsonString="getJsonString" />
50 </el-form-item> 49 </el-form-item>
51 </el-col> 50 </el-col>
52 </el-row> 51 </el-row>
53 </el-form> 52 </el-form>
54 </template> 53 </div>
55 <template slot="footer"> 54 </dialogBox>
56 <el-button class="cancel-button" @click="close()">取消</el-button>
57
58 <el-button type="primary" @click="submitForm()">保存</el-button>
59 </template>
60 </Dialog>
61 <!-- 图标列表 -->
62 <IconList ref="iconList" @iconName="getIconName" />
63 </div>
64 </template> 55 </template>
65 56
66 <script> 57 <script>
67 import Dialog from "@/components/Dialog/"; 58 import { getParentMenuListAction } from '@/api/authorityManage'
68 import { getParentMenuListAction } from '@/api/authorityManage' 59 import JsonEditor from '@/components/JsonEditors'
69 import JsonEditor from '@/components/JsonEditors' 60 import { validateCode } from '@/utils/validate';
70 import IconList from '@/components/IconList' 61 import { api, httpAction } from '@/api/manageApi'
71 import { validateCode } from '@/utils/validate'; 62 export default {
72 import { api, httpAction } from '@/api/manageApi' 63 name: 'MenuModal',
73 export default { 64 components: {
74 name: 'MenuModal', 65 JsonEditor,
75 components: { 66 },
76 IconList, 67 props: {
77 JsonEditor, 68 value: { type: Boolean, default: false },
78 Dialog 69 productId: {
79 }, 70 type: String,
80 props: { 71 default: ''
81 productId: { 72 }
82 type: String, 73 },
83 default: '' 74 data () {
75 return {
76 myValue: this.value,
77 form: {
78 icon: '',
79 code: ''
80 },
81 rules: {
82 name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
83 code: [
84 { required: true, message: '必填', trigger: 'blur' },
85 { validator: validateCode, trigger: 'blur' }
86 ]
87 },
88 title: '',
89 type: '',
90 visible: false,
91 parentMenuList: [],
92 menuKey: 0,
93 jumpModeList: [
94 { name: '在当前页面显示', value: 1 },
95 { name: '跳转到新页面', value: 2 }
96 ],
97 setProps: {
98 value: 'id',
99 label: 'name',
100 children: 'children',
101 expandTrigger: 'hover',
102 checkStrictly: true, // 可取消关联,选择任意一级选项
103 emitPath: false
104 },
105 dataUrl: api.menus
106 }
107 },
108 computed: {
109 codeComputed: {
110 get: function () {
111 return this.form.code
112 },
113 set: function (val) {
114 this.form.code = val.toUpperCase()
84 } 115 }
116 }
117 },
118 watch: {
119 value (val) {
120 this.myValue = val
121 }
122 },
123 methods: {
124 // 获取父级菜单
125 getParentMenuList (id) {
126
127 getParentMenuListAction(id).then((res) => {
128 if (res.status === 1) {
129 const list = this.$dealArrChildren(res.content)
130 if (id) {
131 this.parentMenuList = this.$dealArrDisabled(
132 this.$deepCopy(list),
133 id
134 )
135 this.menuKey++
136 } else {
137 this.parentMenuList = list
138 }
139 } else {
140 this.$message.error({ message: res.message, showClose: true })
141 }
142 })
85 }, 143 },
86 data () { 144 getIconList () {
87 return { 145 this.$refs.iconList.show(true)
88 form: {
89 icon: '',
90 code: ''
91 },
92 rules: {
93 name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
94 code: [
95 { required: true, message: '必填', trigger: 'blur' },
96 { validator: validateCode, trigger: 'blur' }
97 ]
98 },
99 title: '',
100 type: '',
101 visible: false,
102 parentMenuList: [],
103 menuKey: 0,
104 jumpModeList: [
105 { name: '在当前页面显示', value: 1 },
106 { name: '跳转到新页面', value: 2 }
107 ],
108 setProps: {
109 value: 'id',
110 label: 'name',
111 children: 'children',
112 expandTrigger: 'hover',
113 checkStrictly: true, // 可取消关联,选择任意一级选项
114 emitPath: false
115 },
116 dataUrl: api.menus
117 }
118 }, 146 },
119 computed: { 147 getIconName (data) {
120 codeComputed: { 148 this.form.icon = data
121 get: function () { 149 },
122 return this.form.code 150 // 配置参数
123 }, 151 getJsonString (data) {
124 set: function (val) { 152 this.form.metadata = data
125 this.form.code = val.toUpperCase() 153 },
126 } 154 // 新增菜单
155 add () {
156 this.getParentMenuList(this.productId)
157 this.type = 0
158 this.form.jumpMode = 1
159 },
160 // 编辑菜单
161 edit (record) {
162 this.type = 1
163 // 若有id为编辑
164 if (record.id) {
165 this.$nextTick(() => {
166 this.form = Object.assign({}, record)
167 this.getParentMenuList(this.productId)
168 })
127 } 169 }
128 }, 170 },
129 created () { }, 171 // 选择上级菜单
130 mounted () { }, 172 handleChange (value) {
131 methods: { 173 this.form.parentId = value
132 // 获取父级菜单 174 },
133 getParentMenuList (id) { 175 // 保存
134 176 submitForm (submitType) {
135 getParentMenuListAction(id).then((res) => { 177 this.$refs.form.validate((valid) => {
136 if (res.status === 1) { 178 if (valid) {
137 const list = this.$dealArrChildren(res.content) 179 let method = ''
138 if (id) { 180 let url = ''
139 this.parentMenuList = this.$dealArrDisabled( 181 const formData = this.form
140 this.$deepCopy(list), 182 formData.productId = this.productId
141 id 183 if (!formData.id) {
142 ) 184 method = 'post'
143 this.menuKey++ 185 url = this.dataUrl
144 } else {
145 this.parentMenuList = list
146 }
147 } else { 186 } else {
148 this.$message.error({ message: res.message, showClose: true }) 187 method = 'put'
188 url = `${this.dataUrl}/${formData.id}`
149 } 189 }
150 }) 190 debugger
151 }, 191 httpAction(url, formData, method)
152 getIconList () { 192 .then((res) => {
153 this.$refs.iconList.show(true) 193 if (res.status === 1) {
154 }, 194 this.$message.success({
155 getIconName (data) { 195 message: res.message,
156 this.form.icon = data 196 showClose: true
157 }, 197 })
158 // 配置参数
159 getJsonString (data) {
160 this.form.metadata = data
161 },
162 // 新增菜单
163 add () {
164 this.getParentMenuList(this.productId)
165 this.visible = true
166 this.type = 0
167 this.form.jumpMode = 1
168 },
169 // 编辑菜单
170 edit (record) {
171 this.type = 1
172 // 若有id为编辑
173 if (record.id) {
174 this.$nextTick(() => {
175 this.form = Object.assign({}, record)
176 this.getParentMenuList(this.productId)
177 })
178 }
179 this.visible = true
180 },
181 // 选择上级菜单
182 handleChange (value) {
183 this.form.parentId = value
184 },
185 // 保存
186 submitForm (submitType) {
187 this.$refs.form.validate((valid) => {
188 if (valid) {
189 let method = ''
190 let url = ''
191 const formData = this.form
192 formData.productId = this.productId
193 if (!formData.id) {
194 method = 'post'
195 url = this.dataUrl
196 } else {
197 method = 'put'
198 url = `${this.dataUrl}/${formData.id}`
199 }
200 debugger
201 httpAction(url, formData, method)
202 .then((res) => {
203 if (res.status === 1) {
204 this.$message.success({
205 message: res.message,
206 showClose: true
207 })
208 198
209 this.resetForm() 199 this.resetForm()
210 this.$emit('ok') 200 this.$emit('ok')
211 } else { 201 } else {
212 this.$message.error({ message: res.message, showClose: true }) 202 this.$message.error({ message: res.message, showClose: true })
213 } 203 }
214 }) 204 })
215 .catch((err) => { 205 .catch((err) => {
216 console.log(err) 206 console.log(err)
217 }) 207 })
218 }
219 })
220 },
221 resetForm () {
222 this.$refs.form.resetFields()
223 this.form = {
224 icon: '',
225 code: ''
226 } 208 }
227 }, 209 })
228 close () { 210 },
229 this.resetForm() 211 resetForm () {
230 this.visible = false 212 this.$refs.form.resetFields()
213 this.form = {
214 icon: '',
215 code: ''
231 } 216 }
217 },
218 close () {
219 this.resetForm()
220 this.visible = false
232 } 221 }
233 } 222 }
223 }
234 </script> 224 </script>
235 <style scoped lang="scss"> 225 <style scoped lang="scss">
236 // @import "~@/styles/public.scss"; 226 .modifydialog {
237 </style> 227 &-con {
228 background: #031A46;
229 }
230 }
231 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -17,250 +17,160 @@ ...@@ -17,250 +17,160 @@
17 :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> 17 :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
18 </lb-table> 18 </lb-table>
19 </div> 19 </div>
20 <edit-dialog ref="dialogForm" :product-id="productId" :resource-category-id="resourceCategoryId" 20 <edit-dialog ref="dialogForm" v-model="isDialog" :product-id="productId" :resource-category-id="resourceCategoryId"
21 @ok="reloadTableData" /> 21 @ok="reloadTableData" />
22 <!-- <authorizationdiglog ref="rolesForm" /> --> 22 <!-- <authorizationdiglog ref="rolesForm" /> -->
23 </div> 23 </div>
24 </template> 24 </template>
25 <script> 25 <script>
26 // 定时任务 26 // 定时任务
27 import data from "./data"; 27 import data from "./data";
28 import { deleteAction, getAction, api } from "@/api/manageApi"; 28 import { deleteAction, getAction, api } from "@/api/manageApi";
29 import EditDialog from "./edit-dialog.vue"; 29 import EditDialog from "./edit-dialog.vue";
30 import { mapGetters } from "vuex"; 30 import { mapGetters } from "vuex";
31 import { getMenuInfo } from "@/api/user"; 31 import { getMenuInfo } from "@/api/user";
32 import { 32 import {
33 getUuid, 33 getUuid,
34 judgeSort, 34 judgeSort,
35 realMove, 35 realMove,
36 findParents, 36 findParents,
37 removeTreeListItem, 37 removeTreeListItem,
38 } from "@/utils/operation"; 38 } from "@/utils/operation";
39 // import authorizationdiglog from "./authorizationdiglog.vue"; 39 // import authorizationdiglog from "./authorizationdiglog.vue";
40 export default { 40 export default {
41 name: "menus", 41 name: "menus",
42 components: { 42 components: {
43 EditDialog, 43 EditDialog,
44 // authorizationdiglog, 44 // authorizationdiglog,
45 }, 45 },
46 data () { 46 data () {
47 return { 47 return {
48 tablelistData: [], 48 isDialog: false,
49 resourceCategoryId: "", 49 tablelistData: [],
50 taskData: null, 50 resourceCategoryId: "",
51 form: { 51 taskData: null,
52 job_name: "", 52 form: {
53 currentPage: 1, 53 job_name: "",
54 }, 54 currentPage: 1,
55 title: "", 55 },
56 queryParam: {}, 56 title: "",
57 selectType: "0", 57 queryParam: {},
58 queryName: "", 58 selectType: "0",
59 organizationId: "", // 组织机构ID 59 queryName: "",
60 departmentId: "", // 部门ID 60 organizationId: "", // 组织机构ID
61 departmentList: [], // 部门列表 61 departmentId: "", // 部门ID
62 levelList: [], // 职务级别 62 departmentList: [], // 部门列表
63 sexList: [], 63 levelList: [], // 职务级别
64 sexList: [],
64 65
65 selectionList: [], 66 selectionList: [],
66 tableData: { 67 tableData: {
67 columns: [].concat(data.columns()).concat([ 68 columns: [].concat(data.columns()).concat([
68 { 69 {
69 label: "操作", 70 label: "操作",
70 width: 380, 71 width: 380,
71 render: (h, scope) => { 72 render: (h, scope) => {
72 return ( 73 return (
73 <div> 74 <div>
74 <el-button 75 <el-button
75 type="text" 76 type="text"
76 size="mini" 77 size="mini"
77 icon="el-icon-edit" 78 icon="el-icon-edit"
78 onClick={() => { 79 onClick={() => {
79 this.handleEdit(scope.row); 80 this.handleEdit(scope.row);
80 }} 81 }}
81 > 82 >
82 修改 83 修改
83 </el-button> 84 </el-button>
84 85
85 <el-button 86 <el-button
86 type="text" 87 type="text"
87 size="mini" 88 size="mini"
88 icon="el-icon-delete" 89 icon="el-icon-delete"
89 style="color:#F56C6C" 90 style="color:#F56C6C"
90 onClick={() => { 91 onClick={() => {
91 this.handleDelete(scope.row.id, scope.row.name); 92 this.handleDelete(scope.row.id, scope.row.name);
92 }} 93 }}
93 > 94 >
94 删除 95 删除
95 </el-button> 96 </el-button>
96 </div> 97 </div>
97 ); 98 );
98 },
99 }, 99 },
100 ]), 100 },
101 data: [], 101 ]),
102 }, 102 data: [],
103 pageData: { 103 },
104 total: 5, 104 pageData: {
105 pageSize: 15, 105 total: 5,
106 current: 1, 106 pageSize: 15,
107 current: 1,
108 },
109 tableUrl: api.menus, // 菜单接口地址
110 meumurlid: api.subsystem,// 项目id接口地址
111 productId: ""//项目id
112 };
113 },
114 created () {
115 this.getTableList();
116 },
117 computed: {
118 ...mapGetters(["products"])
119 },
120 methods: {
121 // 加载表格数据
122 getTableList () {
123 getMenuInfo(sessionStorage.getItem("products")).then((res) => {
124 if (res.code === 200) {
125 this.tablelistData = judgeSort(res.result)
126 } else {
127 this.$message.error({ message: res.message, showClose: true })
128 }
129 })
130 const queryOptionsid = {
131 conditionGroup: {
132 queryRelation: "AND",
133 conditions: [
134 {
135 property: "code",
136 value: this.products,
137 operator: "EQ",
138 },
139 ],
107 }, 140 },
108 tableUrl: api.menus, // 菜单接口地址
109 meumurlid: api.subsystem,// 项目id接口地址
110 productId: ""//项目id
111 }; 141 };
142 const params = {
143 queryOptions: queryOptionsid,
144 };
145 // 获取系统id
146 getAction(this.meumurlid, params)
147 .then((res) => {
148 this.productId = res.content[0].id;
149 this.getAuthorityList(res.content[0].id, res.content[0].code)
150 this.selectedSubsystemCode = res.content[0].code
151
152 })
153 .catch((error) => {
154 console.log("er", error);
155 })
112 }, 156 },
113 created () { 157 // 新增菜单
114 this.getTableList(); 158 handleAdd () {
115 }, 159 this.isDialog = true
116 computed: { 160 this.$refs.dialogForm.add();
117 ...mapGetters(["products"]) 161 this.$refs.dialogForm.title = "添加";
118 }, 162 },
119 methods: {
120 // 加载表格数据
121 getTableList () {
122 getMenuInfo(sessionStorage.getItem("products")).then((res) => {
123 if (res.code === 200) {
124 this.tablelistData = judgeSort(res.result)
125 } else {
126 this.$message.error({ message: res.message, showClose: true })
127 }
128 })
129 const queryOptionsid = {
130 conditionGroup: {
131 queryRelation: "AND",
132 conditions: [
133 {
134 property: "code",
135 value: this.products,
136 operator: "EQ",
137 },
138 ],
139 },
140 };
141 const params = {
142 queryOptions: queryOptionsid,
143 };
144 // 获取系统id
145 getAction(this.meumurlid, params)
146 .then((res) => {
147 this.productId = res.content[0].id;
148 this.getAuthorityList(res.content[0].id, res.content[0].code)
149 this.selectedSubsystemCode = res.content[0].code
150 // let queryOptions = {
151 // conditionGroup: {
152 // conditions: [
153 // {
154 // property: "productId",
155 // value: this.productId,
156 // operator: "EQ",
157 // },
158 // ],
159 // queryRelation: "AND",
160 // },
161 // orderBys: [{ property: "sort", direction: "desc" }],
162 // };
163 // if (!this.tableUrl) {
164 // console.log("请设置tableUrl属性为接口地址!");
165 // return;
166 // }
167 // if (this.queryOptions !== "") {
168 // this.queryParam.queryOptions = JSON.stringify(queryOptions);
169 // }
170 // 查询系统菜单
171 // getAction(this.tableUrl, this.queryParam)
172 // .then((res) => {
173 // if (res.status === 1) {
174 // this.loading = false;
175 // // this.menutablelistData = res.content;
176 // console.log("res.content菜单", res.content);
177 // } else {
178 // this.$message.error({ message: res.message, showClose: true });
179 // this.loading = false;
180 // }
181 // })
182 // .catch((error) => {
183 // console.log("er", error);
184 // this.loading = false;
185 // });
186 })
187 .catch((error) => {
188 console.log("er", error);
189 });
190 // const queryOptionsid = {
191 // conditionGroup: {
192 // queryRelation: "AND",
193 // conditions: [
194 // {
195 // property: "code",
196 // value: sessionStorage.getItem("products"),
197 // operator: "EQ",
198 // },
199 // ],
200 // },
201 // };
202 // const params = {
203 // queryOptions: queryOptionsid,
204 // };
205 // // 获取系统id
206 // getAction(this.meumurlid, params)
207 // .then((res) => {
208 // this.productId = res.content[0].id;
209 // let queryOptions = {
210 // conditionGroup: {
211 // conditions: [
212 // {
213 // property: "productId",
214 // value: this.productId,
215 // operator: "EQ",
216 // },
217 // ],
218 // queryRelation: "AND",
219 // },
220 // orderBys: [{ property: "sort", direction: "desc" }],
221 // };
222 // if (!this.tableUrl) {
223 // console.log("请设置tableUrl属性为接口地址!");
224 // return;
225 // }
226 // if (this.queryOptions !== "") {
227 // this.queryParam.queryOptions = JSON.stringify(queryOptions);
228 // }
229 // // 查询系统菜单
230 // getAction(this.tableUrl, this.queryParam)
231 // .then((res) => {
232 // if (res.status === 1) {
233 // this.loading = false;
234 // this.tablelistData = res.content;
235 // } else {
236 // this.$message.error({ message: res.message, showClose: true });
237 // this.loading = false;
238 // }
239 // })
240 // .catch((error) => {
241 // console.log("er", error);
242 // this.loading = false;
243 // });
244 // })
245 // .catch((error) => {
246 // console.log("er", error);
247 // });
248 },
249 // 新增菜单
250 handleAdd () {
251 this.$refs.dialogForm.add();
252 this.$refs.dialogForm.title = "添加";
253 },
254 163
255 // 修改 164 // 修改
256 handleEdit (record) { 165 handleEdit (record) {
257 this.$refs.dialogForm.edit(record); 166 this.isDialog = true
258 this.$refs.dialogForm.title = "修改"; 167 this.$refs.dialogForm.edit(record);
259 }, 168 this.$refs.dialogForm.title = "修改";
260 // 删除 169 },
261 handleDelete (id, content) { 170 // 删除
262 this.$confirm( 171 handleDelete (id, content) {
263 `<div class="customer-message-wrapper"> 172 this.$confirm(
173 `<div class="customer-message-wrapper">
264 <h5 class="title">您确认要执行该操作用于以下信息:</h5> 174 <h5 class="title">您确认要执行该操作用于以下信息:</h5>
265 <p class="content" aria-controls="${content}">${content} 175 <p class="content" aria-controls="${content}">${content}
266 </p> 176 </p>
...@@ -268,51 +178,51 @@ ...@@ -268,51 +178,51 @@
268 <span >无法恢复</span> 178 <span >无法恢复</span>
269 </p> 179 </p>
270 </div>`, 180 </div>`,
271 '执行确认', 181 '执行确认',
272 { 182 {
273 dangerouslyUseHTMLString: true, 183 dangerouslyUseHTMLString: true,
274 customClass: 'customer-delete', 184 customClass: 'customer-delete',
275 confirmButtonText: '确定', 185 confirmButtonText: '确定',
276 cancelButtonText: '取消', 186 cancelButtonText: '取消',
277 type: 'warning' 187 type: 'warning'
188 }
189 )
190 .then(() => {
191 if (!this.tableUrl) {
192 this.$message.error({
193 message: '请设置tableUrl属性为接口地址!',
194 showClose: true
195 })
196 return
278 } 197 }
279 ) 198 const url = this.tableUrl + '/' + id
280 .then(() => { 199 deleteAction(url).then(res => {
281 if (!this.tableUrl) { 200 if (res.status === 1) {
282 this.$message.error({ 201 this.$message.success({ message: res.message, showClose: true })
283 message: '请设置tableUrl属性为接口地址!', 202 this.reloadTableData()
284 showClose: true 203 } else {
285 }) 204 this.$message.error({ message: res.message, showClose: true })
286 return
287 } 205 }
288 const url = this.tableUrl + '/' + id
289 deleteAction(url).then(res => {
290 if (res.status === 1) {
291 this.$message.success({ message: res.message, showClose: true })
292 this.reloadTableData()
293 } else {
294 this.$message.error({ message: res.message, showClose: true })
295 }
296 })
297 }) 206 })
298 .catch(() => { }) 207 })
299 }, 208 .catch(() => { })
300 // 新增、编辑回显 209 },
301 reloadTableData () { 210 // 新增、编辑回显
302 this.getTableList() 211 reloadTableData () {
303 }, 212 this.getTableList()
304 }, 213 },
305 }; 214 },
215 };
306 </script> 216 </script>
307 <style scoped lang="scss"> 217 <style scoped lang="scss">
308 @import "~@/styles/mixin.scss"; 218 @import "~@/styles/mixin.scss";
309 219
310 // @import "~@/styles/public.scss"; 220 // @import "~@/styles/public.scss";
311 .btnColRight { 221 .btnColRight {
312 margin-top: 20px; 222 margin-top: 20px;
313 } 223 }
314 224
315 /deep/.el-table__expand-icon { 225 /deep/.el-table__expand-icon {
316 color: #fff; 226 color: #fff;
317 } 227 }
318 </style> 228 </style>
......