+
-
+
-
+
@@ -34,41 +34,25 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
@@ -80,8 +64,7 @@
@@ -89,24 +72,71 @@
-
-
+
+
-
-
+
+
元/账号
-
- 配置数据权限
-
+
+ 配置数据权限
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 预览
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -114,11 +144,16 @@
export default {
data() {
return {
+ schoolId: 1001,
+ userId: this.$store.state.userLoginId,
+ userName: this.$store.state.userName,
keyword: '',
searchTimer: null,
date: [],
+ startTime: '',
+ endTime: '',
status: '',
- orderData:[],
+ listData:[],
multipleSelection: [],
statusList: [{
name: '不限',
@@ -129,26 +164,63 @@ export default {
},
{
name: '已下架',
- value: 2
+ value: 0
}],
- pageNo: 1,
+ page: 1,
pageSize: 10,
totals: 1,
productVisible: false,
+ id: '',
+ productName: '',
+ market: '',
typeList: [],
defaultProps: {
children: 'children',
label: 'label'
},
- defaultActive: [],
+ checkedIds: [],
+ isDetail: false,
+ typeIndex: 1000,
+
+ configVisible: false,
+ configChecked: [],
+ configCheckedTableId: [],
+ categoryId: '',
+ configIds: [],
+ updateTime: '',
+ keywordConfig: '',
+ typeConfigList: [],
+ pageConfig: 1,
+ pageSizeConfig: 10,
+ totalConfig: 0,
+ listConfigData: [],
+ previewVisible: false,
+ previewHead: [],
+ previewData: []
};
},
watch: {
+ date: function(val){
+ if(val){
+ this.startTime = val[0]
+ this.endTime = val[1]
+ }else{
+ this.startTime = ''
+ this.endTime = ''
+ }
+ this.initData()
+ },
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
+ },
+ keywordConfig: function(val) {
+ clearTimeout(this.searchTimer)
+ this.searchTimer = setTimeout(() => {
+ this.initConfigData()
+ },500)
}
},
mounted() {
@@ -156,64 +228,132 @@ export default {
},
methods: {
getData() {
- // this.$get(this.api.queryOrder,data).then(res => {
- // res.message.rows.forEach(e => {
- // e.orderType = this.orderTypeFn(e.orderType)
- // e.orderStatus = this.orderStatusFn(e.orderStatus)
- // e.orderNature = this.orderNatureFn(e.orderNature)
- // })
- // this.orderData = res.message.rows
- // this.totals = res.message.total
- // }).catch(res => {});
+ this.$post(this.api.listByEntity,{
+ createTime: this.startTime,
+ endTime: this.endTime,
+ pageNum: this.page,
+ pageSize: this.pageSize,
+ productName: this.keyword,
+ status: this.status,
+ }).then(res => {
+ this.listData = res.pageList.records
+ this.totals = res.pageList.total
+ }).catch(res => {})
},
initData(){
- this.pageNo = 1
+ this.page = 1
this.getData()
},
+ getTable(n,i){
+ this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=1&pageSize=10000&updateTime=`).then(res => {
+ res.list.map(n => {
+ n.label = n.showName
+ n.id = String(n.id)
+ })
+ n.children = res.list
+ }).catch(res => {})
+ },
getType(){
+ this.productVisible = true
this.$post(this.api.getTableByClassification).then(res => {
res.map(n => {
- n.id = String(n.id)
+ n.originId = n.id
+ n.id = String(++this.typeIndex)
n.label = n.categoryName
n.children.map(n => {
- n.id = String(n.id)
+ n.originId = n.id
+ n.id = String(++this.typeIndex)
n.label = n.categoryName
n.children.map(n => {
- n.id = String(n.id)
+ n.originId = n.id
+ n.id = String(++this.typeIndex)
n.label = n.categoryName
n.isThird = true
})
})
})
- this.typeList = res
- this.productVisible = true
+ res.map((n,i) => {
+ if(n.children.length){
+ n.children.map(n => {
+ if(n.children.length){
+ n.children.map(n => this.getTable(n,i))
+ }else{
+ this.getTable(n,i)
+ }
+ })
+ }else{
+ this.getTable(n,i)
+ }
+ })
+ setTimeout(() => {
+ this.typeList = res
+ },500)
+ this.importVisible = true
+ }).catch(res => {})
+ },
+ handleType(data,typeList){
+ let result = data
+ if(typeList.length){
+ typeList.map(e => {
+ if(result.includes(e.id) && e.children.length){
+ e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id),1)
+ }
+ e.children.length && this.handleType(data,e.children)
+ })
+ }
+ return result
+ },
+ getDetail(){
+ this.$post(`${this.api.findById}?id=${this.id}`).then(res => {
+ let data = res.product
+ this.productName = data.productName
+ this.market = data.market
+ this.checkedIds = this.handleType(data.tableId.split(','),this.typeList)
+ this.$refs.type.setCheckedNodes(this.checkedIds)
}).catch(res => {})
},
add(){
this.getType()
+ this.id = ''
+ this.checkedIds = []
},
edit(row){
this.getType()
+ this.id = row.id
+ this.getDetail()
+ },
+ switchOff(val,row,index) {
+ this.$post(this.api.updateProduct,{
+ id: row.id,
+ productName: row.productName,
+ market: row.market,
+ tableId: row.tableId,
+ userId: row.userId,
+ userName: row.userName,
+ createTime: '',
+ orderNum: '',
+ status: val,
+ tableNum: row.tableNum,
+ updateTime: '',
+ }).then(res => {
+ this.$message.success(val ? '上架成功' : '下架成功')
+ }).catch(err => {})
},
preview(row){
this.isDetail = true
this.getType()
+ this.id = row.id
+ this.getDetail()
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
- })
- .then(() => {
- let result = row.orderId
- var arr = []
- arr.push(result)
- let data = arr
- this.$post(this.api.deleteOrder,data).then(res => {
+ }).then(() => {
+ this.$post(`${this.api.deleteProduct}?ids=${row.id}`).then(res => {
this.$message.success('删除成功')
this.getData()
- }).catch(res => {});
- })
- .catch(() => {});
+ }).catch(res => {})
+ }).catch(() => {})
},
handleSelectionChange(val) {
this.multipleSelection = val
@@ -221,33 +361,183 @@ export default {
delAllSelection() {
if(this.multipleSelection.length != ''){
let arr = this.multipleSelection
- let result = arr.map(e => e.orderId)
+ let result = arr.map(e => e.id)
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
- })
- .then(() => {
- let data = result
- this.$post(this.api.deleteOrder,data).then(res => {
- this.multipleSelection = []
+ }).then(() => {
+ this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => {
+ this.$refs.table.clearSelection()
this.$message.success('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
}else{
- this.$message.error('请先选择订单 !')
+ this.$message.error('请先选择数据')
}
},
handleCurrentChange(val) {
- this.pageNo = val
+ this.page = val
this.getData()
},
closeProduct(){
+ this.productName = ''
+ this.market = ''
this.isDetail = false
+ this.typeIndex = 1000
+ this.typeList = []
+ },
+ confirm(){
+ if(!this.productName) return this.$message.warning('请输入数据产品名称')
+ if(!this.market) return this.$message.warning('请输入市场价格')
+ if(isNaN(this.market)) return this.$message.warning('市场价格请输入数字')
+ let list = this.$refs.type.getCheckedNodes()
+ let tableId = []
+ list.map(n => {
+ if(n.name) tableId.push(n.id)
+ })
+ if(!tableId.length) return this.$message.warning('请选择数据')
+ let data = {
+ id: this.id,
+ productName: this.productName,
+ market: this.market,
+ tableId: tableId.join(),
+ userId: this.userId,
+ userName: this.userName,
+ createTime: '',
+ orderNum: '',
+ status: '',
+ tableNum: tableId.length,
+ updateTime: '',
+ }
+ if(this.id){
+ this.$post(this.api.updateProduct,data).then(res => {
+ this.$message.success('新增成功')
+ this.productVisible = false
+ this.getData()
+ }).catch(res => {})
+ }else{
+ this.$post(this.api.saveProduct,data).then(res => {
+ this.$message.success('新增成功')
+ this.productVisible = false
+ this.getData()
+ }).catch(res => {})
+ }
+ },
+
+ configData(){
+ this.configVisible = true
+ this.getConfigType()
+
+ let list = this.$refs.type.getCheckedNodes()
+ let configIds = []
+ list.map(n => {
+ if(!n.name) configIds.push(n.originId)
+ })
+ this.configIds = configIds
+ },
+ typeConfigClick(data,node){
+ this.categoryId = data.id
+ this.getConfigTable()
+ },
+ closeConfig(){
+ this.$refs.typeConfig.setCheckedNodes([])
+ },
+ getConfigType(){
+ this.$post(this.api.getTableByClassification).then(res => {
+ res.map(n => {
+ n.id = String(n.id)
+ n.label = n.categoryName
+ n.children.map(n => {
+ n.id = String(n.id)
+ n.label = n.categoryName
+ n.children.map(n => {
+ n.id = String(n.id)
+ n.label = n.categoryName
+ n.isThird = true
+ })
+ })
+ })
+ this.typeConfigList = res
+ if(res[0].children.length){
+ this.categoryId = res[0].children[0].id
+ }else{
+ this.categoryId = res[0].id
+ }
+ this.getConfigTable()
+ }).catch(res => {})
+ },
+ getConfigTable(){
+ this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keywordConfig}&pageNum=${this.pageConfig}&pageSize=${this.pageSizeConfig}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => {
+ this.listConfigData = res.list
+ this.totalConfig = res.totalCount
+ }).catch(res => {})
+ },
+ initConfigData(){
+ this.pageConfig = 1
+ this.getConfigTable()
+ },
+ handleCurrentConfigChange(){
+ this.pageConfig = val
+ this.getConfigTable()
+ },
+ previewConfig(row){
+ this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
+ this.$post(this.api.saveRecord,{
+ platformUserId: 4,
+ tableId: row.id,
+ type: 2,
+ schoolId: this.schoolId,
+ }).then(res => {}).catch(res => {})
+
+ let comment = res.comment
+ let previewHead = []
+ comment.map(n => {
+ n.field != 'id' && n.field != 'operation_time' && previewHead.push(n)
+ })
+ this.previewHead = previewHead
+
+ let data = res.data
+ data.map(n => {
+ for(let i in n){
+ if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i]))
+ }
+ })
+ this.previewData = data
+ this.previewVisible = true
+ }).catch(res => {})
+ },
+ getTableId(list){
+ let checked = this.configChecked
+ list.map(n => {
+ if(n.children && n.children.length){
+ this.getTableId(n.children)
+ if(checked.includes(n.originId) && n.children[0].name){
+ this.configCheckedTableId = [...this.configCheckedTableId,...n.children.map(n => n.id)]
+ }else{
+ this.getTableId(n.children)
+ }
+ }
+ })
+ },
+ confirmConfig(){
+ this.configChecked = this.$refs.typeConfig.getCheckedKeys().map(n => Number(n))
+ this.getTableId(this.typeList)
+ this.checkedIds = Array.from(new Set(this.configCheckedTableId))
+ this.configVisible = false
+ this.$refs.type.setCheckedNodes(this.checkedIds)
}
}
};
\ No newline at end of file
diff --git a/src/views/setting/Person.vue b/src/views/setting/Person.vue
new file mode 100644
index 0000000..1035602
--- /dev/null
+++ b/src/views/setting/Person.vue
@@ -0,0 +1,1322 @@
+
+
+
+
+
+
+ 用户信息
+ 更新资料
+
+
+ 个人信息
+
+
+
+
+
+
+
+
+
+
+
+
+ 账号信息
+
+
+
+
+
+
+
+
+
+
+
+
+ {{emailBtnText}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{phoneBtnText}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/user/AddUser.vue b/src/views/user/AddUser.vue
index 7a60574..c6cb161 100644
--- a/src/views/user/AddUser.vue
+++ b/src/views/user/AddUser.vue
@@ -7,17 +7,8 @@
返回
-
+ 查看用户信息
-
确定
@@ -29,7 +20,6 @@