Commit ee074c32 authored by YIyiyi's avatar YIyiyi

pref:添加事项搜索条件

parent 4f3f263e
...@@ -7,22 +7,22 @@ ...@@ -7,22 +7,22 @@
<div class="left-btn"> <div class="left-btn">
<a-button type="danger" @click="handleDelAll"> 批量移除 </a-button> <a-button type="danger" @click="handleDelAll"> 批量移除 </a-button>
</div> </div>
<div class="search-box"> <div>
<!-- <a-select <a-space>
style="width: 180px" <a-select
style="width: 120px"
allowClear allowClear
v-model="leftSearch.deptName" v-model="leftSource"
class="select-department" class="select-department"
placeholder="请选择部门" placeholder="事项来源"
> >
<a-select-option <a-select-option :value="0">
v-for="v in deptList" 一体化添加
:key="v.id" </a-select-option>
:value="v.name" <a-select-option :value="1">
> 手动添加
{{ v.name }}
</a-select-option> </a-select-option>
</a-select> --> </a-select>
<a-input-search <a-input-search
v-model="searchLeftVal" v-model="searchLeftVal"
placeholder="请输入事项名称搜索" placeholder="请输入事项名称搜索"
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
@search="onSearchLeft" @search="onSearchLeft"
allowClear allowClear
/> />
</a-space>
</div> </div>
</div> </div>
</div> </div>
...@@ -74,7 +75,7 @@ ...@@ -74,7 +75,7 @@
</template> </template>
<div class="matter-name">{{ text.matterName }}</div> <div class="matter-name">{{ text.matterName }}</div>
</a-tooltip> </a-tooltip>
<a-tag v-if="text.source === 0" color="green"> 一体化添加 </a-tag> <a-tag v-if="text.source == 0" color="green"> 一体化添加 </a-tag>
<a-tag v-else color="blue"> 手动添加 </a-tag> <a-tag v-else color="blue"> 手动添加 </a-tag>
</template> </template>
<!-- 到现场次数 --> <!-- 到现场次数 -->
...@@ -118,6 +119,21 @@ ...@@ -118,6 +119,21 @@
<a-button class="add-btn" @click="addMatter"> 新增事项 </a-button> <a-button class="add-btn" @click="addMatter"> 新增事项 </a-button>
</div> </div>
<div> <div>
<a-space>
<a-select
style="width: 120px"
allowClear
v-model="rightSource"
class="select-department"
placeholder="事项来源"
>
<a-select-option :value="0">
一体化事项
</a-select-option>
<a-select-option :value="1">
自建事项
</a-select-option>
</a-select>
<a-input-search <a-input-search
v-model="searchRightVal" v-model="searchRightVal"
placeholder="请输入事项名称搜索" placeholder="请输入事项名称搜索"
...@@ -125,6 +141,7 @@ ...@@ -125,6 +141,7 @@
@search="onSearchRight" @search="onSearchRight"
allowClear allowClear
/> />
</a-space>
</div> </div>
</div> </div>
</div> </div>
...@@ -171,8 +188,8 @@ ...@@ -171,8 +188,8 @@
</template> </template>
<div class="matter-name">{{ text.matterName }}</div> <div class="matter-name">{{ text.matterName }}</div>
</a-tooltip> </a-tooltip>
<a-tag v-if="text.source === 0" color="green"> 一体化添加 </a-tag> <a-tag v-if="text.source == 0" color="green"> 一体化事项 </a-tag>
<a-tag v-else color="blue"> 手动添加 </a-tag> <a-tag v-else color="blue"> 自建事项 </a-tag>
</template> </template>
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="text"> <template slot="action" slot-scope="text">
...@@ -284,6 +301,8 @@ export default { ...@@ -284,6 +301,8 @@ export default {
rightColumns, rightColumns,
leftLoading: false, leftLoading: false,
rightLoading: false, rightLoading: false,
leftSource: undefined, // 左边来源
rightSource: undefined, // 右边来源
selectedRowKeys: [], selectedRowKeys: [],
matterSiteData: [], // 站点事项 matterSiteData: [], // 站点事项
matterDataList: [], //事项列表数据 matterDataList: [], //事项列表数据
...@@ -320,6 +339,7 @@ export default { ...@@ -320,6 +339,7 @@ export default {
page: this.leftCurrent, page: this.leftCurrent,
size: this.leftSize, size: this.leftSize,
siteId: this.siteId, siteId: this.siteId,
source: this.leftSource,
matterName: `%${this.searchLeftVal}%`, matterName: `%${this.searchLeftVal}%`,
...search, ...search,
}); });
...@@ -340,6 +360,7 @@ export default { ...@@ -340,6 +360,7 @@ export default {
page: this.rightCurrent, page: this.rightCurrent,
size: this.rightSize, size: this.rightSize,
matterName: this.searchRightVal, matterName: this.searchRightVal,
source: this.rightSource,
...search, ...search,
}); });
if (res.data.code === 1) { if (res.data.code === 1) {
......
...@@ -101,6 +101,22 @@ ...@@ -101,6 +101,22 @@
</div> --> </div> -->
<div class="color_title flex jcb"> <div class="color_title flex jcb">
<span>站点事项列表:</span> <span>站点事项列表:</span>
<div>
<a-space>
<a-select
style="width: 120px"
allowClear
v-model="source"
class="select-department"
placeholder="事项来源"
>
<a-select-option :value="0">
一体化添加
</a-select-option>
<a-select-option :value="1">
手动添加
</a-select-option>
</a-select>
<a-input-search <a-input-search
style="width: 300px" style="width: 300px"
placeholder="输入事项名称搜索" placeholder="输入事项名称搜索"
...@@ -109,6 +125,8 @@ ...@@ -109,6 +125,8 @@
@search="onSearchMatter" @search="onSearchMatter"
v-model="matterNameSearch" v-model="matterNameSearch"
/> />
</a-space>
</div>
</div> </div>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<a-table <a-table
...@@ -137,6 +155,11 @@ ...@@ -137,6 +155,11 @@
{{ (page - 1) * 10 + index + 1 }} {{ (page - 1) * 10 + index + 1 }}
</span> </span>
</template> </template>
<!-- 来源 -->
<template slot="source" slot-scope="text">
<a-tag v-if="text.source == 0" color="green"> 一体化事项 </a-tag>
<a-tag v-else color="blue"> 自建事项 </a-tag>
</template>
</a-table> </a-table>
</div> </div>
<!-- <a-form-model <!-- <a-form-model
...@@ -240,6 +263,11 @@ const matterColumns = [ ...@@ -240,6 +263,11 @@ const matterColumns = [
title: "事项名称", title: "事项名称",
dataIndex: "matterName", dataIndex: "matterName",
}, },
{
title: "来源",
width: "15%",
scopedSlots: { customRender: "source" },
},
]; ];
export default { export default {
components: { components: {
...@@ -247,6 +275,7 @@ export default { ...@@ -247,6 +275,7 @@ export default {
}, },
data() { data() {
return { return {
source: undefined,
leftColumns, leftColumns,
matterColumns, matterColumns,
visible: false, visible: false,
...@@ -267,7 +296,7 @@ export default { ...@@ -267,7 +296,7 @@ export default {
allDel: "", // 批量删除id allDel: "", // 批量删除id
windowInfo: {}, windowInfo: {},
formData: { formData: {
isShow: 0, isShow: 1,
sort: 0, sort: 0,
}, },
// rules: { // rules: {
...@@ -307,6 +336,7 @@ export default { ...@@ -307,6 +336,7 @@ export default {
size: 10, size: 10,
siteId: this.windowInfo.siteId, siteId: this.windowInfo.siteId,
matterName: `%${this.matterNameSearch}%`, matterName: `%${this.matterNameSearch}%`,
source: this.source,
// deptId: this.windowInfo.deptId, // deptId: this.windowInfo.deptId,
}); });
let { data, total } = res.data.data; let { data, total } = res.data.data;
......
import axios from 'axios' import axios from "axios";
// import Cookie from 'js-cookie' // import Cookie from 'js-cookie'
// 跨域认证信息 header 名 // 跨域认证信息 header 名
// const xsrfHeaderName = 'Authtoken' // const xsrfHeaderName = 'Authtoken'
axios.defaults.timeout = 5000 // axios.defaults.timeout = 5000
// axios.defaults.withCredentials = true // axios.defaults.withCredentials = true
// axios.defaults.xsrfHeaderName = xsrfHeaderName // axios.defaults.xsrfHeaderName = xsrfHeaderName
// axios.defaults.xsrfCookieName = xsrfHeaderName // axios.defaults.xsrfCookieName = xsrfHeaderName
...@@ -21,9 +21,9 @@ axios.defaults.timeout = 5000 ...@@ -21,9 +21,9 @@ axios.defaults.timeout = 5000
// http method // http method
const METHOD = { const METHOD = {
GET: 'get', GET: "get",
POST: 'post' POST: "post",
} };
/** /**
* axios请求 * axios请求
...@@ -32,14 +32,14 @@ const METHOD = { ...@@ -32,14 +32,14 @@ const METHOD = {
* @param params 请求参数 * @param params 请求参数
* @returns {Promise<AxiosResponse<T>>} * @returns {Promise<AxiosResponse<T>>}
*/ */
async function request (url, method, params, config) { async function request(url, method, params, config) {
switch (method) { switch (method) {
case METHOD.GET: case METHOD.GET:
return axios.get(url, { params, ...config }) return axios.get(url, { params, ...config });
case METHOD.POST: case METHOD.POST:
return axios.post(url, params, config) return axios.post(url, params, config);
default: default:
return axios.get(url, { params, ...config }) return axios.get(url, { params, ...config });
} }
} }
...@@ -104,59 +104,59 @@ async function request (url, method, params, config) { ...@@ -104,59 +104,59 @@ async function request (url, method, params, config) {
* @param interceptors * @param interceptors
* @param options * @param options
*/ */
function loadInterceptors (interceptors, options) { function loadInterceptors(interceptors, options) {
const { request, response } = interceptors const { request, response } = interceptors;
// 加载请求拦截器 // 加载请求拦截器
request.forEach(item => { request.forEach((item) => {
let { onFulfilled, onRejected } = item let { onFulfilled, onRejected } = item;
if (!onFulfilled || typeof onFulfilled !== 'function') { if (!onFulfilled || typeof onFulfilled !== "function") {
onFulfilled = config => config onFulfilled = (config) => config;
} }
if (!onRejected || typeof onRejected !== 'function') { if (!onRejected || typeof onRejected !== "function") {
onRejected = error => Promise.reject(error) onRejected = (error) => Promise.reject(error);
} }
axios.interceptors.request.use( axios.interceptors.request.use(
config => onFulfilled(config, options), (config) => onFulfilled(config, options),
error => onRejected(error, options) (error) => onRejected(error, options)
) );
}) });
// 加载响应拦截器 // 加载响应拦截器
response.forEach(item => { response.forEach((item) => {
let { onFulfilled, onRejected } = item let { onFulfilled, onRejected } = item;
if (!onFulfilled || typeof onFulfilled !== 'function') { if (!onFulfilled || typeof onFulfilled !== "function") {
onFulfilled = response => response onFulfilled = (response) => response;
} }
if (!onRejected || typeof onRejected !== 'function') { if (!onRejected || typeof onRejected !== "function") {
onRejected = error => Promise.reject(error) onRejected = (error) => Promise.reject(error);
} }
axios.interceptors.response.use( axios.interceptors.response.use(
response => onFulfilled(response, options), (response) => onFulfilled(response, options),
error => onRejected(error, options) (error) => onRejected(error, options)
) );
}) });
} }
/** /**
* 解析 url 中的参数 * 解析 url 中的参数
* @param url * @param url
* @returns {Object} * @returns {Object}
*/ */
function parseUrlParams (url) { function parseUrlParams(url) {
const params = {} const params = {};
if (!url || url === '' || typeof url !== 'string') { if (!url || url === "" || typeof url !== "string") {
return params return params;
} }
const paramsStr = url.split('?')[1] const paramsStr = url.split("?")[1];
if (!paramsStr) { if (!paramsStr) {
return params return params;
} }
const paramsArr = paramsStr.replace(/&|=/g, ' ').split(' ') const paramsArr = paramsStr.replace(/&|=/g, " ").split(" ");
for (let i = 0; i < paramsArr.length / 2; i++) { for (let i = 0; i < paramsArr.length / 2; i++) {
const value = paramsArr[i * 2 + 1] const value = paramsArr[i * 2 + 1];
params[paramsArr[i * 2]] = value === 'true' ? true : (value === 'false' ? false : value) params[paramsArr[i * 2]] =
value === "true" ? true : value === "false" ? false : value;
} }
return params return params;
} }
// 获取Cookie // 获取Cookie
...@@ -174,4 +174,4 @@ export { ...@@ -174,4 +174,4 @@ export {
loadInterceptors, loadInterceptors,
parseUrlParams, parseUrlParams,
// getCookie // getCookie
} };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment