Browse Source

修改常用应用

dev
caoyizhong 2 years ago
parent
commit
b58edc58a4
  1. 147
      src/views/dashboard/HomePage.vue
  2. 112
      src/views/dashboard/KeyApplications.vue
  3. 14
      src/views/merchandisenews/modules/ProcessMerchandiseNewsForm.vue

147
src/views/dashboard/HomePage.vue

@ -65,10 +65,10 @@
<div style="width: 100%; height:70%; margin-top: 11px; overflow-y: hidden" :headStyle="{}" :bodyStyle="{height:'100%' , overflow:'hidden'}">
<a-row :gutter="24">
<a-col :span="12">
<a-card class="bottom-card" title="常用应用" style="width: 100%; height:60%; margin-top: 11px; overflow-y: hidden" :headStyle="{}" :bodyStyle="{height:'100%' , overflow:'hidden'}" >
<a slot="extra" @click="keyApp" v-has="">添加常用应用</a>
<a-card class="bottom-card" title="常用应用" style="width: 100%; height:478px; margin-top: 11px; overflow-y: hidden" :headStyle="{}" :bodyStyle="{height:'100%' , overflow:'hidden'}" >
<a slot="extra" @click="keyApp" v-has="'dashboard:addKey'" >添加常用应用</a>
<div style="max-height: 420px;overflow-y: auto;">
<span class="ant-col-md-4" v-for="(item,index) in userChildren" @click="goRouteView(item.path)" :title="item.meta.title"
<span class="ant-col-md-4" v-for="(item,index) in keyChildren" @click="goRouteView(item.path)" :title="item.meta.title"
style="display: inline-block; margin: 20px;">
<a-icon :type="item.meta.icon" :style="{'color':item.color}" style="font-size: 25px"></a-icon> &nbsp;&nbsp;{{ item.meta.title }}
</span>
@ -86,8 +86,15 @@
</a-card>
</a-col>
</a-row>
<a-modal v-model="keyApplic" width="50%" title="添加常用应用" @ok="handleOk">
<KeyApplications :userChildren = this.userChildren></KeyApplications>
<a-modal v-model="keyApplic" width="50%" title="添加常用应用" @ok="handleOk" :destroyOnClose= true @cancel = "handleCole" :maskClosable=true >
<KeyApplications :userChildren = this.userChildren :keyChildren = this.keyChildren @expandedRow = expandedRowKeys></KeyApplications>
<!-- <template slot="footer">-->
<!--&lt;!&ndash; // closable &ndash;&gt;-->
<!--&lt;!&ndash; // slot="footer" &ndash;&gt;-->
<!-- <a-button type="primary " @click="handleOk">确定</a-button>-->
<!-- <a-button @click="handleCole">关闭</a-button>-->
<!-- </template>-->
</a-modal>
</div>
@ -104,7 +111,7 @@
<script>
import { getAction, putAction } from '@api/manage'
import { getAction, putAction,postAction } from '@api/manage'
import { JVXETypes } from '@/components/jeecg/JVxeTable/index'
import { colorList } from '@/components/tools/setting'
import ShowAnnouncement from '@comp/tools/ShowAnnouncement'
@ -132,8 +139,9 @@ export default {
url: {
listCementByUser:"/sys/annountCement/listByUser",
todoManger: '/actTask/todoList',
keyApplications: '/keyApplications/processKeyApplications/list',
addKeyApplications: '/keyApplications/processKeyApplications/add',
lists: '/sys/log/listHomePage',
list: '',
listMseeage: '/sys/sysAnnouncementSend/getMyAnnouncementSend',
editCementSend:"/sys/sysAnnouncementSend/editByAnntIdAndUserId",
},
@ -198,56 +206,109 @@ export default {
userMean:[],
//
userChildren:[],
keyChildren:[],
KeyApplicationsChildren:[],
selectRowKeys:[],
routerGo:"",
colors:[],
}
},
created() {
getAction(this.url.keyApplications).then((res) => {
if (res.success) {
// console.log("res===========",res.result);
this.KeyApplicationsChildren = res.result;
}
})
this.todoList();
this.loginList();
this.systemMessage();
this.getChildrenMenu();
setTimeout(()=>{
this.getChildrenMenu();
},500);
this.colorLists();
},
methods: {
expandedRowKeys(row){
// console.log("=====",row);
this.selectRowKeys = row;
},
//
keyApp(){
// console.log("");
this.keyApplic = true;
},
handleCole(e) {
// console.log(e,"==============");
// this.batchDe();
this.$confirm({
title: "关闭",
content: `确定关闭当前页面?`,
centered: true,
onOk: () => {
// console.log("222222222222222")
this.keyApplic = false;
},
onCancel: ()=>{
// console.log("11111111111111")
this.keyApplic = true;
}
})
},
//
handleOk(e) {
// console.log(e,"==============");
this.keyApplic = false;
this.batchDe();
},
batchDe() {
console.log()
if (this.selectedRowKeys.length <= 0) {
// console.log(this.selectRowKeys," ==-=-");
if (this.selectRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
return;
} else {
var ids = "";
for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
let ids = [];
this.selectRowKeys.forEach(item => {
let i = {
permissionId : item.id, permissionName: item.title
}
ids.push(i);
})
// for (var a = 0; a < this.selectRowKeys.length; a++) {
// // ids += this.selectRowKeys[a] + ",";
// {
// permissionId : this.selectRowKeys[a],
//
// }
// }
this.keyApplic = false;
var that = this;
this.$confirm({
title: "确认删除",
content: "是否删除选中数据?",
title: "确认提交",
content: "是否提交选中数据?",
onOk: function () {
// that.loading = true;
// deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
// if (res.success) {
// that.$message.success(res.message);
// that.loadData();
// that.onClearSelected();
// } else {
// that.$message.warning(res.message);
// }
// }).finally(() => {
// that.loading = false;
// });
that.loading = true;
postAction(that.url.addKeyApplications, ids).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.selectRowKeys = [];
getAction(that.url.keyApplications).then((res) => {
if (res.success) {
that.KeyApplicationsChildren = [];
that.KeyApplicationsChildren = res.result;
that.getChildrenMenu();
}
})
// that.onClearSelected();
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.loading = false;
});
}
});
}
@ -300,7 +361,7 @@ export default {
}
}
})
console.log("到底了")
// console.log("")
}
},
colorLists(){
@ -315,7 +376,7 @@ export default {
getChildrenMenu() {
let userMean = JSON.parse(sessionStorage.getItem('ASIDE_MEAN'))
// console.log("userMean")
console.log(userMean,"==========")
// console.log(userMean,"==========")
let children = []
for (let i in userMean){
if ( userMean[i].hidden != true){
@ -330,6 +391,18 @@ export default {
childrenMean.push(childrenArray[j])
}
}
this.keyChildren = [];
if(this.KeyApplicationsChildren.length > 0){
// console.log("=====")
this.KeyApplicationsChildren.forEach( item =>{
childrenMean.forEach(it =>{
if(item.permissionId == it.id){
this.keyChildren.push(it);
}
})
})
}
this.userChildren = childrenMean
for (let i in this.userChildren){
let j =i%4
@ -377,15 +450,17 @@ export default {
}
},
//
todoList(){
async todoList(){
getAction(this.url.todoManger).then((res) => {
if (res.success) {
console.log("res")
// console.log("res")
this.loading = false
this.tasks = res.result
console.log(res.result)
// console.log(res.result)
}
})
});
},
//
@ -397,7 +472,7 @@ export default {
getAction(this.url.listMseeage,param).then((res) => {
if (res.success) {
console.log("resMessage")
// console.log("resMessage")
this.loading = false
this.msgContent = res.result.records
console.log(res.result.records)

112
src/views/dashboard/KeyApplications.vue

@ -8,19 +8,20 @@
<!-- </span>-->
<!-- </div>-->
<!-- </a-card>-->
<a-table
<a-table v-if="isData"
:columns="columns"
rowKey="id"
:data-source="data"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:expanded-row-keys.sync="expandedRowKeys"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChanger,getCheckboxProps: getCheckboxProps}"
:pagination = false
:customRow="loadCustomRow"
/>
</div>
</template>
<script>
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
// import { mixinDevice } from '@/utils/mixin'
// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { deleteAction } from '@api/manage'
export default {
@ -29,13 +30,19 @@ export default {
userChildren:{
type: Array,
required: false
} ,
keyChildren:{
type: Array,
required: false
}
},
mixins:[JeecgListMixin, mixinDevice],
// mixins:[JeecgListMixin, mixinDevice],
data() {
return {
data:[],
expandedRowKeys: [],
isData: false,
selectedRowKeys: [],
selectedRows: [],
//
columns: [
{
@ -56,26 +63,111 @@ export default {
}
],
url: {
list: "",
list: '',
},
}
},
computed:{
// checkBox
getCheckboxProps (record) {
// console.log(record,"=====sdrfgadsfhrb");
// console.log("=====sdrfgadsfhrb");
return record => ({
props: {
defaultChecked: record.ex
}
})
},
// rowSelection () {
// const { expandedRowKeys } = this;
// return {
// onChange: (selectedRowKeys, selectedRows) => {
// console.log(selectedRows)
// console.log(`selectedRowKeys: ${selectedRowKeys}`);
// },
// selections: true, //
// getCheckboxProps: record => {
// return {
// props: {
// // record record.goodsId != null
// defaultChecked: record.goodsId != null
// }
// };
// },
// };
// },
},
created() {
// console.log("1231234123");
this.data = [];
this.isData = true;
this.selectedRowKeys = [];
this.selectedRowKeys = [];
// this.keyChildren = [];
// this.userChildren = [];
this.userChild();
},
methods:{
loadCustomRow (record, index) {
// console.log("==jopafghb")
return {
on: {
click: () => {
// disabled
if (record.disabled) return
// console.log("dsfsghsdfr",record,index);
const type = 'checkbox'
const key = record.id || index
let selectedRowKeys = this.selectedRowKeys
let selectedRows = this.selectedRows
// console.log(type,"-=========")
if (type === 'radio') {
selectedRowKeys = [key]
selectedRows = [record]
} else if (!this.selectedRowKeys.includes(key)) {
// console.log(type,"12331231")
selectedRowKeys.push(key)
selectedRows.push(record)
} else {
// console.log(type,"-===1111111111======")
const index = this.selectedRowKeys.findIndex(skey => skey === key)
selectedRows.splice(index, 1)
selectedRowKeys.splice(index, 1)
}
// this.updateSelect(selectedRowKeys, selectedRows)
this.onSelectChanger(selectedRowKeys, selectedRows)
}
}
}
},
updateSelect (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows
},
onSelectChanger(selectedRowKeys, selectionRows) {
// console.log(selectedRowKeys,"==========");
// console.log(selectionRows,"11111111111");
this.selectedRowKeys = selectedRowKeys;
this.selectedRows = selectionRows;
this.$emit('expandedRow',this.selectedRows);
},
userChild(){
// console.log(this.userChildren.length,"===");
// this.data = this.userChildren;
let u = [];
this.userChildren.forEach(it =>{
let i = false;
this.keyChildren.forEach( item =>{
if(item.id == it.id){
// this.expandedRowKeys.push(it.id);
i = true;
}
})
// console.log(it,"===");
u.push({id: it.id,title:it.meta.title})
u.push({id: it.id,title:it.meta.title, ex: i})
})
this.data = u;
},

14
src/views/merchandisenews/modules/ProcessMerchandiseNewsForm.vue

@ -79,6 +79,15 @@
placeholder="请选择物资类型" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="物资属性" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-input placeholder="供应商" v-model="queryParam.materialsUnit"></a-input>-->
<a-select v-decorator = "['materialAttributes',validatorRules.materialAttributes]" placeholder="请选择" >
<a-select-option value="一般类物资">一般类物资</a-select-option>
<a-select-option value="资产类物资">资产类物资</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- <a-col :span="8">-->
<!-- <a-form-item label="分类" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
@ -147,6 +156,7 @@
confirmLoading: false,
validatorRules: {
materialType: { rules: [{ required: true, message: '请选择物资类型!' }] },
materialAttributes: { rules: [{ required: true, message: '请选择物资属性!' }] },
merchandiseName: { rules: [{ required: true, message: '请输入物资名称!' }] },
supplierId: { rules: [{ required: true, message: '请输入供应商!' }] },
partyNumber: { rules: [{ required: true, message: '请输入第三方编号!' }] },
@ -271,7 +281,7 @@
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify','materialDepart','materialType'))
this.form.setFieldsValue(pick(this.model,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify','materialDepart','materialType','materialAttributes'))
})
},
//
@ -340,7 +350,7 @@
})
},
popupCallback(row){
this.form.setFieldsValue(pick(row,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify','materialDepart','materialType'))
this.form.setFieldsValue(pick(row,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify','materialDepart','materialType','materialAttributes'))
},
}
}

Loading…
Cancel
Save