-
+
-
-
+
+
-
+
{{ scope.row.dictType }}
@@ -160,8 +160,8 @@
-
-
+
+
@@ -213,14 +213,14 @@ export default {
// 是否显示弹出层
open: false,
// 状态数据字典
- statusOptions: [],
+ statusOptions: [{dictLabel: '正常', dictValue: '1',}, {dictLabel: '停用', dictValue: '0',}],
// 日期范围
dateRange: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
- dictName: undefined,
+ name: undefined,
dictType: undefined,
status: undefined
},
@@ -228,7 +228,7 @@ export default {
form: {},
// 表单校验
rules: {
- dictName: [
+ name: [
{ required: true, message: "字典名称不能为空", trigger: "blur" }
],
dictType: [
@@ -239,17 +239,17 @@ export default {
},
created() {
this.getList();
- this.getDicts("sys_normal_disable").then(response => {
- this.statusOptions = response.data;
- });
+ // this.getDicts("sys_normal_disable").then(response => {
+ // this.statusOptions = response.data;
+ // });
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
- this.typeList = response.rows;
- this.total = response.total;
+ this.typeList = response.data.results;
+ this.total = response.data.count;
this.loading = false;
}
);
@@ -266,8 +266,8 @@ export default {
// 表单重置
reset() {
this.form = {
- dictId: undefined,
- dictName: undefined,
+ id: undefined,
+ name: undefined,
dictType: undefined,
status: "0",
remark: undefined
@@ -293,15 +293,15 @@ export default {
},
// 多选框选中数据
handleSelectionChange(selection) {
- this.ids = selection.map(item => item.dictId)
+ this.ids = selection.map(item => item.id)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
- const dictId = row.dictId || this.ids
- getType(dictId).then(response => {
+ const id = row.id || this.ids
+ getType(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改字典类型";
@@ -311,7 +311,7 @@ export default {
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
- if (this.form.dictId != undefined) {
+ if (this.form.id != undefined) {
updateType(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
@@ -329,13 +329,13 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
- const dictIds = row.dictId || this.ids;
- this.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', "警告", {
+ const ids = row.id || this.ids;
+ this.$confirm('是否确认删除字典编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
- return delType(dictIds);
+ return delType(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
@@ -362,4 +362,4 @@ export default {
}
}
};
-
\ No newline at end of file
+