Ver código fonte

reactor:对接数据共享平台;

zhangchong 10 meses atrás
pai
commit
501ea211af

+ 24 - 0
src/api/dataShare/index.ts

@@ -155,4 +155,28 @@ export const getEditRecord = (params: object) => {
     method: 'get',
     params
   });
+};
+/**
+ * @description 对接平台用户列表
+ * @param {object}  params
+ */
+export const getUserList = (params: object) => {
+  return request({
+    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
+    url: `/api/v1/HotlineWeb/get-user-info-list`,
+    method: 'get',
+    params
+  });
+};
+/**
+ * @description 新增对接平台用户
+ * @param {object}  data
+ */
+export const platformSourceAddUser = (data: object) => {
+  return request({
+    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
+    url: `/api/v1/HotlineWeb/adduserinfo`,
+    method: 'post',
+    data
+  });
 };

+ 0 - 1
src/components/LogicFlow/PropertySetting/start.vue

@@ -148,7 +148,6 @@ import {onMounted, reactive, ref, watch} from 'vue';
 import {getSelectList, queryUser} from '@/api/system/workflow';
 import {getCanUseOrg} from '@/api/system/user';
 import {removeDuplicate} from '@/utils/arrayOperation';
-import {ElInput} from 'element-plus';
 
 // 定义属性
 const props = defineProps({

+ 0 - 1
src/components/LogicFlow/PropertySetting/task.vue

@@ -156,7 +156,6 @@ import {onMounted, reactive, ref, watch} from 'vue';
 import {getSelectList, queryUser} from '@/api/system/workflow';
 import {getCanUseOrg} from '@/api/system/user';
 import {removeDuplicate} from '@/utils/arrayOperation';
-import {ElInput} from 'element-plus';
 
 const ruleFormRef = ref<RefType>();
 // 定义属性

+ 1 - 1
src/views/auxiliary/knowledgeLexicon/components/Knowledge-lexicon-add.vue

@@ -69,7 +69,7 @@ const props = defineProps({
 const inputValue = ref('');
 const dynamicTags = ref<EmptyArrayType>([]);
 const inputVisible = ref(false);
-const InputRef = ref<InstanceType<typeof ElInput>>();
+const InputRef = ref<InstanceType<any>>();
 // 删除同义词
 const handleClose = (tag: string) => {
   dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);

+ 1 - 1
src/views/auxiliary/knowledgeLexicon/components/Knowledge-lexicon-edit.vue

@@ -71,7 +71,7 @@ const emit = defineEmits(['updateList']);
 const inputValue = ref('');
 const dynamicTags = ref<EmptyArrayType>([]);
 const inputVisible = ref(false);
-const InputRef = ref<InstanceType<typeof ElInput>>();
+const InputRef = ref<InstanceType<any>>();
 // 删除同义词
 const handleClose = (tag: string) => {
 	dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);

+ 1 - 1
src/views/auxiliary/orderLexicon/components/Order-lexicon-add.vue

@@ -72,7 +72,7 @@ const emit = defineEmits(['updateList']);
 const inputValue = ref('');
 const dynamicTags = ref<EmptyArrayType>([]);
 const inputVisible = ref(false);
-const InputRef = ref<InstanceType<typeof ElInput>>();
+const InputRef = ref<InstanceType<any>>();
 // 删除同义词
 const handleClose = (tag: string) => {
 	dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);

+ 1 - 1
src/views/auxiliary/orderLexicon/components/Order-lexicon-edit.vue

@@ -79,7 +79,7 @@ const emit = defineEmits(['updateList']);
 const inputValue = ref('');
 const dynamicTags = ref<EmptyArrayType>([]);
 const inputVisible = ref(false);
-const InputRef = ref<InstanceType<typeof ElInput>>();
+const InputRef = ref<InstanceType<any>>();
 // 删除同义词
 const handleClose = (tag: string) => {
 	dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);

+ 1 - 1
src/views/business/repeatEvent/components/Repeat-event-edit.vue

@@ -162,7 +162,7 @@ const columns = ref<any[]>([
 const inputValue = ref('');
 const dynamicTags = ref<EmptyArrayType>([]);
 const inputVisible = ref(false);
-const InputRef = ref<InstanceType<typeof ElInput>>();
+const InputRef = ref<InstanceType<any>>();
 // 删除同义词
 const handleClose = (tag: string) => {
 	dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);

+ 169 - 0
src/views/dataShare/userInfo.vue

@@ -0,0 +1,169 @@
+<template>
+	<div class="dataShare-userInfo-container layout-pd">
+		<el-card shadow="never">
+			<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
+				<el-form-item label="平台名称" prop="Keyword">
+					<el-input v-model="state.queryParams.Keyword" placeholder="平台名称" clearable @keyup.enter="handleQuery" class="keyword-input" />
+				</el-form-item>
+				<el-form-item label-width="0">
+					<el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
+					<el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
+						<SvgIcon name="ele-Refresh" class="mr5" />重置
+					</el-button>
+				</el-form-item>
+			</el-form>
+		</el-card>
+		<el-card shadow="never">
+			<ProTable
+				ref="proTableRef"
+				:columns="columns"
+				:data="state.tableData"
+				@updateTable="queryList"
+				:loading="state.loading"
+				:total="state.total"
+				v-model:page-index="state.queryParams.PageIndex"
+				v-model:page-size="state.queryParams.PageSize"
+				:key="Math.random()"
+			>
+				<template #tableHeader="scope">
+					<el-button type="primary" @click="onAdd(false)" :loading="state.loading" title="新增账号">
+						<SvgIcon name="ele-Plus" class="mr5" />新增账号
+					</el-button>
+				</template>
+			</ProTable>
+		</el-card>
+		<el-dialog title="新增账号" v-model="state.dialogVisible" destroy-on-close append-to-body draggable>
+			<el-form :model="state.form" ref="formRef" label-width="120px">
+				<el-row :gutter="10">
+					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+						<el-form-item label="账号" prop="accountId" :rules="[{ required: true, message: '请填写账号', trigger: 'blur' }]">
+							<el-input v-model="state.form.accountId" placeholder="请填写账号" clearable></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+						<el-form-item label="密码" prop="accountSecret" :rules="[{ required: true, message: '请填写密码', trigger: 'blur' }]">
+							<el-input v-model="state.form.accountSecret" placeholder="请填写密码" clearable></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+						<el-form-item label="所属平台code" prop="platformSource" :rules="[{ required: true, message: '请填写所属平台code', trigger: 'blur' }]">
+							<el-input v-model="state.form.platformSource" placeholder="请填写所属平台code" clearable></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+						<el-form-item
+							label="所属平台名称"
+							prop="platformSourceName"
+							:rules="[{ required: true, message: '请填写所属平台名称', trigger: 'blur' }]"
+						>
+							<el-input v-model="state.form.platformSourceName" placeholder="请填写所属平台名称" clearable></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+						<el-form-item label="备注" prop="remark" :rules="[{ required: false, message: '请填写备注', trigger: 'blur' }]">
+							<el-input v-model="state.form.remark" placeholder="请填写备注" type="textarea" :autosize="{ minRows: 4, maxRows: 8 }"></el-input>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
+			<template #footer>
+				<el-button @click="state.dialogVisible = false" class="default-button">取 消</el-button>
+				<el-button type="primary" @click="onSubmit(formRef)" :loading="state.loading">确 定</el-button>
+			</template>
+		</el-dialog>
+		<edit-record ref="editRecordRef" />
+	</div>
+</template>
+<script setup lang="tsx" name="dataShareUserInfo">
+import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
+import type { FormInstance } from 'element-plus';
+import { useRoute, useRouter } from 'vue-router';
+import { ElMessage } from 'element-plus';
+import { getUserList, platformSourceAddUser } from '@/api/dataShare';
+
+// 引入组件
+const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
+const EditRecord = defineAsyncComponent(() => import('@/views/dataShare/RecordDialog.vue')); // 修改记录弹窗
+
+// 定义变量内容
+const state = reactive<any>({
+	queryParams: {
+		PageIndex: 1, // 当前页
+		PageSize: 10, // 每页条数
+	},
+	tableData: [], //表单
+	loading: false, // 加载
+	total: 0, // 总数
+	dialogVisible: false,
+	form: {},
+});
+const ruleFormRef = ref<RefType>(); // 表单ref
+const route = useRoute(); // 路由
+const router = useRouter(); // 路由
+const proTableRef = ref<RefType>(); // 表格ref
+// 表格配置项
+const columns = ref<any[]>([
+	{ prop: 'accountId', label: '账号', align: 'center' },
+	{ prop: 'accountSecret', label: '密码', align: 'center' },
+	{ prop: 'platformSource', label: '所属平台code', align: 'center' },
+	{ prop: 'platformSourceName', label: '所属平台名称', align: 'center' },
+	{
+		prop: 'state',
+		label: '状态',
+		width: 150,
+		render: (scope) => {
+			return <span>{scope.row.state === '0' ? '未启用' : scope.row.state === '1' ? '正常' : '禁用'}</span>;
+		},
+	},
+	{ prop: 'remark', label: '备注' },
+]);
+// 手动查询,将页码设置为1
+const handleQuery = () => {
+	state.queryParams.PageIndex = 1;
+	queryList();
+};
+/** 获取列表 */
+const queryList = () => {
+	state.loading = true;
+	getUserList(state.queryParams)
+		.then((response: any) => {
+			state.tableData = response?.result.items ?? [];
+			state.total = response?.result.total;
+			state.loading = false;
+		})
+		.catch(() => {
+			state.loading = false;
+		});
+};
+/** 重置按钮操作 */
+const resetQuery = (formEl: FormInstance | undefined) => {
+	if (!formEl) return;
+	formEl.resetFields();
+	queryList();
+};
+// 新增账号
+const onAdd = (row: any) => {
+	state.dialogVisible = true;
+};
+const formRef = ref<RefType>();
+const onSubmit = (formEl: FormInstance | undefined) => {
+	if (!formEl) return;
+	formEl.validate((valid: boolean) => {
+		if (!valid) return;
+		state.loading = true;
+		platformSourceAddUser(state.form)
+			.then(() => {
+				state.loading = false;
+				state.dialogVisible = false;
+				queryList();
+				ElMessage.success('操作成功');
+			})
+			.catch(() => {
+				state.loading = false;
+			});
+	});
+};
+onMounted(() => {
+	queryList();
+});
+</script>

+ 1 - 1
src/views/quality/lexicon/components/Lexicon-add.vue

@@ -70,7 +70,7 @@ const props = defineProps({
 const inputValue = ref('');
 const dynamicTags = ref<EmptyArrayType>([]);
 const inputVisible = ref(false);
-const InputRef = ref<InstanceType<typeof ElInput>>();
+const InputRef = ref<InstanceType<any>>();
 // 删除同义词
 const handleClose = (tag: string) => {
 	dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);

+ 1 - 1
src/views/quality/lexicon/components/Lexicon-edit.vue

@@ -70,7 +70,7 @@ const props = defineProps({
 const inputValue = ref('');
 const dynamicTags = ref<EmptyArrayType>([]);
 const inputVisible = ref(false);
-const InputRef = ref<InstanceType<typeof ElInput>>();
+const InputRef = ref<InstanceType<any>>();
 // 删除同义词
 const handleClose = (tag: string) => {
 	dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);