From ad08df1150ef61cad3b5aca54c9f18aca9874847 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?=
<188633308@qq.com>
Date: Thu, 20 May 2021 20:39:46 +0800
Subject: [PATCH] =?UTF-8?q?update=20=E5=AD=97=E5=85=B8=E7=BB=93=E6=9E=84?=
=?UTF-8?q?=E6=9B=B4=E6=94=B9.=20=E6=89=A9=E5=B1=95=E5=80=BC=E5=8F=AF?=
=?UTF-8?q?=E7=BC=96=E8=BE=91=E4=B8=BAjson?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Service/HouseCode/HouseCodeService.cs | 2 +-
Api/Ewide.Core/Ewide.Core.xml | 34 ++-
.../Service/Dict/Dto/DictTreeOutput.cs | 48 ++++
.../Service/Dict/Dto/DictTypeInput.cs | 3 +
.../Service/Dict/ISysDictDataService.cs | 1 +
.../Service/Dict/ISysDictTypeService.cs | 2 +-
.../Service/Dict/SysDictDataService.cs | 6 +-
.../Service/Dict/SysDictTypeService.cs | 26 +-
Web/package.json | 4 +-
.../common/api/requests/business/houseCode.js | 4 +-
.../common/api/requests/sys/dictDataManage.js | 4 +
Web/src/common/api/requests/sys/dictManage.js | 2 +-
Web/src/components/yoModalForm/index.js | 14 +-
Web/src/components/yoTable/index.js | 4 +
.../business/house/houseCode/form/index.vue | 10 +-
.../business/house/houseCode/form/part.vue | 25 +-
.../pages/business/house/houseCode/index.vue | 230 +++++++++++++++-
Web/src/pages/system/dict/_index.vue | 232 ++++++++++++++++
Web/src/pages/system/dict/dictdata/form.vue | 140 ++++++++++
Web/src/pages/system/dict/dictdata/index.vue | 50 +++-
Web/src/pages/system/dict/form.vue | 51 +++-
Web/src/pages/system/dict/index.vue | 250 ++++++++++++------
Web/src/views/main/_layout/content.vue | 16 +-
Web/vue.config.js | 7 +
Web/yarn.lock | 12 +
25 files changed, 1033 insertions(+), 144 deletions(-)
create mode 100644 Web/src/pages/system/dict/_index.vue
create mode 100644 Web/src/pages/system/dict/dictdata/form.vue
diff --git a/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs b/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs
index a5c5bb5..9dbb16d 100644
--- a/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs
+++ b/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs
@@ -79,7 +79,7 @@ LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) WHERE HC.Address
///
///
///
- [HttpGet("/houseCode/GetNextNoByFullNumber")]
+ [HttpGet("/houseCode/getNextNoByCode")]
public async Task GetNextNoByFullNumber([Required] string projectId)
{
var areaCodeRep = Db.GetRepository();
diff --git a/Api/Ewide.Core/Ewide.Core.xml b/Api/Ewide.Core/Ewide.Core.xml
index fcb21db..e7d4520 100644
--- a/Api/Ewide.Core/Ewide.Core.xml
+++ b/Api/Ewide.Core/Ewide.Core.xml
@@ -3989,6 +3989,36 @@
子节点集合
+
+
+ Id
+
+
+
+
+ 父Id
+
+
+
+
+ 名称
+
+
+
+
+ 值
+
+
+
+
+ 排序,越小优先级越高
+
+
+
+
+ 子节点
+
+
字典类型参数
@@ -4086,11 +4116,11 @@
-
+
删除字典值 id数组传入
-
+
diff --git a/Api/Ewide.Core/Service/Dict/Dto/DictTreeOutput.cs b/Api/Ewide.Core/Service/Dict/Dto/DictTreeOutput.cs
index 67d1505..680cbe5 100644
--- a/Api/Ewide.Core/Service/Dict/Dto/DictTreeOutput.cs
+++ b/Api/Ewide.Core/Service/Dict/Dto/DictTreeOutput.cs
@@ -57,4 +57,52 @@ namespace Ewide.Core.Service
Children = (List)children;
}
}
+
+ public class DictTreeNode : ITreeNode
+ {
+ ///
+ /// Id
+ ///
+ public string Id { get; set; }
+
+ ///
+ /// 父Id
+ ///
+ public string ParentId { get; set; }
+
+ ///
+ /// 名称
+ ///
+ public string Title { get; set; }
+
+ ///
+ /// 值
+ ///
+ public string Value { get; set; }
+
+ ///
+ /// 排序,越小优先级越高
+ ///
+ public int Weight { get; set; }
+
+ ///
+ /// 子节点
+ ///
+ public List Children { get; set; } = new List();
+
+ public string GetId()
+ {
+ return Id;
+ }
+
+ public string GetPid()
+ {
+ return ParentId;
+ }
+
+ public void SetChildren(IList children)
+ {
+ Children = (List)children;
+ }
+ }
}
diff --git a/Api/Ewide.Core/Service/Dict/Dto/DictTypeInput.cs b/Api/Ewide.Core/Service/Dict/Dto/DictTypeInput.cs
index 9920495..8fd349b 100644
--- a/Api/Ewide.Core/Service/Dict/Dto/DictTypeInput.cs
+++ b/Api/Ewide.Core/Service/Dict/Dto/DictTypeInput.cs
@@ -7,6 +7,7 @@ namespace Ewide.Core.Service
///
public class DictTypeInput : PageInputBase
{
+ public string Pid { get; set; }
///
/// 名称
///
@@ -17,6 +18,8 @@ namespace Ewide.Core.Service
///
public virtual string Code { get; set; }
+ public int Type { get; set; }
+
///
/// 排序
///
diff --git a/Api/Ewide.Core/Service/Dict/ISysDictDataService.cs b/Api/Ewide.Core/Service/Dict/ISysDictDataService.cs
index b89fb9d..ba44595 100644
--- a/Api/Ewide.Core/Service/Dict/ISysDictDataService.cs
+++ b/Api/Ewide.Core/Service/Dict/ISysDictDataService.cs
@@ -14,6 +14,7 @@ namespace Ewide.Core.Service
Task GetDictDataListByDictTypeId(string dictTypeId);
Task GetDictDataListByDictTypeIds(SysDictType[] dictTypes);
Task QueryDictDataPageList([FromQuery] DictDataInput input);
+ Task DeleteDictDataBatch(string[] Ids);
Task UpdateDictData(UpdateDictDataInput input);
}
}
\ No newline at end of file
diff --git a/Api/Ewide.Core/Service/Dict/ISysDictTypeService.cs b/Api/Ewide.Core/Service/Dict/ISysDictTypeService.cs
index e0df868..e1bbf2c 100644
--- a/Api/Ewide.Core/Service/Dict/ISysDictTypeService.cs
+++ b/Api/Ewide.Core/Service/Dict/ISysDictTypeService.cs
@@ -9,7 +9,7 @@ namespace Ewide.Core.Service
Task AddDictType(AddDictTypeInput input);
Task ChangeDictTypeStatus(UpdateDictTypeInput input);
Task DeleteDictType(DeleteDictTypeInput input);
- Task> GetDictTree();
+ Task> GetDictTree();
Task GetDictType([FromQuery] QueryDictTypeInfoInput input);
Task GetDictTypeDropDown([FromQuery] DropDownDictTypeInput input);
Task GetDictTypeDropDowns([FromQuery] DropDownDictTypesInput input);
diff --git a/Api/Ewide.Core/Service/Dict/SysDictDataService.cs b/Api/Ewide.Core/Service/Dict/SysDictDataService.cs
index 8e756ad..b301f7d 100644
--- a/Api/Ewide.Core/Service/Dict/SysDictDataService.cs
+++ b/Api/Ewide.Core/Service/Dict/SysDictDataService.cs
@@ -95,12 +95,12 @@ namespace Ewide.Core.Service
///
/// 删除字典值 id数组传入
///
- ///
+ ///
///
[HttpPost("/sysDictData/deleteBatch")]
- public async Task DeleteDictDataBatch(List idList)
+ public async Task DeleteDictDataBatch([FromBody] string[] ids)
{
- var dictDataList = await _sysDictDataRep.Where(s => idList.Contains(s.Id)).ToListAsync();
+ var dictDataList = await _sysDictDataRep.Where(s => ids.Contains(s.Id)).ToListAsync();
if (dictDataList.Count == 0) throw Oops.Oh(ErrorCode.D3004);
dictDataList.ForEach(s =>
{
diff --git a/Api/Ewide.Core/Service/Dict/SysDictTypeService.cs b/Api/Ewide.Core/Service/Dict/SysDictTypeService.cs
index f5ae5b1..0adc3af 100644
--- a/Api/Ewide.Core/Service/Dict/SysDictTypeService.cs
+++ b/Api/Ewide.Core/Service/Dict/SysDictTypeService.cs
@@ -40,9 +40,13 @@ namespace Ewide.Core.Service
{
var code = !string.IsNullOrEmpty(input.Code?.Trim());
var name = !string.IsNullOrEmpty(input.Name?.Trim());
+ var pId = !string.IsNullOrEmpty(input.Pid?.Trim());
+ var type = input.Type > 0;
var dictTypes = await _sysDictTypeRep.DetachedEntities
+ .Where(pId, u => EF.Functions.Like(u.Pids, $"%[{input.Pid.Trim()}]%") || u.Id == input.Pid.Trim())
.Where((code, u => EF.Functions.Like(u.Code, $"%{input.Code.Trim()}%")),
(name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")))
+ .Where(type, u => input.Type == 1 ? string.IsNullOrEmpty(u.Code) : !string.IsNullOrEmpty(u.Code))
.Where(u => u.Status != CommonStatus.DELETED).OrderBy(u => u.Sort)
//.ToPagedListAsync(input.PageNo, input.PageSize);
.ToPageData(input);
@@ -176,18 +180,18 @@ namespace Ewide.Core.Service
///
[AllowAnonymous]
[HttpGet("/sysDictType/tree")]
- public async Task> GetDictTree()
+ public async Task> GetDictTree()
{
- var DictTypeList = await _sysDictTypeRep.AsQueryable().ToListAsync();
- return new TreeBuildUtil().DoTreeBuild(DictTypeList.Select(u => new DictTreeOutput
- {
- Name=u.Name,
- Code = u.Code,
- Pid=u.Pid,
- Id=u.Id,
- Remark=u.Remark,
- Sort =u.Sort
- }).OrderBy(s => s.Sort).ToList());
+ var DictTypeList = await _sysDictTypeRep.AsQueryable().Where(p => string.IsNullOrEmpty(p.Code)).ToListAsync();
+ return new TreeBuildUtil().DoTreeBuild(DictTypeList
+ .OrderBy(s => s.Sort)
+ .Select(u => new DictTreeNode
+ {
+ Title = u.Name,
+ ParentId = u.Pid,
+ Id = u.Id,
+ Value = u.Id
+ }).ToList());
}
///
/// 创建Pids格式
diff --git a/Web/package.json b/Web/package.json
index 1604acb..d5afe21 100644
--- a/Web/package.json
+++ b/Web/package.json
@@ -21,6 +21,8 @@
"nprogress": "^0.2.0",
"photoswipe": "^4.1.3",
"swiper": "^6.5.0",
+ "monaco-editor": "^0.22.3",
+ "monaco-editor-webpack-plugin": "^3.0.0",
"vue": "^2.6.11",
"vue-awesome-swiper": "^4.1.1",
"vue-color": "^2.8.1",
@@ -56,4 +58,4 @@
"last 2 versions",
"not dead"
]
-}
+}
\ No newline at end of file
diff --git a/Web/src/common/api/requests/business/houseCode.js b/Web/src/common/api/requests/business/houseCode.js
index 87ae030..cc586a6 100644
--- a/Web/src/common/api/requests/business/houseCode.js
+++ b/Web/src/common/api/requests/business/houseCode.js
@@ -1,3 +1,5 @@
export default {
- houseCodeAdd: ['/houseCode/add', 'post']
+ houseCodeAdd: ['/houseCode/add', 'post'],
+ houseCodePage: ['/houseCode/page', 'post'],
+ houseCodeNo: '/houseCode/getNextNoByCode',
}
\ No newline at end of file
diff --git a/Web/src/common/api/requests/sys/dictDataManage.js b/Web/src/common/api/requests/sys/dictDataManage.js
index 75cc250..0a60ca5 100644
--- a/Web/src/common/api/requests/sys/dictDataManage.js
+++ b/Web/src/common/api/requests/sys/dictDataManage.js
@@ -15,4 +15,8 @@ export default {
* 删除系统字典值
*/
sysDictDataDelete: ['/sysDictData/delete', 'post'],
+ /**
+ * 批量删除系统字典值
+ */
+ sysDictDataDeleteBatch: ['/sysDictData/deleteBatch', 'post'],
}
\ No newline at end of file
diff --git a/Web/src/common/api/requests/sys/dictManage.js b/Web/src/common/api/requests/sys/dictManage.js
index c3c2c93..88e6ace 100644
--- a/Web/src/common/api/requests/sys/dictManage.js
+++ b/Web/src/common/api/requests/sys/dictManage.js
@@ -24,7 +24,7 @@ export default {
*/
sysDictTypeDropDowns: ['/sysDictType/dropDowns', 'get'],
/**
- * 获取所有字典,启动时加入缓存使用
+ * 获取所有字典树
*/
sysDictTypeTree: ['/sysDictType/tree', 'get'],
}
\ No newline at end of file
diff --git a/Web/src/components/yoModalForm/index.js b/Web/src/components/yoModalForm/index.js
index f1a6cc8..90a1296 100644
--- a/Web/src/components/yoModalForm/index.js
+++ b/Web/src/components/yoModalForm/index.js
@@ -122,19 +122,23 @@ export default {
&& this.body.onGetData
&& this.body.onGetData()
.then((data) => {
- this.confirmLoading = true
- this.action
- && this.action(data)
+ if (this.action) {
+ this.confirmLoading = true
+ this.action(data)
.then(({ success }) => {
if (success) {
- this.$message.success(this.successMessage || '保存成功');
+ this.$message.success(this.successMessage || '保存成功')
this.onClose();
- this.$emit('ok');
+ this.$emit('ok', data)
}
})
.finally(() => {
this.confirmLoading = false
})
+ } else {
+ this.onClose()
+ this.$emit('ok', data)
+ }
}).catch(() => { })
}
},
diff --git a/Web/src/components/yoTable/index.js b/Web/src/components/yoTable/index.js
index 5ee24f3..4c64ca2 100644
--- a/Web/src/components/yoTable/index.js
+++ b/Web/src/components/yoTable/index.js
@@ -174,6 +174,10 @@ export default {
this.data.splice(this.data.indexOf(row), 1)
}
},
+
+ getData() {
+ return this.data
+ },
},
render() {
diff --git a/Web/src/pages/business/house/houseCode/form/index.vue b/Web/src/pages/business/house/houseCode/form/index.vue
index 99608b9..d7f02f7 100644
--- a/Web/src/pages/business/house/houseCode/form/index.vue
+++ b/Web/src/pages/business/house/houseCode/form/index.vue
@@ -101,7 +101,15 @@ export default {
.then(({ success }) => {
if (success) {
this.$message.success('保存成功');
- this.closeContentWindow();
+ this.$confirm({
+ content: '已添加成功,是否继续添加?',
+ onOk() {
+ console.log('OK');
+ },
+ onCancel: () => {
+ this.closeContentWindow();
+ },
+ });
}
})
.finally(() => {
diff --git a/Web/src/pages/business/house/houseCode/form/part.vue b/Web/src/pages/business/house/houseCode/form/part.vue
index e326c96..d5749b7 100644
--- a/Web/src/pages/business/house/houseCode/form/part.vue
+++ b/Web/src/pages/business/house/houseCode/form/part.vue
@@ -46,6 +46,7 @@
:field-names="{ label: 'name', value: 'code', children: 'children' }"
:options="options.areaTree"
@change="onAreaCodeChange"
+ expand-trigger="hover"
placeholder="请选择所在区域"
v-model="form.areaCode"
/>
@@ -407,30 +408,40 @@ export default {
this.getProjects();
},
- getProjects() {
+ async getProjects() {
if (this.form.projectId) {
this.form.projectId = undefined;
}
if (this.form.areaCode && this.form.areaCode.length === 4) {
this.loading = true;
- this.$api
+ const projects = await this.$api
.houseProjectList({
areaCode: this.form.areaCode[3],
type: this.form.type,
})
.then(({ data }) => {
- this.options.projects = data;
- })
- .finally(() => {
- this.loading = false;
+ return data;
});
+ this.options.projects = projects;
+ this.loading = false;
}
},
/**
* 切换项目
*/
- onProjectChange() {},
+ async onProjectChange() {
+ this.loading = true;
+ const no = await this.$api
+ .houseCodeNo({
+ projectId: this.form.projectId,
+ })
+ .then(({ data }) => {
+ return data;
+ });
+ this.$set(this.form, 'no', no);
+ this.loading = false;
+ },
},
};
\ No newline at end of file
diff --git a/Web/src/pages/business/house/houseCode/index.vue b/Web/src/pages/business/house/houseCode/index.vue
index a2e4ffc..76abf34 100644
--- a/Web/src/pages/business/house/houseCode/index.vue
+++ b/Web/src/pages/business/house/houseCode/index.vue
@@ -1,10 +1,222 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+ 新增编码
+
+
+
+
+
+
+
+ 编辑
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Web/src/pages/system/dict/_index.vue b/Web/src/pages/system/dict/_index.vue
new file mode 100644
index 0000000..c044c35
--- /dev/null
+++ b/Web/src/pages/system/dict/_index.vue
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 新增字典类型
+
+
+ {{ bindCodeValue(text, 'commonStatus') }}
+
+
+
+
+ 编辑
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Web/src/pages/system/dict/dictdata/form.vue b/Web/src/pages/system/dict/dictdata/form.vue
new file mode 100644
index 0000000..0df599a
--- /dev/null
+++ b/Web/src/pages/system/dict/dictdata/form.vue
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Web/src/pages/system/dict/dictdata/index.vue b/Web/src/pages/system/dict/dictdata/index.vue
index 6b2b7bb..481d636 100644
--- a/Web/src/pages/system/dict/dictdata/index.vue
+++ b/Web/src/pages/system/dict/dictdata/index.vue
@@ -4,6 +4,7 @@
:bordered="false"
:columns="columns"
:load-data="loadData"
+ :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: (e) => selectedRowKeys = e }"
@query="onQuery"
@resetQuery="onResetQuery"
ref="table"
@@ -18,6 +19,16 @@
+
+
+ 批量删除
+
+
新增字典数据
@@ -29,7 +40,7 @@
-
+ 编辑
+
+
+
+
\ No newline at end of file
diff --git a/Web/src/pages/system/dict/form.vue b/Web/src/pages/system/dict/form.vue
index a56ed6c..82c3c75 100644
--- a/Web/src/pages/system/dict/form.vue
+++ b/Web/src/pages/system/dict/form.vue
@@ -7,7 +7,22 @@
-
+
+
+ 目录
+ 字典类型
+
+
+
+
+
+
@@ -21,16 +36,23 @@
\ No newline at end of file
diff --git a/Web/src/pages/system/dict/index.vue b/Web/src/pages/system/dict/index.vue
index c044c35..67d1571 100644
--- a/Web/src/pages/system/dict/index.vue
+++ b/Web/src/pages/system/dict/index.vue
@@ -1,76 +1,134 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- 新增字典类型
-
-
- {{ bindCodeValue(text, 'commonStatus') }}
-
-
-
-
- 编辑
-
-
-
- 删除
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 目录
+ 字典类型
+
+
+
+
+ 新增目录/字典类型
+
+
+
+
+ {{ text ? '字典类型' : '目录' }}
+
+ {{ bindCodeValue(text, 'commonStatus') }}
+
+
+
+
+ 编辑
+
+
+
+ 删除
+
+
+
+
+
+
-
+
+
+ 不可在目录中添加字典数据
+
+
+
+
+
+
+
-
+
+
-
+